Created
November 14, 2014 06:00
-
-
Save prurigro/69919a291debf9cb45c5 to your computer and use it in GitHub Desktop.
(Arch Linux) Small demo to play with ideas surrounding how linked library updates might be traced back to packages needing to be rebuilt
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
#!/usr/bin/env bash | |
function recursive_ldd() { | |
for file in "$(find . -type f -exec file '{}' \; | grep 'dynamically linked')"; do sed 's|:.*||' <<< "$file"; done | |
} | |
function find_libs() { | |
ldd $(recursive_ldd) \ | |
| sed '/^[^ ]*:$/d;s|^ *||' \ | |
| grep -o -e '/[^ ]*' \ | |
| sort -u | |
} | |
function find_pkgs() { | |
for library in $(find_libs); do | |
pacman -Qo "$library" \ | |
| sed 's|^.*owned by ||;s| .*$||' | |
done | sort -u | |
} | |
find_pkgs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment