1 |
vapier 12/11/24 16:54:32 |
2 |
|
3 |
Modified: lddtree.py |
4 |
Log: |
5 |
lddtree.py: handle $ORIGIN in the middle of paths as pointed out by David James |
6 |
|
7 |
Revision Changes Path |
8 |
1.13 pax-utils/lddtree.py |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.13&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.13&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?r1=1.12&r2=1.13 |
13 |
|
14 |
Index: lddtree.py |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v |
17 |
retrieving revision 1.12 |
18 |
retrieving revision 1.13 |
19 |
diff -u -r1.12 -r1.13 |
20 |
--- lddtree.py 17 Nov 2012 00:11:39 -0000 1.12 |
21 |
+++ lddtree.py 24 Nov 2012 16:54:32 -0000 1.13 |
22 |
@@ -2,7 +2,7 @@ |
23 |
# Copyright 2012 Gentoo Foundation |
24 |
# Copyright 2012 Mike Frysinger <vapier@g.o> |
25 |
# Distributed under the terms of the GNU General Public License v2 |
26 |
-# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v 1.12 2012/11/17 00:11:39 vapier Exp $ |
27 |
+# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v 1.13 2012/11/24 16:54:32 vapier Exp $ |
28 |
|
29 |
"""Read the ELF dependency tree and show it |
30 |
|
31 |
@@ -64,8 +64,8 @@ |
32 |
if ldpath == '': |
33 |
# The ldso treats "" paths as $PWD. |
34 |
ldpath = os.getcwd() |
35 |
- elif ldpath == '$ORIGIN': |
36 |
- ldpath = os.path.dirname(path) |
37 |
+ else: |
38 |
+ ldpath = ldpath.replace('$ORIGIN', os.path.dirname(path)) |
39 |
ldpath = normpath(root + ldpath) |
40 |
if not ldpath in ldpaths: |
41 |
ldpaths.append(ldpath) |
42 |
@@ -141,7 +141,9 @@ |
43 |
if root != '/': |
44 |
warn('ignoring LD_LIBRARY_PATH due to ROOT usage') |
45 |
else: |
46 |
- ldpaths['env'] = ParseLdPaths(env_ldpath) |
47 |
+ # XXX: If this contains $ORIGIN, we probably have to parse this |
48 |
+ # on a per-ELF basis so it can get turned into the right thing. |
49 |
+ ldpaths['env'] = ParseLdPaths(env_ldpath, path='') |
50 |
|
51 |
# Load up /etc/ld.so.conf. |
52 |
ldpaths['conf'] = ParseLdSoConf(root + 'etc/ld.so.conf', root=root) |
53 |
@@ -309,7 +311,7 @@ |
54 |
|
55 |
|
56 |
def _ShowVersion(_option, _opt, _value, _parser): |
57 |
- id = '$Id: lddtree.py,v 1.12 2012/11/17 00:11:39 vapier Exp $'.split() |
58 |
+ id = '$Id: lddtree.py,v 1.13 2012/11/24 16:54:32 vapier Exp $'.split() |
59 |
print('%s-%s %s %s' % (id[1].split('.')[0], id[2], id[3], id[4])) |
60 |
sys.exit(0) |