From df3c74765f353b2983b17cc06f0d6066ab1201c9 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 19 Sep 2020 23:21:23 +0200 Subject: [PATCH 1/4] [aurup] store and revert current path --- scripts/aurup.fish | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/aurup.fish b/scripts/aurup.fish index 5c6b9f0..39c8839 100755 --- a/scripts/aurup.fish +++ b/scripts/aurup.fish @@ -7,6 +7,8 @@ # License: GPLv3 (https://www.gnu.org/licenses/gpl-3.0.en.html) for pkg in (auracle outdated | cut -d' ' -f1) +set -l pwd $PWG + cd ~/aur/ echo "Updating $pkg" cd $pkg @@ -27,3 +29,4 @@ for pkg in (auracle outdated | cut -d' ' -f1) makepkg -Ccsir cd .. end +cd $pwd From 9d45e740a8d8d67f0b4f9a57531b0360e4b1d741 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 19 Sep 2020 23:21:47 +0200 Subject: [PATCH 2/4] [aurup] Show outdated packages at the beginning --- scripts/aurup.fish | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/aurup.fish b/scripts/aurup.fish index 39c8839..35bcc15 100755 --- a/scripts/aurup.fish +++ b/scripts/aurup.fish @@ -9,6 +9,7 @@ for pkg in (auracle outdated | cut -d' ' -f1) set -l pwd $PWG +auracle outdated cd ~/aur/ echo "Updating $pkg" cd $pkg From 862764bd3b4a219ffbca9014898faf01815d4958 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 19 Sep 2020 23:22:53 +0200 Subject: [PATCH 3/4] [aurup] Updated repos, if updates are available. Other exit with 1 --- scripts/aurup.fish | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/aurup.fish b/scripts/aurup.fish index 35bcc15..ab300f4 100755 --- a/scripts/aurup.fish +++ b/scripts/aurup.fish @@ -10,8 +10,16 @@ for pkg in (auracle outdated | cut -d' ' -f1) set -l pwd $PWG auracle outdated +if test $status -ne 0 + echo "No updates available." + echo "Exiting now..." + exit 1 +else + echo "Updating existing repositories..." cd ~/aur/ echo "Updating $pkg" + auracle update +end cd $pkg cat PKGBUILD read -P 'PKGBUILD OK? (y/N) > ' pkgbuild_ok From 98059d44841620854e6f4bc140583787dc3ce54c Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 19 Sep 2020 23:23:18 +0200 Subject: [PATCH 4/4] [aurup] Colorfull output and more output --- scripts/aurup.fish | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/scripts/aurup.fish b/scripts/aurup.fish index ab300f4..e55f451 100755 --- a/scripts/aurup.fish +++ b/scripts/aurup.fish @@ -6,28 +6,43 @@ # # License: GPLv3 (https://www.gnu.org/licenses/gpl-3.0.en.html) -for pkg in (auracle outdated | cut -d' ' -f1) set -l pwd $PWG +set_color -o blue +echo "Listing outdated AUR packages..." +set_color normal auracle outdated + if test $status -ne 0 + set_color -o blue echo "No updates available." + set_color -o red echo "Exiting now..." + set_color normal exit 1 else + set_color -o blue echo "Updating existing repositories..." + set_color normal cd ~/aur/ - echo "Updating $pkg" auracle update end + +for pkg in (auracle outdated | cut -d' ' -f1) + set_color -o blue + echo "Updating $pkg..." + set_color normal cd $pkg + set_color -o blue + echo "PKGBUILD for $pkg:" + set_color normal cat PKGBUILD - read -P 'PKGBUILD OK? (y/N) > ' pkgbuild_ok + read -p 'set_color -o cyan; echo -n "PKGBUILD OK?"; set_color normal; echo -n " (y/N) > "' pkgbuild_ok if test $pkgbuild_ok != "y" - read -P 'Edit PKGBUKD? (Y/n) > ' pkgbuild_edit + read -p 'set_color -o cyan; echo -n "Edit PKGBUILD?"; set_color normal; echo -n " (Y/n) > "' pkgbuild_edit if test $pkgbuild_edit != "n" $EDITOR -nw PKGBUILD - read -P 'PKGBUILD now OK? (y/N) > ' pkgbuild_edit_ok + read -p 'set_color -o cyan; echo -n "PKGBUILD OK?"; set_color normal; echo -n " (y/N) > "' pkgbuild_edit_ok if test $pkgbuild_edit_ok != "y" continue end @@ -35,7 +50,17 @@ end continue end end + set_color -o blue + echo "Building and installing $pkg..." + set_color normal makepkg -Ccsir + set_color -o blue + echo "Finished installing $pkg." + set_color normal cd .. end + +set_color -o blue +echo "Done updating packages." +set_color normal cd $pwd