* [PATCH] sanity.bbclass: always use oe.lsb.distro_identifier method
@ 2013-03-01 17:42 Martin Jansa
2013-03-05 10:54 ` Paul Eggleton
0 siblings, 1 reply; 5+ messages in thread
From: Martin Jansa @ 2013-03-01 17:42 UTC (permalink / raw)
To: openembedded-core
* even when /etc/redhat-release or /etc/SuSE-release exists
* don't read /etc/lsb-release manually, NATIVELSBSTRING is not
reading it too
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/sanity.bbclass | 36 ++++--------------------------------
1 file changed, 4 insertions(+), 32 deletions(-)
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 94c6ce3..06e95e3 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -263,39 +263,11 @@ def check_supported_distro(sanity_data):
if not tested_distros:
return
- if os.path.exists("/etc/redhat-release"):
- f = open("/etc/redhat-release", "r")
- try:
- distro = f.readline().strip()
- finally:
- f.close()
- elif os.path.exists("/etc/SuSE-release"):
- import re
- f = open("/etc/SuSE-release", "r")
- try:
- distro = f.readline()
- # Remove the architecture suffix e.g. (i586)
- distro = re.sub(r' \([a-zA-Z0-9\-_]*\)$', '', distro).strip()
- finally:
- f.close()
- else:
- # Use LSB method
- try:
- distro = oe.lsb.distro_identifier()
- except Exception:
- distro = None
+ try:
+ distro = oe.lsb.distro_identifier()
+ except Exception:
+ distro = None
- if not distro:
- if os.path.exists("/etc/lsb-release"):
- f = open("/etc/lsb-release", "r")
- try:
- for line in f:
- lns = line.split('=')
- if lns[0] == "DISTRIB_DESCRIPTION":
- distro = lns[1].strip('"\n')
- break
- finally:
- f.close()
if distro:
if distro not in [x.strip() for x in tested_distros.split('\\n')]:
bb.warn('Host distribution "%s" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.' % distro)
--
1.8.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] sanity.bbclass: always use oe.lsb.distro_identifier method
2013-03-01 17:42 [PATCH] sanity.bbclass: always use oe.lsb.distro_identifier method Martin Jansa
@ 2013-03-05 10:54 ` Paul Eggleton
2013-03-05 11:03 ` Burton, Ross
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Paul Eggleton @ 2013-03-05 10:54 UTC (permalink / raw)
To: Martin Jansa; +Cc: openembedded-core
On Friday 01 March 2013 18:42:22 Martin Jansa wrote:
> * even when /etc/redhat-release or /etc/SuSE-release exists
> * don't read /etc/lsb-release manually, NATIVELSBSTRING is not
> reading it too
Unfortunately this has been merged before I had a chance to reply. FYI I put
the code in here to read the files directly on purpose, because most distros
bundle up the lsb_release tool with all of the LSB dependencies, so if you
want to set up a headless server without some of the LSB dependencies (which
include X11) you won't have the lsb_release tool and NATIVELSBSTRING is
"Unknown". Yes, I know we have this problem with NATIVELSBSTRING already.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sanity.bbclass: always use oe.lsb.distro_identifier method
2013-03-05 10:54 ` Paul Eggleton
@ 2013-03-05 11:03 ` Burton, Ross
2013-03-06 17:37 ` Martin Jansa
2013-03-06 22:29 ` Saul Wold
2 siblings, 0 replies; 5+ messages in thread
From: Burton, Ross @ 2013-03-05 11:03 UTC (permalink / raw)
To: Paul Eggleton; +Cc: Martin Jansa, openembedded-core
On 5 March 2013 10:54, Paul Eggleton <paul.eggleton@linux.intel.com> wrote:
> Unfortunately this has been merged before I had a chance to reply. FYI I put
> the code in here to read the files directly on purpose, because most distros
> bundle up the lsb_release tool with all of the LSB dependencies, so if you
> want to set up a headless server without some of the LSB dependencies (which
> include X11) you won't have the lsb_release tool and NATIVELSBSTRING is
> "Unknown". Yes, I know we have this problem with NATIVELSBSTRING already.
Score one for Debian, which ships lsb_release in a dedicated package
for this exact reason. :)
Ross
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sanity.bbclass: always use oe.lsb.distro_identifier method
2013-03-05 10:54 ` Paul Eggleton
2013-03-05 11:03 ` Burton, Ross
@ 2013-03-06 17:37 ` Martin Jansa
2013-03-06 22:29 ` Saul Wold
2 siblings, 0 replies; 5+ messages in thread
From: Martin Jansa @ 2013-03-06 17:37 UTC (permalink / raw)
To: Paul Eggleton; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 932 bytes --]
On Tue, Mar 05, 2013 at 10:54:25AM +0000, Paul Eggleton wrote:
> On Friday 01 March 2013 18:42:22 Martin Jansa wrote:
> > * even when /etc/redhat-release or /etc/SuSE-release exists
> > * don't read /etc/lsb-release manually, NATIVELSBSTRING is not
> > reading it too
>
> Unfortunately this has been merged before I had a chance to reply. FYI I put
> the code in here to read the files directly on purpose, because most distros
> bundle up the lsb_release tool with all of the LSB dependencies, so if you
> want to set up a headless server without some of the LSB dependencies (which
> include X11) you won't have the lsb_release tool and NATIVELSBSTRING is
> "Unknown". Yes, I know we have this problem with NATIVELSBSTRING already.
then we should fix it in oe.lsb.distro_identifier method and share the
same code for sanity and NATIVELSBSTRING.
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sanity.bbclass: always use oe.lsb.distro_identifier method
2013-03-05 10:54 ` Paul Eggleton
2013-03-05 11:03 ` Burton, Ross
2013-03-06 17:37 ` Martin Jansa
@ 2013-03-06 22:29 ` Saul Wold
2 siblings, 0 replies; 5+ messages in thread
From: Saul Wold @ 2013-03-06 22:29 UTC (permalink / raw)
To: Paul Eggleton; +Cc: Martin Jansa, openembedded-core
On 03/05/2013 02:54 AM, Paul Eggleton wrote:
> On Friday 01 March 2013 18:42:22 Martin Jansa wrote:
>> * even when /etc/redhat-release or /etc/SuSE-release exists
>> * don't read /etc/lsb-release manually, NATIVELSBSTRING is not
>> reading it too
>
> Unfortunately this has been merged before I had a chance to reply. FYI I put
> the code in here to read the files directly on purpose, because most distros
> bundle up the lsb_release tool with all of the LSB dependencies, so if you
> want to set up a headless server without some of the LSB dependencies (which
> include X11) you won't have the lsb_release tool and NATIVELSBSTRING is
> "Unknown". Yes, I know we have this problem with NATIVELSBSTRING already.
>
+1, but not just headless server, my FC18 release does not have
lsb_release installed at all.
Sau!
> Cheers,
> Paul
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-03-06 22:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-01 17:42 [PATCH] sanity.bbclass: always use oe.lsb.distro_identifier method Martin Jansa
2013-03-05 10:54 ` Paul Eggleton
2013-03-05 11:03 ` Burton, Ross
2013-03-06 17:37 ` Martin Jansa
2013-03-06 22:29 ` Saul Wold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox