summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-10-02 17:19:24 -0700
committerZac Medico <zmedico@gentoo.org>2010-10-06 15:47:14 -0700
commit8e89fe946091ef53b4a24d30ee071960ff3c05a5 (patch)
treec0f4a7bab19fc7d7c1d814b664cb4d9f425b6a08 /pym
parent7bc3eef7cd21fa3ea49e699e58b6040b60e9691e (diff)
downloadportage-8e89fe946091ef53b4a24d30ee071960ff3c05a5.tar.gz
portage-8e89fe946091ef53b4a24d30ee071960ff3c05a5.tar.bz2
portage-8e89fe946091ef53b4a24d30ee071960ff3c05a5.zip
Fix repo atom breakage in getmaskingreason().
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dep/__init__.py6
-rw-r--r--pym/portage/package/ebuild/getmaskingreason.py11
2 files changed, 15 insertions, 2 deletions
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 0867263cf..db66f02a2 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -1112,6 +1112,12 @@ class Atom(_atom_base):
_("Strong blocks are not allowed in EAPI %s: '%s'") \
% (eapi, self), category='EAPI.incompatible')
+ @property
+ def without_repo(self):
+ if self.repo is None:
+ return self
+ return Atom(self.replace(_repo_separator + self.repo, '', 1))
+
def __setattr__(self, name, value):
raise AttributeError("Atom instances are immutable",
self.__class__, name, value)
diff --git a/pym/portage/package/ebuild/getmaskingreason.py b/pym/portage/package/ebuild/getmaskingreason.py
index 3511c0dcb..83757b798 100644
--- a/pym/portage/package/ebuild/getmaskingreason.py
+++ b/pym/portage/package/ebuild/getmaskingreason.py
@@ -6,7 +6,8 @@ __all__ = ['getmaskingreason']
import portage
from portage import os
from portage.const import USER_CONFIG_PATH
-from portage.dep import match_from_list
+from portage.dep import Atom, match_from_list, _slot_separator, _repo_separator
+from portage.exception import InvalidAtom
from portage.localization import _
from portage.util import grablines, normalize_path
from portage.versions import catpkgsplit
@@ -49,19 +50,25 @@ def getmaskingreason(mycpv, metadata=None, settings=None, portdb=None, return_lo
if mycp in pmaskdict:
for x in pmaskdict[mycp]:
if match_from_list(x, cpv_slot_list):
+ x = x.without_repo
for pmask in pmasklists:
comment = ""
comment_valid = -1
pmask_filename = os.path.join(pmask[0], "package.mask")
for i in range(len(pmask[1])):
l = pmask[1][i].strip()
+ try:
+ l_atom = Atom(l, allow_repo=True,
+ allow_wildcard=True).without_repo
+ except InvalidAtom:
+ l_atom = None
if l == "":
comment = ""
comment_valid = -1
elif l[0] == "#":
comment += (l+"\n")
comment_valid = i + 1
- elif l == x:
+ elif l_atom == x:
if comment_valid != i:
comment = ""
if return_location: