public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:root-deps-both commit in: lib/portage/dbapi/
@ 2024-06-11 13:01 James Le Cuirot
  0 siblings, 0 replies; 2+ messages in thread
From: James Le Cuirot @ 2024-06-11 13:01 UTC (permalink / raw
  To: gentoo-commits

commit:     2db89a16ab87b85004216959ec6bc508575d96a0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 27 18:03:32 2024 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Mon May 27 18:04:41 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2db89a16

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 <AT> gentoo.org>

 lib/portage/dbapi/bintree.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/portage/dbapi/bintree.py b/lib/portage/dbapi/bintree.py
index 64dfee4faa..b32dea1eae 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:


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/portage:root-deps-both commit in: lib/portage/dbapi/
@ 2024-06-11 13:01 James Le Cuirot
  0 siblings, 0 replies; 2+ messages in thread
From: James Le Cuirot @ 2024-06-11 13:01 UTC (permalink / raw
  To: gentoo-commits

commit:     1a7fc63d20ad2e1292be3697c105c2d7e1691f91
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  1 04:56:45 2024 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Sat Jun  1 19:18:35 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1a7fc63d

MergeProcess: Pass bintree to subprocess

It's required for FEATURES=*-backup.

Fixes: b9a85ff987ea ("MergeProcess: Support QueryCommand with spawn start method")
Bug: https://bugs.gentoo.org/933297
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/dbapi/_MergeProcess.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/portage/dbapi/_MergeProcess.py b/lib/portage/dbapi/_MergeProcess.py
index d9ab2b47aa..34e39eb229 100644
--- a/lib/portage/dbapi/_MergeProcess.py
+++ b/lib/portage/dbapi/_MergeProcess.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2023 Gentoo Authors
+# Copyright 2010-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import functools
@@ -183,11 +183,12 @@ class MergeProcess(ForkProcess):
 
         # Since the entire QueryCommand._db is not required, only pass
         # in tree types that QueryCommand specifically requires.
+        # NOTE: For FEATURES=*-backup bintree is needed (bug 933297).
         child_db = {}
         parent_db = portage.db if QueryCommand._db is None else QueryCommand._db
         for root in parent_db:
             child_db[root] = {}
-            for tree_type in ("vartree", "porttree"):
+            for tree_type in ("bintree", "porttree", "vartree"):
                 child_db[root][tree_type] = parent_db[root][tree_type]
 
         self.target = functools.partial(


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-11 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-11 13:01 [gentoo-commits] proj/portage:root-deps-both commit in: lib/portage/dbapi/ James Le Cuirot
  -- strict thread matches above, loose matches on Subject: below --
2024-06-11 13:01 James Le Cuirot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox