diff options
Diffstat (limited to 'bitbake/lib/bb/fetch2')
| -rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 569007fdb8..288a1c8fd0 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
| @@ -862,7 +862,7 @@ def build_mirroruris(origud, mirrors, ld): | |||
| 862 | replacements["BASENAME"] = origud.path.split("/")[-1] | 862 | replacements["BASENAME"] = origud.path.split("/")[-1] |
| 863 | replacements["MIRRORNAME"] = origud.host.replace(':','.') + origud.path.replace('/', '.').replace('*', '.') | 863 | replacements["MIRRORNAME"] = origud.host.replace(':','.') + origud.path.replace('/', '.').replace('*', '.') |
| 864 | 864 | ||
| 865 | def adduri(ud, uris, uds): | 865 | def adduri(ud, uris, uds, mirrors): |
| 866 | for line in mirrors: | 866 | for line in mirrors: |
| 867 | try: | 867 | try: |
| 868 | (find, replace) = line | 868 | (find, replace) = line |
| @@ -876,6 +876,12 @@ def build_mirroruris(origud, mirrors, ld): | |||
| 876 | logger.debug(1, "Mirror %s not in the list of trusted networks, skipping" % (newuri)) | 876 | logger.debug(1, "Mirror %s not in the list of trusted networks, skipping" % (newuri)) |
| 877 | continue | 877 | continue |
| 878 | 878 | ||
| 879 | # Create a local copy of the mirrors minus the current line | ||
| 880 | # this will prevent us from recursively processing the same line | ||
| 881 | # as well as indirect recursion A -> B -> C -> A | ||
| 882 | localmirrors = list(mirrors) | ||
| 883 | localmirrors.remove(line) | ||
| 884 | |||
| 879 | try: | 885 | try: |
| 880 | newud = FetchData(newuri, ld) | 886 | newud = FetchData(newuri, ld) |
| 881 | newud.setup_localpath(ld) | 887 | newud.setup_localpath(ld) |
| @@ -885,16 +891,16 @@ def build_mirroruris(origud, mirrors, ld): | |||
| 885 | try: | 891 | try: |
| 886 | # setup_localpath of file:// urls may fail, we should still see | 892 | # setup_localpath of file:// urls may fail, we should still see |
| 887 | # if mirrors of the url exist | 893 | # if mirrors of the url exist |
| 888 | adduri(newud, uris, uds) | 894 | adduri(newud, uris, uds, localmirrors) |
| 889 | except UnboundLocalError: | 895 | except UnboundLocalError: |
| 890 | pass | 896 | pass |
| 891 | continue | 897 | continue |
| 892 | uris.append(newuri) | 898 | uris.append(newuri) |
| 893 | uds.append(newud) | 899 | uds.append(newud) |
| 894 | 900 | ||
| 895 | adduri(newud, uris, uds) | 901 | adduri(newud, uris, uds, localmirrors) |
| 896 | 902 | ||
| 897 | adduri(origud, uris, uds) | 903 | adduri(origud, uris, uds, mirrors) |
| 898 | 904 | ||
| 899 | return uris, uds | 905 | return uris, uds |
| 900 | 906 | ||
