From 6848505d7e7cb330d85ea2d16b0041ef68125677 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 28 Jun 2009 19:03:33 +0000 Subject: [PATCH] Make Package.invalid suitable for use by repoman. svn path=/main/trunk/; revision=13726 --- pym/_emerge/Package.py | 12 ++++++++---- pym/_emerge/depgraph.py | 5 +++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index 938c17733..512703b83 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -52,10 +52,14 @@ class Package(Task): 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): @@ -217,7 +221,7 @@ class _PackageMetadataWrapper(_PackageMetadataWrapperBase): 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): diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 371c0b1ea..bb0f4da3b 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -4898,8 +4898,9 @@ def get_masking_status(pkg, pkgsettings, root_config): 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") -- 2.26.2