summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-06-30 21:00:52 -0700
committerZac Medico <zmedico@gentoo.org>2011-06-30 21:00:52 -0700
commita30cc13e70baad6abf41224afadf4a91dd3eb828 (patch)
tree7fbca19223aae7b8f49cb0ed9447d622d6ddb6d0
parent038f142cffb8437dbb2e8588078e802d441c3860 (diff)
downloadportage-a30cc13e70baad6abf41224afadf4a91dd3eb828.tar.gz
portage-a30cc13e70baad6abf41224afadf4a91dd3eb828.tar.bz2
portage-a30cc13e70baad6abf41224afadf4a91dd3eb828.zip
preserve-libs: only preserve soname symlinksv2.2.0_alpha42
This avoids calling the LinkageMapELF.isMasterLink() method, since the only symlinks that are strictly required are the soname symlinks.
-rw-r--r--pym/portage/dbapi/vartree.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index b3e6f6a62..5a86291f8 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -2461,25 +2461,25 @@ class dblink(object):
preserve_paths = set()
for preserve_node in preserve_nodes:
- # Make sure that at least one of the paths is not a symlink.
- # This prevents symlinks from being erroneously preserved by
- # themselves when the old instance installed symlinks that
- # the new instance does not install.
- have_lib = False
+ # Preserve the library itself, and also preserve the
+ # soname symlink which is the only symlink that is
+ # strictly required.
+ hardlinks = set()
+ soname_symlinks = set()
+ soname = linkmap.getSoname(next(iter(preserve_node.alt_paths)))
for f in preserve_node.alt_paths:
f_abs = os.path.join(root, f.lstrip(os.sep))
try:
if stat.S_ISREG(os.lstat(f_abs).st_mode):
- have_lib = True
- break
+ hardlinks.add(f)
+ elif os.path.basename(f) == soname:
+ soname_symlinks.add(f)
except OSError:
- continue
+ pass
- if have_lib:
- # There's no point in preserving the "master" symlink, since
- # the soname symlink is all that's strictly required.
- preserve_paths.update(f for f in preserve_node.alt_paths
- if not linkmap.isMasterLink(f))
+ if hardlinks:
+ preserve_paths.update(hardlinks)
+ preserve_paths.update(soname_symlinks)
return preserve_paths