diff options
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/sanity.bbclass | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 3b40ebec0a..dbcc26b184 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass | |||
@@ -753,6 +753,39 @@ def check_sanity_everybuild(status, d): | |||
753 | if oeroot.find(' ') != -1: | 753 | if oeroot.find(' ') != -1: |
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 | ||
757 | mir_types = ['MIRRORS', 'PREMIRRORS', 'SSTATE_MIRRORS'] | ||
758 | protocols = ['http://', 'ftp://', 'file://', 'https://', 'https?$://', \ | ||
759 | 'git://', 'gitsm://', 'hg://', 'osc://', 'p4://', 'svk://', 'svn://', \ | ||
760 | 'bzr://', 'cvs://'] | ||
761 | for mir_type in mir_types: | ||
762 | mirros = (d.getVar(mir_type, True) or '').split('\\n') | ||
763 | for mir in mirros: | ||
764 | mir_list = mir.split() | ||
765 | # Should be two members. | ||
766 | if len(mir_list) not in [0, 2]: | ||
767 | bb.warn('Invalid %s: %s, should be 2 members, but found %s.' \ | ||
768 | % (mir_type, mir.strip(), len(mir_list))) | ||
769 | elif len(mir_list) == 2: | ||
770 | # Each member should start with protocols | ||
771 | valid_protocol_0 = False | ||
772 | valid_protocol_1 = False | ||
773 | file_absolute = True | ||
774 | for protocol in protocols: | ||
775 | if not valid_protocol_0 and mir_list[0].startswith(protocol): | ||
776 | valid_protocol_0 = True | ||
777 | if not valid_protocol_1 and mir_list[1].startswith(protocol): | ||
778 | valid_protocol_1 = True | ||
779 | # The file:// must be an absolute path. | ||
780 | if protocol == 'file://' and not mir_list[1].startswith('file:///'): | ||
781 | file_absolute = False | ||
782 | if valid_protocol_0 and valid_protocol_1: | ||
783 | break | ||
784 | if not (valid_protocol_0 and valid_protocol_1): | ||
785 | bb.warn('Invalid protocol in %s: %s' % (mir_type, mir.strip())) | ||
786 | if not file_absolute: | ||
787 | bb.warn('Invalid file url in %s: %s, must be absolute path (file:///)' % (mir_type, mir.strip())) | ||
788 | |||
756 | # Check that TMPDIR hasn't changed location since the last time we were run | 789 | # Check that TMPDIR hasn't changed location since the last time we were run |
757 | tmpdir = d.getVar('TMPDIR', True) | 790 | tmpdir = d.getVar('TMPDIR', True) |
758 | checkfile = os.path.join(tmpdir, "saved_tmpdir") | 791 | checkfile = os.path.join(tmpdir, "saved_tmpdir") |