commit:     626b15b139203091a8159dd968026b330f8ce4a9
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Jan  7 10:19:04 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Jan  7 10:19:04 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=626b15b1

lib/portage/util/_dyn_libs/LinkageMapMachO: fix getSoname

Make getSoname return what LinkageMapELF would return: the basename
only.  We need this to have the logic in vartree to work on Darwin when
preserving the soname symlinks.  The recent libreadline major update
revealed that the install_name symlink was actually not preserved
causing system-wide breakage.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 lib/portage/util/_dyn_libs/LinkageMapMachO.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lib/portage/util/_dyn_libs/LinkageMapMachO.py 
b/lib/portage/util/_dyn_libs/LinkageMapMachO.py
index 5cfbadb6d..933ce02c1 100644
--- a/lib/portage/util/_dyn_libs/LinkageMapMachO.py
+++ b/lib/portage/util/_dyn_libs/LinkageMapMachO.py
@@ -1,4 +1,4 @@
-# Copyright 1998-2017 Gentoo Foundation
+# Copyright 1998-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import errno
@@ -490,7 +490,7 @@ class LinkageMapMachO(object):
                """
                Determine whether an object is a "master" symlink, which means
                that its basename is the same as the beginning part of the
-               soname and it lacks the soname's version component.
+               install_name and it lacks the install_name's version component.
 
                Examples:
 
@@ -569,12 +569,13 @@ class LinkageMapMachO(object):
 
        def getSoname(self, obj):
                """
-               Return the soname associated with an object.
+               Return the install_name associated with an object.  To match
+               soname behaviour, the leading path is stripped.
 
                @param obj: absolute path to an object
                @type obj: string (example: '/usr/bin/bar')
                @rtype: string
-               @return: soname as a string
+               @return: install_name basename as a string
 
                """
                if not self._libs:
@@ -583,10 +584,11 @@ class LinkageMapMachO(object):
                        obj_key = obj
                        if obj_key not in self._obj_properties:
                                raise KeyError("%s not in object list" % 
obj_key)
-                       return self._obj_properties[obj_key].install_name
+                       return 
os.path.basename(self._obj_properties[obj_key].install_name)
                if obj not in self._obj_key_cache:
                        raise KeyError("%s not in object list" % obj)
-               return 
self._obj_properties[self._obj_key_cache[obj]].install_name
+               return os.path.basename(
+                               
self._obj_properties[self._obj_key_cache[obj]].install_name)
 
        def findProviders(self, obj):
                """

Reply via email to