Created
June 30, 2017 18:33
-
-
Save Scimmia22/0fcca58fe0f7c2b5eb906fafc1f32a62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
workdir=$(mktemp -d) | |
bsdtar xf "$1" -C "$workdir" | |
while read file; do | |
liblist="$(objdump -p "$file" 2> /dev/null | grep -E "NEEDED\s+$2")" | |
[[ -n "$liblist" ]] && printf "%s\n%s\n" "${file#$workdir}" "$liblist" && found=1 | |
done < <(find "$workdir" -type f) | |
[[ ! $found ]] && printf "No file in %s is linked to %s\n" "${1##*/}" "$2" | |
rm -rf "$workdir" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment