-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkAur
executable file
·39 lines (36 loc) · 985 Bytes
/
checkAur
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
[[ -d /tmp/aur_build ]] || mkdir /tmp/aur_build
shopt -s nullglob
cd /tmp/aur_build || exit
rm -rf *
{
sudo pacman -Qm | \
while read pkg ver ; do
cur=$(
{
wget -qO - "http://aur.archlinux.org/packages/$pkg/PKGBUILD" ;
printf "\n%s\n" 'printf "%s-%s\n" "$pkgver" "$pkgrel"' ;
} | bash
) || continue
[[ $cur = "-" ]] && continue
newer=$(vercmp "$cur" "$ver")
(( newer > 0 )) || continue
printf "%s: Have %s and AUR has %s\n" "$pkg" "$ver" "$cur"
#read -p "Upgrade? [y/N] " -n 1 <&3
#[[ $REPLY = [yY] ]] || continue
[[ -d /tmp/aur_build/$pkg ]] && { rm -rf "/tmp/aur_build/$pkg" || continue ; }
wget -qO - "http://aur.archlinux.org/packages/$pkg/$pkg.tar.gz" | tar xz || continue
done
} 3<&1
pkgs=(/tmp/aur_build/*)
while (( "${#pkgs[@]}" )) ; do
for i in "${pkgs[@]}" ; do
read -p "Build $i? [Y/n]"
if [[ $REPLY = [nN] ]] ; then
rm -r "$i"
else
( cd "$i" && makepkg -i ; ) && rm -rf "$i"
fi
done
pkgs=( /tmp/aur_build/* )
done