summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2019-09-27 12:33:52 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-30 16:55:21 +0100
commit9a07399607218a56c9c8ea6fdbfc638b7b37458e (patch)
treea20f474b64e9c2c0d3eeeb5f27ba8d2a4f79c5bc /meta/lib/oe
parent7d751fc737ab678d4f5b1a85b86b6d40e98822f1 (diff)
downloadpoky-9a07399607218a56c9c8ea6fdbfc638b7b37458e.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: 4ba7ef79d23a4cf688d7a794064893fe5f2f473b) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-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('/','-')