self.cpv_split = portage.catpkgsplit(self.cpv)
self.pv_split = self.cpv_split[1:]
- def _invalid_metadata(self, msg):
+ def _invalid_metadata(self, msg_type, msg):
if self.invalid is None:
- self.invalid = []
- self.invalid.append(msg)
+ self.invalid = {}
+ msgs = self.invalid.get(msg_type)
+ if msgs is None:
+ msgs = []
+ self.invalid[msg_type] = msgs
+ msgs.append(msg)
class _use_class(object):
try:
use_reduce(paren_reduce(v), matchall=1)
except portage.exception.InvalidDependString, e:
- self._pkg._invalid_metadata("%s: %s" % (k, e))
+ self._pkg._invalid_metadata(k + ".syntax", "%s: %s" % (k, e))
def _set_inherited(self, k, v):
if isinstance(v, basestring):
mreasons.append("CHOST: %s" % \
pkg.metadata["CHOST"])
if pkg.invalid:
- for msg in pkg.invalid:
- mreasons.append("invalid: %s" % (msg,))
+ for msg_type, msgs in pkg.invalid.iteritems():
+ for msg in msgs:
+ mreasons.append("invalid: %s" % (msg,))
if not pkg.metadata["SLOT"]:
mreasons.append("invalid: SLOT is undefined")