Fixup a couple of shellcheck "fixes".
authorGerald Combs <gerald@wireshark.org>
Fri, 8 Jun 2018 23:17:41 +0000 (16:17 -0700)
committerGerald Combs <gerald@wireshark.org>
Fri, 8 Jun 2018 23:18:57 +0000 (23:18 +0000)
Change-Id: If3e6acf28c22cbc98a26c7e12c449e27fdc1321e
Reviewed-on: https://code.wireshark.org/review/28164
Reviewed-by: Gerald Combs <gerald@wireshark.org>
packaging/macosx/osx-app.sh.in

index 17cb5953945630fb414fb1cd163b9899d7e59eaa..1c92099eef40fbe0b4b4b9257895b8e4df8fdbe7 100755 (executable)
@@ -225,9 +225,7 @@ rpathify_file () {
        #
        # OK, what type of file is this?
        #
-       filetype=$( otool -hv "$1" | grep -E MH_MAGIC | awk '{print $5}' ; exit "${PIPESTATUS[0]}" )
-       RETVAL=$0
-       if [ "$RETVAL" -ne 0 ] ; then
+       if ! filetype=$( otool -hv "$1" | grep -E MH_MAGIC | awk '{print $5}' ; exit "${PIPESTATUS[0]}" ) ; then
                echo "Unable to rpathify $1 in $( pwd ): file type failed."
                exit 1
        fi
@@ -359,11 +357,14 @@ rpathify_dir () {
                #
                # Make sure we *have* files to fix
                #
-               files=$( ls "$2" 2>/dev/null )
+               # shellcheck disable=SC2086
+               files=$( ls $2 2>/dev/null )
                if [ ! -z "$files" ]; then
                        for file in $files; do
                                rpathify_file "$file" "$( pwd )"
                        done
+               else
+                       echo "no files found in $1"
                fi
                )
                rf_ret=$?