From 8acc67237115dcdeba2c5e70618da26b0d1e6cab Mon Sep 17 00:00:00 2001 From: Eduard Toloza Date: Wed, 1 Aug 2018 08:39:31 -0500 Subject: [PATCH] Print accurate information about the installed status of a package --- simpleaur | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/simpleaur b/simpleaur index 2ad3826..8155f96 100755 --- a/simpleaur +++ b/simpleaur @@ -86,14 +86,25 @@ for ipackage in "$@"; do #Check if PKGBUILD exist if [ -f "$ipackage/PKGBUILD" ]; then cd "$ipackage" || exit - if makepkg -sci ; then + makepkg -sci + if pacman -Qq "$ipackage" &> /dev/null ; then cd "$basebuilddir" || exit printf '\e[1;32m%-6s\e[m\n\n' "The package [ $ipackage ] has been installed" continue else - printf '\n\e[1;31m%-6s\e[m\n' 'Error: Installation not completed.' - cd "$basebuilddir" || exit - continue + printf '\n\e[1;31m%-6s\e[m' "Error: Installation for the package [ $ipackage ] was not completed." + printf '\n\e[1;33m%-6s\e[m' "Do you want to continue? [Y/n] " + read -r answer + if [ "$answer" = "y" ] || [ "$answer" = "Y" ] ; then + printf '\n\e[1;32m%-6s\e[m\n' 'Info: Removing the failed build directory...' + rm -rf "$basebuilddir/$ipackage" + cd "$basebuilddir" + continue + else + printf '\n\e[1;32m%-6s\e[m\n' 'Info: Removing the failed build directory...' + rm -rf "$basebuilddir/$ipackage" + break + fi fi else printf '\n\e[1;31m%-6s\e[m\n' "Error: The PKGBUILD file for [ $ipackage ] does not exist, please check your internet connection and make sure that the AUR package name exists, you can use simplesearch for that."