1 |
commit: a472460f7d93b83bbc8b8c08d48f0a57ab7924d3 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jun 30 10:01:06 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jun 30 10:01:06 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a472460f |
7 |
|
8 |
LinkageMapELF.isMasterLink(): literally compare |
9 |
|
10 |
Comparing the lengths of the names alone seems like too much of an |
11 |
assumption, so literally compare the beginning of the soname to the |
12 |
basename of the given file. |
13 |
|
14 |
--- |
15 |
pym/portage/util/_dyn_libs/LinkageMapELF.py | 8 +++++--- |
16 |
1 files changed, 5 insertions(+), 3 deletions(-) |
17 |
|
18 |
diff --git a/pym/portage/util/_dyn_libs/LinkageMapELF.py b/pym/portage/util/_dyn_libs/LinkageMapELF.py |
19 |
index 4b23421..d4c490c 100644 |
20 |
--- a/pym/portage/util/_dyn_libs/LinkageMapELF.py |
21 |
+++ b/pym/portage/util/_dyn_libs/LinkageMapELF.py |
22 |
@@ -481,7 +481,9 @@ class LinkageMapELF(object): |
23 |
|
24 |
def isMasterLink(self, obj): |
25 |
""" |
26 |
- Determine whether an object is a master link. |
27 |
+ Determine whether an object is a "master" symlink, which means |
28 |
+ that its basename is that same as the beginning part of the |
29 |
+ soname and it lacks the soname's version component. |
30 |
|
31 |
@param obj: absolute path to an object |
32 |
@type obj: string (example: '/usr/bin/foo') |
33 |
@@ -492,12 +494,12 @@ class LinkageMapELF(object): |
34 |
|
35 |
""" |
36 |
os = _os_merge |
37 |
- basename = os.path.basename(obj) |
38 |
obj_key = self._obj_key(obj) |
39 |
if obj_key not in self._obj_properties: |
40 |
raise KeyError("%s (%s) not in object list" % (obj_key, obj)) |
41 |
+ basename = os.path.basename(obj) |
42 |
soname = self._obj_properties[obj_key][3] |
43 |
- return (len(basename) < len(soname)) |
44 |
+ return len(basename) < len(soname) and soname.startswith(basename) |
45 |
|
46 |
def listLibraryObjects(self): |
47 |
""" |