"LIVEVCS.stable":"This ebuild is a live checkout from a VCS but has stable keywords.",
"LIVEVCS.unmasked":"This ebuild is a live checkout from a VCS but has keywords and is not masked in the global package.mask.",
"IUSE.invalid":"This ebuild has a variable in IUSE that is not in the use.desc or its metadata.xml file",
+ "IUSE.missing":"This ebuild has a USE conditional which references a flag that is not listed in IUSE",
"IUSE.undefined":"This ebuild does not define IUSE (style guideline says to define IUSE even when empty)",
"LICENSE.invalid":"This ebuild is listing a license that doesnt exist in portages license/ dir.",
"KEYWORDS.invalid":"This ebuild contains KEYWORDS that are not listed in profiles/arch.list or for which no valid profile was found",
use_reduce(v, eapi=dep_eapi,
is_valid_flag=dep_valid_flag, token_class=Atom)
except portage.exception.InvalidDependString as e:
- if not self.installed:
- categorized_error = False
- if e.errors:
- for error in e.errors:
- if getattr(error, 'category', None) is None:
- continue
- categorized_error = True
- self._invalid_metadata(error.category,
- "%s: %s" % (k, error))
-
- if not categorized_error:
- self._invalid_metadata(k + ".syntax",
- "%s: %s" % (k, e))
- else:
- # For installed packages, show the path of the file
- # containing the invalid metadata, since the user may
- # want to fix the deps by hand.
- vardb = self.root_config.trees['vartree'].dbapi
- path = vardb.getpath(self.cpv, filename=k)
- self._invalid_metadata(k + ".syntax",
- "%s: %s in '%s'" % (k, e, path))
+ self._metadata_exception(k, e)
k = 'REQUIRED_USE'
v = self.metadata.get(k)
is_valid_flag=self.iuse.is_valid_flag)
except portage.exception.InvalidDependString as e:
if not self.installed:
- self._invalid_metadata(k + ".syntax", "%s: %s" % (k, e))
+ self._metadata_exception(k, e)
def copy(self):
return Package(built=self.built, cpv=self.cpv, depth=self.depth,
return True
+ def _metadata_exception(self, k, e):
+ if not self.installed:
+ categorized_error = False
+ if e.errors:
+ for error in e.errors:
+ if getattr(error, 'category', None) is None:
+ continue
+ categorized_error = True
+ self._invalid_metadata(error.category,
+ "%s: %s" % (k, error))
+
+ if not categorized_error:
+ self._invalid_metadata(k + ".syntax",
+ "%s: %s" % (k, e))
+ else:
+ # For installed packages, show the path of the file
+ # containing the invalid metadata, since the user may
+ # want to fix the deps by hand.
+ vardb = self.root_config.trees['vartree'].dbapi
+ path = vardb.getpath(self.cpv, filename=k)
+ self._invalid_metadata(k + ".syntax",
+ "%s: %s in '%s'" % (k, e, path))
+
def _invalid_metadata(self, msg_type, msg):
if self.invalid is None:
self.invalid = {}
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(