Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-projects commit in pax-utils: lddtree.py
Date: Wed, 27 Mar 2013 03:07:51
Message-Id: 20130327030746.D20212171D@flycatcher.gentoo.org
1 vapier 13/03/27 03:07:46
2
3 Modified: lddtree.py
4 Log:
5 lddtree.py: support globs on the command line
6
7 Revision Changes Path
8 1.29 pax-utils/lddtree.py
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.29&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.29&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?r1=1.28&r2=1.29
13
14 Index: lddtree.py
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v
17 retrieving revision 1.28
18 retrieving revision 1.29
19 diff -u -r1.28 -r1.29
20 --- lddtree.py 26 Mar 2013 05:22:28 -0000 1.28
21 +++ lddtree.py 27 Mar 2013 03:07:46 -0000 1.29
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.28 2013/03/26 05:22:28 vapier Exp $
27 +# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v 1.29 2013/03/27 03:07:46 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.28 2013/03/26 05:22:28 vapier Exp $'.split()
36 + d = '$Id: lddtree.py,v 1.29 2013/03/27 03:07:46 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 @@ -501,6 +501,9 @@
41
42 Display ELF dependencies as a tree
43
44 +<ELFs> can be globs that lddtree will take care of expanding.
45 +Useful when you want to glob a path under the ROOT path.
46 +
47 When using the --root option, all paths are implicitly prefixed by that.
48 e.g. lddtree -R /my/magic/root /bin/bash
49 This will load up the ELF found at /my/magic/root/bin/bash and then resolve
50 @@ -572,16 +575,17 @@
51 for path in paths:
52 if options.auto_root:
53 path = options.root + path.lstrip('/')
54 - try:
55 - elf = ParseELF(path, options.root, ldpaths)
56 - except (exceptions.ELFError, IOError) as e:
57 - ret = 1
58 - warn('%s: %s' % (path, e))
59 - continue
60 - if options.dest is None:
61 - _ActionShow(options, elf)
62 - else:
63 - _ActionCopy(options, elf)
64 + for p in glob.glob(path):
65 + try:
66 + elf = ParseELF(p, options.root, ldpaths)
67 + except (exceptions.ELFError, IOError) as e:
68 + ret = 1
69 + warn('%s: %s' % (p, e))
70 + continue
71 + if options.dest is None:
72 + _ActionShow(options, elf)
73 + else:
74 + _ActionCopy(options, elf)
75 return ret