From fd00e25b76afe80dd9ca047bfe62c9c3e1954ed6 Mon Sep 17 00:00:00 2001 From: Botspot Date: Sat, 10 Apr 2021 13:42:32 -0500 Subject: [PATCH] pkg-install & purge-installed fixes for package-double-checking --- pkg-install | 2 +- purge-installed | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg-install b/pkg-install index 2e1d5f8..f88c297 100755 --- a/pkg-install +++ b/pkg-install @@ -117,7 +117,7 @@ if [ ! -z "$INSTALL_LIST" ];then INSTALL_LIST="$(sudo LANG=C LC_ALL=C apt-get install --no-install-recommends --dry-run $PKG_LIST | sed -n '/The following packages/,/to remove/p' | sed -e '2,$!d' -e '$d' | tr -d '*' | tr '\n' ' ' | sed 's/The following.*//')" - if [ ! -z $INSTALL_LIST ];then + if [ ! -z "$INSTALL_LIST" ];then echo -e "\e[91mAPT did not exit with an error, but these packages failed to install somehow: $INSTALL_LIST\e[39m" exit 1 else diff --git a/purge-installed b/purge-installed index b585b49..6d407ee 100755 --- a/purge-installed +++ b/purge-installed @@ -55,7 +55,7 @@ if [ $exitcode != 0 ] || [ ! -z "$errors" ];then fi #ensure all packages are really purged -PURGE_LIST="$(sudo LANG=C apt-get purge --dry-run $PKG_LIST | sed -n '/The following packages/,/to remove/p' | sed -e '2,$!d' -e '$d' | tr -d '*' | tr '\n' ' ')" +PURGE_LIST="$(sudo LANG=C apt-get purge --dry-run $PKG_LIST | sed -n '/The following packages will be REMOVED/,/to remove and/p' | sed -e '2,$!d' -e '$d' | tr -d '*' | tr '\n' ' ' | sed 's/The following.*//')" if [ ! -z "$PURGE_LIST" ];then error "APT did not exit with an error, but these packages are still installed somehow: $PURGE_LIST"