Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: pym/portage/dbapi/vartree.py

Issue 6370011: Update Portage to support fixing *.la and *.pc files. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/portage_tool.git@cros-2.1.9
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pym/portage/const.py ('k') | pym/portage/package/ebuild/doebuild.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « pym/portage/const.py ('k') | pym/portage/package/ebuild/doebuild.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698