summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorOlof Johansson <olof.johansson@axis.com>2014-03-03 15:37:36 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-05 15:24:06 +0000
commit1e527136e2ac274735a25b957e0391f48b18beba (patch)
tree8f91b06e1ec8b12b47a8816771e63e1c75c5d12c /meta
parentebaa5485abda86691b0eeadaf689d75072357178 (diff)
downloadopenembedded-core-1e527136e2ac274735a25b957e0391f48b18beba.tar.gz
openembedded-core-1e527136e2ac274735a25b957e0391f48b18beba.tar.bz2
openembedded-core-1e527136e2ac274735a25b957e0391f48b18beba.zip
sanity.bbclass: support wildcards in SANITY_TESTED_DISTROS
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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/sanity.bbclass13
1 files changed, 9 insertions, 4 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index bae010d864..d79db8f800 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 = ""