recipetool: create: lower case name when determining from filename

As a matter of general convention we expect recipe names to be lower
case; in fact some of the packaging backends insist upon it. Since in
this part of the code we're auto-determining the name, we should convert
the name to lowercase if it's not already so that we're following
convention and avoiding any validation issues later on.

(From OE-Core rev: 64986decbc11afa0d1e11251f5f7adcba1860d19)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton
2016-01-07 00:15:49 +13:00
committed by Richard Purdie
parent 4deed25330
commit 1e503c0a51

View File

@@ -90,9 +90,9 @@ def determine_from_filename(srcfile):
"""Determine name and version from a filename"""
part = ''
if '.tar.' in srcfile:
namepart = srcfile.split('.tar.')[0]
namepart = srcfile.split('.tar.')[0].lower()
else:
namepart = os.path.splitext(srcfile)[0]
namepart = os.path.splitext(srcfile)[0].lower()
splitval = namepart.rsplit('_', 1)
if len(splitval) == 1:
splitval = namepart.rsplit('-', 1)