Make the CHOST visibility check tolerant of missing CHOST metadata.
authorZac Medico <zmedico@gentoo.org>
Thu, 10 Apr 2008 20:46:56 +0000 (20:46 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 10 Apr 2008 20:46:56 +0000 (20:46 -0000)
(trunk r9817)

svn path=/main/branches/2.1.2/; revision=9818

bin/emerge

index 26061908c8045e601ffc44f8ed4896baf6fa560c..1e445aed7e0afbd7e213a099d40d010e1a3d47cc 100755 (executable)
@@ -1257,9 +1257,10 @@ def visible(pkgsettings, pkg):
        """
        if not pkg.metadata["SLOT"]:
                return False
-       if pkg.built and not pkg.installed and \
-               pkg.metadata["CHOST"] != pkgsettings["CHOST"]:
-               return False
+       if pkg.built and not pkg.installed:
+               pkg_chost = pkg.metadata.get("CHOST")
+               if pkg_chost and pkg_chost != pkgsettings["CHOST"]:
+                       return False
        if not portage.eapi_is_supported(pkg.metadata["EAPI"]):
                return False
        if not pkg.installed and \
@@ -1277,10 +1278,11 @@ def get_masking_status(pkg, pkgsettings, root_config):
                pkg, settings=pkgsettings,
                portdb=root_config.trees["porttree"].dbapi)
 
-       if pkg.built and not pkg.installed and \
-               pkg.metadata["CHOST"] != root_config.settings["CHOST"]:
-               mreasons.append("CHOST: %s" % \
-                       pkg.metadata["CHOST"])
+       if pkg.built and not pkg.installed:
+               pkg_chost = pkg.metadata.get("CHOST")
+               if pkg_chost and pkg_chost != pkgsettings["CHOST"]:
+                       mreasons.append("CHOST: %s" % \
+                               pkg.metadata["CHOST"])
 
        if not pkg.metadata["SLOT"]:
                mreasons.append("invalid: SLOT is undefined")