From 7ca57894891febe439a74167cb6f5e1fa2996468 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 20 Nov 2016 20:12:27 +0100 Subject: [PATCH 1/2] Debloc stop if not on a Debian system --- scripts/debloc.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/debloc.sh b/scripts/debloc.sh index 9eeb1b4..880d1b0 100755 --- a/scripts/debloc.sh +++ b/scripts/debloc.sh @@ -1,5 +1,11 @@ #!/usr/bin/env bash +if [ ! -f /etc/apt/sources.list ]; then + # Not a debian system + return 0 +fi + + ARCH=$(dpkg --print-architecture) DEBLOC_DB=$HOME/.config/debloc/$ARCH DEBLOC_ROOT=$HOME/.debloc/$ARCH From 99b89352be79f3b700de3efa1b48961097aea464 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sun, 20 Nov 2016 20:39:43 +0100 Subject: [PATCH 2/2] Multiple states of non-install --- scripts/debloc.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/debloc.sh b/scripts/debloc.sh index 880d1b0..f0797cc 100755 --- a/scripts/debloc.sh +++ b/scripts/debloc.sh @@ -72,13 +72,13 @@ function _debloc-globallyInstalled { # package rm -f $STATUS > /dev/null return 0 fi - cat $STATUS | grep '^Status:' | grep 'not-installed' --quiet + cat $STATUS | grep '^Status:' | grep ' installed' --quiet if [ $? != 0 ]; then rm -f $STATUS > /dev/null - return 1 + return 0 else rm -f $STATUS > /dev/null - return 0 + return 1 fi }