vscripts/pmah.zsh

20 lines
581 B
Bash
Raw Normal View History

2015-07-30 20:13:09 +03:00
#!/usr/bin/env zsh
# poor man's aur helper
uri='https://aur4.archlinux.org'
2015-07-30 20:13:09 +03:00
for i in jq curl; do
whence $i &>/dev/null || { printf "missing %s!\n" $i >&2; exit 1 }
done
updates=()
2015-07-30 20:13:09 +03:00
pacman -Qm | while read package version; do
eval upstream=$(curl -s "$uri/rpc.php?type=info&arg=$package"|jq '.results.Version?')
2015-07-30 20:13:09 +03:00
if [[ -n $upstream && $version != $upstream ]]; then
printf "%s :: %s -> %s\n" $package $version $upstream
updates+=$package
2015-07-30 20:13:09 +03:00
fi
done
print "Do you want to download the pkgbuilds here? (C-c to cancel)"
read none
for i in $updates; do
git clone "$uri/$i.git"
done