All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fetch2/git: always use premirror first if update is required
@ 2016-09-16  8:58 Pascal Bach
  2016-09-16 16:20 ` Christopher Larson
  0 siblings, 1 reply; 8+ messages in thread
From: Pascal Bach @ 2016-09-16  8:58 UTC (permalink / raw)
  To: bitbake-devel

When an update of the local copy is required always try to fetch the update
from a premirror first.
The premirror should always have precedence over the upstream repository
as updating from there might not work if BB_FETCH_PREMIRRORONLY,
BB_NO_NBB_ALLOWED_NETWORKS or BB_NO_NETWORK is set.

This also gets rid of the special case for BB_FETCH_PREMIRRORONLY.

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
---
 lib/bb/fetch2/git.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 1bec60a..cac2a87 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -227,13 +227,8 @@ class Git(FetchMethod):
         return False
 
     def try_premirror(self, ud, d):
-        # If we don't do this, updating an existing checkout with only premirrors
-        # is not possible
-        if d.getVar("BB_FETCH_PREMIRRORONLY", True) is not None:
-            return True
-        if os.path.exists(ud.clonedir):
-            return False
-        return True
+        # Always try premirror if an update is required
+        return self.need_update(ud, d)
 
     def download(self, ud, d):
         """Fetch url"""
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-09-22 12:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-16  8:58 [PATCH] fetch2/git: always use premirror first if update is required Pascal Bach
2016-09-16 16:20 ` Christopher Larson
2016-09-19  7:22   ` Pascal Bach
2016-09-19 15:10     ` Christopher Larson
2016-09-20  6:51       ` Pascal Bach
2016-09-22  7:45         ` Pascal Bach
2016-09-22 10:17           ` Richard Purdie
2016-09-22 12:16             ` Richard Purdie

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.