mirror of
https://github.com/brunofontes/linuxShortcuts.git
synced 2024-11-23 23:40:51 +00:00
Aur now updates too
This commit is contained in:
parent
ffe9452cbe
commit
3f091d45ed
@ -1,7 +1,12 @@
|
||||
sudo echo
|
||||
if [ -z "$2" ]; then
|
||||
echo -n Sudo Password:
|
||||
read -s sudoPass
|
||||
else
|
||||
sudoPass=$2
|
||||
fi
|
||||
mkdir -p ~/AUR
|
||||
cd ~/AUR
|
||||
git clone https://aur.archlinux.org/"$1".git
|
||||
cd "$1"
|
||||
echo "cd ..; rm -rf ""$1""" > clean.sh
|
||||
sudo yes | makepkg -si && ./clean.sh && notify-send """$1"" installed!"
|
||||
echo "cd --; rm -rf ~/AUR/""$1""" > clean.sh
|
||||
echo "$sudoPass" | sudo -S yes | makepkg -si && source clean.sh
|
||||
|
@ -1,6 +1,26 @@
|
||||
echo -n Please type your sudo password:
|
||||
read -s sudoPass
|
||||
echo;
|
||||
check_pkgversion() {
|
||||
newver=$(curl -s "https://aur.archlinux.org/rpc.php?type=info&arg=$1" | awk -F : '{print $10}' | awk -F , '{print $1}' | sed 's/"//g')
|
||||
currentver=$(pacman -Qi $1 | awk '{print $3}' | head -n 2 | tail -n 1)
|
||||
if [[ $newver != $currentver ]]; then
|
||||
echo 1
|
||||
fi
|
||||
}
|
||||
|
||||
echo
|
||||
echo Updating with Pacman...
|
||||
echo
|
||||
pacman -Syu --color always
|
||||
echo "$sudoPass" | sudo -S pacman -Syu --color always
|
||||
echo
|
||||
yes | pacman -Sc --color always
|
||||
aurpkgs=$(pacman -Qm | awk '{print $1}')
|
||||
for line in $aurpkgs
|
||||
do
|
||||
vcheck=$(check_pkgversion $line)
|
||||
if [[ $vcheck == 1 ]]; then
|
||||
source ~/aur.sh "$line" "$sudoPass"
|
||||
fi
|
||||
done
|
||||
echo "$sudoPass" | sudo -S yes | pacman -Sc --color always
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user