summaryrefslogtreecommitdiffstats
path: root/meta/classes
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:29 +0100
commitaf6d66852f1868f00d24e0ff1d9ac0c9e82434ac (patch)
treef3e1dcea96dfeac689c22ac7fc5d43a93d14b38a /meta/classes
parentd68255d14bfa43bfa35c724631ab844a141e300e (diff)
downloadpoky-af6d66852f1868f00d24e0ff1d9ac0c9e82434ac.tar.gz
sanity: fix support for regex schemes in mirrors check
(From OE-Core rev: c8afcb9cab9d610892db9c41b29685583f3b5773) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-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):
754 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.") 754 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.")
755 755
756 # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS 756 # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS
757 import re
757 mir_types = ['MIRRORS', 'PREMIRRORS', 'SSTATE_MIRRORS'] 758 mir_types = ['MIRRORS', 'PREMIRRORS', 'SSTATE_MIRRORS']
758 protocols = ['http://', 'ftp://', 'file://', 'https://', 'https?$://', \ 759 protocols = ['http://', 'ftp://', 'file://', 'https://', \
759 'git://', 'gitsm://', 'hg://', 'osc://', 'p4://', 'svk://', 'svn://', \ 760 'git://', 'gitsm://', 'hg://', 'osc://', 'p4://', 'svk://', 'svn://', \
760 'bzr://', 'cvs://'] 761 'bzr://', 'cvs://']
761 for mir_type in mir_types: 762 for mir_type in mir_types:
@@ -767,12 +768,19 @@ def check_sanity_everybuild(status, d):
767 bb.warn('Invalid %s: %s, should be 2 members, but found %s.' \ 768 bb.warn('Invalid %s: %s, should be 2 members, but found %s.' \
768 % (mir_type, mir.strip(), len(mir_list))) 769 % (mir_type, mir.strip(), len(mir_list)))
769 elif len(mir_list) == 2: 770 elif len(mir_list) == 2:
771 decoded = bb.fetch2.decodeurl(mir_list[0])
772 try:
773 pattern_scheme = re.compile(decoded[0])
774 except re.error as exc:
775 bb.warn('Invalid scheme regex (%s) in %s: %s' % (decoded[0], mir_type, mir.strip()))
776 continue
777
770 # Each member should start with protocols 778 # Each member should start with protocols
771 valid_protocol_0 = False 779 valid_protocol_0 = False
772 valid_protocol_1 = False 780 valid_protocol_1 = False
773 file_absolute = True 781 file_absolute = True
774 for protocol in protocols: 782 for protocol in protocols:
775 if not valid_protocol_0 and mir_list[0].startswith(protocol): 783 if not valid_protocol_0 and pattern_scheme.match(protocol[:-3]):
776 valid_protocol_0 = True 784 valid_protocol_0 = True
777 if not valid_protocol_1 and mir_list[1].startswith(protocol): 785 if not valid_protocol_1 and mir_list[1].startswith(protocol):
778 valid_protocol_1 = True 786 valid_protocol_1 = True