diff options
| author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-03-20 20:37:12 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-03-22 14:42:18 +0000 |
| commit | 3acdd43b2f10b57cf26a7871b3d002f8241d41d8 (patch) | |
| tree | 38a5031bcb7322740cd21e66480f2466c3008702 /meta/lib/oe/lsb.py | |
| parent | cbce06a172c0fd0979e3f1fc6dcd4e24e235c30a (diff) | |
| download | poky-3acdd43b2f10b57cf26a7871b3d002f8241d41d8.tar.gz | |
lib/oe/lsb.py: Prioritize parsing of /etc/os-release
Moved parsing of /etc/os-release before parsing of
/etc/SuSE-release as /etc/SuSE-release is deprecated in
recent releases of OpenSuSE.
Here is the quote from /etc/SuSE-release:
/etc/SuSE-release is deprecated and will be removed in the future,
use /etc/os-release instead
(From OE-Core rev: b3852bebb850048389994993e3717e54020c662f)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/lsb.py')
| -rw-r--r-- | meta/lib/oe/lsb.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/meta/lib/oe/lsb.py b/meta/lib/oe/lsb.py index 50c1d4720b..ddfe71b6b5 100644 --- a/meta/lib/oe/lsb.py +++ b/meta/lib/oe/lsb.py | |||
| @@ -37,14 +37,6 @@ def release_dict_file(): | |||
| 37 | if match: | 37 | if match: |
| 38 | data['DISTRIB_ID'] = match.group(1) | 38 | data['DISTRIB_ID'] = match.group(1) |
| 39 | data['DISTRIB_RELEASE'] = match.group(2) | 39 | data['DISTRIB_RELEASE'] = match.group(2) |
| 40 | elif os.path.exists('/etc/SuSE-release'): | ||
| 41 | data = {} | ||
| 42 | data['DISTRIB_ID'] = 'SUSE LINUX' | ||
| 43 | with open('/etc/SuSE-release') as f: | ||
| 44 | for line in f: | ||
| 45 | if line.startswith('VERSION = '): | ||
| 46 | data['DISTRIB_RELEASE'] = line[10:].rstrip() | ||
| 47 | break | ||
| 48 | elif os.path.exists('/etc/os-release'): | 40 | elif os.path.exists('/etc/os-release'): |
| 49 | data = {} | 41 | data = {} |
| 50 | with open('/etc/os-release') as f: | 42 | with open('/etc/os-release') as f: |
| @@ -53,6 +45,15 @@ def release_dict_file(): | |||
| 53 | data['DISTRIB_ID'] = line[5:].rstrip().strip('"') | 45 | data['DISTRIB_ID'] = line[5:].rstrip().strip('"') |
| 54 | if line.startswith('VERSION_ID='): | 46 | if line.startswith('VERSION_ID='): |
| 55 | data['DISTRIB_RELEASE'] = line[11:].rstrip().strip('"') | 47 | data['DISTRIB_RELEASE'] = line[11:].rstrip().strip('"') |
| 48 | elif os.path.exists('/etc/SuSE-release'): | ||
| 49 | data = {} | ||
| 50 | data['DISTRIB_ID'] = 'SUSE LINUX' | ||
| 51 | with open('/etc/SuSE-release') as f: | ||
| 52 | for line in f: | ||
| 53 | if line.startswith('VERSION = '): | ||
| 54 | data['DISTRIB_RELEASE'] = line[10:].rstrip() | ||
| 55 | break | ||
| 56 | |||
| 56 | except IOError: | 57 | except IOError: |
| 57 | return None | 58 | return None |
| 58 | return data | 59 | return data |
