1 |
vapier 13/03/27 03:20:52 |
2 |
|
3 |
Modified: lddtree.py |
4 |
Log: |
5 |
lddtree.py: add --copy-non-elfs to simplify copying of lots of files |
6 |
|
7 |
Revision Changes Path |
8 |
1.31 pax-utils/lddtree.py |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.31&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.31&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?r1=1.30&r2=1.31 |
13 |
|
14 |
Index: lddtree.py |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v |
17 |
retrieving revision 1.30 |
18 |
retrieving revision 1.31 |
19 |
diff -u -r1.30 -r1.31 |
20 |
--- lddtree.py 27 Mar 2013 03:20:04 -0000 1.30 |
21 |
+++ lddtree.py 27 Mar 2013 03:20:52 -0000 1.31 |
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.30 2013/03/27 03:20:04 vapier Exp $ |
27 |
+# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v 1.31 2013/03/27 03:20:52 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.30 2013/03/27 03:20:04 vapier Exp $'.split() |
36 |
+ d = '$Id: lddtree.py,v 1.31 2013/03/27 03:20:52 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 |
@@ -541,6 +541,9 @@ |
41 |
parser.add_option('--generate-wrappers', |
42 |
action='store_true', default=False, |
43 |
help=('Wrap executable ELFs with scripts for local ldso')) |
44 |
+ parser.add_option('--copy-non-elfs', |
45 |
+ action='store_true', default=False, |
46 |
+ help=('Copy over plain (non-ELF) files rather than warn+ignore')) |
47 |
parser.add_option('-l', '--list', |
48 |
action='store_true', default=False, |
49 |
help=('Display output in a simple list (easy for copying)')) |
50 |
@@ -582,6 +585,18 @@ |
51 |
try: |
52 |
elf = ParseELF(p, options.root, ldpaths) |
53 |
except (exceptions.ELFError, IOError) as e: |
54 |
+ # XXX: Ugly. Should unify with _Action* somehow. |
55 |
+ if options.dest is not None and options.copy_non_elfs: |
56 |
+ if os.path.exists(p): |
57 |
+ elf = { |
58 |
+ 'interp': None, |
59 |
+ 'libs': [], |
60 |
+ 'runpath': [], |
61 |
+ 'rpath': [], |
62 |
+ 'path': p, |
63 |
+ } |
64 |
+ _ActionCopy(options, elf) |
65 |
+ continue |
66 |
ret = 1 |
67 |
warn('%s: %s' % (p, e)) |
68 |
continue |