]> code.ossystems Code Review - openembedded-core.git/commitdiff
insane.bbclass: add qa package name check
authorConstantin Musca <constantinx.musca@intel.com>
Tue, 13 Nov 2012 15:51:00 +0000 (17:51 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 18 Nov 2012 11:45:05 +0000 (11:45 +0000)
Check if package names match the [a-z0-9.+-]+ regular
expression

[YOCTO #3139]

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/insane.bbclass

index 34bcd98e8d198a6f7a54710411a0ad360b0348d9..237ee823fdc456af83c704bfe1ce094c056a7838 100644 (file)
@@ -781,6 +781,9 @@ python do_package_qa () {
         return
 
     testmatrix = d.getVarFlags("QAPATHTEST")
+    import re
+    # The package name matches the [a-z0-9.+-]+ regular expression
+    pkgname_pattern = re.compile("^[a-z0-9.+-]+$")
 
     g = globals()
     walk_sane = True
@@ -804,6 +807,11 @@ python do_package_qa () {
                 errorchecks.append(g[testmatrix[e]])
 
         bb.note("Checking Package: %s" % package)
+        # Check package name
+        if not pkgname_pattern.match(package):
+            package_qa_handle_error("pkgname",
+                    "%s doesn't match the [a-z0-9.+-]+ regex\n" % package, d)
+
         path = "%s/%s" % (pkgdest, package)
         if not package_qa_walk(path, warnchecks, errorchecks, skip, package, d):
             walk_sane  = False