summaryrefslogtreecommitdiffstats
path: root/pym/portage
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-26 22:43:31 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-26 22:43:31 -0700
commit365e9a71e5dff59be90f4ca16eefb245031c1e7f (patch)
tree334ed847ad84acd72b33e37d03715f9ec66d0770 /pym/portage
parenta6d1ea1a96194687463e320fa6ad39b2e5cff634 (diff)
downloadportage-365e9a71e5dff59be90f4ca16eefb245031c1e7f.tar.gz
portage-365e9a71e5dff59be90f4ca16eefb245031c1e7f.tar.bz2
portage-365e9a71e5dff59be90f4ca16eefb245031c1e7f.zip
Add a IUSE.missing repoman category for packages that have a USE
conditional which references a flag that is not listed in IUSE. Also split out a Package._metadata_exception() method to handle IUSE.missing for *DEPEND and SRC_URI.
Diffstat (limited to 'pym/portage')
-rw-r--r--pym/portage/dep/__init__.py8
-rw-r--r--pym/portage/exception.py3
2 files changed, 8 insertions, 3 deletions
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 499b43fc0..36b655f7c 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -307,9 +307,11 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i
if is_valid_flag:
if not is_valid_flag(flag):
- raise portage.exception.InvalidDependString(
- _("use flag '%s' is not referencable in conditional '%s' (flag missing from IUSE?)") \
- % (flag, conditional))
+ msg = _("USE flag '%s' referenced in " + \
+ "conditional '%s' is not in IUSE") \
+ % (flag, conditional)
+ e = InvalidData(msg, category='IUSE.missing')
+ raise portage.exception.InvalidDependString(msg, errors=(e,))
else:
if _valid_use_re.match(flag) is None:
raise portage.exception.InvalidDependString(
diff --git a/pym/portage/exception.py b/pym/portage/exception.py
index b289b6285..9564af98a 100644
--- a/pym/portage/exception.py
+++ b/pym/portage/exception.py
@@ -52,6 +52,9 @@ class ParseError(PortageException):
class InvalidData(PortageException):
"""An incorrect formatting was passed instead of the expected one"""
+ def __init__(self, value, category=None):
+ PortageException.__init__(self, value)
+ self.category = category
class InvalidDataType(PortageException):
"""An incorrect type was passed instead of the expected one"""