[27506] in Source-Commits
scripts commit: Quote variable in existence test
daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Tue Oct 8 16:18:05 2013
Date: Tue, 8 Oct 2013 16:17:57 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201310082017.r98KHvNJ003248@drugstore.mit.edu>
To: source-commits@MIT.EDU
https://github.com/mit-athena/scripts/commit/7bc7cb6ca27e173bd95a835907beddc47753d3f6
commit 7bc7cb6ca27e173bd95a835907beddc47753d3f6
Author: Jonathan Reed <jdreed@mit.edu>
Date: Tue Oct 8 16:16:36 2013 -0400
Quote variable in existence test
Thanks to a shell glob (which should die), $dir can contain more
than one path, which yields a syntax error unless $dir is quoted.
build-server/build-all/do-build | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/build-server/build-all/do-build b/build-server/build-all/do-build
index bd1d560..c22596a 100755
--- a/build-server/build-all/do-build
+++ b/build-server/build-all/do-build
@@ -16,7 +16,7 @@ tag=$(gettag $suite)
trap 'echo "An error occured. Press Enter to continue." >&2; echo -en "\a"; read ERROR; touch "$stamp.error"' EXIT
touch "$stamp.started"
dir=$(echo ${DEBATHENA_BUILD_AREA}/*/"${package#debathena-}")
-if [ ! -e $dir ]; then
+if [ ! -e "$dir" ]; then
dir=$(echo ${DEBATHENA_BUILD_AREA}/*/"${package}")
fi
[ -e "$dir" ]