Change option : --arch-mirror; Check for errors for arch and ask to repair

This commit is contained in:
Cyrille L 2022-08-07 12:04:45 +02:00
parent 07b69b20a7
commit a62dd17a2d
3 changed files with 19 additions and 3 deletions

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# version: 0.1.2 # version: 0.1.3
# file: upd # file: upd
# Folder: /usr/local/bin # Folder: /usr/local/bin
# By echolib # By echolib
@ -106,7 +106,7 @@ case "$1" in
-U) Updater ;; -U) Updater ;;
-u) sysup="system";upg__main ;; -u) sysup="system";upg__main ;;
-f) sysup="full";upg__main ;; -f) sysup="full";upg__main ;;
--arch_mirror|-am) arch__mirror ;; --arch-mirror|-am) arch__mirror ;;
--arch-repair|-ar) arch__mirror;arch__repair ;; --arch-repair|-ar) arch__mirror;arch__repair ;;
-A) sysup="aur";upg__main ;; -A) sysup="aur";upg__main ;;
*) echo "! Bad argument '$1' : see upd --help" ;; *) echo "! Bad argument '$1' : see upd --help" ;;

View File

@ -22,7 +22,7 @@ cat << EOHELP
-u : update system only -u : update system only
-f : update system + AUR -f : update system + AUR
-A : update AUR packages only -A : update AUR packages only
--arch_mirror | -am : update mirrorlist only --arch-mirror | -am : update mirrorlist only
--arch-repair | -ar : update mirrors, archlinux-keyrings, clean --arch-repair | -ar : update mirrors, archlinux-keyrings, clean
and update system (not AUR) and update system (not AUR)

View File

@ -99,6 +99,22 @@ fi
echo -e "$I_Yellow Upgrading System...\n" echo -e "$I_Yellow Upgrading System...\n"
sudo pacman -Su --noconfirm --needed $upd_pkg_upg sudo pacman -Su --noconfirm --needed $upd_pkg_upg
upg_rep=$?
if (( $upg_rep != 0 ));then
printf '\n%s\n%s\n%s\n\n' \
"! An error has been detected" \
"- Try to repair, first (R)" \
"- Try to manually update (U)"
read ": What to do (R|U|*) ? " upg_try
case "$upg_try" in
R) upd --arch-repair;exit ;;
U) sudo pacman -Syu;exit ;;
esac
fi
} }