mirror of
https://git.yoctoproject.org/poky
synced 2026-04-13 23:02:30 +02:00
lib/oe/lsb: Make sure the distro ID is always lowercased
In commit 8689e561 (lib/oe/lsb: attempt to ensure consistent distro id regardless of source), the distro ID returned by oe.lsb.distro_identifier() was lowercased, but only if a release version is also present. This changes the code to always lowercase the distro ID, including the default distro ID "unknown", which is used if no other ID can be identified. (From OE-Core rev: c552c9f0fe0f8aaa230a4c6a410a00e8b99a74ae) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
1a33ae9cc7
commit
bacc8e1617
@@ -110,12 +110,12 @@ def distro_identifier(adjust_hook=None):
|
||||
if adjust_hook:
|
||||
distro_id, release = adjust_hook(distro_id, release)
|
||||
if not distro_id:
|
||||
return "Unknown"
|
||||
# Filter out any non-alphanumerics
|
||||
distro_id = re.sub(r'\W', '', distro_id)
|
||||
return "unknown"
|
||||
# Filter out any non-alphanumerics and convert to lowercase
|
||||
distro_id = re.sub(r'\W', '', distro_id).lower()
|
||||
|
||||
if release:
|
||||
id_str = '{0}-{1}'.format(distro_id.lower(), release)
|
||||
id_str = '{0}-{1}'.format(distro_id, release)
|
||||
else:
|
||||
id_str = distro_id
|
||||
return id_str.replace(' ','-').replace('/','-')
|
||||
|
||||
Reference in New Issue
Block a user