From 5ac6812ba5bc36a50eb60e7aa458d99bf32d6371 Mon Sep 17 00:00:00 2001 From: mboelen Date: Mon, 13 Oct 2014 20:07:19 +0200 Subject: [PATCH] Skip directory if it has already been found, or its symlink --- include/binaries | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/binaries b/include/binaries index 2c685107..0a1ff249 100644 --- a/include/binaries +++ b/include/binaries @@ -52,10 +52,6 @@ logtext "Result: found the path behind this symlink (${SCANDIR} --> ${sFILE})" ORGPATH="${SCANDIR}" SCANDIR="${sFILE}" - FIND=`echo ${SCANNEDPATHS} | grep ", ${SCANDIR}"` - if [ ! "${FIND}" = "" ]; then - SKIPDIR=1; logtext "Result: Skipping this directory as it is a symlink and was already scanned" - fi else SKIPDIR=1; logtext "Result: Symlink variable empty, or directory to symlink is non-existing" fi @@ -63,6 +59,12 @@ SKIPDIR=1; logtext "Result: Could not find the location of this symlink, or is not a directory" fi fi + + FIND=`echo ${SCANNEDPATHS} | grep ", ${SCANDIR}"` + if [ ! "${FIND}" = "" ]; then + SKIPDIR=1; logtext "Result: Skipping this directory as it was already scanned" + fi + if [ ${SKIPDIR} -eq 0 ]; then logtext "Test: Checking binaries in directory ${SCANDIR}" Display --indent 4 --text "- ${SCANDIR}" --result FOUND --color GREEN @@ -174,7 +176,7 @@ done else logtext "Result: Directory ${SCANDIR} skipped" - Display --indent 4 --text "- ${SCANDIR} (symlinked from ${ORGPATH})" --result SKIPPED --color YELLOW + Display --indent 4 --text "- ${SCANDIR}" --result SKIPPED --color YELLOW fi else Display --indent 4 --text "- ${SCANDIR}" --result "NOT FOUND" --color WHITE