Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o, Brian Dolbec <dolsen@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH] dbapi: fix repoman implicit IUSE (bug 660982)
Date: Sat, 14 Jul 2018 23:52:59
Message-Id: 76d134ac-9535-a8bf-304e-738eca5af5d9@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] dbapi: fix repoman implicit IUSE (bug 660982) by Brian Dolbec
1 On 07/12/2018 06:36 AM, Brian Dolbec wrote:
2 > On Thu, 12 Jul 2018 02:59:03 -0700
3 > Zac Medico <zmedico@g.o> wrote:
4 >
5 >> Account for repoman modifications of the portdbapi self.settings
6 >> reference, and treat all flags as valid for the empty profile
7 >> because it does not have any implicit IUSE settings.
8 >>
9 >> Bug: https://bugs.gentoo.org/660982
10 >> ---
11 >> pym/_emerge/Package.py | 5 ++++-
12 >> pym/portage/dbapi/__init__.py | 16 ++++++++++++++++
13 >> 2 files changed, 20 insertions(+), 1 deletion(-)
14 >>
15 >> diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
16 >> index a7ce00bc9..5f34f3d27 100644
17 >> --- a/pym/_emerge/Package.py
18 >> +++ b/pym/_emerge/Package.py
19 >> @@ -93,7 +93,10 @@ class Package(Task):
20 >> # sync metadata with validated repo (may be
21 >> UNKNOWN_REPO) self._metadata['repository'] = self.cpv.repo
22 >>
23 >> - implicit_match = db._iuse_implicit_cnstr(self.cpv,
24 >> self._metadata)
25 >> + if self.root_config.settings.local_config:
26 >> + implicit_match =
27 >> db._iuse_implicit_cnstr(self.cpv, self._metadata)
28 >> + else:
29 >> + implicit_match =
30 >> db._repoman_iuse_implicit_cnstr(self.cpv, self._metadata) usealiases
31 >> = self.root_config.settings._use_manager.getUseAliases(self)
32 >> self.iuse = self._iuse(self, self._metadata["IUSE"].split(),
33 >> implicit_match, usealiases, self.eapi) diff --git
34 >> a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index
35 >> d320cc75f..61d301839 100644 --- a/pym/portage/dbapi/__init__.py
36 >> +++ b/pym/portage/dbapi/__init__.py
37 >> @@ -216,6 +216,22 @@ class dbapi(object):
38 >>
39 >> yield cpv
40 >>
41 >> + def _repoman_iuse_implicit_cnstr(self, pkg, metadata):
42 >> + """
43 >> + In repoman's version of _iuse_implicit_cnstr,
44 >> account for modifications
45 >> + of the self.settings reference between calls, and
46 >> treat all flags as
47 >> + valid for the empty profile because it does not have
48 >> any implicit IUSE
49 >> + settings. See bug 660982.
50 >> + """
51 >> + eapi_attrs = _get_eapi_attrs(metadata["EAPI"])
52 >> + if eapi_attrs.iuse_effective:
53 >> + iuse_implicit_match = lambda flag: (True if
54 >> not self.settings.profile_path
55 >> + else
56 >> self.settings._iuse_effective_match(flag))
57 >> + else:
58 >> + iuse_implicit_match = lambda flag: (True if
59 >> not self.settings.profile_path
60 >> + else
61 >> self.settings._iuse_implicit_match(flag))
62 >> + return iuse_implicit_match
63 >> +
64 >> def _iuse_implicit_cnstr(self, pkg, metadata):
65 >> """
66 >> Construct a callable that checks if a given USE flag
67 >> should
68 >
69 > looks good thanks.
70
71 Thanks, merged:
72
73 https://gitweb.gentoo.org/proj/portage.git/commit/?id=e691f07bf0572fad7686a54d628c1a29aec4ebe4
74
75 > Please add the test case ebuild that was supplied to the repoman
76 > gen-b0rk repo "not-broken" category.
77 >
78 > https://gitweb.gentoo.org/repo/proj/gen-b0rk.git/
79
80 Well, these ebuilds are broken in the sense that they normally produce
81 these results:
82
83 RepoMan scours the neighborhood...
84 KEYWORDS.missing 1
85 net-im/a/a-0.ebuild
86 KEYWORDS.unsorted 1
87 net-im/b/b-0.ebuild contains unsorted keywords
88 metadata.missing [fatal] 2
89 net-im/a/metadata.xml
90 net-im/b/metadata.xml
91 --
92 Thanks,
93 Zac

Attachments

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