diff options
author | Siddhanth Rathod <xsiddhanthrathod@gmail.com> | 2023-03-23 21:58:14 +0530 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-08-21 06:15:05 +0100 |
commit | 71daef3ac877329a0479a72ba333a9c801a36bf3 (patch) | |
tree | ae375ca694642306788a4c1eece2633618e90000 | |
parent | NEWS, meson.build: prepare for portage-3.0.51 (diff) | |
download | portage-71daef3a.tar.gz portage-71daef3a.tar.bz2 portage-71daef3a.zip |
bintree: Add invalid_paths member to API
Add object invalid_paths for new eclean feature to deal with invalid binpkgs.
This is needed for gentoolkit's eclean to handle cleaning up invalid binpkgs.
gentoolkit side PR: https://github.com/gentoo/gentoolkit/pull/28
Bug: https://bugs.gentoo.org/900224
Signed-off-by: Siddhanth Rathod <xsiddhanthrathod@gmail.com>
Closes: https://github.com/gentoo/portage/pull/1016
Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r-- | NEWS | 7 | ||||
-rw-r--r-- | lib/portage/dbapi/bintree.py | 4 | ||||
-rw-r--r-- | lib/portage/tests/dbapi/test_bintree.py | 1 |
3 files changed, 12 insertions, 0 deletions
@@ -1,3 +1,10 @@ +portage-3.0.52 (UNRELEASED) +-------------- + +Features: +* bintree: Add new API member (invalid_paths) to allow gentoolkit to later + clean up invalid binpkgs (bug #900224). + portage-3.0.51 (2023-08-20) -------------- diff --git a/lib/portage/dbapi/bintree.py b/lib/portage/dbapi/bintree.py index 5f58c548d..af2113bd8 100644 --- a/lib/portage/dbapi/bintree.py +++ b/lib/portage/dbapi/bintree.py @@ -485,6 +485,7 @@ class binarytree: self._remotepkgs = None # remote metadata indexed by cpv self._additional_pkgs = {} self.invalids = [] + self.invalid_paths: dict[str, list[str]] = {} self.settings = settings self._pkg_paths = {} self._populating = False @@ -1017,12 +1018,14 @@ class binarytree: noiselevel=-1, ) self.invalids.append(myfile[:-5]) + self.invalid_paths[myfile] = [full_path] continue try: binpkg_format = get_binpkg_format(myfile) except InvalidBinaryPackageFormat: self.invalids.append(myfile[:-5]) + self.invalid_paths[myfile[:-5]] = [full_path] continue if gpkg_only: @@ -1089,6 +1092,7 @@ class binarytree: for line in textwrap.wrap("".join(msg), 72): writemsg(f"!!! {line}\n", noiselevel=-1) self.invalids.append(mypkg) + self.invalid_paths[mypkg] = [full_path] continue multi_instance = False diff --git a/lib/portage/tests/dbapi/test_bintree.py b/lib/portage/tests/dbapi/test_bintree.py index 383d5585e..60785b4e5 100644 --- a/lib/portage/tests/dbapi/test_bintree.py +++ b/lib/portage/tests/dbapi/test_bintree.py @@ -46,6 +46,7 @@ class BinarytreeTestCase(TestCase): "_remotepkgs", "_additional_pkgs", "invalids", + "invalid_paths", "settings", "_pkg_paths", "_populating", |