Gentoo Archives: gentoo-portage-dev

From: Matt Turner <mattst88@g.o>
To: Zac Medico <zmedico@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: Mon, 02 Mar 2020 21:11:15
Message-Id: CAEdQ38EF7cQtPvB8T40JTH-yJo6QfnjB=BU2v=PgfpSSBLS9KA@mail.gmail.com
In Reply to: Re: [gentoo-portage-dev] [PATCH gentoolkit 2/2] eclean: Add option to delete binpkgs with changed deps by Zac Medico
1 On Sun, Mar 1, 2020 at 10:39 PM Zac Medico <zmedico@g.o> wrote:
2 >
3 > On 2/20/20 9:29 PM, Matt Turner wrote:
4 > > @@ -564,7 +577,22 @@ def findPackages(
5 > >
6 > > # Exclude if binpkg exists in the porttree and not --deep
7 > > if not destructive and port_dbapi.cpv_exists(cpv):
8 > > - continue
9 > > + if not options['changed-deps']:
10 > > + continue
11 > > +
12 > > + uselist = bin_dbapi.aux_get(cpv, ['USE'])[0].split()
13 > > + all_equal = True
14 > > +
15 > > + for k in ('RDEPEND', 'PDEPEND'):
16 > > + binpkg_deps = bin_dbapi.aux_get(cpv, [k])
17 > > + ebuild_deps = port_dbapi.aux_get(cpv, [k])
18 > > +
19 > > + if not _deps_equal(binpkg_deps, ebuild_deps, cpv.eapi, uselist):
20 > > + all_equal = False
21 > > + break
22 > > +
23 > > + if all_equal:
24 > > + continue
25 >
26 > If all_equal is True, then none of the other filters have an opportunity
27 > to add this package to the dead_binpkgs set. That's not good is it?
28
29 There are four cases we skip including packages: 1) exclude list, 2)
30 time limit, 3) non-destructive and package still exists (and now
31 optionally runtime deps haven't changed), 4) destructive and package
32 is installed. Cases (3) and (4) are non-overlapping.
33
34 If none of those cases are true, then we add the package to the
35 dead_binpkgs set. The logic looks right to me.
36
37 Maybe I'm not understanding.
38
39 With your other suggestion in place, the code looks like this, which
40 is hopefully clearer.
41
42 # Exclude if binpkg exists in the porttree and not --deep
43 if not destructive and port_dbapi.cpv_exists(cpv):
44 if not options['changed-deps']:
45 continue
46
47 keys = ('RDEPEND', 'PDEPEND')
48 binpkg_deps = bin_dbapi.aux_get(cpv, keys)
49 ebuild_deps = port_dbapi.aux_get(cpv, keys)
50 uselist = bin_dbapi.aux_get(cpv, ['USE'])[0].split()
51
52 if _deps_equal(binpkg_deps, ebuild_deps, cpv.eapi, uselist):
53 continue
54
55 Unfortunately I don't have any packages with changed-deps at the
56 moment for testing :(

Replies