From 272d5ae098e3519b4d484f36a0497cb944667f74 Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Wed, 31 Jan 2024 19:31:00 -0800 Subject: bitbake: fetch2/git.py: add comment in try_premirrors The purpose of ensuring 'incremental fetch' is not easy to see from the codes. So add comments to explain this. (Bitbake rev: 8b890b87e30cd05ec92ed71ee3691a47b4d77253) Signed-off-by: Chen Qi Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/git.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bitbake/lib/bb/fetch2/git.py') diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 1faa2145cf..db1e286371 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py @@ -361,6 +361,11 @@ class Git(FetchMethod): # we need to try premirrors first as using upstream is destined to fail. if not trusted_network(d, ud.url): return True + # the following check is to ensure incremental fetch in downloads, this is + # because the premirror might be old and does not contain the new rev required, + # and this will cause a total removal and new clone. So if we can reach to + # network, we prefer upstream over premirror, though the premirror might contain + # the new rev. if os.path.exists(ud.clonedir): return False return True -- cgit v1.2.3-54-g00ecf