]> code.ossystems Code Review - openembedded-core.git/commitdiff
selftest/prservice.py: Sanitize package version when looking for stamp
authorMariano Lopez <mariano.lopez@linux.intel.com>
Thu, 10 Mar 2016 10:29:21 +0000 (10:29 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 11 Mar 2016 16:50:27 +0000 (16:50 +0000)
Currently when using a git version the check for the stamp, using regex,
will fail because of plus sign in the version.

With this change the version is escaped before adding it to the regex.

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oeqa/selftest/prservice.py

index 66638de8f8aae1bd7e8de36f11a2dacc6e0d1e97..1b9a510fd46518670978584a756b52ff6213a893 100644 (file)
@@ -27,7 +27,7 @@ class BitbakePrTests(oeSelfTest):
         package_stamps_path = "/".join(stampdata[:-1])
         stamps = []
         for stamp in os.listdir(package_stamps_path):
-            find_stamp = re.match("%s\.%s\.([a-z0-9]{32})" % (prefix, recipe_task), stamp)
+            find_stamp = re.match("%s\.%s\.([a-z0-9]{32})" % (re.escape(prefix), recipe_task), stamp)
             if find_stamp:
                 stamps.append(find_stamp.group(1))
         self.assertFalse(len(stamps) == 0, msg="Cound not find stamp for task %s for recipe %s" % (recipe_task, package_name))