From 92b5c31075f64cfe678f2f6250461e25fb3b91b6 Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Sun, 6 Nov 2011 23:13:36 +0000 Subject: [PATCH] Followup r102201, quote all variables to guard against paths with spaces in them. --- maintenance/dev/install.sh | 6 +++--- maintenance/dev/installmw.sh | 6 +++--- maintenance/dev/installphp.sh | 16 ++++++++-------- maintenance/dev/start.sh | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/maintenance/dev/install.sh b/maintenance/dev/install.sh index 067d687498..daa7888491 100755 --- a/maintenance/dev/install.sh +++ b/maintenance/dev/install.sh @@ -3,6 +3,6 @@ if [[ "x$BASH_SOURCE" == "x" ]]; then echo '$BASH_SOURCE not set'; exit 1; fi DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd) -$DEV/installphp.sh -$DEV/installmw.sh -$DEV/start.sh +"$DEV/installphp.sh" +"$DEV/installmw.sh" +"$DEV/start.sh" diff --git a/maintenance/dev/installmw.sh b/maintenance/dev/installmw.sh index 6146b3350e..5d2cd64eda 100755 --- a/maintenance/dev/installmw.sh +++ b/maintenance/dev/installmw.sh @@ -7,10 +7,10 @@ set -e PORT=4881 -cd $DEV/../../; # $IP +cd "$DEV/../../"; # $IP -mkdir $DEV/data -$DEV/php/bin/php maintenance/install.php --server="http://localhost:$PORT" --scriptpath="" --dbtype=sqlite --dbpath=$DEV/data --pass=admin "Trunk Test" $USER +mkdir "$DEV/data" +"$DEV/php/bin/php" maintenance/install.php --server="http://localhost:$PORT" --scriptpath="" --dbtype=sqlite --dbpath="$DEV/data" --pass=admin "Trunk Test" "$USER" echo "" echo "Development wiki created with admin user $USER and password 'admin'." echo "" diff --git a/maintenance/dev/installphp.sh b/maintenance/dev/installphp.sh index 7ab3a673ce..b3285f3214 100755 --- a/maintenance/dev/installphp.sh +++ b/maintenance/dev/installphp.sh @@ -5,25 +5,25 @@ DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd) set -e # DO NOT USE PIPES unless this is rewritten -if [ -d $DEV/php ]; then +if [ -d "$DEV/php" ]; then echo "PHP is already installed" exit 1 fi TAR=php5.4-latest.tar.gz -PHPURL=http://snaps.php.net/$TAR +PHPURL="http://snaps.php.net/$TAR" -cd $DEV +cd "$DEV" # Some debain-like systems bundle wget but not curl, some other systems # like os x bundle curl but not wget... use whatever is available echo -n "Downloading PHP 5.4" if command -v wget &>/dev/null; then echo "- using wget" - wget $PHPURL + wget "$PHPURL" elif command -v curl &>/dev/null; then echo "- using curl" - curl -O $PHPURL + curl -O "$PHPURL" else echo "- aborting" echo "Could not find curl or wget." >&2; @@ -31,11 +31,11 @@ else fi echo "Extracting php 5.4" -tar -xzf $TAR +tar -xzf "$TAR" cd php5.4-*/ -echo "Configuring and installing php 5.4 in $IP/maintenance/dev/php/" -./configure --prefix=$DEV/php/ +echo "Configuring and installing php 5.4 in \$IP/maintenance/dev/php/" +./configure --prefix="$DEV/php/" make make install diff --git a/maintenance/dev/start.sh b/maintenance/dev/start.sh index 9736c8b3b1..8904556673 100755 --- a/maintenance/dev/start.sh +++ b/maintenance/dev/start.sh @@ -8,5 +8,5 @@ PORT=4881 echo "Starting up MediaWiki at http://localhost:$PORT/" echo "" -cd $DEV/../../; # $IP -$DEV/php/bin/php -S localhost:$PORT +cd "$DEV/../../"; # $IP +"$DEV/php/bin/php" -S "localhost:$PORT" -- 2.20.1