diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-06-28 19:03:33 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-06-28 19:03:33 +0000 |
commit | 6848505d7e7cb330d85ea2d16b0041ef68125677 (patch) | |
tree | 78f3e5ae9c95fd6e8f536c696fa877687be9e6b3 | |
parent | 5f9a324fe4cf7e10fe2981ec9ad92ca0836de387 (diff) | |
download | portage-6848505d7e7cb330d85ea2d16b0041ef68125677.tar.gz portage-6848505d7e7cb330d85ea2d16b0041ef68125677.tar.bz2 portage-6848505d7e7cb330d85ea2d16b0041ef68125677.zip |
Make Package.invalid suitable for use by repoman.
svn path=/main/trunk/; revision=13726
-rw-r--r-- | pym/_emerge/Package.py | 12 | ||||
-rw-r--r-- | 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") |