1 |
commit: 1fbd7ec8a46c359c5ef98168156a91ba05cf6a6f |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Dec 20 02:03:43 2015 +0000 |
4 |
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Dec 20 02:03:43 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=1fbd7ec8 |
7 |
|
8 |
revdep-rebuild/analyse.py: Account for more than 5 parts to report the error bug 586752 |
9 |
|
10 |
As suggested by Zac Medico, the %F output does have the possibility of containing spaces, breaking a space separated output. |
11 |
Change the format string to delimit on a semicolon to split it on. |
12 |
|
13 |
Traceback: |
14 |
File "/usr/lib64/python3.4/site-packages/gentoolkit/revdep_rebuild/analyse.py", line 47, in scan_files |
15 |
filename, sfilename, soname, needed, bits = parts |
16 |
ValueError: too many values to unpack (expected 5) |
17 |
|
18 |
pym/gentoolkit/revdep_rebuild/analyse.py | 8 ++++---- |
19 |
1 file changed, 4 insertions(+), 4 deletions(-) |
20 |
|
21 |
diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/revdep_rebuild/analyse.py |
22 |
index 056e421..92233ab 100644 |
23 |
--- a/pym/gentoolkit/revdep_rebuild/analyse.py |
24 |
+++ b/pym/gentoolkit/revdep_rebuild/analyse.py |
25 |
@@ -31,7 +31,7 @@ def scan_files(libs_and_bins, cmd_max_args, logger, searchbits): |
26 |
''' |
27 |
stime = current_milli_time() |
28 |
scanned_files = {} # {bits: {soname: (filename, needed), ...}, ...} |
29 |
- lines = scan(['-BF', '%F %f %S %n %M'], |
30 |
+ lines = scan(['-BF', '%F;%f;%S;%n;%M'], |
31 |
libs_and_bins, cmd_max_args, logger) |
32 |
ftime = current_milli_time() |
33 |
logger.debug("\tscan_files(); total time to get scanelf data is " |
34 |
@@ -39,8 +39,8 @@ def scan_files(libs_and_bins, cmd_max_args, logger, searchbits): |
35 |
stime = current_milli_time() |
36 |
count = 0 |
37 |
for line in lines: |
38 |
- parts = line.split(' ') |
39 |
- if len(parts) < 5: |
40 |
+ parts = line.split(';') |
41 |
+ if len(parts) != 5: |
42 |
logger.error("\tscan_files(); error processing lib: %s" % line) |
43 |
logger.error("\tscan_files(); parts = %s" % str(parts)) |
44 |
continue |
45 |
@@ -205,7 +205,7 @@ class LibCheck(object): |
46 |
try: |
47 |
scanned = scanned_files[bits] |
48 |
except KeyError: |
49 |
- self.logger.debug('There are no %s-bit libraries'%bits) |
50 |
+ self.logger.debug('There are no %s-bit libraries'%bits) |
51 |
continue |
52 |
self.logger.debug(self.smsg % bits) |
53 |
self.setlibs(sorted(scanned), bits) |