All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] sstate.bbclass: Add an extra check for sstate_mirrors
       [not found] <1372447783-24719-1-git-send-email-joe.macdonald@windriver.com>
@ 2013-07-02 13:19 ` Joe MacDonald
  0 siblings, 0 replies; only message in thread
From: Joe MacDonald @ 2013-07-02 13:19 UTC (permalink / raw)
  To: openembedded-core

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>
---
 meta/classes/sstate.bbclass |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 28dc312..c1ca54b 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -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
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-07-02 13:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1372447783-24719-1-git-send-email-joe.macdonald@windriver.com>
2013-07-02 13:19 ` [RFC PATCH] sstate.bbclass: Add an extra check for sstate_mirrors Joe MacDonald

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.