summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiddhanth Rathod <xsiddhanthrathod@gmail.com>2023-09-29 00:24:44 +0530
committerSam James <sam@gentoo.org>2023-09-29 08:20:18 +0100
commite49cc3493ab77678a740bf8a27cf22e77e061409 (patch)
tree701ae0b1df1262dad9d0fd28e7d02d2035b9dae0
parentequery meta: map the remote-id to the respective url (diff)
downloadgentoolkit-0.6.2.tar.gz
gentoolkit-0.6.2.tar.bz2
gentoolkit-0.6.2.zip
eclean-pkg: fix compatibility with FEATURES=pkgdir-index-trustedgentoolkit-0.6.2
Portage recently enabled FEATURES=pkgdir-index-trusted by default which breaks the eclean-invalids feature. Force reindexing after cleaning up to fix this. See-also: https://github.com/gentoo/portage/commit/3bc7bfef51d88fd716e882d3931f2873e3493e01 Bug: https://bugs.gentoo.org/889300 Bug: https://bugs.gentoo.org/900224 Signed-off-by: Siddhanth Rathod <xsiddhanthrathod@gmail.com> Closes: https://github.com/gentoo/gentoolkit/pull/34 Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--pym/gentoolkit/eclean/search.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/pym/gentoolkit/eclean/search.py b/pym/gentoolkit/eclean/search.py
index a2ac0ce..ce8fe37 100644
--- a/pym/gentoolkit/eclean/search.py
+++ b/pym/gentoolkit/eclean/search.py
@@ -8,6 +8,7 @@ import os
import stat
import sys
from functools import partial
+from inspect import signature
from typing import Optional
import portage
@@ -16,13 +17,12 @@ from portage.dep._slot_operator import strip_slots
import gentoolkit.pprinter as pp
from gentoolkit.eclean.exclude import (
- exclDictMatchCP,
exclDictExpand,
exclDictExpandPkgname,
+ exclDictMatchCP,
exclMatchFilename,
)
-
# Misc. shortcuts to some portage stuff:
port_settings = portage.settings
pkgdir = port_settings["PKGDIR"]
@@ -568,7 +568,12 @@ def findPackages(
dead_binpkgs: dict[str, list[str]] = {}
keep_binpkgs = {}
- bin_dbapi = portage.binarytree(pkgdir=pkgdir, settings=var_dbapi.settings).dbapi
+ # FEATURES=pkgdir-index-trusted is now on by default which makes portages inavlids
+ # inaccessible
+ settings = var_dbapi.settings
+ bin_dbapi = portage.binarytree(pkgdir=pkgdir, settings=settings).dbapi
+ if "force_reindex" in signature(bin_dbapi.bintree.populate).parameters:
+ bin_dbapi.bintree.populate(force_reindex=True)
for cpv in bin_dbapi.cpv_all():
cp = portage.cpv_getkey(cpv)