From c0f3bc79b3e5d5b13c950cadfe558bbcd10187a0 Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt Date: Wed, 19 Mar 2025 00:25:39 +0100 Subject: 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 Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- scripts/lib/devtool/standard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/lib/devtool/standard.py') 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): lines = f.readlines() with open(new_layerconf_file, 'a') as nf: for line in lines: - pprovider_exp = r'^PREFERRED_PROVIDER_.*? = "' + pn + r'"$' + pprovider_exp = r'^PREFERRED_PROVIDER_.*? = "' + re.escape(pn) + r'"$' if not re.match(pprovider_exp, line): nf.write(line) else: -- cgit v1.2.3-54-g00ecf