From 3a4bc4db9c82ef4ab1fe6f4d44b82b1dd2a71af7 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Thu, 25 Jan 2018 19:14:58 +0100 Subject: [PATCH] Use binary paths from both PATH and predefined list to improve detection on all platforms --- include/binaries | 4 ++-- include/consts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/binaries b/include/binaries index 1c56607b..a86708f3 100644 --- a/include/binaries +++ b/include/binaries @@ -43,8 +43,8 @@ LogText "Status: Starting binary scan..." # Test if our PATH variable provides a set of paths (otherwise we use predefined list in include/consts) - if [ ! -z "${PATH}" ]; then BIN_PATHS=$(echo ${PATH} | tr ':' ' '); fi - SORTED_BIN_PATHS=$(echo ${BIN_PATHS} | tr ' ' '\n' | sort | tr '\n' ' ') + if [ ! -z "${PATH}" ]; then BIN_PATHS=$(echo "${BIN_PATHS} ${PATH}" | tr ':' ' '); fi + SORTED_BIN_PATHS=$(echo ${BIN_PATHS} | tr ' ' '\n' | sort | uniq | tr '\n' ' ') for SCANDIR in ${SORTED_BIN_PATHS}; do LogText "Test: Checking binaries in directory ${SCANDIR}" ORGPATH="" diff --git a/include/consts b/include/consts index 1cd32d4d..181ff15b 100644 --- a/include/consts +++ b/include/consts @@ -23,8 +23,8 @@ ################################################################################# # -# Paths where system and program binaries are located -BIN_PATHS="/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin \ +# Paths where system and program binaries are typically located +BIN_PATHS="/bin /sbin /usr/bin /usr/gnu/bin /usr/sbin /usr/local/bin /usr/local/sbin \ /usr/local/libexec /usr/libexec /usr/sfw/bin /usr/sfw/sbin \ /usr/sfw/libexec /opt/sfw/bin /opt/sfw/sbin /opt/sfw/libexec \ /usr/xpg4/bin /usr/css/bin /usr/ucb /usr/X11R6/bin /usr/X11R7/bin \