1 |
vapier 13/03/27 03:20:04 |
2 |
|
3 |
Modified: lddtree.py |
4 |
Log: |
5 |
lddtree.py: use glob.iglob, and warn when no paths were matched |
6 |
|
7 |
Revision Changes Path |
8 |
1.30 pax-utils/lddtree.py |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.30&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?rev=1.30&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/pax-utils/lddtree.py?r1=1.29&r2=1.30 |
13 |
|
14 |
Index: lddtree.py |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v |
17 |
retrieving revision 1.29 |
18 |
retrieving revision 1.30 |
19 |
diff -u -r1.29 -r1.30 |
20 |
--- lddtree.py 27 Mar 2013 03:07:46 -0000 1.29 |
21 |
+++ lddtree.py 27 Mar 2013 03:20:04 -0000 1.30 |
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.29 2013/03/27 03:07:46 vapier Exp $ |
27 |
+# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.py,v 1.30 2013/03/27 03:20:04 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.29 2013/03/27 03:07:46 vapier Exp $'.split() |
36 |
+ d = '$Id: lddtree.py,v 1.30 2013/03/27 03:20:04 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 |
@@ -575,17 +575,26 @@ |
41 |
for path in paths: |
42 |
if options.auto_root: |
43 |
path = options.root + path.lstrip('/') |
44 |
- for p in glob.glob(path): |
45 |
+ |
46 |
+ matched = False |
47 |
+ for p in glob.iglob(path): |
48 |
+ matched = True |
49 |
try: |
50 |
elf = ParseELF(p, options.root, ldpaths) |
51 |
except (exceptions.ELFError, IOError) as e: |
52 |
ret = 1 |
53 |
warn('%s: %s' % (p, e)) |
54 |
continue |
55 |
+ |
56 |
if options.dest is None: |
57 |
_ActionShow(options, elf) |
58 |
else: |
59 |
_ActionCopy(options, elf) |
60 |
+ |
61 |
+ if not matched: |
62 |
+ ret = 1 |
63 |
+ warn('%s: did not match any paths' % (path,)) |
64 |
+ |
65 |
return ret |