diff options
| -rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 20 | ||||
| -rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 2 | ||||
| -rw-r--r-- | bitbake/lib/bb/fetch2/local.py | 2 | ||||
| -rw-r--r-- | bitbake/lib/bb/fetch2/wget.py | 2 |
4 files changed, 13 insertions, 13 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 7fd9ec7bf1..8d0221decc 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
| @@ -907,12 +907,12 @@ def rename_bad_checksum(ud, suffix): | |||
| 907 | bb.utils.movefile(ud.localpath, new_localpath) | 907 | bb.utils.movefile(ud.localpath, new_localpath) |
| 908 | 908 | ||
| 909 | 909 | ||
| 910 | def try_mirror_url(origud, ud, ld, check = False): | 910 | def try_mirror_url(fetch, origud, ud, ld, check = False): |
| 911 | # Return of None or a value means we're finished | 911 | # Return of None or a value means we're finished |
| 912 | # False means try another url | 912 | # False means try another url |
| 913 | try: | 913 | try: |
| 914 | if check: | 914 | if check: |
| 915 | found = ud.method.checkstatus(ud, ld) | 915 | found = ud.method.checkstatus(fetch, ud, ld) |
| 916 | if found: | 916 | if found: |
| 917 | return found | 917 | return found |
| 918 | return False | 918 | return False |
| @@ -975,7 +975,7 @@ def try_mirror_url(origud, ud, ld, check = False): | |||
| 975 | pass | 975 | pass |
| 976 | return False | 976 | return False |
| 977 | 977 | ||
| 978 | def try_mirrors(d, origud, mirrors, check = False): | 978 | def try_mirrors(fetch, d, origud, mirrors, check = False): |
| 979 | """ | 979 | """ |
| 980 | Try to use a mirrored version of the sources. | 980 | Try to use a mirrored version of the sources. |
| 981 | This method will be automatically called before the fetchers go. | 981 | This method will be automatically called before the fetchers go. |
| @@ -989,7 +989,7 @@ def try_mirrors(d, origud, mirrors, check = False): | |||
| 989 | uris, uds = build_mirroruris(origud, mirrors, ld) | 989 | uris, uds = build_mirroruris(origud, mirrors, ld) |
| 990 | 990 | ||
| 991 | for index, uri in enumerate(uris): | 991 | for index, uri in enumerate(uris): |
| 992 | ret = try_mirror_url(origud, uds[index], ld, check) | 992 | ret = try_mirror_url(fetch, origud, uds[index], ld, check) |
| 993 | if ret != False: | 993 | if ret != False: |
| 994 | return ret | 994 | return ret |
| 995 | return None | 995 | return None |
| @@ -1473,7 +1473,7 @@ class FetchMethod(object): | |||
| 1473 | """ | 1473 | """ |
| 1474 | return True | 1474 | return True |
| 1475 | 1475 | ||
| 1476 | def checkstatus(self, urldata, d): | 1476 | def checkstatus(self, fetch, urldata, d): |
| 1477 | """ | 1477 | """ |
| 1478 | Check the status of a URL | 1478 | Check the status of a URL |
| 1479 | Assumes localpath was called first | 1479 | Assumes localpath was called first |
| @@ -1577,7 +1577,7 @@ class Fetch(object): | |||
| 1577 | elif m.try_premirror(ud, self.d): | 1577 | elif m.try_premirror(ud, self.d): |
| 1578 | logger.debug(1, "Trying PREMIRRORS") | 1578 | logger.debug(1, "Trying PREMIRRORS") |
| 1579 | mirrors = mirror_from_string(self.d.getVar('PREMIRRORS', True)) | 1579 | mirrors = mirror_from_string(self.d.getVar('PREMIRRORS', True)) |
| 1580 | localpath = try_mirrors(self.d, ud, mirrors, False) | 1580 | localpath = try_mirrors(self, self.d, ud, mirrors, False) |
| 1581 | 1581 | ||
| 1582 | if premirroronly: | 1582 | if premirroronly: |
| 1583 | self.d.setVar("BB_NO_NETWORK", "1") | 1583 | self.d.setVar("BB_NO_NETWORK", "1") |
| @@ -1616,7 +1616,7 @@ class Fetch(object): | |||
| 1616 | m.clean(ud, self.d) | 1616 | m.clean(ud, self.d) |
| 1617 | logger.debug(1, "Trying MIRRORS") | 1617 | logger.debug(1, "Trying MIRRORS") |
| 1618 | mirrors = mirror_from_string(self.d.getVar('MIRRORS', True)) | 1618 | mirrors = mirror_from_string(self.d.getVar('MIRRORS', True)) |
| 1619 | localpath = try_mirrors (self.d, ud, mirrors) | 1619 | localpath = try_mirrors(self, self.d, ud, mirrors) |
| 1620 | 1620 | ||
| 1621 | if not localpath or ((not os.path.exists(localpath)) and localpath.find("*") == -1): | 1621 | if not localpath or ((not os.path.exists(localpath)) and localpath.find("*") == -1): |
| 1622 | if firsterr: | 1622 | if firsterr: |
| @@ -1648,15 +1648,15 @@ class Fetch(object): | |||
| 1648 | logger.debug(1, "Testing URL %s", u) | 1648 | logger.debug(1, "Testing URL %s", u) |
| 1649 | # First try checking uri, u, from PREMIRRORS | 1649 | # First try checking uri, u, from PREMIRRORS |
| 1650 | mirrors = mirror_from_string(self.d.getVar('PREMIRRORS', True)) | 1650 | mirrors = mirror_from_string(self.d.getVar('PREMIRRORS', True)) |
| 1651 | ret = try_mirrors(self.d, ud, mirrors, True) | 1651 | ret = try_mirrors(self, self.d, ud, mirrors, True) |
| 1652 | if not ret: | 1652 | if not ret: |
| 1653 | # Next try checking from the original uri, u | 1653 | # Next try checking from the original uri, u |
| 1654 | try: | 1654 | try: |
| 1655 | ret = m.checkstatus(ud, self.d) | 1655 | ret = m.checkstatus(self, ud, self.d) |
| 1656 | except: | 1656 | except: |
| 1657 | # Finally, try checking uri, u, from MIRRORS | 1657 | # Finally, try checking uri, u, from MIRRORS |
| 1658 | mirrors = mirror_from_string(self.d.getVar('MIRRORS', True)) | 1658 | mirrors = mirror_from_string(self.d.getVar('MIRRORS', True)) |
| 1659 | ret = try_mirrors(self.d, ud, mirrors, True) | 1659 | ret = try_mirrors(self, self.d, ud, mirrors, True) |
| 1660 | 1660 | ||
| 1661 | if not ret: | 1661 | if not ret: |
| 1662 | raise FetchError("URL %s doesn't work" % u, u) | 1662 | raise FetchError("URL %s doesn't work" % u, u) |
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 2e5388221f..0abd67924b 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
| @@ -423,7 +423,7 @@ class Git(FetchMethod): | |||
| 423 | else: | 423 | else: |
| 424 | return True, str(rev) | 424 | return True, str(rev) |
| 425 | 425 | ||
| 426 | def checkstatus(self, ud, d): | 426 | def checkstatus(self, fetch, ud, d): |
| 427 | try: | 427 | try: |
| 428 | self._lsremote(ud, d, "") | 428 | self._lsremote(ud, d, "") |
| 429 | return True | 429 | return True |
diff --git a/bitbake/lib/bb/fetch2/local.py b/bitbake/lib/bb/fetch2/local.py index 0785236a6b..2d921f7e55 100644 --- a/bitbake/lib/bb/fetch2/local.py +++ b/bitbake/lib/bb/fetch2/local.py | |||
| @@ -112,7 +112,7 @@ class Local(FetchMethod): | |||
| 112 | 112 | ||
| 113 | return True | 113 | return True |
| 114 | 114 | ||
| 115 | def checkstatus(self, urldata, d): | 115 | def checkstatus(self, fetch, urldata, d): |
| 116 | """ | 116 | """ |
| 117 | Check the status of the url | 117 | Check the status of the url |
| 118 | """ | 118 | """ |
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index 162a6bd3be..abacbcf796 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py | |||
| @@ -100,7 +100,7 @@ class Wget(FetchMethod): | |||
| 100 | 100 | ||
| 101 | return True | 101 | return True |
| 102 | 102 | ||
| 103 | def checkstatus(self, ud, d): | 103 | def checkstatus(self, fetch, ud, d): |
| 104 | 104 | ||
| 105 | uri = ud.url.split(";")[0] | 105 | uri = ud.url.split(";")[0] |
| 106 | fetchcmd = self.basecmd + " --spider '%s'" % uri | 106 | fetchcmd = self.basecmd + " --spider '%s'" % uri |
