[bitbake-devel] [PATCH] fetch2/git: always use premirror first if update is required

Pascal Bach pascal.bach at siemens.com
Fri Sep 16 08:58:13 UTC 2016


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 at 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




More information about the bitbake-devel mailing list