Add yay and aurman

This commit is contained in:
MatMoul 2018-07-22 18:30:02 +02:00
parent eb905aa467
commit 3c170bdd5e
2 changed files with 83 additions and 11 deletions

22
lib
View file

@ -52,6 +52,18 @@ instpkg(){
echo "# sudo -u aurbuilder trizen -S --needed $2" echo "# sudo -u aurbuilder trizen -S --needed $2"
sudo -u aurbuilder trizen -S --needed $2 sudo -u aurbuilder trizen -S --needed $2
pressanykey pressanykey
else
if [ -f /usr/bin/yay ]; then
clear
echo "# sudo -u aurbuilder yay -S --needed $2"
sudo -u aurbuilder yay -S --needed $2
pressanykey
else
if [ -f /usr/bin/aurman ]; then
clear
echo "# sudo -u aurbuilder aurman -S --needed $2"
sudo -u aurbuilder aurman -S --needed $2
pressanykey
else else
if [ -f /usr/bin/yaourt ]; then if [ -f /usr/bin/yaourt ]; then
clear clear
@ -63,6 +75,8 @@ instpkg(){
fi fi
fi fi
fi fi
fi
fi
} }
@ -104,11 +118,19 @@ chooseaurpkg(){
options=() options=()
if [ -f /usr/bin/trizen ]; then if [ -f /usr/bin/trizen ]; then
items=$(trizen -Ssq $1) items=$(trizen -Ssq $1)
else
if [ -f /usr/bin/yay ]; then
items=$(yay -Ssq $1)
else
if [ -f /usr/bin/aurman ]; then
items=$(aurman -Ssq $1)
else else
if [ -f /usr/bin/yaourt ]; then if [ -f /usr/bin/yaourt ]; then
items=$(yaourt -Ssq $1) items=$(yaourt -Ssq $1)
fi fi
fi fi
fi
fi
for item in $items; do for item in $items; do
options+=("$item" "" off) options+=("$item" "" off)
done done

View file

@ -6,12 +6,22 @@ if [ -f /usr/bin/trizen ]; then
options+=("Upgrade with trizen" "trizen -Syu") options+=("Upgrade with trizen" "trizen -Syu")
aurhelper=1 aurhelper=1
fi fi
if [ -f /usr/bin/yay ]; then
options+=("Upgrade with yay" "yay -Syu")
aurhelper=1
fi
if [ -f /usr/bin/aurman ]; then
options+=("Upgrade with aurman" "aurman -Syu")
aurhelper=1
fi
if [ -f /usr/bin/yaourt ]; then if [ -f /usr/bin/yaourt ]; then
options+=("Upgrade with yaourt" "yaourt -Syua") options+=("Upgrade with yaourt" "yaourt -Syua")
aurhelper=1 aurhelper=1
fi fi
if [ ! "$aurhelper" = "1" ]; then if [ ! "$aurhelper" = "1" ]; then
options+=("Install trizen" "") options+=("Install trizen" "")
options+=("Install aurman" "")
options+=("Install yay" "")
options+=("Install yaourt" "(End of life)") options+=("Install yaourt" "(End of life)")
options+=("" "") options+=("" "")
fi fi
@ -42,6 +52,12 @@ if [ "$aurhelper" = "1" ]; then
if [ ! -f /usr/bin/trizen ]; then if [ ! -f /usr/bin/trizen ]; then
options+=("Install trizen" "") options+=("Install trizen" "")
fi fi
if [ ! -f /usr/bin/yay ]; then
options+=("Install yay" "")
fi
if [ ! -f /usr/bin/aurman ]; then
options+=("Install aurman" "")
fi
if [ ! -f /usr/bin/yaourt ]; then if [ ! -f /usr/bin/yaourt ]; then
options+=("Install yaourt" "(End of life)") options+=("Install yaourt" "(End of life)")
fi fi
@ -67,7 +83,7 @@ checkaurdependencies(){
echo -e "$newpass\n$newpass\n"|passwd aurbuilder echo -e "$newpass\n$newpass\n"|passwd aurbuilder
newpass="" newpass=""
else else
usermod -m -d /tmp/aurbuilder aurbuilder >/dev/null usermod -m -d /tmp/aurbuilder aurbuilder 1&>/dev/null
fi fi
if [ ! -f /etc/sudoers.d/aurbuilder ]; then if [ ! -f /etc/sudoers.d/aurbuilder ]; then
echo "aurbuilder ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/aurbuilder echo "aurbuilder ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/aurbuilder
@ -76,7 +92,7 @@ checkaurdependencies(){
} }
checkpackagequerydependencies(){ checkpackagequerydependencies(){
if [ ! -f /usr/bin/package-query ]; then if [ ! -f /usr/bin/package-query ]; then
mkdir /tmp/aurbuilder mkdir /tmp/aurbuilder 1&>/dev/null
chmod 777 /tmp/aurbuilder chmod 777 /tmp/aurbuilder
cd /tmp/aurbuilder cd /tmp/aurbuilder
sudo -u aurbuilder git clone https://aur.archlinux.org/package-query.git sudo -u aurbuilder git clone https://aur.archlinux.org/package-query.git
@ -100,6 +116,14 @@ case $sel in
checkaurdependencies checkaurdependencies
sudo -u aurbuilder trizen -Syu sudo -u aurbuilder trizen -Syu
;; ;;
'Upgrade with aurman')
checkaurdependencies
sudo -u aurbuilder aurman -Syu
;;
'Upgrade with yay')
checkaurdependencies
sudo -u aurbuilder yay -Syu
;;
'Upgrade with yaourt') 'Upgrade with yaourt')
checkaurdependencies checkaurdependencies
sudo -u aurbuilder yaourt -Syua sudo -u aurbuilder yaourt -Syua
@ -115,10 +139,10 @@ case $sel in
instpkg "" "downgrade" instpkg "" "downgrade"
;; ;;
'Install trizen') 'Install trizen')
if(confirm "Yaourt allow you to access the AUR applications.\nBecause is not possible to compile applications as root,\nthis installer create an aurbuilder user.\n\nInstall trizen ?") then if(confirm "Trizen allow you to access the AUR applications.\nBecause is not possible to compile applications as root,\nthis installer create an aurbuilder user.\n\nInstall trizen ?") then
clear clear
checkaurdependencies checkaurdependencies
mkdir /tmp/aurbuilder mkdir /tmp/aurbuilder 1&>/dev/null
chmod 777 /tmp/aurbuilder chmod 777 /tmp/aurbuilder
cd /tmp/aurbuilder cd /tmp/aurbuilder
sudo -u aurbuilder git clone https://aur.archlinux.org/trizen.git sudo -u aurbuilder git clone https://aur.archlinux.org/trizen.git
@ -126,12 +150,38 @@ case $sel in
sudo -u aurbuilder makepkg -si sudo -u aurbuilder makepkg -si
fi fi
;; ;;
'Install aurman')
if(confirm "Aurman allow you to access the AUR applications.\nBecause is not possible to compile applications as root,\nthis installer create an aurbuilder user.\n\nInstall aurman ?") then
clear
checkaurdependencies
mkdir /tmp/aurbuilder 1&>/dev/null
chmod 777 /tmp/aurbuilder
cd /tmp/aurbuilder
sudo -u aurbuilder git clone https://aur.archlinux.org/aurman.git
cd aurman
sudo -u aurbuilder gpg --recv-key 465022E743D71E39
sudo -u aurbuilder makepkg -si
#sudo -u aurbuilder makepkg -si --skippgpcheck
fi
;;
'Install yay')
if(confirm "Yay allow you to access the AUR applications.\nBecause is not possible to compile applications as root,\nthis installer create an aurbuilder user.\n\nInstall yay ?") then
clear
checkaurdependencies
mkdir /tmp/aurbuilder 1&>/dev/null
chmod 777 /tmp/aurbuilder
cd /tmp/aurbuilder
sudo -u aurbuilder git clone https://aur.archlinux.org/yay.git
cd yay
sudo -u aurbuilder makepkg -si
fi
;;
'Install yaourt') 'Install yaourt')
if(confirm "Yaourt allow you to access the AUR applications.\nBecause is not possible to compile applications as root,\nthis installer create an aurbuilder user.\n\nInstall yaourt ?") then if(confirm "Yaourt allow you to access the AUR applications.\nBecause is not possible to compile applications as root,\nthis installer create an aurbuilder user.\n\nInstall yaourt ?") then
clear clear
checkaurdependencies checkaurdependencies
checkpackagequerydependencies checkpackagequerydependencies
mkdir /tmp/aurbuilder mkdir /tmp/aurbuilder 1&>/dev/null
chmod 777 /tmp/aurbuilder chmod 777 /tmp/aurbuilder
cd /tmp/aurbuilder cd /tmp/aurbuilder
sudo -u aurbuilder git clone https://aur.archlinux.org/yaourt.git sudo -u aurbuilder git clone https://aur.archlinux.org/yaourt.git