summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2016-11-14 06:34:06 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-23 11:10:13 +0000
commit67e8ffcfa698c2f244a787024682707198717334 (patch)
tree4d598f58184d307b7b728acd11dbf22686a75756 /meta
parentd755f0721a17313e27653a6406e6f874180355d6 (diff)
downloadpoky-67e8ffcfa698c2f244a787024682707198717334.tar.gz
sanity.bbclass: fix check_connectivity() for BB_NO_NETWORK = "0"
The old code: network_enabled = not d.getVar('BB_NO_NETWORK', True) It is True only when BB_NO_NETWORK is not set (None), but BB_NO_NETWORK = "0" should also be True while "1" means no network, "0" means need network in a normal case. (From OE-Core rev: 3d8db6cb992f96023a0486f64fe6b0f1ead04184) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/sanity.bbclass14
1 files changed, 9 insertions, 5 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 01bf5f780e..921b248b78 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -363,15 +363,19 @@ def check_connectivity(d):
363 test_uris = (d.getVar('CONNECTIVITY_CHECK_URIS', True) or "").split() 363 test_uris = (d.getVar('CONNECTIVITY_CHECK_URIS', True) or "").split()
364 retval = "" 364 retval = ""
365 365
366 bbn = d.getVar('BB_NO_NETWORK', True)
367 if bbn not in (None, '0', '1'):
368 return 'BB_NO_NETWORK should be "0" or "1", but it is "%s"' % bbn
369
366 # Only check connectivity if network enabled and the 370 # Only check connectivity if network enabled and the
367 # CONNECTIVITY_CHECK_URIS are set 371 # CONNECTIVITY_CHECK_URIS are set
368 network_enabled = not d.getVar('BB_NO_NETWORK', True) 372 network_enabled = not (bbn == '1')
369 check_enabled = len(test_uris) 373 check_enabled = len(test_uris)
370 # Take a copy of the data store and unset MIRRORS and PREMIRRORS
371 data = bb.data.createCopy(d)
372 data.delVar('PREMIRRORS')
373 data.delVar('MIRRORS')
374 if check_enabled and network_enabled: 374 if check_enabled and network_enabled:
375 # Take a copy of the data store and unset MIRRORS and PREMIRRORS
376 data = bb.data.createCopy(d)
377 data.delVar('PREMIRRORS')
378 data.delVar('MIRRORS')
375 try: 379 try:
376 fetcher = bb.fetch2.Fetch(test_uris, data) 380 fetcher = bb.fetch2.Fetch(test_uris, data)
377 fetcher.checkstatus() 381 fetcher.checkstatus()