2015-07-30 20:13:09 +03:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
# poor man's aur helper
|
2015-08-10 13:47:14 +03:00
|
|
|
uri='https://aur.archlinux.org'
|
2015-08-05 05:30:26 +03:00
|
|
|
dldir='/tmp/aur'
|
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
|
2015-07-30 21:41:08 +03:00
|
|
|
updates=()
|
2015-07-30 20:13:09 +03:00
|
|
|
pacman -Qm | while read package version; do
|
2015-07-30 21:41:08 +03:00
|
|
|
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
|
2015-07-30 21:41:08 +03:00
|
|
|
updates+=$package
|
2015-07-30 20:13:09 +03:00
|
|
|
fi
|
|
|
|
done
|
2015-08-05 05:30:26 +03:00
|
|
|
printf 'Do you want to download the pkgbuilds to %s? (C-c to cancel)' $dldir
|
2015-07-30 21:41:08 +03:00
|
|
|
read none
|
2015-08-10 13:43:25 +03:00
|
|
|
mkdir -p $dldir
|
|
|
|
cd $dldir
|
2015-07-30 21:41:08 +03:00
|
|
|
for i in $updates; do
|
|
|
|
git clone "$uri/$i.git"
|
|
|
|
done
|