From da6652b526c461c77417385802306e802084d992 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 3 Mar 2017 00:13:01 +0000 Subject: bitbake: fetch2: 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. (Bitbake rev: 044fb04dbe69313ee6908bf4d3cee7f797d0c41c) Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/bb/fetch2') diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 760e24f039..672f1095dc 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py @@ -538,7 +538,11 @@ def fetcher_compare_revisions(): return False def mirror_from_string(data): - return [ i.split() for i in (data or "").replace('\\n','\n').split('\n') if i ] + mirrors = (data or "").replace('\\n',' ').split() + # Split into pairs + if len(mirrors) % 2 != 0: + bb.warn('Invalid mirror data %s, should have paired members.' % data) + return list(zip(*[iter(mirrors)]*2)) def verify_checksum(ud, d, precomputed={}): """ -- cgit v1.2.3-54-g00ecf