aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2024-01-31 19:31:00 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-19 12:01:00 +0000
commit8b890b87e30cd05ec92ed71ee3691a47b4d77253 (patch)
treece48b053e3051aab706095ce5e2c66d69fe30240 /lib
parent80c91ceb81b1cae203067af58d3f1fe9c619ae83 (diff)
downloadbitbake-8b890b87e30cd05ec92ed71ee3691a47b4d77253.tar.gz
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. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/fetch2/git.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 1faa2145c..db1e28637 100644
--- a/lib/bb/fetch2/git.py
+++ b/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