summaryrefslogtreecommitdiffstats
path: root/tools/valgrind
diff options
context:
space:
mode:
authorthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-17 02:19:57 +0000
committerthomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-17 02:19:57 +0000
commit4855b874911cb79535e0bc275dbb51dd13bf6390 (patch)
tree1991dda702f9717c06a791c4dfd43854fc271925 /tools/valgrind
parent3cdb2f75f8ee53dceaa4f19ae6282e41fde649cc (diff)
downloadchromium_src-4855b874911cb79535e0bc275dbb51dd13bf6390.zip
chromium_src-4855b874911cb79535e0bc275dbb51dd13bf6390.tar.gz
chromium_src-4855b874911cb79535e0bc275dbb51dd13bf6390.tar.bz2
Quote a few more uses of the paths to make sure things work with spaces in dirs.
TEST=none BUG=none Review URL: http://codereview.chromium.org/172017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23539 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/valgrind')
-rwxr-xr-xtools/valgrind/build-valgrind-for-chromium.sh67
1 files changed, 35 insertions, 32 deletions
diff --git a/tools/valgrind/build-valgrind-for-chromium.sh b/tools/valgrind/build-valgrind-for-chromium.sh
index d36bac8..d07fc88 100755
--- a/tools/valgrind/build-valgrind-for-chromium.sh
+++ b/tools/valgrind/build-valgrind-for-chromium.sh
@@ -13,17 +13,17 @@ VEX_SVN_REV=1913
# and TSAN may be out of sync, so you have to check that out by rev anyway
TSAN_SVN_REV=1111
-THISDIR=`dirname $0`
-THISDIR=`cd $THISDIR && /bin/pwd`
+THISDIR=$(dirname "${0}")
+THISDIR=$(cd "${THISDIR}" && /bin/pwd)
-case x"$1" in
+case "x${1}" in
x|x/*) ;;
*)
echo "Usage: sh build-valgrind-for-chromium.sh [prefix]"
echo "Prefix is optional, but if present, must be the absolute path to where"
echo "you want to install valgrind's bin, include, and lib directories."
- echo "Prefix defaults to /usr/local/valgrind-$VALGRIND_SVN_REV, where"
- echo "$VALGRIND_SVN_REV is the revision used when retrieving valgrind from svn."
+ echo "Prefix defaults to /usr/local/valgrind-${VALGRIND_SVN_REV}, where"
+ echo "${VALGRIND_SVN_REV} is the revision used when retrieving valgrind from svn."
echo "Will use sudo to do the install if you don't own the parent of prefix."
exit 1
;;
@@ -32,37 +32,39 @@ esac
set -x
set -e
-if test x"$USE_TARBALL" = xyes && test x"$MAKE_TARBALL" = yes
+if test "x${USE_TARBALL}" = "xyes" && test "x${MAKE_TARBALL}" = "xyes"
then
echo Set only one of MAKE_TARBALL or USE_TARBALL to yes
exit 1
fi
-if test x"$USE_TARBALL" != xyes
+# Clean checkout our untar
+rm -rf "valgrind-${VALGRIND_SVN_REV}"
+
+if test "x${USE_TARBALL}" != "xyes"
then
# Check out latest version that following patches known to apply against
- rm -rf valgrind-$VALGRIND_SVN_REV
- svn co -r $VALGRIND_SVN_REV svn://svn.valgrind.org/valgrind/trunk valgrind-$VALGRIND_SVN_REV
+ svn co -r "${VALGRIND_SVN_REV}" "svn://svn.valgrind.org/valgrind/trunk" "valgrind-${VALGRIND_SVN_REV}"
- cd valgrind-$VALGRIND_SVN_REV
+ cd "valgrind-${VALGRIND_SVN_REV}"
# Make sure svn gets the right version of the external VEX repo, too
- svn update -r $VEX_SVN_REV VEX/
+ svn update -r "${VEX_SVN_REV}" VEX/
# Work around bug https://bugs.kde.org/show_bug.cgi?id=162848
# "fork() not handled properly"
- patch -p0 < "$THISDIR"/fork.patch
+ patch -p0 < "${THISDIR}/fork.patch"
# Add feature bug https://bugs.kde.org/show_bug.cgi?id=201170
# "Want --show-possible option so I can ignore the bazillion possible leaks..."
- patch -p0 < "$THISDIR"/possible.patch
+ patch -p0 < "${THISDIR}/possible.patch"
- if [ "$INSTALL_TSAN" = "yes" ]
+ if [ "${INSTALL_TSAN}" = "yes" ]
then
# Add ThreadSanitier to the installation.
# ThreadSanitizer is an experimental dynamic data race detector.
# See http://code.google.com/p/data-race-test/wiki/ThreadSanitizer
- svn checkout -r $TSAN_SVN_REV http://data-race-test.googlecode.com/svn/trunk/tsan tsan
+ svn checkout -r "${TSAN_SVN_REV}" http://data-race-test.googlecode.com/svn/trunk/tsan tsan
mkdir tsan/{docs,tests}
touch tsan/{docs,tests}/Makefile.am
patch -p 0 < tsan/valgrind.patch
@@ -72,30 +74,31 @@ then
cd ..
fi
-if test x"$MAKE_TARBALL" = xyes
+if test "x${MAKE_TARBALL}" = "xyes"
then
- tar -czvf valgrind-$VALGRIND_SVN_REV.tgz valgrind-$VALGRIND_SVN_REV
+ tar -czvf "valgrind-${VALGRIND_SVN_REV}.tgz" "valgrind-${VALGRIND_SVN_REV}"
fi
-if test x"$USE_TARBALL" = xyes
+if test "x${USE_TARBALL}" = "xyes"
then
- tar -xzvf valgrind-$VALGRIND_SVN_REV.tgz
+ tar -xzvf "valgrind-${VALGRIND_SVN_REV}.tgz"
fi
-if test x"$MAKE_TARBALL" != xyes
+if test "x${MAKE_TARBALL}" != "xyes"
then
- cd valgrind-$VALGRIND_SVN_REV
+ cd "valgrind-${VALGRIND_SVN_REV}"
+ OVERRIDE_LD_DIR="${THISDIR}/override_ld"
if ld --version | grep gold
then
# build/install-build-deps leaves original ld around, try using that
if test -x /usr/bin/ld.orig
then
echo "Using /usr/bin/ld.orig instead of gold to link valgrind"
- test -d $THISDIR/override_ld && rm -rf $THISDIR/override_ld
- mkdir $THISDIR/override_ld
- ln -s /usr/bin/ld.orig $THISDIR/override_ld/ld
- PATH="$THISDIR/override_ld:$PATH"
+ test -d "${OVERRIDE_LD_DIR}" && rm -rf "${OVERRIDE_LD_DIR}"
+ mkdir "${OVERRIDE_LD_DIR}"
+ ln -s /usr/bin/ld.orig "${OVERRIDE_LD_DIR}/ld"
+ PATH="${OVERRIDE_LD_DIR}:${PATH}"
else
echo "Cannot build valgrind with gold. Please switch to normal /usr/bin/ld, rerun this script, then switch back to gold."
exit 1
@@ -103,15 +106,15 @@ then
fi
# Desired parent directory for valgrind's bin, include, etc.
- PREFIX="${1:-/usr/local/valgrind-$VALGRIND_SVN_REV}"
- parent_of_prefix="`dirname $PREFIX`"
- if test ! -d "$parent_of_prefix"
+ PREFIX="${1:-/usr/local/valgrind-${VALGRIND_SVN_REV}}"
+ parent_of_prefix=$(dirname "${PREFIX}")
+ if test ! -d "${parent_of_prefix}"
then
- echo "Directory $parent_of_prefix does not exist"
+ echo "Directory ${parent_of_prefix} does not exist"
exit 1
fi
- ./configure --prefix="$PREFIX"
+ ./configure --prefix="${PREFIX}"
make -j4
if ./vg-in-place true
@@ -122,10 +125,10 @@ then
exit 1
fi
- test -d $THISDIR/override_ld && rm -rf $THISDIR/override_ld
+ test -d "${OVERRIDE_LD_DIR}" && rm -rf "${OVERRIDE_LD_DIR}"
# Don't use sudo if we own the destination
- if test -w "$parent_of_prefix"
+ if test -w "${parent_of_prefix}"
then
make install
else