All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] sanity.bbclass: support wildcards in SANITY_TESTED_DISTROS
@ 2014-03-03 14:37 Olof Johansson
  2014-03-03 18:17 ` Khem Raj
  0 siblings, 1 reply; 7+ messages in thread
From: Olof Johansson @ 2014-03-03 14:37 UTC (permalink / raw)
  To: openembedded-core

With this change, you can use shell like globbing expressions (as
supported by Python's fnmatch) for entries in SANITY_TESTED_DISTROS.
This makes it possible to say that, e.g. "all Debian 7 Wheezy releases
are supported" with the entry "Debian-7.*".

[YOCTO #5265]

Signed-off-by: Olof Johansson <olof.johansson@axis.com>
---
 meta/classes/sanity.bbclass | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index bae010d..d79db8f 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -246,6 +246,8 @@ def check_connectivity(d):
     return retval
 
 def check_supported_distro(sanity_data):
+    from fnmatch import fnmatch
+
     tested_distros = sanity_data.getVar('SANITY_TESTED_DISTROS', True)
     if not tested_distros:
         return
@@ -255,12 +257,15 @@ def check_supported_distro(sanity_data):
     except Exception:
         distro = None
 
-    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)
-    else:
+    if not distro:
         bb.warn('Host distribution could not be determined; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.')
 
+    for supported in [x.strip() for x in tested_distros.split('\\n')]:
+        if fnmatch(distro, supported):
+            return
+
+    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)
+
 # Checks we should only make if MACHINE is set correctly
 def check_sanity_validmachine(sanity_data):
     messages = ""
-- 
1.8.5.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-03-04 10:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-03 14:37 [PATCH v2] sanity.bbclass: support wildcards in SANITY_TESTED_DISTROS Olof Johansson
2014-03-03 18:17 ` Khem Raj
2014-03-03 20:13   ` Mark Hatle
2014-03-03 20:41     ` Khem Raj
2014-03-04  8:37   ` Olof Johansson
2014-03-04  8:56     ` Anders Darander
2014-03-04 10:56       ` Paul Eggleton

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.