From 6de2e5da1bb9284f8592fe389411e73c665b934e Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Fri, 10 Nov 2023 15:24:25 +0100 Subject: [PATCH 1/5] Add styling to differentiate each 'update' steps more easily This PR aims to add some basic styling to differentiate each `update` steps (regular packages, AUR packages, Flatpak packages) more easily. This makes the script more "transparent" about what it does and will also be useful for eventual debugging. --- src/script/arch-update.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index 10fa653..7de3d8e 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -176,6 +176,7 @@ update() { list_news if [ -n "${packages}" ]; then + echo -e "\n--Updating Packages--" if ! "${su_cmd}" pacman -Syu; then icon_updates_available echo -e >&2 "\nAn error has occurred\nThe update has been aborted\n" && read -n 1 -r -s -p $'Press \"enter\" to quit\n' @@ -184,6 +185,7 @@ update() { fi if [ -n "${aur_packages}" ]; then + echo -e "\n--Updating AUR Packages--" if ! "${aur_helper}" -Syu; then icon_updates_available echo -e >&2 "\nAn error has occurred\nThe update has been aborted\n" && read -n 1 -r -s -p $'Press \"enter\" to quit\n' @@ -192,6 +194,7 @@ update() { fi if [ -n "${flatpak_packages}" ]; then + echo -e "\n--Updating Flatpak Packages--" if ! flatpak update; then icon_updates_available echo -e >&2 "\nAn error has occurred\nThe update has been aborted\n" && read -n 1 -r -s -p $'Press \"enter\" to quit\n' From 8357d8baf36dd31642cd4d0d7e95f1a9731f336d Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Fri, 10 Nov 2023 15:30:57 +0100 Subject: [PATCH 2/5] Add style for orphan/unused removal as well --- src/script/arch-update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index 7de3d8e..fc80b64 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -228,7 +228,7 @@ orphan_packages() { case "${answer}" in [Yy]) - echo + echo "--Removing Orphan Packages--" pacman -Qtdq | "${su_cmd}" pacman -Rns - && echo -e "\nThe removal has been applied\n" || echo -e >&2 "\nAn error has occurred\nThe removal has been aborted\n" ;; *) @@ -250,7 +250,7 @@ orphan_packages() { case "${answer}" in [Yy]) - echo + echo "--Removing Flatpak Unused Packages--" flatpak remove --unused && echo -e "\nThe removal has been applied\n" || echo -e >&2 "\nAn error has occurred\nThe removal has been aborted\n" ;; *) From fa077aa0d87e2ea57194fcbbdb60c311e5ec0ba2 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Fri, 10 Nov 2023 15:33:08 +0100 Subject: [PATCH 3/5] Add correct spacing --- src/script/arch-update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index fc80b64..940fb71 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -228,7 +228,7 @@ orphan_packages() { case "${answer}" in [Yy]) - echo "--Removing Orphan Packages--" + echo -e "\n--Removing Orphan Packages--" pacman -Qtdq | "${su_cmd}" pacman -Rns - && echo -e "\nThe removal has been applied\n" || echo -e >&2 "\nAn error has occurred\nThe removal has been aborted\n" ;; *) @@ -250,7 +250,7 @@ orphan_packages() { case "${answer}" in [Yy]) - echo "--Removing Flatpak Unused Packages--" + echo -e "\n--Removing Flatpak Unused Packages--" flatpak remove --unused && echo -e "\nThe removal has been applied\n" || echo -e >&2 "\nAn error has occurred\nThe removal has been aborted\n" ;; *) From c4b50b6c4d1b7414440d53645b37d707367ab10a Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Fri, 10 Nov 2023 15:39:57 +0100 Subject: [PATCH 4/5] Styling --- src/script/arch-update.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index 940fb71..c865c75 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -163,7 +163,6 @@ list_news() { echo -e "\n---\nTitle: ${news_selected}\nAuthor: ${news_author}\nPublication date: ${news_date}\nURL: ${news_url}\n---\n\n${news_article}\n" && read -n 1 -r -s -p $'Press \"enter\" to continue\n' ;; *) - echo redo="n" ;; esac From 0a89ec96ae59b45ff8a124e9c82a602b2e55cf00 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Fri, 10 Nov 2023 15:47:39 +0100 Subject: [PATCH 5/5] Add style for pacnew processing --- src/script/arch-update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index c865c75..1a88046 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -276,7 +276,7 @@ pacnew_files() { case "${answer}" in [Yy]|"") - echo + echo -e "\n--Processing Pacnew Files--" "${su_cmd}" pacdiff echo -e "\nThe pacnew file(s) processing has been applied\n" ;;