From fe7fad15b2f678d3b8ededf13b8a8f935c38dbdb Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 7 Nov 2008 21:18:44 +0000 Subject: Improve the error message that's generated in LinkageMap.rebuild() for corrupt NEEDED.ELF.2 entries. svn path=/main/trunk/; revision=11823 --- pym/portage/dbapi/vartree.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'pym') 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] -- cgit v1.2.3-1-g7c22