set -ex -o pipefail
# Verify exactly 1 deb is in the path we expect
-set -- $WORKSPACE/packaging/packages/deb/opendaylight/*.deb
+set -- "$WORKSPACE"/packaging/packages/deb/opendaylight/*.deb
if [ $# -eq 1 ]; then
echo "Found one deb in build out dir, as expected"
else
fi
# If path is globbed (/path/to/*.deb), expand it
-path=$(sudo find / -wholename $WORKSPACE/packaging/packages/deb/opendaylight/*.deb)
+path=$(sudo find / -wholename "$WORKSPACE"/packaging/packages/deb/opendaylight/*.deb)
# If no deb found, fail clearly
-if [ -z $path ]; then
+if [ -z "$path" ]; then
echo "deb not found"
exit 1
fi
fi
# shellcheck disable=SC2034
-mapfile -t actual_deps < <( dpkg -I $WORKSPACE/packaging/packages/deb/opendaylight/*.deb | grep Depends | sed 's/Depends: //g' | sed 's/,/\n/g' )
+mapfile -t actual_deps < <( dpkg -I "$WORKSPACE"/packaging/packages/deb/opendaylight/*.deb | grep Depends | sed 's/Depends: //g' | sed 's/,/\n/g' )
# shellcheck disable=SC2154 disable=SC2145
printf 'Dependency found: %s\n' "${actual_deps[@]}"
# shellcheck disable=SC2154,SC2145,SC2034,SC2207
-diff_deps=(`echo "${expected_deps[@]}" "${actual_deps[@]}" | tr ' ' '\n' | sort | uniq -u`)
+diff_deps=($(echo "${expected_deps[@]}" "${actual_deps[@]}" | tr ' ' '\n' | sort | uniq -u))
# shellcheck disable=SC2154 disable=SC2145 disable=SC2068 disable=SC2170 disable=SC1083
if [ ${#diff_deps[*]} -eq 0 ]; then