summaryrefslogtreecommitdiff
path: root/tests/shrink-rpath-with-allowed-prefixes.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shrink-rpath-with-allowed-prefixes.sh')
-rwxr-xr-xtests/shrink-rpath-with-allowed-prefixes.sh42
1 files changed, 21 insertions, 21 deletions
diff --git a/tests/shrink-rpath-with-allowed-prefixes.sh b/tests/shrink-rpath-with-allowed-prefixes.sh
index db24da2..aca8d06 100755
--- a/tests/shrink-rpath-with-allowed-prefixes.sh
+++ b/tests/shrink-rpath-with-allowed-prefixes.sh
@@ -1,47 +1,47 @@
#! /bin/sh -e
-SCRATCH=scratch/$(basename $0 .sh)
+SCRATCH=scratch/$(basename "$0" .sh)
-rm -rf ${SCRATCH}
-mkdir -p ${SCRATCH}
-mkdir -p ${SCRATCH}/libsA
-mkdir -p ${SCRATCH}/libsB
+rm -rf "${SCRATCH}"
+mkdir -p "${SCRATCH}"
+mkdir -p "${SCRATCH}/libsA"
+mkdir -p "${SCRATCH}/libsB"
-cp main ${SCRATCH}/
-cp libfoo.so libbar.so ${SCRATCH}/libsA/
-cp libfoo.so libbar.so ${SCRATCH}/libsB/
+cp main "${SCRATCH}"/
+cp libfoo.so libbar.so "${SCRATCH}/libsA/"
+cp libfoo.so libbar.so "${SCRATCH}/libsB/"
-oldRPath=$(../src/patchelf --print-rpath ${SCRATCH}/main)
+oldRPath=$(../src/patchelf --print-rpath "${SCRATCH}/main")
if test -z "$oldRPath"; then oldRPath="/oops"; fi
pathA="$(pwd)/${SCRATCH}/libsA"
pathB="$(pwd)/${SCRATCH}/libsB"
-../src/patchelf --force-rpath --set-rpath $oldRPath:$pathA:$pathB ${SCRATCH}/main
+../src/patchelf --force-rpath --set-rpath "$oldRPath:$pathA:$pathB" "${SCRATCH}/main"
-cp ${SCRATCH}/main ${SCRATCH}/mainA
-cp ${SCRATCH}/main ${SCRATCH}/mainB
+cp "${SCRATCH}"/main "${SCRATCH}/mainA"
+cp "${SCRATCH}"/main "${SCRATCH}/mainB"
-../src/patchelf --shrink-rpath ${SCRATCH}/main
-../src/patchelf --shrink-rpath --allowed-rpath-prefixes $oldRPath:$pathA ${SCRATCH}/mainA
-../src/patchelf --shrink-rpath --allowed-rpath-prefixes $oldRPath:$pathB ${SCRATCH}/mainB
+../src/patchelf --shrink-rpath "${SCRATCH}/main"
+../src/patchelf --shrink-rpath --allowed-rpath-prefixes "$oldRPath:$pathA" "${SCRATCH}/mainA"
+../src/patchelf --shrink-rpath --allowed-rpath-prefixes "$oldRPath:$pathB" "${SCRATCH}/mainB"
check() {
exe=$1
mustContain=$2
mustNotContain=$3
- rpath=$(../src/patchelf --print-rpath $exe)
+ rpath=$(../src/patchelf --print-rpath "$exe")
echo "RPATH of $exe after: $rpath"
- if ! echo "$rpath" | grep -q $mustContain; then
+ if ! echo "$rpath" | grep -q "$mustContain"; then
echo "RPATH didn't contain '$mustContain' when it should have"
exit 1
fi
- if echo "$rpath" | grep -q $mustNotContain; then
+ if echo "$rpath" | grep -q "$mustNotContain"; then
echo "RPATH contained '$mustNotContain' when it shouldn't have"
exit 1
fi
}
-check ${SCRATCH}/main $pathA $pathB
-check ${SCRATCH}/mainA $pathA $pathB
-check ${SCRATCH}/mainB $pathB $pathA
+check "${SCRATCH}/main" "$pathA" "$pathB"
+check "${SCRATCH}/mainA" "$pathA" "$pathB"
+check "${SCRATCH}/mainB" "$pathB" "$pathA"