From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/, pym/portage/util/_dyn_libs/
Date: Sat, 7 May 2011 03:03:03 +0000 (UTC) [thread overview]
Message-ID: <f4ef24e29e2968bd581425198220dce7d6a28bc3.zmedico@gentoo> (raw)
commit: f4ef24e29e2968bd581425198220dce7d6a28bc3
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 7 03:02:50 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 7 03:02:50 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f4ef24e2
preserve-libs: fix linkmap logic for new plibs
Together with commit f36b9fa38b5268c2a5579db62acec026625f84a9,
hopefully this solves bug #366061.
---
pym/portage/dbapi/vartree.py | 18 ++++++++++----
pym/portage/util/_dyn_libs/LinkageMapELF.py | 33 ++++++++++++++++++++++-----
2 files changed, 40 insertions(+), 11 deletions(-)
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 4170d3d..d8fe7b5 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -1434,7 +1434,7 @@ class dblink(object):
return pkgfiles
def _prune_plib_registry(self, unmerge=False, others_in_slot=[],
- needed=None):
+ needed=None, preserve_paths=None):
# remove preserved libraries that don't have any consumers left
plib_registry = self.vartree.dbapi._plib_registry
if plib_registry:
@@ -1450,7 +1450,7 @@ class dblink(object):
exclude_pkgs = None
self._linkmap_rebuild(exclude_pkgs=exclude_pkgs,
- include_file=needed)
+ include_file=needed, preserve_paths=preserve_paths)
cpv_lib_map = self._find_unused_preserved_libs()
if cpv_lib_map:
@@ -1476,7 +1476,8 @@ class dblink(object):
plib_registry.unlock()
def unmerge(self, pkgfiles=None, trimworld=None, cleanup=True,
- ldpath_mtimes=None, others_in_slot=None, needed=None):
+ ldpath_mtimes=None, others_in_slot=None, needed=None,
+ preserve_paths=None):
"""
Calls prerm
Unmerges a given package (CPV)
@@ -1496,6 +1497,11 @@ class dblink(object):
@type others_in_slot: list
@param needed: Filename containing libraries needed after unmerge.
@type needed: String
+ @param preserve_paths: Libraries preserved by a package instance that
+ is currently being merged. They need to be explicitly passed to the
+ LinkageMap, since they are not registered in the
+ PreservedLibsRegistry yet.
+ @type preserve_paths: set
@rtype: Integer
@returns:
1. os.EX_OK if everything went well.
@@ -1629,7 +1635,8 @@ class dblink(object):
level=logging.ERROR, noiselevel=-1)
self._prune_plib_registry(unmerge=True,
- others_in_slot=others_in_slot, needed=needed)
+ others_in_slot=others_in_slot, needed=needed,
+ preserve_paths=preserve_paths)
finally:
self.vartree.dbapi._bump_mtime(self.mycpv)
if builddir_lock:
@@ -3321,7 +3328,8 @@ class dblink(object):
dblnk.settings["REPLACED_BY_VERSION"] = portage.versions.cpv_getversion(self.mycpv)
dblnk.settings.backup_changes("REPLACED_BY_VERSION")
unmerge_rval = dblnk.unmerge(ldpath_mtimes=prev_mtimes,
- others_in_slot=others_in_slot, needed=needed)
+ others_in_slot=others_in_slot, needed=needed,
+ preserve_paths=preserve_paths)
dblnk.settings.pop("REPLACED_BY_VERSION", None)
if unmerge_rval == os.EX_OK:
diff --git a/pym/portage/util/_dyn_libs/LinkageMapELF.py b/pym/portage/util/_dyn_libs/LinkageMapELF.py
index bbfce88..9e79bd8 100644
--- a/pym/portage/util/_dyn_libs/LinkageMapELF.py
+++ b/pym/portage/util/_dyn_libs/LinkageMapELF.py
@@ -142,10 +142,26 @@ class LinkageMapELF(object):
def __str__(self):
return str(sorted(self.alt_paths))
- def rebuild(self, exclude_pkgs=None, include_file=None):
+ def rebuild(self, exclude_pkgs=None, include_file=None,
+ preserve_paths=None):
"""
Raises CommandNotFound if there are preserved libs
and the scanelf binary is not available.
+
+ @param exclude_pkgs: A set of packages that should be excluded from
+ the LinkageMap, since they are being unmerged and their NEEDED
+ entries are therefore irrelevant and would only serve to corrupt
+ the LinkageMap.
+ @type exclude_pkgs: set
+ @param include_file: The path of a file containing NEEDED entries for
+ a package which does not exist in the vardbapi yet because it is
+ currently being merged.
+ @type include_file: String
+ @param preserve_paths: Libraries preserved by a package instance that
+ is currently being merged. They need to be explicitly passed to the
+ LinkageMap, since they are not registered in the
+ PreservedLibsRegistry yet.
+ @type preserve_paths: set
"""
os = _os_merge
@@ -178,12 +194,17 @@ class LinkageMapELF(object):
# have to call scanelf for preserved libs here as they aren't
# registered in NEEDED.ELF.2 files
plibs = set()
- if self._dbapi._plib_registry and self._dbapi._plib_registry.getPreservedLibs():
- args = ["/usr/bin/scanelf", "-qF", "%a;%F;%S;%r;%n"]
- for items in self._dbapi._plib_registry.getPreservedLibs().values():
+ if preserve_paths is not None:
+ plibs.update(preserve_paths)
+ if self._dbapi._plib_registry and \
+ self._dbapi._plib_registry.hasEntries():
+ for items in \
+ self._dbapi._plib_registry.getPreservedLibs().values():
plibs.update(items)
- args.extend(os.path.join(root, x.lstrip("." + os.sep)) \
- for x in items)
+ if plibs:
+ args = ["/usr/bin/scanelf", "-qF", "%a;%F;%S;%r;%n"]
+ args.extend(os.path.join(root, x.lstrip("." + os.sep)) \
+ for x in plibs)
try:
proc = subprocess.Popen(args, stdout=subprocess.PIPE)
except EnvironmentError as e:
next reply other threads:[~2011-05-07 3:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-07 3:03 Zac Medico [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-05-15 1:57 [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/, pym/portage/util/_dyn_libs/ Zac Medico
2011-07-18 5:30 Zac Medico
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f4ef24e29e2968bd581425198220dce7d6a28bc3.zmedico@gentoo \
--to=zmedico@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox