* [gentoo-portage-dev] [PATCH 1/2] portdbapi.cp_list(): Don't write into xmatch's "match-all" cache @ 2014-01-01 22:14 SebastianLuther 2014-01-01 22:14 ` [gentoo-portage-dev] [PATCH 2/2] repoman: Add check for missing slot operators (bug 493742) SebastianLuther 2014-01-01 22:46 ` [gentoo-portage-dev] [PATCH 1/2] portdbapi.cp_list(): Don't write into xmatch's "match-all" cache SebastianLuther 0 siblings, 2 replies; 8+ messages in thread From: SebastianLuther @ 2014-01-01 22:14 UTC (permalink / raw To: gentoo-portage-dev From: Sebastian Luther <SebastianLuther@gmx.de> xmatch returns _pkg_str instances these days. They require metadata access, which cp_list doesn't have. That means that writing cp_list results into the xmatch cache breaks xmatch users that expect _pkg_str instances with full metadata. --- pym/portage/dbapi/porttree.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index fc3fc03..62ac75c 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -740,12 +740,6 @@ class portdbapi(dbapi): if self.frozen and mytree is None: cachelist = self.xcache["cp-list"].get(mycp) - if cachelist is not None: - # Try to propagate this to the match-all cache here for - # repoman since he uses separate match-all caches for each - # profile (due to differences in _get_implicit_iuse). - self.xcache["match-all"][(mycp, mycp)] = cachelist - return cachelist[:] mysplit = mycp.split("/") invalid_category = mysplit[0] not in self._categories d={} @@ -796,7 +790,6 @@ class portdbapi(dbapi): if self.frozen and mytree is None: cachelist = mylist[:] self.xcache["cp-list"][mycp] = cachelist - self.xcache["match-all"][(mycp, mycp)] = cachelist return mylist def freeze(self): -- 1.8.3.2 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-portage-dev] [PATCH 2/2] repoman: Add check for missing slot operators (bug 493742) 2014-01-01 22:14 [gentoo-portage-dev] [PATCH 1/2] portdbapi.cp_list(): Don't write into xmatch's "match-all" cache SebastianLuther @ 2014-01-01 22:14 ` SebastianLuther 2014-01-01 23:30 ` Brian Dolbec ` (2 more replies) 2014-01-01 22:46 ` [gentoo-portage-dev] [PATCH 1/2] portdbapi.cp_list(): Don't write into xmatch's "match-all" cache SebastianLuther 1 sibling, 3 replies; 8+ messages in thread From: SebastianLuther @ 2014-01-01 22:14 UTC (permalink / raw To: gentoo-portage-dev From: Sebastian Luther <SebastianLuther@gmx.de> --- bin/repoman | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/repoman b/bin/repoman index d1542e9..2a332a7 100755 --- a/bin/repoman +++ b/bin/repoman @@ -78,7 +78,7 @@ from portage.output import ConsoleStyleFile, StyleWriter from portage.util import writemsg_level from portage.util._argparse import ArgumentParser from portage.package.ebuild.digestgen import digestgen -from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use +from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use, eapi_has_slot_operator if sys.hexversion >= 0x3000000: basestring = str @@ -354,6 +354,7 @@ qahelp = { "portage.internal": "The ebuild uses an internal Portage function or variable", "repo.eapi.banned": "The ebuild uses an EAPI which is banned by the repository's metadata/layout.conf settings", "repo.eapi.deprecated": "The ebuild uses an EAPI which is deprecated by the repository's metadata/layout.conf settings", + "slot.operator.missing": "The ebuild depends on package with several slots and/or sub slots without specifying a slot operator", "virtual.oldstyle": "The ebuild PROVIDEs an old-style virtual (see GLEP 37)", "virtual.suspect": "Ebuild contains a package that usually should be pulled via virtual/, not directly.", "usage.obsolete": "The ebuild makes use of an obsolete construct", @@ -399,6 +400,7 @@ qawarnings = set(( "metadata.warning", "portage.internal", "repo.eapi.deprecated", +"slot.operator.missing", "usage.obsolete", "upstream.workaround", "LIVEVCS.stable", @@ -2070,6 +2072,14 @@ for x in effective_scanlist: " with a non-zero revision:" + \ " '%s'") % (mytype, atom)) + if not (atom.blocker or atom.slot or atom.slot_operator) and \ + eapi_has_slot_operator(eapi): + child_slots = set((child.slot, child.sub_slot) for child in portdb.xmatch("match-all", atom)) + if len(child_slots) > 1: + stats['slot.operator.missing'] += 1 + fails['slot.operator.missing'].append(relative_path + \ + ": '%s' missing slot or slot operator" % atom) + type_list.extend([mytype] * (len(badsyntax) - len(type_list))) for m, b in zip(type_list, badsyntax): -- 1.8.3.2 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [gentoo-portage-dev] [PATCH 2/2] repoman: Add check for missing slot operators (bug 493742) 2014-01-01 22:14 ` [gentoo-portage-dev] [PATCH 2/2] repoman: Add check for missing slot operators (bug 493742) SebastianLuther @ 2014-01-01 23:30 ` Brian Dolbec 2014-01-02 8:50 ` [gentoo-portage-dev] " Ryan Hill 2014-01-02 9:24 ` [gentoo-portage-dev] SebastianLuther 2 siblings, 0 replies; 8+ messages in thread From: Brian Dolbec @ 2014-01-01 23:30 UTC (permalink / raw To: gentoo-portage-dev [-- Attachment #1: Type: text/plain, Size: 2495 bytes --] On Wed, 2014-01-01 at 23:14 +0100, SebastianLuther@gmx.de wrote: > From: Sebastian Luther <SebastianLuther@gmx.de> > > --- > bin/repoman | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/bin/repoman b/bin/repoman > index d1542e9..2a332a7 100755 > --- a/bin/repoman > +++ b/bin/repoman > @@ -78,7 +78,7 @@ from portage.output import ConsoleStyleFile, StyleWriter > from portage.util import writemsg_level > from portage.util._argparse import ArgumentParser > from portage.package.ebuild.digestgen import digestgen > -from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use > +from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use, eapi_has_slot_operator > > if sys.hexversion >= 0x3000000: > basestring = str > @@ -354,6 +354,7 @@ qahelp = { > "portage.internal": "The ebuild uses an internal Portage function or variable", > "repo.eapi.banned": "The ebuild uses an EAPI which is banned by the repository's metadata/layout.conf settings", > "repo.eapi.deprecated": "The ebuild uses an EAPI which is deprecated by the repository's metadata/layout.conf settings", > + "slot.operator.missing": "The ebuild depends on package with several slots and/or sub slots without specifying a slot operator", > "virtual.oldstyle": "The ebuild PROVIDEs an old-style virtual (see GLEP 37)", > "virtual.suspect": "Ebuild contains a package that usually should be pulled via virtual/, not directly.", > "usage.obsolete": "The ebuild makes use of an obsolete construct", > @@ -399,6 +400,7 @@ qawarnings = set(( > "metadata.warning", > "portage.internal", > "repo.eapi.deprecated", > +"slot.operator.missing", > "usage.obsolete", > "upstream.workaround", > "LIVEVCS.stable", > @@ -2070,6 +2072,14 @@ for x in effective_scanlist: > " with a non-zero revision:" + \ > " '%s'") % (mytype, atom)) > > + if not (atom.blocker or atom.slot or atom.slot_operator) and \ > + eapi_has_slot_operator(eapi): > + child_slots = set((child.slot, child.sub_slot) for child in portdb.xmatch("match-all", atom)) > + if len(child_slots) > 1: > + stats['slot.operator.missing'] += 1 > + fails['slot.operator.missing'].append(relative_path + \ > + ": '%s' missing slot or slot operator" % atom) > + > type_list.extend([mytype] * (len(badsyntax) - len(type_list))) > > for m, b in zip(type_list, badsyntax): Looks good [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 620 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* [gentoo-portage-dev] Re: [PATCH 2/2] repoman: Add check for missing slot operators (bug 493742) 2014-01-01 22:14 ` [gentoo-portage-dev] [PATCH 2/2] repoman: Add check for missing slot operators (bug 493742) SebastianLuther 2014-01-01 23:30 ` Brian Dolbec @ 2014-01-02 8:50 ` Ryan Hill 2014-01-02 9:24 ` [gentoo-portage-dev] SebastianLuther 2 siblings, 0 replies; 8+ messages in thread From: Ryan Hill @ 2014-01-02 8:50 UTC (permalink / raw To: gentoo-portage-dev [-- Attachment #1: Type: text/plain, Size: 366 bytes --] On Wed, 1 Jan 2014 23:14:11 +0100 SebastianLuther@gmx.de wrote: + "slot.operator.missing": "The ebuild depends on package with several... ^ a -- Ryan Hill psn: dirtyepic_sk gcc-porting/toolchain/wxwidgets @ gentoo.org 47C3 6D62 4864 0E49 8E9E 7F92 ED38 BD49 957A 8463 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 490 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* [gentoo-portage-dev] 2014-01-01 22:14 ` [gentoo-portage-dev] [PATCH 2/2] repoman: Add check for missing slot operators (bug 493742) SebastianLuther 2014-01-01 23:30 ` Brian Dolbec 2014-01-02 8:50 ` [gentoo-portage-dev] " Ryan Hill @ 2014-01-02 9:24 ` SebastianLuther 2014-01-02 9:24 ` [gentoo-portage-dev] [PATCH] repoman: Add check for missing slot operators (bug 493742) SebastianLuther 2 siblings, 1 reply; 8+ messages in thread From: SebastianLuther @ 2014-01-02 9:24 UTC (permalink / raw To: gentoo-portage-dev Changes: * restrict check to runtime dependencies * don't skip the check for atoms with slots, but only for slot+sub-slot * fix typo found by Ryan ^ permalink raw reply [flat|nested] 8+ messages in thread
* [gentoo-portage-dev] [PATCH] repoman: Add check for missing slot operators (bug 493742) 2014-01-02 9:24 ` [gentoo-portage-dev] SebastianLuther @ 2014-01-02 9:24 ` SebastianLuther 0 siblings, 0 replies; 8+ messages in thread From: SebastianLuther @ 2014-01-02 9:24 UTC (permalink / raw To: gentoo-portage-dev From: Sebastian Luther <SebastianLuther@gmx.de> --- bin/repoman | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bin/repoman b/bin/repoman index d1542e9..cb1d620 100755 --- a/bin/repoman +++ b/bin/repoman @@ -78,7 +78,7 @@ from portage.output import ConsoleStyleFile, StyleWriter from portage.util import writemsg_level from portage.util._argparse import ArgumentParser from portage.package.ebuild.digestgen import digestgen -from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use +from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use, eapi_has_slot_operator if sys.hexversion >= 0x3000000: basestring = str @@ -354,6 +354,7 @@ qahelp = { "portage.internal": "The ebuild uses an internal Portage function or variable", "repo.eapi.banned": "The ebuild uses an EAPI which is banned by the repository's metadata/layout.conf settings", "repo.eapi.deprecated": "The ebuild uses an EAPI which is deprecated by the repository's metadata/layout.conf settings", + "slot.operator.missing": "The ebuild depends on a package with several slots and/or sub slots without specifying a slot operator", "virtual.oldstyle": "The ebuild PROVIDEs an old-style virtual (see GLEP 37)", "virtual.suspect": "Ebuild contains a package that usually should be pulled via virtual/, not directly.", "usage.obsolete": "The ebuild makes use of an obsolete construct", @@ -399,6 +400,7 @@ qawarnings = set(( "metadata.warning", "portage.internal", "repo.eapi.deprecated", +"slot.operator.missing", "usage.obsolete", "upstream.workaround", "LIVEVCS.stable", @@ -2070,6 +2072,16 @@ for x in effective_scanlist: " with a non-zero revision:" + \ " '%s'") % (mytype, atom)) + if runtime and not atom.blocker and not atom.slot_operator and \ + eapi_has_slot_operator(eapi) and \ + not (atom.slot and atom.sub_slot): + child_slots = set((child.slot, child.sub_slot) \ + for child in portdb.xmatch("match-all", atom)) + if len(child_slots) > 1: + stats['slot.operator.missing'] += 1 + fails['slot.operator.missing'].append(relative_path + \ + ": '%s' in %s missing slot/sub-slot or slot operator" % (atom, mytype)) + type_list.extend([mytype] * (len(badsyntax) - len(type_list))) for m, b in zip(type_list, badsyntax): -- 1.8.3.2 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-portage-dev] [PATCH 1/2] portdbapi.cp_list(): Don't write into xmatch's "match-all" cache 2014-01-01 22:14 [gentoo-portage-dev] [PATCH 1/2] portdbapi.cp_list(): Don't write into xmatch's "match-all" cache SebastianLuther 2014-01-01 22:14 ` [gentoo-portage-dev] [PATCH 2/2] repoman: Add check for missing slot operators (bug 493742) SebastianLuther @ 2014-01-01 22:46 ` SebastianLuther 2014-01-01 23:29 ` Brian Dolbec 1 sibling, 1 reply; 8+ messages in thread From: SebastianLuther @ 2014-01-01 22:46 UTC (permalink / raw To: gentoo-portage-dev From: Sebastian Luther <SebastianLuther@gmx.de> xmatch returns _pkg_str instances these days. They require metadata access, which cp_list doesn't have. That means that writing cp_list results into the xmatch cache breaks xmatch users that expect _pkg_str instances with full metadata. --- pym/portage/dbapi/porttree.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index fc3fc03..53b9648 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -741,10 +741,6 @@ class portdbapi(dbapi): if self.frozen and mytree is None: cachelist = self.xcache["cp-list"].get(mycp) if cachelist is not None: - # Try to propagate this to the match-all cache here for - # repoman since he uses separate match-all caches for each - # profile (due to differences in _get_implicit_iuse). - self.xcache["match-all"][(mycp, mycp)] = cachelist return cachelist[:] mysplit = mycp.split("/") invalid_category = mysplit[0] not in self._categories @@ -796,7 +792,6 @@ class portdbapi(dbapi): if self.frozen and mytree is None: cachelist = mylist[:] self.xcache["cp-list"][mycp] = cachelist - self.xcache["match-all"][(mycp, mycp)] = cachelist return mylist def freeze(self): -- 1.8.3.2 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [gentoo-portage-dev] [PATCH 1/2] portdbapi.cp_list(): Don't write into xmatch's "match-all" cache 2014-01-01 22:46 ` [gentoo-portage-dev] [PATCH 1/2] portdbapi.cp_list(): Don't write into xmatch's "match-all" cache SebastianLuther @ 2014-01-01 23:29 ` Brian Dolbec 0 siblings, 0 replies; 8+ messages in thread From: Brian Dolbec @ 2014-01-01 23:29 UTC (permalink / raw To: gentoo-portage-dev [-- Attachment #1: Type: text/plain, Size: 1526 bytes --] On Wed, 2014-01-01 at 23:46 +0100, SebastianLuther@gmx.de wrote: > From: Sebastian Luther <SebastianLuther@gmx.de> > > xmatch returns _pkg_str instances these days. They require metadata > access, which cp_list doesn't have. That means that writing cp_list > results into the xmatch cache breaks xmatch users that expect _pkg_str > instances with full metadata. > --- > pym/portage/dbapi/porttree.py | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py > index fc3fc03..53b9648 100644 > --- a/pym/portage/dbapi/porttree.py > +++ b/pym/portage/dbapi/porttree.py > @@ -741,10 +741,6 @@ class portdbapi(dbapi): > if self.frozen and mytree is None: > cachelist = self.xcache["cp-list"].get(mycp) > if cachelist is not None: > - # Try to propagate this to the match-all cache here for > - # repoman since he uses separate match-all caches for each > - # profile (due to differences in _get_implicit_iuse). > - self.xcache["match-all"][(mycp, mycp)] = cachelist > return cachelist[:] > mysplit = mycp.split("/") > invalid_category = mysplit[0] not in self._categories > @@ -796,7 +792,6 @@ class portdbapi(dbapi): > if self.frozen and mytree is None: > cachelist = mylist[:] > self.xcache["cp-list"][mycp] = cachelist > - self.xcache["match-all"][(mycp, mycp)] = cachelist > return mylist > > def freeze(self): Sounds correct to me. Anyone object to committing this? [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 620 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-01-02 9:24 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-01-01 22:14 [gentoo-portage-dev] [PATCH 1/2] portdbapi.cp_list(): Don't write into xmatch's "match-all" cache SebastianLuther 2014-01-01 22:14 ` [gentoo-portage-dev] [PATCH 2/2] repoman: Add check for missing slot operators (bug 493742) SebastianLuther 2014-01-01 23:30 ` Brian Dolbec 2014-01-02 8:50 ` [gentoo-portage-dev] " Ryan Hill 2014-01-02 9:24 ` [gentoo-portage-dev] SebastianLuther 2014-01-02 9:24 ` [gentoo-portage-dev] [PATCH] repoman: Add check for missing slot operators (bug 493742) SebastianLuther 2014-01-01 22:46 ` [gentoo-portage-dev] [PATCH 1/2] portdbapi.cp_list(): Don't write into xmatch's "match-all" cache SebastianLuther 2014-01-01 23:29 ` Brian Dolbec
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox