summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorPavel Zhukov <pavel@zhukoff.net>2024-01-27 13:15:36 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-19 12:52:30 +0000
commitb2d0f31d248418f76cc8df8da9050b693d627776 (patch)
tree5c0e7b134e64065a2576f51617b502742c167a78 /bitbake
parente6892bc47a5aa52ab640d74cf4729fe52c46fd81 (diff)
downloadpoky-b2d0f31d248418f76cc8df8da9050b693d627776.tar.gz
bitbake: fetch2/git.py: Fetch mirror into HEAD
Fix the issue with using of (pre)mirror in case if clonedir exists but outdated. Previous version of the code fetched new mirror content into FETCH_HEAD instead of branch which caused refetch from the upstream. Add new remote add fetch from it instead so the ref can be found by "_contains_ref" Fixes [Yocto #15369] (Bitbake rev: 69588e2a5c7c200e47b02b2391498dcb72388bd2) Signed-off-by: Pavel Zhukov <pavel@zhukoff.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/git.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 842f1c6896..43c0ca2f15 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -375,7 +375,11 @@ class Git(FetchMethod):
375 else: 375 else:
376 tmpdir = tempfile.mkdtemp(dir=d.getVar('DL_DIR')) 376 tmpdir = tempfile.mkdtemp(dir=d.getVar('DL_DIR'))
377 runfetchcmd("tar -xzf %s" % ud.fullmirror, d, workdir=tmpdir) 377 runfetchcmd("tar -xzf %s" % ud.fullmirror, d, workdir=tmpdir)
378 fetch_cmd = "LANG=C %s fetch -f --progress %s " % (ud.basecmd, shlex.quote(tmpdir)) 378 output = runfetchcmd("%s remote" % ud.basecmd, d, quiet=True, workdir=ud.clonedir)
379 if 'mirror' in output:
380 runfetchcmd("%s remote rm mirror" % ud.basecmd, d, workdir=ud.clonedir)
381 runfetchcmd("%s remote add --mirror=fetch mirror %s" % (ud.basecmd, tmpdir), d, workdir=ud.clonedir)
382 fetch_cmd = "LANG=C %s fetch -f --update-head-ok --progress mirror " % (ud.basecmd)
379 runfetchcmd(fetch_cmd, d, workdir=ud.clonedir) 383 runfetchcmd(fetch_cmd, d, workdir=ud.clonedir)
380 repourl = self._get_repo_url(ud) 384 repourl = self._get_repo_url(ud)
381 385