aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2015-12-19 18:03:43 -0800
committerBrian Dolbec <dolsen@gentoo.org>2015-12-19 18:03:43 -0800
commit1fbd7ec8a46c359c5ef98168156a91ba05cf6a6f (patch)
tree1dce906a0b6ff88e424a43bee1119130a0a6cf18
parentrevdep-rebuild: Adjust the intro message for a normal release (diff)
downloadgentoolkit-1fbd7ec8a46c359c5ef98168156a91ba05cf6a6f.tar.gz
gentoolkit-1fbd7ec8a46c359c5ef98168156a91ba05cf6a6f.tar.bz2
gentoolkit-1fbd7ec8a46c359c5ef98168156a91ba05cf6a6f.zip
revdep-rebuild/analyse.py: Account for more than 5 parts to report the error bug 586752
As suggested by Zac Medico, the %F output does have the possibility of containing spaces, breaking a space separated output. Change the format string to delimit on a semicolon to split it on. Traceback: File "/usr/lib64/python3.4/site-packages/gentoolkit/revdep_rebuild/analyse.py", line 47, in scan_files filename, sfilename, soname, needed, bits = parts ValueError: too many values to unpack (expected 5)
-rw-r--r--pym/gentoolkit/revdep_rebuild/analyse.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/revdep_rebuild/analyse.py
index 056e421..92233ab 100644
--- a/pym/gentoolkit/revdep_rebuild/analyse.py
+++ b/pym/gentoolkit/revdep_rebuild/analyse.py
@@ -31,7 +31,7 @@ def scan_files(libs_and_bins, cmd_max_args, logger, searchbits):
'''
stime = current_milli_time()
scanned_files = {} # {bits: {soname: (filename, needed), ...}, ...}
- lines = scan(['-BF', '%F %f %S %n %M'],
+ lines = scan(['-BF', '%F;%f;%S;%n;%M'],
libs_and_bins, cmd_max_args, logger)
ftime = current_milli_time()
logger.debug("\tscan_files(); total time to get scanelf data is "
@@ -39,8 +39,8 @@ def scan_files(libs_and_bins, cmd_max_args, logger, searchbits):
stime = current_milli_time()
count = 0
for line in lines:
- parts = line.split(' ')
- if len(parts) < 5:
+ parts = line.split(';')
+ if len(parts) != 5:
logger.error("\tscan_files(); error processing lib: %s" % line)
logger.error("\tscan_files(); parts = %s" % str(parts))
continue
@@ -205,7 +205,7 @@ class LibCheck(object):
try:
scanned = scanned_files[bits]
except KeyError:
- self.logger.debug('There are no %s-bit libraries'%bits)
+ self.logger.debug('There are no %s-bit libraries'%bits)
continue
self.logger.debug(self.smsg % bits)
self.setlibs(sorted(scanned), bits)