summaryrefslogtreecommitdiff
path: root/meta/classes/sanity.bbclass
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2014-08-25 15:57:43 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-27 12:12:04 +0100
commitc8afcb9cab9d610892db9c41b29685583f3b5773 (patch)
tree6ef470ef07f9bbddcd01dc22a15c4dfc1b359fd9 /meta/classes/sanity.bbclass
parent3e203e91afa48557eb754dd554944012f7f0c0a2 (diff)
downloadopenembedded-core-c8afcb9cab9d610892db9c41b29685583f3b5773.tar.gz
openembedded-core-c8afcb9cab9d610892db9c41b29685583f3b5773.tar.bz2
openembedded-core-c8afcb9cab9d610892db9c41b29685583f3b5773.zip
sanity: fix support for regex schemes in mirrors check
Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sanity.bbclass')
-rw-r--r--meta/classes/sanity.bbclass12
1 files changed, 10 insertions, 2 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 7cfc4be79b..f655d8bf61 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -754,8 +754,9 @@ def check_sanity_everybuild(status, d):
status.addresult("Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space since autotools doesn't support this.")
# Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS
+ import re
mir_types = ['MIRRORS', 'PREMIRRORS', 'SSTATE_MIRRORS']
- protocols = ['http://', 'ftp://', 'file://', 'https://', 'https?$://', \
+ protocols = ['http://', 'ftp://', 'file://', 'https://', \
'git://', 'gitsm://', 'hg://', 'osc://', 'p4://', 'svk://', 'svn://', \
'bzr://', 'cvs://']
for mir_type in mir_types:
@@ -767,12 +768,19 @@ def check_sanity_everybuild(status, d):
bb.warn('Invalid %s: %s, should be 2 members, but found %s.' \
% (mir_type, mir.strip(), len(mir_list)))
elif len(mir_list) == 2:
+ decoded = bb.fetch2.decodeurl(mir_list[0])
+ try:
+ pattern_scheme = re.compile(decoded[0])
+ except re.error as exc:
+ bb.warn('Invalid scheme regex (%s) in %s: %s' % (decoded[0], mir_type, mir.strip()))
+ continue
+
# Each member should start with protocols
valid_protocol_0 = False
valid_protocol_1 = False
file_absolute = True
for protocol in protocols:
- if not valid_protocol_0 and mir_list[0].startswith(protocol):
+ if not valid_protocol_0 and pattern_scheme.match(protocol[:-3]):
valid_protocol_0 = True
if not valid_protocol_1 and mir_list[1].startswith(protocol):
valid_protocol_1 = True