]> code.ossystems Code Review - openembedded-core.git/commitdiff
sstate.bbclass: Add an extra check for sstate_mirrors
authorJoe MacDonald <joe@deserted.net>
Tue, 2 Jul 2013 13:19:07 +0000 (09:19 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 5 Jul 2013 14:26:22 +0000 (15:26 +0100)
BB_NO_NETWORK disables any fetching, however if we're using an external
sstate cache, we may want to be able to fetch those objects even if we are
not fetching the upstream sources.  Denote this situation by setting
SSTATE_MIRROR_ALLOW_NETWORK in local.conf.  When it is found, for sstate
cache fetches, mask off BB_NO_NETWORK for the local function.

Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/classes/sstate.bbclass

index 28dc3128088af1f8b0d5321ab6baf3f0bb86c606..c1ca54b4ff61e9e266c30218383dced757de18ee 100644 (file)
@@ -509,6 +509,11 @@ def pstaging_fetch(sstatefetch, sstatepkg, d):
     localdata.setVar('DL_DIR', dldir)
     localdata.setVar('PREMIRRORS', mirrors)
 
+    # if BB_NO_NETWORK is set but we also have SSTATE_MIRROR_ALLOW_NETWORK,
+    # we'll want to allow network access for the current set of fetches.
+    if localdata.getVar('BB_NO_NETWORK', True) == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK', True) == "1":
+        localdata.delVar('BB_NO_NETWORK')
+
     # Try a fetch from the sstate mirror, if it fails just return and
     # we will build the package
     for srcuri in ['file://{0}'.format(sstatefetch),
@@ -619,6 +624,11 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d):
 
         bb.debug(2, "SState using premirror of: %s" % mirrors)
 
+        # if BB_NO_NETWORK is set but we also have SSTATE_MIRROR_ALLOW_NETWORK,
+        # we'll want to allow network access for the current set of fetches.
+        if localdata.getVar('BB_NO_NETWORK', True) == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK', True) == "1":
+            localdata.delVar('BB_NO_NETWORK')
+
         for task in range(len(sq_fn)):
             if task in ret:
                 continue