Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o, Matt Turner <mattst88@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH v2 gentoolkit 2/2] eclean: Add option to delete binpkgs with changed deps
Date: Wed, 11 Mar 2020 03:30:29
Message-Id: f94dcbe6-97c0-d5f8-e46b-be04cb9639d5@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH v2 gentoolkit 2/2] eclean: Add option to delete binpkgs with changed deps by Matt Turner
1 On 3/6/20 10:11 PM, Matt Turner wrote:
2 > +def _deps_equal(deps_a, deps_b, eapi, uselist=None):
3 > + """Compare two dependency lists given a set of USE flags"""
4 > + if deps_a == deps_b: return True
5 > +
6 > + deps_a = use_reduce(deps_a, uselist=uselist, eapi=eapi, token_class=Atom)
7 > + deps_b = use_reduce(deps_b, uselist=uselist, eapi=eapi, token_class=Atom)
8
9 It's pure luck that passing a list of depstrings to use_reduce works
10 here, so it will be more future-proof to use ' '.join(depstr) instead.
11 The relevant code in use_reduce looks like this:
12
13 if isinstance(depstr, list):
14 if portage._internal_caller:
15 warnings.warn(_("Passing paren_reduced dep arrays to %s is deprecated. " + \
16 "Pass the original dep string instead.") % \
17 ('portage.dep.use_reduce',), DeprecationWarning, stacklevel=2)
18 depstr = paren_enclose(depstr)
19 --
20 Thanks,
21 Zac

Attachments

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

Replies