From a62dd17a2d15df03d15ca5fe9d24cfcc96787538 Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Sun, 7 Aug 2022 12:04:45 +0200 Subject: [PATCH] Change option : --arch-mirror; Check for errors for arch and ask to repair --- usr/local/bin/upd | 4 ++-- var/lib/upd/scripts/help | 2 +- var/lib/upd/scripts/upgrader | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/usr/local/bin/upd b/usr/local/bin/upd index 6fe6e8a..94e52b5 100755 --- a/usr/local/bin/upd +++ b/usr/local/bin/upd @@ -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" ;; diff --git a/var/lib/upd/scripts/help b/var/lib/upd/scripts/help index 04981ca..033f238 100644 --- a/var/lib/upd/scripts/help +++ b/var/lib/upd/scripts/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) diff --git a/var/lib/upd/scripts/upgrader b/var/lib/upd/scripts/upgrader index 6d6b137..9b99c7a 100644 --- a/var/lib/upd/scripts/upgrader +++ b/var/lib/upd/scripts/upgrader @@ -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 }