From b92c888f42da75e44e6a5adf6aa9888b52074162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fuhry?= Date: Wed, 1 Feb 2023 02:07:55 +0100 Subject: [PATCH 1/4] Continued development... --- update | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/update b/update index 9f9043d..499d5c3 100644 --- a/update +++ b/update @@ -1,9 +1,10 @@ #!/bin/bash # updates using a pacman-wrapper and flatpak-update with flags -# version 1.3 +# version 1.4 -IGreen="\033[0;92m" # Green +IGREEN="\033[0;92m" # Intense Green +IYELLOW="\033[0;93m" # Intense Red NC="\033[0m" # Text Reset TMP="/tmp/backup" @@ -26,9 +27,11 @@ Help() { # it then rsyncs the tar to the backup location before_backup() { [[ ! -d /tmp/backup ]] && mkdir /tmp/backup - pacman -Q > "${TMP}"/pacman-pre.txt + pacman -Q > "${TMP}"/pacman-pre.txt flatpak list > "${TMP}"/flatpak-pre.txt + sudo touch /var/lib/pacman/db.lck tar -cJf "${TMP}"/before-backup.tar.xz.new "${TMP}"/pacman-pre.txt "${TMP}"/flatpak-pre.txt /var/lib/pacman/local &> /dev/null + sudo rm /var/lib/pacman/db.lck rsync "${TMP}"/before-backup.tar.xz.new "${backup_location}" rename before-backup.tar.xz.new before-backup.tar.xz "${backup_location}"/before-backup.tar.xz.new } @@ -56,11 +59,13 @@ update_with_flatpak() { [[ $1 = --help ]] && Help && exit 0; while [ -f /var/lib/pacman/db.lck ]; do { - sleep 1s + echo -e "${IYELLOW}->${NC} /var/lib/pacman/db.lck exists" + echo -e "${IYELLOW}->${NC} there might be an instance of pacman running. exiting..." + exit 1 } done -before_backup && echo -e "${IGreen} pre-backup complete ${NC}" +before_backup && echo -e "${IGREEN}pre-backup complete${NC}" [[ -z $1 ]] && update_with_pacman_wrapper && update_with_flatpak; while getopts 'fpagr' OPTIONS; do @@ -73,14 +78,14 @@ while getopts 'fpagr' OPTIONS; do update_with_pacman_wrapper; update_with_flatpak ;; g) [[ $1 = -g ]] && update_with_pacman_wrapper && update_with_flatpak; - after_backup && echo -e "${IGreen} after-backup complete ${NC}" && sleep 3s && shutdown now ;; + after_backup && echo -e "${IGREEN}after-backup complete${NC}" && sleep 3s && shutdown now ;; r) [[ $1 = -r ]] && update_with_pacman_wrapper && update_with_flatpak; - after_backup && echo -e "${IGreen} after-backup complete ${NC}" && sleep 3s && reboot ;; + after_backup && echo -e "${IGREEN}after-backup complete${NC}" && sleep 3s && reboot ;; ?) Help exit 1;; esac done -after_backup && echo -e "${IGreen} after-backup complete ${NC}" +after_backup && echo -e "${IGREEN}after-backup complete${NC}" From 97a72332690330f3d1070903f4f3f57c1c5d4b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fuhry?= Date: Wed, 1 Feb 2023 02:08:37 +0100 Subject: [PATCH 2/4] version bump --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index d456093..ef4679b 100644 --- a/makefile +++ b/makefile @@ -1,4 +1,4 @@ -VER = "v1.3" +VER = "v1.4" install: @echo "==> Installing update $(VER)..." From 693282236b9d60442800a4614259d997a8b97c29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fuhry?= Date: Wed, 1 Feb 2023 02:10:05 +0100 Subject: [PATCH 3/4] nevermind From 175757c688de1ec2ab9a158cf9bee2074465eaec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fuhry?= Date: Wed, 1 Feb 2023 02:12:58 +0100 Subject: [PATCH 4/4] better --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 4af4d5d..471b20e 100644 --- a/README.md +++ b/README.md @@ -26,10 +26,7 @@ no flag same as -a -g shutdowns the computer afterwards (needs to be the last or only option to work properly) -r reboots the computer afterwards (needs to be the last or only option to work properly) ``` -## Roadmap -- Publish to the aur -- First time setup ## Contributing Contributions are always welcome! \ No newline at end of file