From 3c170bdd5eb0c309e8f86d5e3408ac7db6981be7 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sun, 22 Jul 2018 18:30:02 +0200 Subject: [PATCH] Add yay and aurman --- lib | 34 +++++++++++++++++++++++------ updates/menu | 60 +++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 83 insertions(+), 11 deletions(-) diff --git a/lib b/lib index a06c9ce..e81304e 100644 --- a/lib +++ b/lib @@ -53,13 +53,27 @@ instpkg(){ sudo -u aurbuilder trizen -S --needed $2 pressanykey else - if [ -f /usr/bin/yaourt ]; then + if [ -f /usr/bin/yay ]; then clear - echo "# sudo -u aurbuilder yaourt -S --needed $2" - sudo -u aurbuilder yaourt -S --needed $2 + echo "# sudo -u aurbuilder yay -S --needed $2" + sudo -u aurbuilder yay -S --needed $2 pressanykey else - echo "To install AUR packages, you need to install yaourt or packer in updates menu !" + if [ -f /usr/bin/aurman ]; then + clear + echo "# sudo -u aurbuilder aurman -S --needed $2" + sudo -u aurbuilder aurman -S --needed $2 + pressanykey + else + if [ -f /usr/bin/yaourt ]; then + clear + echo "# sudo -u aurbuilder yaourt -S --needed $2" + sudo -u aurbuilder yaourt -S --needed $2 + pressanykey + else + echo "To install AUR packages, you need to install yaourt or packer in updates menu !" + fi + fi fi fi fi @@ -105,8 +119,16 @@ chooseaurpkg(){ if [ -f /usr/bin/trizen ]; then items=$(trizen -Ssq $1) else - if [ -f /usr/bin/yaourt ]; then - items=$(yaourt -Ssq $1) + if [ -f /usr/bin/yay ]; then + items=$(yay -Ssq $1) + else + if [ -f /usr/bin/aurman ]; then + items=$(aurman -Ssq $1) + else + if [ -f /usr/bin/yaourt ]; then + items=$(yaourt -Ssq $1) + fi + fi fi fi for item in $items; do diff --git a/updates/menu b/updates/menu index f68fa57..cb47627 100644 --- a/updates/menu +++ b/updates/menu @@ -6,12 +6,22 @@ if [ -f /usr/bin/trizen ]; then options+=("Upgrade with trizen" "trizen -Syu") aurhelper=1 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 options+=("Upgrade with yaourt" "yaourt -Syua") aurhelper=1 fi if [ ! "$aurhelper" = "1" ]; then options+=("Install trizen" "") + options+=("Install aurman" "") + options+=("Install yay" "") options+=("Install yaourt" "(End of life)") options+=("" "") fi @@ -42,6 +52,12 @@ if [ "$aurhelper" = "1" ]; then if [ ! -f /usr/bin/trizen ]; then options+=("Install trizen" "") 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 options+=("Install yaourt" "(End of life)") fi @@ -67,7 +83,7 @@ checkaurdependencies(){ echo -e "$newpass\n$newpass\n"|passwd aurbuilder newpass="" else - usermod -m -d /tmp/aurbuilder aurbuilder >/dev/null + usermod -m -d /tmp/aurbuilder aurbuilder 1&>/dev/null fi if [ ! -f /etc/sudoers.d/aurbuilder ]; then echo "aurbuilder ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/aurbuilder @@ -76,7 +92,7 @@ checkaurdependencies(){ } checkpackagequerydependencies(){ if [ ! -f /usr/bin/package-query ]; then - mkdir /tmp/aurbuilder + mkdir /tmp/aurbuilder 1&>/dev/null chmod 777 /tmp/aurbuilder cd /tmp/aurbuilder sudo -u aurbuilder git clone https://aur.archlinux.org/package-query.git @@ -100,6 +116,14 @@ case $sel in checkaurdependencies 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') checkaurdependencies sudo -u aurbuilder yaourt -Syua @@ -115,10 +139,10 @@ case $sel in instpkg "" "downgrade" ;; '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 checkaurdependencies - mkdir /tmp/aurbuilder + mkdir /tmp/aurbuilder 1&>/dev/null chmod 777 /tmp/aurbuilder cd /tmp/aurbuilder sudo -u aurbuilder git clone https://aur.archlinux.org/trizen.git @@ -126,12 +150,38 @@ case $sel in sudo -u aurbuilder makepkg -si 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') 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 checkaurdependencies checkpackagequerydependencies - mkdir /tmp/aurbuilder + mkdir /tmp/aurbuilder 1&>/dev/null chmod 777 /tmp/aurbuilder cd /tmp/aurbuilder sudo -u aurbuilder git clone https://aur.archlinux.org/yaourt.git