diff options
author | 2012-07-23 11:27:32 -0400 | |
---|---|---|
committer | 2012-07-23 11:27:32 -0400 | |
commit | d8d6c562032e0e91b92e5bbcce50b72ee863d8bf (patch) | |
tree | bca8c35632a6138a29b60eccc806c5d1caf65a52 | |
parent | scripts/revdep-pax: use Popen, correct exception handling (diff) | |
download | elfix-d8d6c562032e0e91b92e5bbcce50b72ee863d8bf.tar.gz elfix-d8d6c562032e0e91b92e5bbcce50b72ee863d8bf.tar.bz2 elfix-d8d6c562032e0e91b92e5bbcce50b72ee863d8bf.zip |
scripts/revdep-pax: add sanity for OBJECT, SONAME, LIBRARY
-rwxr-xr-x | scripts/revdep-pax | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/scripts/revdep-pax b/scripts/revdep-pax index ca35ac4..7504877 100755 --- a/scripts/revdep-pax +++ b/scripts/revdep-pax @@ -239,6 +239,9 @@ def migrate_flags(importer, exporter_str_flags, exporter_bin_flags): def run_binary(binary, verbose, mark, allyes): + if not os.path.exists(binary): + print('%s\tNo such OBJECT' % binary) + return ( linkings, mappings ) = get_ldd_linkings(binary) ( binary_str_flags, binary_bin_flags ) = pax.getflags(binary) print('%s (%s)\n' % ( binary, binary_str_flags )) @@ -308,9 +311,18 @@ def run_soname(name, verbose, use_soname, mark, allyes, executable_only): soname = name else: library2soname_mappings = invert_so2library_mappings(so2library_mappings) - soname = library2soname_mappings[name] + try: + soname = library2soname_mappings[name] + except KeyError: + print('%s\tNo such LIBRARY' % name) + return + + try: + linkings = reverse_linkings[soname] + except KeyError: + print('%s\tNo such SONAME' % soname) + return - linkings = reverse_linkings[soname] library = so2library_mappings[soname] ( library_str_flags, library_bin_flags ) = pax.getflags(library) |