treewalk: skip CHOST warning for binary packages
authorZac Medico <zmedico@gentoo.org>
Sun, 2 Jun 2013 22:42:38 +0000 (15:42 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 2 Jun 2013 22:46:27 +0000 (15:46 -0700)
The CHOST of a binary package does not necessarily match the make.conf
setting, especially if ACCEPT_CHOSTS is configured to match other CHOST
values.

pym/portage/dbapi/vartree.py

index c6eaabfc000cd73d01c98d3897277d07d7c7d54b..e1a4753cee554a9f486a46d47c4a7d65a1670eae 100644 (file)
@@ -3555,6 +3555,7 @@ class dblink(object):
                                level=logging.ERROR, noiselevel=-1)
                        return 1
 
+               is_binpkg = self.settings.get("EMERGE_FROM") == "binary"
                slot = ''
                for var_name in ('CHOST', 'SLOT'):
                        if var_name == 'CHOST' and self.cat == 'virtual':
@@ -3588,7 +3589,9 @@ class dblink(object):
                                                return 1
                                        write_atomic(os.path.join(inforoot, var_name), slot + '\n')
 
-                       if val != self.settings.get(var_name, ''):
+                       # This check only applies when built from source, since
+                       # inforoot values are written just after src_install.
+                       if not is_binpkg and val != self.settings.get(var_name, ''):
                                self._eqawarn('preinst',
                                        [_("QA Notice: Expected %(var_name)s='%(expected_value)s', got '%(actual_value)s'\n") % \
                                        {"var_name":var_name, "expected_value":self.settings.get(var_name, ''), "actual_value":val}])