diff options
| -rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 43c0ca2f15..1faa2145cf 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
| @@ -87,6 +87,7 @@ from contextlib import contextmanager | |||
| 87 | from bb.fetch2 import FetchMethod | 87 | from bb.fetch2 import FetchMethod |
| 88 | from bb.fetch2 import runfetchcmd | 88 | from bb.fetch2 import runfetchcmd |
| 89 | from bb.fetch2 import logger | 89 | from bb.fetch2 import logger |
| 90 | from bb.fetch2 import trusted_network | ||
| 90 | 91 | ||
| 91 | 92 | ||
| 92 | sha1_re = re.compile(r'^[0-9a-f]{40}$') | 93 | sha1_re = re.compile(r'^[0-9a-f]{40}$') |
| @@ -355,6 +356,11 @@ class Git(FetchMethod): | |||
| 355 | # is not possible | 356 | # is not possible |
| 356 | if bb.utils.to_boolean(d.getVar("BB_FETCH_PREMIRRORONLY")): | 357 | if bb.utils.to_boolean(d.getVar("BB_FETCH_PREMIRRORONLY")): |
| 357 | return True | 358 | return True |
| 359 | # If the url is not in trusted network, that is, BB_NO_NETWORK is set to 0 | ||
| 360 | # and BB_ALLOWED_NETWORKS does not contain the host that ud.url uses, then | ||
| 361 | # we need to try premirrors first as using upstream is destined to fail. | ||
| 362 | if not trusted_network(d, ud.url): | ||
| 363 | return True | ||
| 358 | if os.path.exists(ud.clonedir): | 364 | if os.path.exists(ud.clonedir): |
| 359 | return False | 365 | return False |
| 360 | return True | 366 | return True |
