[entropy.tools] read_elf_real_dynamic_libraries: some final fixes

This commit is contained in:
Fabio Erculiani
2010-08-30 23:05:12 +02:00
parent b6ca4ed514
commit 14bcfbf0ce

View File

@@ -2723,7 +2723,6 @@ def read_elf_real_dynamic_libraries(elf_file):
@type elf_file: string
@return: list (set) of strings in NEEDED metadatum
@rtype: set
@raise LibraryNotFound: if ldd cannot run
@raise FileNotFound: if ldd is not found
"""
global ldd_avail_check
@@ -2732,7 +2731,9 @@ def read_elf_real_dynamic_libraries(elf_file):
FileNotFound('FileNotFound: no ldd')
sts, output = getstatusoutput('/usr/bin/ldd "%s"' % (elf_file,))
if sts != 0:
raise LibraryNotFound("cannot properly execute ldd")
# garbage file
# non-dynamic executables cause this
return []
return set((x.split()[0].strip() for x in output.split("\n") if "=>" in x \
and not x.split()[-1].startswith("(")))