diff options
author | Peter Kjellerstedt <pkj@axis.com> | 2025-03-19 00:25:39 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-03-20 11:29:04 +0000 |
commit | c0f3bc79b3e5d5b13c950cadfe558bbcd10187a0 (patch) | |
tree | 68323a91fb924088b144fd9d16c539a3b38c18ea /scripts/lib/devtool/standard.py | |
parent | 0e32e1cb260aac59cabbbeba26f8f844978a75a0 (diff) | |
download | poky-c0f3bc79b3e5d5b13c950cadfe558bbcd10187a0.tar.gz |
devtool: reset: Escape command line input used in regular expression
Running, e.g., `devtool reset sdbus-c++` would result in the following
error:
re.error: multiple repeat at position 35
This was due to the ++ in the recipe name, which would be treated as an
incorrect regular expression in _reset().
Use re.escape() to make sure all characters in the recipe name are
treated literally.
(From OE-Core rev: 6e73bd9b3e6d529752db93879f2c0ed53873dd1a)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/standard.py')
-rw-r--r-- | scripts/lib/devtool/standard.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 0cdb9c6cfb..cdfdba43ee 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -1951,7 +1951,7 @@ def _reset(recipes, no_clean, remove_work, config, basepath, workspace): | |||
1951 | lines = f.readlines() | 1951 | lines = f.readlines() |
1952 | with open(new_layerconf_file, 'a') as nf: | 1952 | with open(new_layerconf_file, 'a') as nf: |
1953 | for line in lines: | 1953 | for line in lines: |
1954 | pprovider_exp = r'^PREFERRED_PROVIDER_.*? = "' + pn + r'"$' | 1954 | pprovider_exp = r'^PREFERRED_PROVIDER_.*? = "' + re.escape(pn) + r'"$' |
1955 | if not re.match(pprovider_exp, line): | 1955 | if not re.match(pprovider_exp, line): |
1956 | nf.write(line) | 1956 | nf.write(line) |
1957 | else: | 1957 | else: |