diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-08-02 03:01:41 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-08-02 03:01:41 +0000 |
commit | bcd106c2f2505345ed6e07c4a70390a084fa934b (patch) | |
tree | 05d040b410ebeeac2e6228bd16f25a75b6c4469b | |
parent | 659589ec71dc60ef67a07d2db3bb2c1337f8cb44 (diff) | |
download | portage-bcd106c2f2505345ed6e07c4a70390a084fa934b.tar.gz portage-bcd106c2f2505345ed6e07c4a70390a084fa934b.tar.bz2 portage-bcd106c2f2505345ed6e07c4a70390a084fa934b.zip |
Remove duplicate profile.env values from the environment so that they don't override updated profile.env values later (profile.env is reloaded in each call to self.regenerate). See bug #51370.
svn path=/main/trunk/; revision=4083
-rw-r--r-- | pym/portage.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pym/portage.py b/pym/portage.py index 5dae56416..dc4ea15df 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -1019,6 +1019,24 @@ class config: pass del blacklisted, cfg + env_d = getconfig( + os.path.join(config_root, "etc", "profile.env")) + # env_d will be None if profile.env doesn't exist. + if env_d: + self.configdict["env.d"].update(env_d) + # Remove duplicate values so they don't override updated + # profile.env values later (profile.env is reloaded in each + # call to self.regenerate). + for cfg in (self.configdict["backupenv"], + self.configdict["env"]): + for k, v in env_d.iteritems(): + try: + if cfg[k] == v: + del cfg[k] + except KeyError: + pass + del cfg, k, v + self["PORTAGE_CONFIGROOT"] = config_root self.backup_changes("PORTAGE_CONFIGROOT") self["ROOT"] = target_root |