aboutsummaryrefslogtreecommitdiffstats
path: root/lib/_emerge/depgraph.py
diff options
context:
space:
mode:
authorSheng Yu <syu.os@protonmail.com>2023-01-09 22:03:40 -0500
committerSam James <sam@gentoo.org>2023-01-10 03:28:03 +0000
commita0ca453907f461d0bed987cfe7ce52520b2d59ef (patch)
tree24b4124b44a454fbd662df5b907d0e4bf937bbc4 /lib/_emerge/depgraph.py
parentUpdate NEWS with PATH changes (diff)
downloadgentoo-portage-a0ca453907f461d0bed987cfe7ce52520b2d59ef.tar.xz
gentoo-portage-a0ca453907f461d0bed987cfe7ce52520b2d59ef.zip
emerge: depgraph: Correctly detect installation from path for binpkgs
Bug: https://bugs.gentoo.org/873202 Bug: https://bugs.gentoo.org/890291 Signed-off-by: Sheng Yu <syu.os@protonmail.com> Closes: https://github.com/gentoo/portage/pull/973 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'lib/_emerge/depgraph.py')
-rw-r--r--lib/_emerge/depgraph.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 6b08f9fe2f66..4d7a96a2d28e 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -18,6 +18,7 @@ from portage.const import (
PORTAGE_PACKAGE_ATOM,
USER_CONFIG_PATH,
VCS_DIRS,
+ SUPPORTED_XPAK_EXTENSIONS,
SUPPORTED_GPKG_EXTENSIONS,
)
from portage.dbapi import dbapi
@@ -4574,7 +4575,9 @@ class depgraph:
onlydeps = "--onlydeps" in self._frozen_config.myopts
lookup_owners = []
for x in myfiles:
- if x.endswith(".tbz2") or x.endswith(SUPPORTED_GPKG_EXTENSIONS):
+ if x.endswith(SUPPORTED_XPAK_EXTENSIONS) or x.endswith(
+ SUPPORTED_GPKG_EXTENSIONS
+ ):
if not os.path.exists(x):
if os.path.exists(os.path.join(pkgsettings["PKGDIR"], "All", x)):
x = os.path.join(pkgsettings["PKGDIR"], "All", x)
@@ -4608,7 +4611,7 @@ class depgraph:
mykey = None
cat = mytbz2.getfile("CATEGORY")
elif binpkg_format == "gpkg":
- mygpkg = portage.gpkg.gpkg(self.frozen_config, None, x)
+ mygpkg = portage.gpkg.gpkg(root_config.settings, None, x)
mykey = None
cat = mygpkg.get_metadata("CATEGORY")
else:
@@ -4618,7 +4621,12 @@ class depgraph:
cat = _unicode_decode(
cat.strip(), encoding=_encodings["repo.content"]
)
- mykey = cat + "/" + os.path.basename(x)[:-5]
+ if binpkg_format == "xpak":
+ mykey = cat + "/" + os.path.basename(x)[:-5]
+ elif binpkg_format == "gpkg":
+ mykey = cat + "/" + os.path.basename(x)[:-9]
+ else:
+ raise InvalidBinaryPackageFormat(x)
if mykey is None:
writemsg(