[oe-commits] [bitbake] 01/02: fetch2: Allow whitespace only mirror entries

git at git.openembedded.org git at git.openembedded.org
Fri Mar 3 00:20:14 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository bitbake.

commit 044fb04dbe69313ee6908bf4d3cee7f797d0c41c
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Fri Mar 3 00:13:01 2017 +0000

    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.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/fetch2/__init__.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 760e24f..672f109 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/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={}):
     """

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list