update pmah to automatically download the shit, slower than cower, but at least it is working
This commit is contained in:
parent
e8abdc2640
commit
23c1617206
1 changed files with 9 additions and 2 deletions
11
pmah.zsh
11
pmah.zsh
|
@ -1,12 +1,19 @@
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
# poor man's aur helper
|
# poor man's aur helper
|
||||||
|
uri='https://aur4.archlinux.org'
|
||||||
for i in jq curl; do
|
for i in jq curl; do
|
||||||
whence $i &>/dev/null || { printf "missing %s!\n" $i >&2; exit 1 }
|
whence $i &>/dev/null || { printf "missing %s!\n" $i >&2; exit 1 }
|
||||||
done
|
done
|
||||||
|
updates=()
|
||||||
pacman -Qm | while read package version; do
|
pacman -Qm | while read package version; do
|
||||||
eval upstream=$(curl -s "https://aur4.archlinux.org/rpc.php?type=info&arg=$package"|jq '.results.Version?')
|
eval upstream=$(curl -s "$uri/rpc.php?type=info&arg=$package"|jq '.results.Version?')
|
||||||
if [[ -n $upstream && $version != $upstream ]]; then
|
if [[ -n $upstream && $version != $upstream ]]; then
|
||||||
printf "%s :: %s -> %s\n" $package $version $upstream
|
printf "%s :: %s -> %s\n" $package $version $upstream
|
||||||
|
updates+=$package
|
||||||
fi
|
fi
|
||||||
done
|
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
|
||||||
|
|
Loading…
Reference in a new issue