Created
January 9, 2016 20:25
-
-
Save critiqjo/c151755f1ef0d3a26ce5 to your computer and use it in GitHub Desktop.
Pacman recursive dependency list
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 | |
total=( $1 ) | |
len0=0 | |
len1=${#total[*]} | |
while [ $len0 -ne $len1 ]; do | |
len0=$len1 | |
t1=( "${total[@]}" ) | |
t2=( `pacman -Qi "${t1[@]}" 2>/dev/null | \ | |
sed -n 's/Depends On.*: \(.*\)$/\1/p'` ) | |
t3=( "${t1[@]}" "${t2[@]}" ) | |
total=( $(echo "$(printf "\n%s" "${t3[@]}")" | \ | |
sed -e '/^None$/d' -e 's/^\([^><=]\+\).*/\1/' | \ | |
sort | uniq) ) | |
len1=${#total[*]} | |
done | |
pacman -Q "${total[@]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment