From a30cc13e70baad6abf41224afadf4a91dd3eb828 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 30 Jun 2011 21:00:52 -0700 Subject: preserve-libs: only preserve soname symlinks This avoids calling the LinkageMapELF.isMasterLink() method, since the only symlinks that are strictly required are the soname symlinks. --- pym/portage/dbapi/vartree.py | 26 +++++++++++++------------- 1 file 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 -- cgit v1.2.3-1-g7c22