summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-11-07 21:18:44 +0000
committerZac Medico <zmedico@gentoo.org>2008-11-07 21:18:44 +0000
commitfe7fad15b2f678d3b8ededf13b8a8f935c38dbdb (patch)
treec7af1735319f0b8285b0a390cbd522e16a88bd88 /pym
parentd3e2e2c5ad25aa67edfc976c50a4d4b279eaa332 (diff)
downloadportage-fe7fad15b2f678d3b8ededf13b8a8f935c38dbdb.tar.gz
portage-fe7fad15b2f678d3b8ededf13b8a8f935c38dbdb.tar.bz2
portage-fe7fad15b2f678d3b8ededf13b8a8f935c38dbdb.zip
Improve the error message that's generated in LinkageMap.rebuild() for corrupt
NEEDED.ELF.2 entries. svn path=/main/trunk/; revision=11823
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/vartree.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 1b5a5b44b..f306420ef 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -145,6 +145,7 @@ class LinkageMap(object):
"""Models dynamic linker dependencies."""
+ _needed_aux_key = "NEEDED.ELF.2"
_soname_map_class = slot_dict_class(
("consumers", "providers"), prefix="")
@@ -262,10 +263,11 @@ class LinkageMap(object):
if include_file is not None:
lines += grabfile(include_file)
+ aux_keys = [self._needed_aux_key]
for cpv in self._dbapi.cpv_all():
if exclude_pkgs is not None and cpv in exclude_pkgs:
continue
- lines += self._dbapi.aux_get(cpv, ["NEEDED.ELF.2"])[0].split('\n')
+ lines += self._dbapi.aux_get(cpv, aux_keys)[0].split('\n')
# Cache NEEDED.* files avoid doing excessive IO for every rebuild.
self._dbapi.flush_cache()
@@ -292,12 +294,14 @@ class LinkageMap(object):
proc.wait()
for l in lines:
- if l.strip() == "":
+ l = l.rstrip("\n")
+ if not l:
continue
- fields = l.strip("\n").split(";")
+ fields = l.split(";")
if len(fields) < 5:
- print "Error", fields
- # insufficient field length
+ writemsg_level("\nWrong number of fields " + \
+ "in %s: %s\n\n" % (self._needed_aux_key, l),
+ level=logging.ERROR, noiselevel=-1)
continue
arch = fields[0]
obj = fields[1]