summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-12 18:45:35 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-12 18:45:35 +0000
commita3f5e79b5e4a78358be1c1cce16ef7c579464f5a (patch)
tree6984a890e5b7e28eae48fdaf97537ca5998ea057
parentDisable EAPI 3_pre1. (diff)
downloadportage-multirepo-a3f5e79b5e4a78358be1c1cce16ef7c579464f5a.tar.gz
portage-multirepo-a3f5e79b5e4a78358be1c1cce16ef7c579464f5a.tar.bz2
portage-multirepo-a3f5e79b5e4a78358be1c1cce16ef7c579464f5a.zip
Bug #261670 - Automatically revert the CHOST metadata to the initial value
after src_install, in case the ebuild has changed it. (trunk r13088) svn path=/main/branches/2.1.6/; revision=13092
-rw-r--r--pym/_emerge/__init__.py1
-rw-r--r--pym/portage/__init__.py12
2 files changed, 13 insertions, 0 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 6b0f54e4..50d6b7cd 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -3170,6 +3170,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)
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index a657a19b..cc87dcf4 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -4714,6 +4714,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 \
@@ -4864,6 +4865,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"