summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2019-11-05 23:08:39 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-11-18 14:42:12 +0000
commitbacc8e1617d5ec87f28d401cab4701f4bcd2bb12 (patch)
treeaf55b79533fa5e4a3a97d2782affdecf227ba8d0 /meta/lib
parent1a33ae9cc768e0b04ffc3e3b416ac8b32acfea4f (diff)
downloadpoky-bacc8e1617d5ec87f28d401cab4701f4bcd2bb12.tar.gz
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>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/lsb.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/lib/oe/lsb.py b/meta/lib/oe/lsb.py
index 4f2b419edc..43e46380d7 100644
--- a/meta/lib/oe/lsb.py
+++ b/meta/lib/oe/lsb.py
@@ -110,12 +110,12 @@ def distro_identifier(adjust_hook=None):
110 if adjust_hook: 110 if adjust_hook:
111 distro_id, release = adjust_hook(distro_id, release) 111 distro_id, release = adjust_hook(distro_id, release)
112 if not distro_id: 112 if not distro_id:
113 return "Unknown" 113 return "unknown"
114 # Filter out any non-alphanumerics 114 # Filter out any non-alphanumerics and convert to lowercase
115 distro_id = re.sub(r'\W', '', distro_id) 115 distro_id = re.sub(r'\W', '', distro_id).lower()
116 116
117 if release: 117 if release:
118 id_str = '{0}-{1}'.format(distro_id.lower(), release) 118 id_str = '{0}-{1}'.format(distro_id, release)
119 else: 119 else:
120 id_str = distro_id 120 id_str = distro_id
121 return id_str.replace(' ','-').replace('/','-') 121 return id_str.replace(' ','-').replace('/','-')