Gentoo Archives: gentoo-portage-dev

From: SebastianLuther@×××.de
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] [PATCH 2/2] repoman: Add check for missing slot operators (bug 493742)
Date: Wed, 01 Jan 2014 22:14:34
Message-Id: 1388614451-18197-2-git-send-email-SebastianLuther@gmx.de
In Reply to: [gentoo-portage-dev] [PATCH 1/2] portdbapi.cp_list(): Don't write into xmatch's "match-all" cache by SebastianLuther@gmx.de
1 From: Sebastian Luther <SebastianLuther@×××.de>
2
3 ---
4 bin/repoman | 12 +++++++++++-
5 1 file changed, 11 insertions(+), 1 deletion(-)
6
7 diff --git a/bin/repoman b/bin/repoman
8 index d1542e9..2a332a7 100755
9 --- a/bin/repoman
10 +++ b/bin/repoman
11 @@ -78,7 +78,7 @@ from portage.output import ConsoleStyleFile, StyleWriter
12 from portage.util import writemsg_level
13 from portage.util._argparse import ArgumentParser
14 from portage.package.ebuild.digestgen import digestgen
15 -from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use
16 +from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use, eapi_has_slot_operator
17
18 if sys.hexversion >= 0x3000000:
19 basestring = str
20 @@ -354,6 +354,7 @@ qahelp = {
21 "portage.internal": "The ebuild uses an internal Portage function or variable",
22 "repo.eapi.banned": "The ebuild uses an EAPI which is banned by the repository's metadata/layout.conf settings",
23 "repo.eapi.deprecated": "The ebuild uses an EAPI which is deprecated by the repository's metadata/layout.conf settings",
24 + "slot.operator.missing": "The ebuild depends on package with several slots and/or sub slots without specifying a slot operator",
25 "virtual.oldstyle": "The ebuild PROVIDEs an old-style virtual (see GLEP 37)",
26 "virtual.suspect": "Ebuild contains a package that usually should be pulled via virtual/, not directly.",
27 "usage.obsolete": "The ebuild makes use of an obsolete construct",
28 @@ -399,6 +400,7 @@ qawarnings = set((
29 "metadata.warning",
30 "portage.internal",
31 "repo.eapi.deprecated",
32 +"slot.operator.missing",
33 "usage.obsolete",
34 "upstream.workaround",
35 "LIVEVCS.stable",
36 @@ -2070,6 +2072,14 @@ for x in effective_scanlist:
37 " with a non-zero revision:" + \
38 " '%s'") % (mytype, atom))
39
40 + if not (atom.blocker or atom.slot or atom.slot_operator) and \
41 + eapi_has_slot_operator(eapi):
42 + child_slots = set((child.slot, child.sub_slot) for child in portdb.xmatch("match-all", atom))
43 + if len(child_slots) > 1:
44 + stats['slot.operator.missing'] += 1
45 + fails['slot.operator.missing'].append(relative_path + \
46 + ": '%s' missing slot or slot operator" % atom)
47 +
48 type_list.extend([mytype] * (len(badsyntax) - len(type_list)))
49
50 for m, b in zip(type_list, badsyntax):
51 --
52 1.8.3.2

Replies