From 7313b10e242da9225211ca9fd53d14a121c5fa42 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 3 Mar 2017 00:12:49 +0000 Subject: 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 --- meta/classes/sanity.bbclass | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'meta/classes/sanity.bbclass') 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: -- cgit 1.2.3-korg