From fa7c01edd23a0ddd3b30c10bbf7a29bbd413f69f Mon Sep 17 00:00:00 2001 From: Krzysztof Knapik Date: Wed, 18 Oct 2017 10:14:59 +0200 Subject: [PATCH 1/2] Fix command existence check --- desktopintegration | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/desktopintegration b/desktopintegration index 591d570ed..6e53d6d97 100644 --- a/desktopintegration +++ b/desktopintegration @@ -147,11 +147,13 @@ check_prevent() check_dep() { - DEP=$1 - if [ -z $(which $DEP 2>&1 1>/dev/null) ] ; then - log "$DEP is missing. Skipping ${THIS}." - exit 0 + set +e + which $1 &>/dev/null + if [ $? -ne 0 ]; then + log "$1 is missing. Skipping ${THIS}." + exit fi + set -e } # Determine where the desktop file should be installed From 66f2a356dea8674af3309f5a0f06ef52a3fbdc07 Mon Sep 17 00:00:00 2001 From: Krzysztof Knapik Date: Wed, 18 Oct 2017 17:26:37 +0200 Subject: [PATCH 2/2] Do not use set builtin --- desktopintegration | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/desktopintegration b/desktopintegration index 6e53d6d97..48bb075c5 100644 --- a/desktopintegration +++ b/desktopintegration @@ -147,13 +147,10 @@ check_prevent() check_dep() { - set +e - which $1 &>/dev/null - if [ $? -ne 0 ]; then + if [ -z "$(command -v $1)" ]; then log "$1 is missing. Skipping ${THIS}." exit fi - set -e } # Determine where the desktop file should be installed