Bug #261670 - Automatically revert the CHOST metadata to the initial value v2.2_rc25
authorZac Medico <zmedico@gentoo.org>
Thu, 12 Mar 2009 06:32:32 +0000 (06:32 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 12 Mar 2009 06:32:32 +0000 (06:32 -0000)
after src_install, in case the ebuild has changed it.

svn path=/main/trunk/; revision=13088

pym/_emerge/__init__.py
pym/portage/__init__.py

index 3d7439d20b88bb2b1ee85cc830d7249f9df41563..09c9ce6be2b9e07cf5780f803048a3d5e7a94ed8 100644 (file)
@@ -3189,6 +3189,7 @@ class EbuildPhase(CompositeTask):
                settings = self.settings
 
                if self.phase == "install":
+                       portage._post_src_install_chost_fix(settings)
                        portage._post_src_install_uid_fix(settings)
 
                post_phase_cmds = self._post_phase_cmds.get(self.phase)
index 8c2137f2c96b347e75207a14f100318311836f6c..705c1f3379e9d2ffb9d24d7e7ba66f40282bcea6 100644 (file)
@@ -4724,6 +4724,7 @@ def spawnebuild(mydo, actionmap, mysettings, debug, alwaysdep=0,
        if mydo == "install":
                _check_build_log(mysettings)
                if phase_retval == os.EX_OK:
+                       _post_src_install_chost_fix(mysettings)
                        phase_retval = _post_src_install_checks(mysettings)
 
        if mydo == "test" and phase_retval != os.EX_OK and \
@@ -4874,6 +4875,17 @@ def _check_build_log(mysettings, out=None):
                msg.extend("\t" + line for line in make_jobserver)
                _eqawarn(msg)
 
+def _post_src_install_chost_fix(settings):
+       """
+       It's possible that the ebuild has changed the
+       CHOST variable, so revert it to the initial
+       setting.
+       """
+       chost = settings.get('CHOST')
+       if chost:
+               write_atomic(os.path.join(settings['PORTAGE_BUILDDIR'],
+                       'build-info', 'CHOST'), chost + '\n')
+
 def _post_src_install_uid_fix(mysettings):
        """
        Files in $D with user and group bits that match the "portage"