diff options
author | Joshua Lock <joshua.g.lock@intel.com> | 2016-11-08 14:49:56 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-11-15 15:19:54 +0000 |
commit | 81afedc905280f4bfc5fd5f2806a0c6baf657055 (patch) | |
tree | 3bd6aa8f2c44d260462363d40ba203b3410fd68d /meta/lib/oe | |
parent | 42441ea4819dfeca7183f6a095c99708124ded5d (diff) | |
download | poky-81afedc905280f4bfc5fd5f2806a0c6baf657055.tar.gz |
lib/oe/lsb: attempt to ensure consistent distro id regardless of source
The LSB Distributor ID and os-release NAME differ for most of the
distributions tested by the Yocto Project (CentOS, Debian, Fedora,
openSUSE and Ubuntu) however for all but openSUSE the os-release ID
matches the LSB Distributor ID when both are lowered before
comparison.
Therefore, in order to improve the consistency of identification of
a distribution, switch to using the os-release ID and converting
the ID value to lowercase.
Table showing comparison of LSB Distributor ID to os-release fields NAME
and ID for current Yocto Project supported host distributions:
Distribution | Version | Distributor ID | NAME | ID |
-------------------------------------------------------------------------
CentOS | 7 | CentOS | CentOS Linux | centos |
Debian | 8 | Debian | Debian GNU/Linux | debian |
Fedora | 23 | Fedora | Fedora | fedora |
Fedora | 24 | Fedora | Fedora | fedora |
openSUSE | 13.2 | openSUSE project | openSUSE | opensuse |
openSUSE | 42.1 | SUSE LINUX | openSUSE Leap | opensuse |
Ubuntu | 14.04 | Ubuntu | Ubuntu | ubuntu |
Ubuntu | 16.04 | Ubuntu | Ubuntu | ubuntu |
[YOCTO #10591]
(From OE-Core rev: 8689e5618d45c2119134ea64754430c06a93ea09)
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r-- | meta/lib/oe/lsb.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oe/lsb.py b/meta/lib/oe/lsb.py index 8018c7b076..5a795a12d3 100644 --- a/meta/lib/oe/lsb.py +++ b/meta/lib/oe/lsb.py | |||
@@ -10,7 +10,7 @@ def release_dict_osr(): | |||
10 | key, val = line.rstrip().split('=', 1) | 10 | key, val = line.rstrip().split('=', 1) |
11 | except ValueError: | 11 | except ValueError: |
12 | continue | 12 | continue |
13 | if key == 'NAME': | 13 | if key == 'ID': |
14 | data['DISTRIB_ID'] = val.strip('"') | 14 | data['DISTRIB_ID'] = val.strip('"') |
15 | if key == 'VERSION_ID': | 15 | if key == 'VERSION_ID': |
16 | data['DISTRIB_RELEASE'] = val.strip('"') | 16 | data['DISTRIB_RELEASE'] = val.strip('"') |
@@ -107,7 +107,7 @@ def distro_identifier(adjust_hook=None): | |||
107 | distro_id = re.sub(r'\W', '', distro_id) | 107 | distro_id = re.sub(r'\W', '', distro_id) |
108 | 108 | ||
109 | if release: | 109 | if release: |
110 | id_str = '{0}-{1}'.format(distro_id, release) | 110 | id_str = '{0}-{1}'.format(distro_id.lower(), release) |
111 | else: | 111 | else: |
112 | id_str = distro_id | 112 | id_str = distro_id |
113 | return id_str.replace(' ','-').replace('/','-') | 113 | return id_str.replace(' ','-').replace('/','-') |