Change option : --arch-mirror; Check for errors for arch and ask to repair
This commit is contained in:
parent
07b69b20a7
commit
a62dd17a2d
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash
|
||||
# version: 0.1.2
|
||||
# version: 0.1.3
|
||||
# file: upd
|
||||
# Folder: /usr/local/bin
|
||||
# By echolib
|
||||
|
@ -106,7 +106,7 @@ case "$1" in
|
|||
-U) Updater ;;
|
||||
-u) sysup="system";upg__main ;;
|
||||
-f) sysup="full";upg__main ;;
|
||||
--arch_mirror|-am) arch__mirror ;;
|
||||
--arch-mirror|-am) arch__mirror ;;
|
||||
--arch-repair|-ar) arch__mirror;arch__repair ;;
|
||||
-A) sysup="aur";upg__main ;;
|
||||
*) echo "! Bad argument '$1' : see upd --help" ;;
|
||||
|
|
|
@ -22,7 +22,7 @@ cat << EOHELP
|
|||
-u : update system only
|
||||
-f : update system + AUR
|
||||
-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
|
||||
and update system (not AUR)
|
||||
|
||||
|
|
|
@ -99,6 +99,22 @@ fi
|
|||
|
||||
echo -e "$I_Yellow Upgrading System...\n"
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue