1 |
vapier 13/03/28 00:58:20 |
2 |
|
3 |
Modified: lddtree.py |
4 |
Log: |
5 |
lddtree.py: add documentation/checks on --bindir/--libdir flags |
6 |
|
7 |
Revision Changes Path |
8 |
1.33 pax-utils/lddtree.py |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.33&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.33&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?r1=1.32&r2=1.33 |
13 |
|
14 |
Index: lddtree.py |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v |
17 |
retrieving revision 1.32 |
18 |
retrieving revision 1.33 |
19 |
diff -u -r1.32 -r1.33 |
20 |
--- lddtree.py 27 Mar 2013 03:22:00 -0000 1.32 |
21 |
+++ lddtree.py 28 Mar 2013 00:58:20 -0000 1.33 |
22 |
@@ -3,7 +3,7 @@ |
23 |
# Copyright 2012 Mike Frysinger <vapier@g.o> |
24 |
# Use of this source code is governed by a BSD-style license (BSD-3) |
25 |
# pylint: disable=C0301 |
26 |
-# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v 1.32 2013/03/27 03:22:00 vapier Exp $ |
27 |
+# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v 1.33 2013/03/28 00:58:20 vapier Exp $ |
28 |
|
29 |
# TODO: Handle symlinks. |
30 |
|
31 |
@@ -369,7 +369,7 @@ |
32 |
|
33 |
|
34 |
def _ShowVersion(_option, _opt, _value, _parser): |
35 |
- d = '$Id: lddtree.py,v 1.32 2013/03/27 03:22:00 vapier Exp $'.split() |
36 |
+ d = '$Id: lddtree.py,v 1.33 2013/03/28 00:58:20 vapier Exp $'.split() |
37 |
print('%s-%s %s %s' % (d[1].split('.')[0], d[2], d[3], d[4])) |
38 |
sys.exit(0) |
39 |
|
40 |
@@ -515,7 +515,20 @@ |
41 |
e.g. lddtree -R /my/magic/root --copy-to-tree /foo /bin/bash |
42 |
You will see /foo/bin/bash and /foo/lib/libc.so.6 and not paths like |
43 |
/foo/my/magic/root/bin/bash. If you want that, you'll have to manually |
44 |
-add the ROOT path to the output path.""") |
45 |
+add the ROOT path to the output path. |
46 |
+ |
47 |
+The --bindir and --libdir flags are used to normalize the output subdirs |
48 |
+when used with --copy-to-tree. |
49 |
+ e.g. lddtree --copy-to-tree /foo /bin/bash /usr/sbin/lspci /usr/bin/lsof |
50 |
+This will mirror the input paths in the output. So you will end up with |
51 |
+/foo/bin/bash and /foo/usr/sbin/lspci and /foo/usr/bin/lsof. Similarly, |
52 |
+the libraries needed will be scattered among /foo/lib/ and /foo/usr/lib/ |
53 |
+and perhaps other paths (like /foo/lib64/ and /usr/lib/gcc/...). You can |
54 |
+collapse all that down into nice directory structure. |
55 |
+ e.g. lddtree --copy-to-tree /foo /bin/bash /usr/sbin/lspci /usr/bin/lsof \\ |
56 |
+ --bindir /bin --libdir /lib |
57 |
+This will place bash, lspci, and lsof into /foo/bin/. All the libraries |
58 |
+they need will be placed into /foo/lib/ only.""") |
59 |
parser.add_option('-a', '--all', |
60 |
action='store_true', default=False, |
61 |
help=('Show all duplicated dependencies')) |
62 |
@@ -543,7 +556,7 @@ |
63 |
help=('Wrap executable ELFs with scripts for local ldso')) |
64 |
parser.add_option('--copy-non-elfs', |
65 |
action='store_true', default=False, |
66 |
- help=('Copy over plain (non-ELF) files rather than warn+ignore')) |
67 |
+ help=('Copy over plain (non-ELF) files instead of warn+ignore')) |
68 |
parser.add_option('-l', '--list', |
69 |
action='store_true', default=False, |
70 |
help=('Display output in a simple list (easy for copying)')) |
71 |
@@ -561,6 +574,11 @@ |
72 |
if options.root != '/': |
73 |
options.root += '/' |
74 |
|
75 |
+ if options.bindir and options.bindir[0] != '/': |
76 |
+ parser.error('--bindir accepts absolute paths only') |
77 |
+ if options.libdir and options.libdir[0] != '/': |
78 |
+ parser.error('--libdir accepts absolute paths only') |
79 |
+ |
80 |
if options.debug: |
81 |
print('root =', options.root) |
82 |
if options.dest: |