Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: Matt Turner <mattst88@g.o>
Cc: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH gentoolkit 2/2] eclean: Add option to delete binpkgs with changed deps
Date: Tue, 03 Mar 2020 05:15:23
Message-Id: b5c7ca65-2b86-42e7-d77d-0245d460e1e2@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH gentoolkit 2/2] eclean: Add option to delete binpkgs with changed deps by Matt Turner
1 On 3/2/20 1:11 PM, Matt Turner wrote:
2 > On Sun, Mar 1, 2020 at 10:39 PM Zac Medico <zmedico@g.o> wrote:
3 >>
4 >> On 2/20/20 9:29 PM, Matt Turner wrote:
5 >>> @@ -564,7 +577,22 @@ def findPackages(
6 >>>
7 >>> # Exclude if binpkg exists in the porttree and not --deep
8 >>> if not destructive and port_dbapi.cpv_exists(cpv):
9 >>> - continue
10 >>> + if not options['changed-deps']:
11 >>> + continue
12 >>> +
13 >>> + uselist = bin_dbapi.aux_get(cpv, ['USE'])[0].split()
14 >>> + all_equal = True
15 >>> +
16 >>> + for k in ('RDEPEND', 'PDEPEND'):
17 >>> + binpkg_deps = bin_dbapi.aux_get(cpv, [k])
18 >>> + ebuild_deps = port_dbapi.aux_get(cpv, [k])
19 >>> +
20 >>> + if not _deps_equal(binpkg_deps, ebuild_deps, cpv.eapi, uselist):
21 >>> + all_equal = False
22 >>> + break
23 >>> +
24 >>> + if all_equal:
25 >>> + continue
26 >>
27 >> If all_equal is True, then none of the other filters have an opportunity
28 >> to add this package to the dead_binpkgs set. That's not good is it?
29 >
30 > There are four cases we skip including packages: 1) exclude list, 2)
31 > time limit, 3) non-destructive and package still exists (and now
32 > optionally runtime deps haven't changed), 4) destructive and package
33 > is installed. Cases (3) and (4) are non-overlapping.
34 >
35 > If none of those cases are true, then we add the package to the
36 > dead_binpkgs set. The logic looks right to me.
37 >
38 > Maybe I'm not understanding.
39
40 What I imagine is that you could have some old packages that you
41 probably want to delete because they're so old, even though their deps
42 have not changed. Meanwhile you have some packages that are
43 relatively recent and you'd like to delete them if they have changed deps.
44
45 Given the current logic, I guess you'd have to do separate passes, one
46 to delete packages based on age and another to delete packages based on
47 changed deps. Maybe it's fine to require separate passes for this kind
48 of thing. I supposed the alternative would be to add an --or flag that
49 would allow you to say that you want to delete packages if they are at
50 least a certain age or they have changed deps.
51 --
52 Thanks,
53 Zac

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies