Fix: pacman and AUR call

This commit is contained in:
Cyrille L 2022-04-25 17:45:31 +02:00
parent 8149886365
commit 4fc287d787
2 changed files with 21 additions and 23 deletions

View File

@ -1,5 +1,5 @@
#!/bin/bash
# version: 0.1.0
# version: 0.1.1
# file: upd
# Folder: /usr/local/bin
# By echolib
@ -12,7 +12,7 @@
if__command() {
! [[ `command -v $1` ]] \
&& echo -e "$I_Red Missing $1 command" \
&& exit 1
&& exit
}
if__file() {
@ -20,7 +20,7 @@ case "$2" in
source)
! [[ -f "$1" ]] \
&& echo "# Missing file: $1" \
&& exit 1
&& exit
source "$1"
;;
create)
@ -43,11 +43,11 @@ if ! [[ -d "$1" ]];then
;;
check)
echo "! Missing folder: $1"
exit 1
exit
;;
*)
echo "! Missing folder: $1"
exit 1
exit
;;
esac
fi
@ -63,7 +63,7 @@ elif [[ `command -v pacman` ]];then
&& aur=yay
else
echo "! upd is not yet ready for this System"
exit 0
exit
fi
}

View File

@ -15,15 +15,15 @@ case "$sysup" in
clear
upd__check_arch
(( $upd_nbr == 0 )) \
&& exit 0
&& exit
upg__arch_system
;;
apt)
clear
upd__check_deb
(( $upd_nbr == 0 )) \
&& exit 0
&& exit
upg__deb_upgrade
;;
@ -36,7 +36,7 @@ case "$sysup" in
clear
upd__check_arch
(( $upd_nbr == 0 )) && (( $upd_nbr_aur == 0 )) \
&& exit 0
&& exit
upg__arch_system
upg__arch_aur
@ -45,8 +45,8 @@ case "$sysup" in
clear
upd__check_deb
(( $upd_nbr == 0 )) \
&& exit 0
&& exit
upg__deb_full_upgrade
;;
esac
@ -55,13 +55,12 @@ case "$sysup" in
aur)
[[ $arch == "apt" ]] \
&& echo "# Invalid option for this system" \
&& exit 0
&& exit
upd__check_arch
(( $upd_nbr_aur == 0 )) \
&& exit 0
#clear
&& exit
upg__arch_aur
;;
@ -84,26 +83,25 @@ upd__sudoroot # Tools: Check if user is admin
echo "# Syncing..."
sudo pacman -Sy &>/dev/null
echo -ne "\r\033[2K"
upd_pkg_upg="--ignore=linux --ignore=linux-headers"
if [[ `grep "^linux-" "$upd_file_check"` ]];then
read -rp "$I_Red Upgrade Kernel (y|N)? " upd_arch_ask
read -rp ": Upgrade Kernel (y|N)? " upd_arch_ask
case "$upd_arch_ask" in
Y|y) unset upd_pkg_upg ;;
*) true ;;
*) upd_pkg_upg="--ignore linux,linux-headers" ;;
esac
fi
echo -e "$I_Yellow Upgrading System...\n"
sudo pacman -Su --noconfirm --needed "$upd_pkg_upg"
sudo pacman -Su --noconfirm --needed $upd_pkg_upg
}
upg__arch_aur() {
upd__sudoroot # Tools: Check if user is admin
if [[ "$aur" == "yay" ]];then
echo -e "$I_Yellow Upgrading AUR packages...\n"
yay -Syu --save --sudoloop --nocleanmenu --nodiffmenu --noeditmenu
yay -Syu --aur --save --sudoloop \
--nocleanmenu --nodiffmenu --noeditmenu --noupgrademenu
else
echo "$I_Red Not using yay ; abandon"
fi