| Index: pym/portage/dbapi/vartree.py
|
| diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
|
| index ccf239ff118209d1577700087563cf23737816c3..965f154901c19294538f86e3ccb075e430331cde 100644
|
| --- a/pym/portage/dbapi/vartree.py
|
| +++ b/pym/portage/dbapi/vartree.py
|
| @@ -58,6 +58,7 @@ from _emerge.PollScheduler import PollScheduler
|
| from _emerge.MiscFunctionsProcess import MiscFunctionsProcess
|
|
|
| import codecs
|
| +import fileinput
|
| import gc
|
| import re, shutil, stat, errno, subprocess
|
| import logging
|
| @@ -1701,10 +1702,11 @@ class dblink(object):
|
| else:
|
| self.settings.pop("PORTAGE_LOG_FILE", None)
|
|
|
| - env_update(target_root=self.settings['ROOT'],
|
| - prev_mtimes=ldpath_mtimes,
|
| - contents=contents, env=self.settings.environ(),
|
| - writemsg_level=self._display_merge)
|
| + if 'no-env-update' not in self.settings.features:
|
| + env_update(target_root=self.settings['ROOT'],
|
| + prev_mtimes=ldpath_mtimes,
|
| + contents=contents, env=self.settings.environ(),
|
| + writemsg_level=self._display_merge)
|
| return os.EX_OK
|
|
|
| def _display_merge(self, msg, level=0, noiselevel=0):
|
| @@ -3377,16 +3379,30 @@ class dblink(object):
|
| showMessage(_("!!! FAILED postinst: ")+str(a)+"\n",
|
| level=logging.ERROR, noiselevel=-1)
|
|
|
| - downgrade = False
|
| - for v in otherversions:
|
| - if pkgcmp(catpkgsplit(self.pkg)[1:], catpkgsplit(v)[1:]) < 0:
|
| - downgrade = True
|
| -
|
| - #update environment settings, library paths. DO NOT change symlinks.
|
| - env_update(makelinks=(not downgrade),
|
| - target_root=self.settings['ROOT'], prev_mtimes=prev_mtimes,
|
| - contents=contents, env=self.settings.environ(),
|
| - writemsg_level=self._display_merge)
|
| + if 'no-env-update' not in self.settings.features:
|
| + downgrade = False
|
| + for v in otherversions:
|
| + if pkgcmp(catpkgsplit(self.pkg)[1:], catpkgsplit(v)[1:]) < 0:
|
| + downgrade = True
|
| +
|
| + #update environment settings, library paths. DO NOT change symlinks.
|
| + env_update(makelinks=(not downgrade),
|
| + target_root=self.settings['ROOT'], prev_mtimes=prev_mtimes,
|
| + contents=contents, env=self.settings.environ(),
|
| + writemsg_level=self._display_merge)
|
| +
|
| + # Fix *.{la,pc} files to point to libs in target_root, if they
|
| + # don't do so already.
|
| + re_root = self.settings["ROOT"].strip("/")
|
| + if re_root:
|
| + fix_files = []
|
| + for path in contents:
|
| + if path.endswith(".la") or path.endswith(".pc"):
|
| + if os.path.exists(path): fix_files.append(path)
|
| + if fix_files:
|
| + pat = re.compile(r"([' =](?:-[IL])?/)(usr|lib|opt)")
|
| + for line in fileinput.input(fix_files, inplace=1):
|
| + sys.stdout.write(pat.sub(r"\1%s/\2" % re_root, line))
|
|
|
| # For gcc upgrades, preserved libs have to be removed after the
|
| # the library path has been updated.
|
|
|