Commit 89f068e
eclean: limit keep_binpkgs lifetime to the current binrepo
This makes eclean-pkg operate on a per-binrepo basis in --unique-use
mode and fixes a KeyError caused by cross-binrepo queries.
Currently, keep_binpkgs persists across binrepos and may retain binary
packages that do not belong to the current binrepo.
When --unique-use is enabled, bin_dbapi.aux_get may then attempt to
query BUILD_TIME for a package from a different binrepo. Since bin_dbapi
only contains data for the current binrepo, it results in a KeyError.
For example, while processing libevdev-1.13.6-7 it may try to query
libevdev-1.13.6-6 from a different binrepo:
```
$ ls /var/cache/binpkgs/dev-libs/libevdev/
libevdev-1.13.6-6.gpkg.tar
$ ls /var/cache/binhost/gentoo/dev-libs/libevdev/
libevdev-1.13.6-7.gpkg.tar
$ sudo eclean-pkg --unique-use --changed-deps
...
KeyError: ('dev-libs/libevdev-1.13.6', 6, ...)
```
All users of keep_binpkgs lie in `for cpv in bin_dbapi.cpv_all()`-loop
so move its initializer right before the loop starts.
Signed-off-by: moexiami <taopyxxm@gmail.com>
Part-of: https://codeberg.org/gentoo/gentoolkit/pulls/8
Merges: https://codeberg.org/gentoo/gentoolkit/pulls/8
Signed-off-by: Sam James <sam@gentoo.org>1 parent 7406b81 commit 89f068e
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
734 | 734 | | |
735 | 735 | | |
736 | 736 | | |
737 | | - | |
738 | 737 | | |
739 | 738 | | |
740 | 739 | | |
| |||
766 | 765 | | |
767 | 766 | | |
768 | 767 | | |
| 768 | + | |
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
| |||
0 commit comments