* [PATCH] lib/oe/lsb.py: Stop parsing /etc/SuSE-release
@ 2015-03-20 11:22 Ed Bartosh
2015-03-20 11:38 ` Paul Eggleton
0 siblings, 1 reply; 4+ messages in thread
From: Ed Bartosh @ 2015-03-20 11:22 UTC (permalink / raw)
To: openembedded-core
/etc/SuSE-release should not be parsed to obtain release info
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
All recent OpenSUSE versions already have /etc/os-release and
oe.lsb/release_dict_file function already parses it.
Current implementation of release_dict_file returns different values
when parsing /etc/SuSE-release and /etc/os-release. This is one more
advantage of getting rid of parsing /etc/SuSE-release.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
meta/lib/oe/lsb.py | 8 --------
1 file changed, 8 deletions(-)
diff --git a/meta/lib/oe/lsb.py b/meta/lib/oe/lsb.py
index 50c1d47..e25e282 100644
--- a/meta/lib/oe/lsb.py
+++ b/meta/lib/oe/lsb.py
@@ -37,14 +37,6 @@ def release_dict_file():
if match:
data['DISTRIB_ID'] = match.group(1)
data['DISTRIB_RELEASE'] = match.group(2)
- elif os.path.exists('/etc/SuSE-release'):
- data = {}
- data['DISTRIB_ID'] = 'SUSE LINUX'
- with open('/etc/SuSE-release') as f:
- for line in f:
- if line.startswith('VERSION = '):
- data['DISTRIB_RELEASE'] = line[10:].rstrip()
- break
elif os.path.exists('/etc/os-release'):
data = {}
with open('/etc/os-release') as f:
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] lib/oe/lsb.py: Stop parsing /etc/SuSE-release
2015-03-20 11:22 [PATCH] lib/oe/lsb.py: Stop parsing /etc/SuSE-release Ed Bartosh
@ 2015-03-20 11:38 ` Paul Eggleton
2015-03-20 14:12 ` Ed Bartosh
0 siblings, 1 reply; 4+ messages in thread
From: Paul Eggleton @ 2015-03-20 11:38 UTC (permalink / raw)
To: Ed Bartosh; +Cc: openembedded-core
Hi Ed,
On Friday 20 March 2015 13:22:50 Ed Bartosh wrote:
> /etc/SuSE-release should not be parsed to obtain release info
>
> 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
>
> All recent OpenSUSE versions already have /etc/os-release and
> oe.lsb/release_dict_file function already parses it.
>
> Current implementation of release_dict_file returns different values
> when parsing /etc/SuSE-release and /etc/os-release. This is one more
> advantage of getting rid of parsing /etc/SuSE-release.
How long ago did OpenSuSE start including /etc/os-release? My concern is if
someone did happen to run on an older OpenSuSE release and then submit a bug
report with an attached log, we'd rather see the actual version rather than
"Unknown". If that's a possible scenario, we might want to just swap the
blocks around so that /etc/os-release is looked for first.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] lib/oe/lsb.py: Stop parsing /etc/SuSE-release
2015-03-20 11:38 ` Paul Eggleton
@ 2015-03-20 14:12 ` Ed Bartosh
2015-03-20 18:37 ` [PATCH] lib/oe/lsb.py: Prioritize parsing of /etc/os-release Ed Bartosh
0 siblings, 1 reply; 4+ messages in thread
From: Ed Bartosh @ 2015-03-20 14:12 UTC (permalink / raw)
To: Paul Eggleton; +Cc: openembedded-core
On Fri, Mar 20, 2015 at 11:38:25AM +0000, Paul Eggleton wrote:
> Hi Ed,
>
> On Friday 20 March 2015 13:22:50 Ed Bartosh wrote:
> > /etc/SuSE-release should not be parsed to obtain release info
> >
> > 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
> >
> > All recent OpenSUSE versions already have /etc/os-release and
> > oe.lsb/release_dict_file function already parses it.
> >
> > Current implementation of release_dict_file returns different values
> > when parsing /etc/SuSE-release and /etc/os-release. This is one more
> > advantage of getting rid of parsing /etc/SuSE-release.
>
> How long ago did OpenSuSE start including /etc/os-release? My concern is if
> someone did happen to run on an older OpenSuSE release and then submit a bug
> report with an attached log, we'd rather see the actual version rather than
> "Unknown". If that's a possible scenario, we might want to just swap the
> blocks around so that /etc/os-release is looked for first.
>
I've checked opensuse versions starting from 12.3, which was released 2 years ago and became OOL in Jan 2015. If you think it's not enough I can check 12.2 and 12.1 or swap the blocks as you've suggested.
Regards,
Ed
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] lib/oe/lsb.py: Prioritize parsing of /etc/os-release
2015-03-20 14:12 ` Ed Bartosh
@ 2015-03-20 18:37 ` Ed Bartosh
0 siblings, 0 replies; 4+ messages in thread
From: Ed Bartosh @ 2015-03-20 18:37 UTC (permalink / raw)
To: openembedded-core
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
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
meta/lib/oe/lsb.py | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/meta/lib/oe/lsb.py b/meta/lib/oe/lsb.py
index 50c1d47..ddfe71b 100644
--- a/meta/lib/oe/lsb.py
+++ b/meta/lib/oe/lsb.py
@@ -37,14 +37,6 @@ def release_dict_file():
if match:
data['DISTRIB_ID'] = match.group(1)
data['DISTRIB_RELEASE'] = match.group(2)
- elif os.path.exists('/etc/SuSE-release'):
- data = {}
- data['DISTRIB_ID'] = 'SUSE LINUX'
- with open('/etc/SuSE-release') as f:
- for line in f:
- if line.startswith('VERSION = '):
- data['DISTRIB_RELEASE'] = line[10:].rstrip()
- break
elif os.path.exists('/etc/os-release'):
data = {}
with open('/etc/os-release') as f:
@@ -53,6 +45,15 @@ def release_dict_file():
data['DISTRIB_ID'] = line[5:].rstrip().strip('"')
if line.startswith('VERSION_ID='):
data['DISTRIB_RELEASE'] = line[11:].rstrip().strip('"')
+ elif os.path.exists('/etc/SuSE-release'):
+ data = {}
+ data['DISTRIB_ID'] = 'SUSE LINUX'
+ with open('/etc/SuSE-release') as f:
+ for line in f:
+ if line.startswith('VERSION = '):
+ data['DISTRIB_RELEASE'] = line[10:].rstrip()
+ break
+
except IOError:
return None
return data
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-03-20 18:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-20 11:22 [PATCH] lib/oe/lsb.py: Stop parsing /etc/SuSE-release Ed Bartosh
2015-03-20 11:38 ` Paul Eggleton
2015-03-20 14:12 ` Ed Bartosh
2015-03-20 18:37 ` [PATCH] lib/oe/lsb.py: Prioritize parsing of /etc/os-release Ed Bartosh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.