aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2024-05-27 11:03:32 -0700
committerZac Medico <zmedico@gentoo.org>2024-05-27 11:04:41 -0700
commit2db89a16ab87b85004216959ec6bc508575d96a0 (patch)
treedaa144eb84caa6dc79d1a6767b244013938a4bf1
parentScheduler: convert state_change to boolean in _schedule_tasks_imp() (diff)
downloadportage-2db89a16ab87b85004216959ec6bc508575d96a0.tar.gz
portage-2db89a16ab87b85004216959ec6bc508575d96a0.tar.bz2
portage-2db89a16ab87b85004216959ec6bc508575d96a0.zip
binarytree: Rewrite remote index only on change
I noticed that the remote index was rewritten with a new DOWNLOAD_TIMESTAMP even while frozen, and this patch fixed it. Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--lib/portage/dbapi/bintree.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/portage/dbapi/bintree.py b/lib/portage/dbapi/bintree.py
index 64dfee4fa..b32dea1ea 100644
--- a/lib/portage/dbapi/bintree.py
+++ b/lib/portage/dbapi/bintree.py
@@ -1400,6 +1400,7 @@ class binarytree:
except OSError as e:
if e.errno != errno.ENOENT:
raise
+ changed = True
local_timestamp = pkgindex.header.get("TIMESTAMP", None)
try:
download_timestamp = float(pkgindex.header.get("DOWNLOAD_TIMESTAMP", 0))
@@ -1574,6 +1575,7 @@ class binarytree:
noiselevel=-1,
)
except UseCachedCopyOfRemoteIndex:
+ changed = False
desc = "frozen" if repo.frozen else "up-to-date"
writemsg_stdout("\n")
writemsg_stdout(
@@ -1611,7 +1613,7 @@ class binarytree:
os.unlink(tmp_filename)
except OSError:
pass
- if pkgindex is rmt_idx:
+ if pkgindex is rmt_idx and changed:
pkgindex.modified = False # don't update the header
pkgindex.header["DOWNLOAD_TIMESTAMP"] = "%d" % time.time()
try: