Created
January 18, 2019 22:33
-
-
Save CoRfr/79596dbbc65b588df94f7a51810c070c to your computer and use it in GitHub Desktop.
Find all lib dependencies of a sub-dir that are not contained in that dir
This file contains hidden or 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 | |
| dir=$1 | |
| for file in $(find "$dir" -name "lib*.so" -or -wholename "*/bin/*"); do | |
| objdump -x $file 2>/dev/null | grep NEEDED | |
| done | sort -u | awk '{print $2}' > /tmp/all-libs | |
| while read -r -u 10 lib; do | |
| ( find "$dir" -name "$lib" -print0 | grep -qz . ) || echo "$lib" | |
| done 10</tmp/all-libs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment