bitbake: bitbake: fetch: Fix BB_FETCH_PREMIRRORONLY for git mirror tarballs

When invoking the original git fetcher after downloading a mirror
tarball, BB_FETCH_PREMIRRORONLY is ignored. This leads to git fetch
commands targeting the upstream source being executed silently. Ensure
setting BB_NO_NETWORK before invoking the original fetcher. While this
was only observed for git, setting this in general for all fetcher
types makes sense at this location.

(Bitbake rev: 1b1321f2b60c0a66159e3f20c6befcb0b3ccc4c7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Julian Haller 2025-04-04 14:10:44 +02:00 committed by Richard Purdie
parent 2aec5513da
commit f3948d6ee3

View File

@ -1092,6 +1092,10 @@ def try_mirror_url(fetch, origud, ud, ld, check = False):
# If that tarball is a local file:// we need to provide a symlink to it
dldir = ld.getVar("DL_DIR")
if bb.utils.to_boolean(ld.getVar("BB_FETCH_PREMIRRORONLY")):
ld = ld.createCopy()
ld.setVar("BB_NO_NETWORK", "1")
if origud.mirrortarballs and os.path.basename(ud.localpath) in origud.mirrortarballs and os.path.basename(ud.localpath) != os.path.basename(origud.localpath):
# Create donestamp in old format to avoid triggering a re-download
if ud.donestamp: