From: Petr Štetiar Date: Sat, 23 Dec 2023 07:33:21 +0000 (+0000) Subject: phase2: fix invalid escape sequence flake8 warning in checksums step X-Git-Tag: v13~5 X-Git-Url: http://git.openwrt.org/ubox.git?a=commitdiff_plain;h=f02393e0f7ed923664ef52644b48ad95fa70d55e;p=buildbot.git phase2: fix invalid escape sequence flake8 warning in checksums step Resolved a flake8 linting warning related to an invalid escape sequence in the ShellCommand for calculating checksums: phase2/master.cfg:739:28: W605 invalid escape sequence '\(' phase2/master.cfg:739:32: W605 invalid escape sequence '\)' phase2/master.cfg:739:35: W605 invalid escape sequence '\(' phase2/master.cfg:739:39: W605 invalid escape sequence '\)' The warning was caused by the use of unescaped parentheses in a regular expression within a sed command. Use a raw string (with an 'r' prefix) to treat backslashes as literal characters, ensuring that the regular expression is correctly interpreted and flake8 does not raise a warning. This fix ensures that the code adheres to Python's string handling best practices and maintains the integrity of the regular expression functionality. Fixes: f0faed2970dd ("phase2: compute checksums") Signed-off-by: Petr Štetiar --- diff --git a/phase2/master.cfg b/phase2/master.cfg index fa585d7..deebc28 100644 --- a/phase2/master.cfg +++ b/phase2/master.cfg @@ -575,7 +575,7 @@ for arch in arches: command = "cd bin/packages/%s; " %(arch[0]) + "find . -type f -not -name 'sha256sums' -printf \"%P\n\" | " + "sort | xargs -r ../../../staging_dir/host/bin/mkhash -n sha256 | " - + "sed -ne 's!^\(.*\) \(.*\)$!\1 *\2!p' > sha256sums", + + r"sed -ne 's!^\(.*\) \(.*\)$!\1 *\2!p' > sha256sums", haltOnFailure = True ))