summaryrefslogtreecommitdiff
path: root/meta/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-09-19 08:08:12 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-19 09:06:52 +0100
commitc5d5a1baf98a11676537fb5e9f8ec4409e30c1fd (patch)
treefb5e26c38575c5b8f4cf54741b61fd5b3508c05e /meta/lib
parent78c672a72f49c4b6cfd8c247efcc676b0ba1681a (diff)
downloadopenembedded-core-c5d5a1baf98a11676537fb5e9f8ec4409e30c1fd.tar.gz
openembedded-core-c5d5a1baf98a11676537fb5e9f8ec4409e30c1fd.tar.bz2
openembedded-core-c5d5a1baf98a11676537fb5e9f8ec4409e30c1fd.zip
lib/oe/recipeutils: fix invalid character detection in validate_pn()
* validate_pn() is supposed to protect against invalid characters, fix the function so that it actually does (unanchored regex strikes again...) * However, now that the function is enforcing the restrictions, we do still want to allow + in recipe names (e.g. "gtk+") Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/recipeutils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index a0d78dde46..58e4028aed 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -449,8 +449,8 @@ def get_recipe_patched_files(d):
def validate_pn(pn):
"""Perform validation on a recipe name (PN) for a new recipe."""
reserved_names = ['forcevariable', 'append', 'prepend', 'remove']
- if not re.match('[0-9a-z-.]+', pn):
- return 'Recipe name "%s" is invalid: only characters 0-9, a-z, - and . are allowed' % pn
+ if not re.match('^[0-9a-z-.+]+$', pn):
+ return 'Recipe name "%s" is invalid: only characters 0-9, a-z, -, + and . are allowed' % pn
elif pn in reserved_names:
return 'Recipe name "%s" is invalid: is a reserved keyword' % pn
elif pn.startswith('pn-'):