[gnome-continuous-yocto/gnomeostree-3.28-rocko: 3397/8267] sanity.bbclass: fix check_connectivity() for BB_NO_NETWORK = "0"



commit 67e8ffcfa698c2f244a787024682707198717334
Author: Robert Yang <liezhi yang windriver com>
Date:   Mon Nov 14 06:34:06 2016 -0800

    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>

 meta/classes/sanity.bbclass |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 01bf5f7..921b248 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -363,15 +363,19 @@ def check_connectivity(d):
     test_uris = (d.getVar('CONNECTIVITY_CHECK_URIS', True) or "").split()
     retval = ""
 
+    bbn = d.getVar('BB_NO_NETWORK', True)
+    if bbn not in (None, '0', '1'):
+        return 'BB_NO_NETWORK should be "0" or "1", but it is "%s"' % bbn
+
     # Only check connectivity if network enabled and the
     # CONNECTIVITY_CHECK_URIS are set
-    network_enabled = not d.getVar('BB_NO_NETWORK', True)
+    network_enabled = not (bbn == '1')
     check_enabled = len(test_uris)
-    # Take a copy of the data store and unset MIRRORS and PREMIRRORS
-    data = bb.data.createCopy(d)
-    data.delVar('PREMIRRORS')
-    data.delVar('MIRRORS')
     if check_enabled and network_enabled:
+        # Take a copy of the data store and unset MIRRORS and PREMIRRORS
+        data = bb.data.createCopy(d)
+        data.delVar('PREMIRRORS')
+        data.delVar('MIRRORS')
         try:
             fetcher = bb.fetch2.Fetch(test_uris, data)
             fetcher.checkstatus()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]