summaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2007-04-30 03:16:06 +0000
committerMarius Mauch <genone@gentoo.org>2007-04-30 03:16:06 +0000
commitab258378535e2886250d94a6bf2aaad057906ec3 (patch)
tree5b0a18f3d710565a061780e457bc29d4bc785fb4 /pym
parent- add new echo module for people who don't want any real logging (diff)
downloadportage-multirepo-ab258378535e2886250d94a6bf2aaad057906ec3.tar.gz
portage-multirepo-ab258378535e2886250d94a6bf2aaad057906ec3.tar.bz2
portage-multirepo-ab258378535e2886250d94a6bf2aaad057906ec3.zip
Fix -* handling in gvisible to match incremental semantics
svn path=/main/trunk/; revision=6459
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/__init__.py10
-rw-r--r--pym/portage/dbapi/porttree.py14
2 files changed, 14 insertions, 10 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 04294ce1..5e6e2752 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -4693,12 +4693,14 @@ def getmaskingstatus(mycpv, settings=None, portdb=None):
if matches:
inc_pgroups = []
for x in pgroups:
- if x != "-*" and x.startswith("-"):
+ if x == "-*":
+ inc_pgroups = []
+ elif x[0] == "-":
try:
inc_pgroups.remove(x[1:])
except ValueError:
pass
- if x not in inc_pgroups:
+ elif x not in inc_pgroups:
inc_pgroups.append(x)
pgroups = inc_pgroups
del inc_pgroups
@@ -4715,10 +4717,10 @@ def getmaskingstatus(mycpv, settings=None, portdb=None):
if gp=="*":
kmask=None
break
- elif gp=="-"+myarch:
+ elif gp=="-"+myarch and myarch in pgroups:
kmask="-"+myarch
break
- elif gp=="~"+myarch:
+ elif gp=="~"+myarch and myarch in pgroups:
kmask="~"+myarch
break
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index ad6ccc45..16e962a8 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -668,24 +668,26 @@ class portdbapi(dbapi):
for atom in matches:
pgroups.extend(pkgdict[cp][atom])
if matches:
+ # normalize pgroups with incrementals logic so it
+ # matches ACCEPT_KEYWORDS behavior
inc_pgroups = []
for x in pgroups:
- # The -* special case should be removed once the tree
- # is clean of KEYWORDS=-* crap
- if x != "-*" and x.startswith("-"):
+ if x == "-*":
+ inc_pgroups = []
+ elif x[0] == "-":
try:
inc_pgroups.remove(x[1:])
except ValueError:
pass
- if x not in inc_pgroups:
+ elif x not in inc_pgroups:
inc_pgroups.append(x)
pgroups = inc_pgroups
del inc_pgroups
hasstable = False
hastesting = False
for gp in mygroups:
- if gp=="*":
- writemsg("--- WARNING: Package '%s' uses '*' keyword.\n" % mycpv,
+ if gp == "*" or (gp == "-*" and len(mygroups) == 1):
+ writemsg("--- WARNING: Package '%s' uses '%s' keyword.\n" % (mycpv, gp),
noiselevel=-1)
match=1
break