diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-03 00:12:49 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-03 00:19:00 +0000 |
commit | 7313b10e242da9225211ca9fd53d14a121c5fa42 (patch) | |
tree | 283f120a3c5be77127cf7e55badf95299285238f /meta/classes | |
parent | 444a71b1c2d8f86fc4c35c8ff8e92bcbbe646b75 (diff) | |
download | openembedded-core-7313b10e242da9225211ca9fd53d14a121c5fa42.tar.gz openembedded-core-7313b10e242da9225211ca9fd53d14a121c5fa42.tar.bz2 openembedded-core-7313b10e242da9225211ca9fd53d14a121c5fa42.zip |
sanity: Allow whitespace only mirror entries
Forcing the use of "\n" in mirror variables is pointless, we can just require that
there are pairs of values. With the bitbake restriction relaxed, we can relax
the sanity check too.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/sanity.bbclass | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 8935df8bd8..1fe172f8b2 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass @@ -876,18 +876,16 @@ def check_sanity_everybuild(status, d): 'git', 'gitsm', 'hg', 'osc', 'p4', 'svn', \ 'bzr', 'cvs', 'npm', 'sftp', 'ssh'] for mirror_var in mirror_vars: - mirrors = (d.getVar(mirror_var) or '').replace('\\n', '\n').split('\n') - for mirror_entry in mirrors: - mirror_entry = mirror_entry.strip() - if not mirror_entry: - # ignore blank lines - continue + mirrors = (d.getVar(mirror_var) or '').replace('\\n', ' ').split() - try: - pattern, mirror = mirror_entry.split() - except ValueError: - bb.warn('Invalid %s: %s, should be 2 members.' % (mirror_var, mirror_entry.strip())) - continue + # Split into pairs + if len(mirrors) % 2 != 0: + bb.warn('Invalid mirror variable value for %s: %s, should contain paired members.' % (mirror_var, mirrors.strip())) + continue + mirrors = list(zip(*[iter(mirrors)]*2)) + + for mirror_entry in mirrors: + pattern, mirror = mirror_entry decoded = bb.fetch2.decodeurl(pattern) try: |