[oe-commits] [bitbake] 06/12: bitbake: fetch2: allow fetchers to forward the mirrors management

git at git.openembedded.org git at git.openembedded.org
Thu Jan 23 16:59:12 UTC 2020


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 9fb8af607402db8b34605c49c933e0c140951919
Author: Jean-Marie LEMETAYER <jean-marie.lemetayer at savoirfairelinux.com>
AuthorDate: Mon Jan 20 11:27:14 2020 +0100

    bitbake: fetch2: allow fetchers to forward the mirrors management
    
    This commit is necessary to introduce proxy fetchers and do not modify
    the behavior of existing fetchers.
    
    This commit allows fetchers to forwards the "try_mirrors" functions to
    a proxy fetcher.
    
    Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer at savoirfairelinux.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/fetch2/__init__.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index d4d87f3..923a3cd 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -1564,6 +1564,12 @@ class FetchMethod(object):
         """
         return True
 
+    def try_mirrors(self, fetch, urldata, d, mirrors):
+        """
+        Try to use a mirror
+        """
+        return try_mirrors(fetch, d, urldata, mirrors)
+
     def checkstatus(self, fetch, urldata, d):
         """
         Check the status of a URL
@@ -1678,7 +1684,7 @@ class Fetch(object):
                 elif m.try_premirror(ud, self.d):
                     logger.debug(1, "Trying PREMIRRORS")
                     mirrors = mirror_from_string(self.d.getVar('PREMIRRORS'))
-                    localpath = try_mirrors(self, self.d, ud, mirrors, False)
+                    localpath = m.try_mirrors(self, ud, self.d, mirrors)
                     if localpath:
                         try:
                             # early checksum verification so that if the checksum of the premirror
@@ -1727,7 +1733,7 @@ class Fetch(object):
                             m.clean(ud, self.d)
                         logger.debug(1, "Trying MIRRORS")
                         mirrors = mirror_from_string(self.d.getVar('MIRRORS'))
-                        localpath = try_mirrors(self, self.d, ud, mirrors)
+                        localpath = m.try_mirrors(self, ud, self.d, mirrors)
 
                 if not localpath or ((not os.path.exists(localpath)) and localpath.find("*") == -1):
                     if firsterr:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list