mirror of
https://git.yoctoproject.org/poky
synced 2026-05-02 18:32:15 +02:00
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+") (From OE-Core rev: c5d5a1baf98a11676537fb5e9f8ec4409e30c1fd) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
90f925cd41
commit
ce1904a160
@@ -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-'):
|
||||
|
||||
Reference in New Issue
Block a user