From: Steve M. <svn...@pl...> - 2008-11-30 20:28:43
|
Author: smcmahon Date: Sun Nov 30 20:28:36 2008 New Revision: 23516 Modified: Installers/UnifiedInstaller/trunk/helper_scripts/build_libjpeg.sh Installers/UnifiedInstaller/trunk/helper_scripts/build_python.sh Installers/UnifiedInstaller/trunk/helper_scripts/build_readline.sh Installers/UnifiedInstaller/trunk/helper_scripts/build_zlib.sh Installers/UnifiedInstaller/trunk/install.sh Installers/UnifiedInstaller/trunk/tests/tests.txt Log: Add lots more shell quoting to deal with paths with spaces. Modified: Installers/UnifiedInstaller/trunk/helper_scripts/build_libjpeg.sh ============================================================================== --- Installers/UnifiedInstaller/trunk/helper_scripts/build_libjpeg.sh (original) +++ Installers/UnifiedInstaller/trunk/helper_scripts/build_libjpeg.sh Sun Nov 30 20:28:36 2008 @@ -4,7 +4,7 @@ # if [ "x$UNIVERSALSDK" != "x" ]; then - CFLAGS="-fPIC -isysroot $UNIVERSALSDK -arch ppc -arch i386 -Wl,-syslibroot,$UNIVERSALSDK" + CFLAGS="-fPIC -isysroot \"$UNIVERSALSDK\" -arch ppc -arch i386 -Wl,-syslibroot,\"$UNIVERSALSDK\"" else CFLAGS='-fPIC' fi @@ -42,23 +42,23 @@ mkdir /usr/local/man/man1 fi - cd $PKG - untar $JPEG_TB - chmod -R 775 $JPEG_DIR - cd $JPEG_DIR + cd "$PKG" + untar "$JPEG_TB" + chmod -R 775 "$JPEG_DIR" + cd "$JPEG_DIR" # Oddities to workaround: on Mac OS X, using the "--enable-static" # flag will cause the make to fail. So, we need to manually # create and place the static library. ./configure CFLAGS="$CFLAGS" >> $INSTALL_LOG 2>&1 - $GNU_MAKE >> $INSTALL_LOG 2>&1 - $GNU_MAKE install >> $INSTALL_LOG 2>&1 + "$GNU_MAKE" >> $INSTALL_LOG 2>&1 + "$GNU_MAKE" install >> $INSTALL_LOG 2>&1 ranlib libjpeg.a cp libjpeg.a /usr/local/lib cp *.h /usr/local/include - cd $PKG - if [ -d $JPEG_DIR ] + cd "$PKG" + if [ -d "$JPEG_DIR" ] then - rm -rf $JPEG_DIR + rm -rf "$JPEG_DIR" fi if [ ! -e "/usr/local/lib/libjpeg.a" ] @@ -71,29 +71,29 @@ then echo "Compiling and installing jpeg local libraries ..." - mkdir $LOCAL_HOME/lib >> $INSTALL_LOG 2>&1 - mkdir $LOCAL_HOME/bin >> $INSTALL_LOG 2>&1 - mkdir $LOCAL_HOME/include >> $INSTALL_LOG 2>&1 - mkdir $LOCAL_HOME/man >> $INSTALL_LOG 2>&1 - mkdir $LOCAL_HOME/man/man1 >> $INSTALL_LOG 2>&1 + mkdir "$LOCAL_HOME/lib" >> $INSTALL_LOG 2>&1 + mkdir "$LOCAL_HOME/bin" >> $INSTALL_LOG 2>&1 + mkdir "$LOCAL_HOME/include" >> $INSTALL_LOG 2>&1 + mkdir "$LOCAL_HOME/man" >> $INSTALL_LOG 2>&1 + mkdir "$LOCAL_HOME/man/man1" >> $INSTALL_LOG 2>&1 - cd $PKG - untar $JPEG_TB - chmod -R 775 $JPEG_DIR - cd $JPEG_DIR + cd "$PKG" + untar "$JPEG_TB" + chmod -R 775 "$JPEG_DIR" + cd "$JPEG_DIR" # Oddities to workaround: on Mac OS X, using the "--enable-static" # flag will cause the make to fail. So, we need to manually # create and place the static library. - ./configure CFLAGS="$CFLAGS" --prefix=$LOCAL_HOME >> $INSTALL_LOG 2>&1 - $GNU_MAKE >> $INSTALL_LOG 2>&1 - $GNU_MAKE install >> $INSTALL_LOG 2>&1 + ./configure CFLAGS="$CFLAGS" --prefix="$LOCAL_HOME" >> $INSTALL_LOG 2>&1 + "$GNU_MAKE" >> $INSTALL_LOG 2>&1 + "$GNU_MAKE" install >> $INSTALL_LOG 2>&1 # --enable-static flag doesn't work on OS X, make sure # we get an install anyway if [ ! -e "$LOCAL_HOME/lib/libjpeg.a" ] then ranlib libjpeg.a - cp libjpeg.a $LOCAL_HOME/lib - cp *.h $LOCAL_HOME/include + cp libjpeg.a "$LOCAL_HOME/lib" + cp *.h "$LOCAL_HOME/include" fi if [ ! -e "$LOCAL_HOME/lib/libjpeg.a" ] @@ -104,12 +104,12 @@ fi cd $PKG - if [ -d $JPEG_DIR ] + if [ -d "$JPEG_DIR" ] then - rm -rf $JPEG_DIR + rm -rf "$JPEG_DIR" fi else echo "Skipping libjpeg compile/install" fi -cd $CWD \ No newline at end of file +cd "$CWD" \ No newline at end of file Modified: Installers/UnifiedInstaller/trunk/helper_scripts/build_python.sh ============================================================================== --- Installers/UnifiedInstaller/trunk/helper_scripts/build_python.sh (original) +++ Installers/UnifiedInstaller/trunk/helper_scripts/build_python.sh Sun Nov 30 20:28:36 2008 @@ -5,10 +5,10 @@ # $LastChangedDate$ $LastChangedRevision$ echo "Installing Python 2.4.5. This takes a while..." -cd $PKG -untar $PYTHON_TB -chmod -R 775 $PYTHON_DIR -cd $PYTHON_DIR +cd "$PKG" +untar "$PYTHON_TB" +chmod -R 775 "$PYTHON_DIR" +cd "$PYTHON_DIR" # Look for Darwin if [ `uname` = 'Darwin' ]; then @@ -35,17 +35,17 @@ if [ $NEED_LOCAL -eq 1 ]; then ./configure $EXFLAGS \ - --prefix=$PY_HOME \ + --prefix="$PY_HOME" \ --with-readline \ --with-zlib \ --disable-tk \ - --with-gcc="$GCC -I$LOCAL_HOME/include" \ - --with-cxx="$GPP -I$LOCAL_HOME/include" \ - LDFLAGS="-L$LOCAL_HOME/lib" \ - >> $INSTALL_LOG 2>&1 + --with-gcc="$GCC -I\"$LOCAL_HOME\"/include" \ + --with-cxx="$GPP -I\"$LOCAL_HOME\"/include" \ + LDFLAGS="-L\"$LOCAL_HOME\"/lib" \ + >> "$INSTALL_LOG" 2>&1 else ./configure $EXFLAGS \ - --prefix=$PY_HOME \ + --prefix="$PY_HOME" \ --with-readline \ --with-zlib \ --disable-tk \ @@ -53,12 +53,12 @@ --with-cxx="$GPP" \ >> $INSTALL_LOG 2>&1 fi -$GNU_MAKE >> $INSTALL_LOG 2>&1 -$GNU_MAKE install >> $INSTALL_LOG 2>&1 -cd $PKG -if [ -d $PYTHON_DIR ] +"$GNU_MAKE" >> $INSTALL_LOG 2>&1 +"$GNU_MAKE" install >> $INSTALL_LOG 2>&1 +cd "$PKG" +if [ -d "$PYTHON_DIR" ] then - rm -rf $PYTHON_DIR + rm -rf "$PYTHON_DIR" fi if [ ! -x "$PY_HOME/bin/python" ] then @@ -66,7 +66,7 @@ seelog exit 1 fi -$PY_HOME/bin/python -c "'test'.encode('zip')" +"$PY_HOME/bin/python" -c "'test'.encode('zip')" if [ $? -gt 0 ] then echo "Python zlib support is missing; something went wrong in the zlib or python build." @@ -74,4 +74,4 @@ exit 1 fi -cd $CWD \ No newline at end of file +cd "$CWD" \ No newline at end of file Modified: Installers/UnifiedInstaller/trunk/helper_scripts/build_readline.sh ============================================================================== --- Installers/UnifiedInstaller/trunk/helper_scripts/build_readline.sh (original) +++ Installers/UnifiedInstaller/trunk/helper_scripts/build_readline.sh Sun Nov 30 20:28:36 2008 @@ -6,26 +6,26 @@ then echo "Compiling and installing readline local libraries ..." - mkdir $LOCAL_HOME/lib >> $INSTALL_LOG 2>&1 - mkdir $LOCAL_HOME/bin >> $INSTALL_LOG 2>&1 - mkdir $LOCAL_HOME/include >> $INSTALL_LOG 2>&1 - mkdir $LOCAL_HOME/man >> $INSTALL_LOG 2>&1 - mkdir $LOCAL_HOME/man/man1 >> $INSTALL_LOG 2>&1 + mkdir "$LOCAL_HOME/lib" >> $INSTALL_LOG 2>&1 + mkdir "$LOCAL_HOME/bin" >> $INSTALL_LOG 2>&1 + mkdir "$LOCAL_HOME/include" >> $INSTALL_LOG 2>&1 + mkdir "$LOCAL_HOME/man" >> $INSTALL_LOG 2>&1 + mkdir "$LOCAL_HOME/man/man1" >> $INSTALL_LOG 2>&1 - cd $PKG - untar $READLINE_TB - chmod -R 775 $READLINE_DIR - cd $READLINE_DIR + cd "$PKG" + untar "$READLINE_TB" + chmod -R 775 "$READLINE_DIR" + cd "$READLINE_DIR" if [ "x$UNIVERSALSDK" != "x" ]; then - CFLAGS="-fPIC -isysroot $UNIVERSALSDK -arch ppc -arch i386 -Wl,-syslibroot,$UNIVERSALSDK" + CFLAGS="-fPIC -isysroot \"$UNIVERSALSDK\" -arch ppc -arch i386 -Wl,-syslibroot,\"$UNIVERSALSDK\"" else CFLAGS='-fPIC' fi ./configure CFLAGS="$CFLAGS" \ --disable-shared \ - --prefix=$LOCAL_HOME >> $INSTALL_LOG 2>&1 - $GNU_MAKE >> $INSTALL_LOG 2>&1 - $GNU_MAKE install >> $INSTALL_LOG 2>&1 + --prefix="$LOCAL_HOME" >> $INSTALL_LOG 2>&1 + "$GNU_MAKE" >> $INSTALL_LOG 2>&1 + "$GNU_MAKE" install >> $INSTALL_LOG 2>&1 if [ ! -e "$LOCAL_HOME/lib/libreadline.a" ] then @@ -35,9 +35,9 @@ fi cd $PKG - if [ -d $READLINE_DIR ] + if [ -d "$READLINE_DIR" ] then - rm -rf $READLINE_DIR + rm -rf "$READLINE_DIR" fi else echo "Skipping readline compile/install" Modified: Installers/UnifiedInstaller/trunk/helper_scripts/build_zlib.sh ============================================================================== --- Installers/UnifiedInstaller/trunk/helper_scripts/build_zlib.sh (original) +++ Installers/UnifiedInstaller/trunk/helper_scripts/build_zlib.sh Sun Nov 30 20:28:36 2008 @@ -10,17 +10,17 @@ if [ "X$INSTALL_ZLIB" = "Xglobal" ] then echo "Compiling and installing zlib ..." - cd $PKG - untar $ZLIB_TB - chmod -R 775 $ZLIB_DIR + cd "$PKG" + untar "$ZLIB_TB" + chmod -R 775 "$ZLIB_DIR" cd $ZLIB_DIR CFLAGS="-fPIC" ./configure >> $INSTALL_LOG 2>&1 - $GNU_MAKE test >> $INSTALL_LOG 2>&1 - $GNU_MAKE install >> $INSTALL_LOG 2>&1 - cd $PKG - if [ -d $ZLIB_DIR ] + "$GNU_MAKE" test >> $INSTALL_LOG 2>&1 + "$GNU_MAKE" install >> $INSTALL_LOG 2>&1 + cd "$PKG" + if [ -d "$ZLIB_DIR" ] then - rm -rf $ZLIB_DIR + rm -rf "$ZLIB_DIR" fi if [ ! -e "$/usr/local/lib/libz.a" ] then @@ -31,18 +31,18 @@ elif [ "X$INSTALL_ZLIB" = "Xlocal" ] && [ ! -e "$LOCAL_HOME/lib/libz.a" ] then echo "Compiling and installing local zlib ..." - cd $PKG - untar $ZLIB_TB - chmod -R 775 $ZLIB_DIR - cd $ZLIB_DIR - CFLAGS="-fPIC" ./configure --prefix=$LOCAL_HOME >> $INSTALL_LOG 2>&1 + cd "$PKG" + untar "$ZLIB_TB" + chmod -R 775 "$ZLIB_DIR" + cd "$ZLIB_DIR" + CFLAGS="-fPIC" ./configure --prefix="$LOCAL_HOME" >> $INSTALL_LOG 2>&1 $GNU_MAKE >> $INSTALL_LOG 2>&1 $GNU_MAKE test >> $INSTALL_LOG 2>&1 $GNU_MAKE install >> $INSTALL_LOG 2>&1 - cd $PKG - if [ -d $ZLIB_DIR ] + cd "$PKG" + if [ -d "$ZLIB_DIR" ] then - rm -rf $ZLIB_DIR + rm -rf "$ZLIB_DIR" fi if [ ! -e "$LOCAL_HOME/lib/libz.a" ] then @@ -54,4 +54,4 @@ echo "Skipping zlib compile and install" fi -cd $CWD \ No newline at end of file +cd "$CWD" \ No newline at end of file Modified: Installers/UnifiedInstaller/trunk/install.sh ============================================================================== --- Installers/UnifiedInstaller/trunk/install.sh (original) +++ Installers/UnifiedInstaller/trunk/install.sh Sun Nov 30 20:28:36 2008 @@ -213,7 +213,7 @@ case $option in --with-python=* | -with-python=* | --with_python=* | -with_python=* ) - if [ $optarg ]; then + if [ "$optarg" ]; then WITH_PYTHON=$optarg else usage @@ -221,7 +221,7 @@ ;; --target=* | -target=* ) - if [ $optarg ]; then + if [ "$optarg" ]; then PLONE_HOME=$optarg else usage @@ -229,7 +229,7 @@ ;; --instance=* | -instance=* ) - if [ $optarg ]; then + if [ "$optarg" ]; then INSTANCE_NAME=$optarg else usage @@ -301,7 +301,7 @@ --enable-universalsdk ) export MACOSX_DEPLOYMENT_TARGET=10.4 - if [ $optarg ]; then + if [ "$optarg" ]; then UNIVERSALSDK=$optarg else UNIVERSALSDK=/Developer/SDKs/MacOSX10.4u.sdk @@ -353,7 +353,7 @@ if [ $SKIP_TOOL_TESTS -eq 0 ]; then # Abort install if this script is not run from within it's parent folder - if [ ! -x $PACKAGES_DIR ] || [ ! -x $HSCRIPTS_DIR ]; then + if [ ! -x "$PACKAGES_DIR" ] || [ ! -x "$HSCRIPTS_DIR" ]; then echo "" echo "The install script directory must contain" echo "$PACKAGES_DIR and $HSCRIPTS_DIR subdirectories." @@ -364,17 +364,17 @@ # set up log -if [ -e $INSTALL_LOG ]; then - rm $INSTALL_LOG +if [ -e "$INSTALL_LOG" ]; then + rm "$INSTALL_LOG" fi -touch $INSTALL_LOG 2> /dev/null +touch "$INSTALL_LOG" 2> /dev/null if [ $? -gt 0 ]; then echo "Unable to write to ${INSTALL_LOG}; detailed log will go to stdout." INSTALL_LOG="/dev/stdout" else echo "Detailed installation log being written to $INSTALL_LOG" - echo "Detailed installation log" > $INSTALL_LOG - echo "Starting at `date`" >> $INSTALL_LOG + echo "Detailed installation log" > "$INSTALL_LOG" + echo "Starting at `date`" >> "$INSTALL_LOG" fi seelog () { echo @@ -388,15 +388,15 @@ # unpack a tar archive, decompressing as necessary. # this function is meant to isolate us from problems # with versions of tar that don't support .gz or .bz2. - case $1 in + case "$1" in *.tar) - $GNU_TAR -xf $1 >> $INSTALL_LOG + "$GNU_TAR" -xf "$1" >> "$INSTALL_LOG" ;; *.tgz | *.tar.gz) - $GUNZIP -c $1 | $GNU_TAR -xf - >> $INSTALL_LOG + "$GUNZIP" -c "$1" | "$GNU_TAR" -xf - >> "$INSTALL_LOG" ;; *.tar.bz2) - $BUNZIP2 -c $1 | $GNU_TAR -xf - >> $INSTALL_LOG + $BUNZIP2 -c $1 | $GNU_TAR -xf - >> "$INSTALL_LOG" ;; *) echo "Unable to unpack $1; extension not recognized." @@ -412,8 +412,8 @@ OFFLINE=1 -if [ ! -e $PACKAGES_DIR ]; then - if [ -e $ONLINE_PACKAGES_DIR ]; then +if [ ! -e "$PACKAGES_DIR" ]; then + if [ -e "$ONLINE_PACKAGES_DIR" ]; then # we don't have the full packages directory, # but do have the less-complete version meant for online install. echo "Running in online mode." @@ -426,30 +426,31 @@ fi -if [ $OFFLINE -ne 1 ] && [ ! $WITH_PYTHON ]; then +if [ $OFFLINE -ne 1 ] && [ "x$WITH_PYTHON" = "x" ]; then # we don't have a python tarball or a --with-python # specification; so let's see if we can find a system # python WITH_PYTHON=`which python2.4` - if [ $? -gt 0 ] || [ ! -x $WITH_PYTHON ]; then + if [ $? -gt 0 ] || [ ! -x "$WITH_PYTHON" ]; then echo echo "Installation has failed." - echo "Unable to find a Python 2.4 executable or tarball" + echo "Unable to find a Python 2.4 executable or tarball." + echo "Use --with-python=... to specify a Python executable." exit 1 fi fi # If --with-python has been used, check the argument for our requirements. -if [ $WITH_PYTHON ]; then - if [ -x $WITH_PYTHON ] && [ ! -d $WITH_PYTHON ]; then +if [ "$WITH_PYTHON" ]; then + if [ -x "$WITH_PYTHON" ] && [ ! -d "$WITH_PYTHON" ]; then echo "\nTesting $WITH_PYTHON for Zope/Plone requirements...." - if $WITH_PYTHON $HSCRIPTS_DIR/checkPython.py + if "$WITH_PYTHON" "$HSCRIPTS_DIR"/checkPython.py then echo "$WITH_PYTHON looks OK. We'll try to use it." echo # if the supplied Python is adequate, we don't need to build libraries INSTALL_ZLIB=no - if $PY -c "import _imaging" 2> /dev/null + if "$WITH_PYTHON" -c "import _imaging" 2> /dev/null then INSTALL_JPEG=no fi @@ -488,44 +489,44 @@ if [ $SKIP_TOOL_TESTS -eq 0 ]; then # Abort install if no gcc - GCC=`which "$GCC"` >> $INSTALL_LOG 2>&1 + GCC=`which "$GCC"` >> "$INSTALL_LOG" 2>&1 if [ $? -gt 0 ] || [ ! $GCC ] || [ ! -x $GCC ]; then echo "Note: gcc is required for the install. Exiting now." exit 1 fi # Abort install if no g++ - GPP=`which "$GPP"` >> $INSTALL_LOG 2>&1 - if [ $? -gt 0 ] || [ ! $GPP ] || [ ! -x $GPP ]; then + GPP=`which "$GPP"` >> "$INSTALL_LOG" 2>&1 + if [ $? -gt 0 ] || [ ! "$GPP" ] || [ ! -x "$GPP" ]; then echo "Note: g++ is required for the install. Exiting now." exit 1 fi # Abort install if no make - GNU_MAKE=`which "$GNU_MAKE"` >> $INSTALL_LOG 2>&1 - if [ $? -gt 0 ] || [ ! $GNU_MAKE ] || [ ! -x $GNU_MAKE ]; then + GNU_MAKE=`which "$GNU_MAKE"` >> "$INSTALL_LOG" 2>&1 + if [ $? -gt 0 ] || [ ! "$GNU_MAKE" ] || [ ! -x "$GNU_MAKE" ]; then echo "Note: make is required for the install. Exiting now." exit 1 fi # Abort install if no tar - GNU_TAR=`which "$GNU_TAR"` >> $INSTALL_LOG 2>&1 - if [ $? -gt 0 ] || [ ! $GNU_TAR ] || [ ! -x $GNU_TAR ]; then + GNU_TAR=`which "$GNU_TAR"` >> "$INSTALL_LOG" 2>&1 + if [ $? -gt 0 ] || [ "x$GNU_TAR" = "x" ] || [ ! -x "$GNU_TAR" ]; then echo "Note: gnu tar is required for the install. Exiting now." exit 1 fi fi # not skip tool tests # Abort install if no gunzip -GUNZIP=`which "$GUNZIP"` >> $INSTALL_LOG 2>&1 -if [ $? -gt 0 ] || [ ! $GUNZIP ] || [ ! -x $GUNZIP ]; then +GUNZIP=`which "$GUNZIP"` >> "$INSTALL_LOG" 2>&1 +if [ $? -gt 0 ] || [ "x$GUNZIP" = "x" ] || [ ! -x "$GUNZIP" ]; then echo "Note: gunzip is required for the install. Exiting now." exit 1 fi # Abort install if no bunzip2 -BUNZIP2=`which "$BUNZIP2"` >> $INSTALL_LOG 2>&1 -if [ $? -gt 0 ] || [ ! $BUNZIP2 ] || [ ! -x $BUNZIP2 ]; then +BUNZIP2=`which "$BUNZIP2"` >> "$INSTALL_LOG" 2>&1 +if [ $? -gt 0 ] || [ "x$BUNZIP2" = "x" ] || [ ! -x "$BUNZIP2" ]; then echo "Note: bunzip2 is required for the install. Exiting now." exit 1 fi @@ -546,21 +547,21 @@ ####################################### # create plone home -if [ ! -x $PLONE_HOME ]; then - mkdir $PLONE_HOME +if [ ! -x "$PLONE_HOME" ]; then + mkdir "$PLONE_HOME" # normalize $PLONE_HOME so we can use it in prefixes fi -if [ ! -x $PLONE_HOME ]; then +if [ ! -x "$PLONE_HOME" ]; then echo "Unable to create $PLONE_HOME" exit 1 fi -cd $PLONE_HOME +cd "$PLONE_HOME" PLONE_HOME=`pwd` # More paths if [ ! "x$INSTANCE_NAME" = "x" ]; then # override instance home - if echo $INSTANCE_NAME | grep "/" + if echo "$INSTANCE_NAME" | grep "/" then # we have a full destination, not just a name ZEOCLUSTER_HOME=$INSTANCE_NAME @@ -574,7 +575,7 @@ RINSTANCE_HOME=$PLONE_HOME/$RINSTANCE_HOME fi -cd $CWD +cd "$CWD" if [ "X$INSTALL_ZLIB" = "Xlocal" ] || [ "X$INSTALL_JPEG" = "Xlocal" ]; then NEED_LOCAL=1 @@ -584,34 +585,34 @@ if [ $WITH_PYTHON ] # try to use specified python then - PYBNAME=`basename $WITH_PYTHON` + PYBNAME=`basename "$WITH_PYTHON"` PY_HOME=$PLONE_HOME/Python-2.4 - cd $PKG - tar -zxf $VENV_TB + cd "$PKG" + untar $VENV_TB cd $VENV_DIR echo "Creating python virtual environment..." - $WITH_PYTHON virtualenv.py $PY_HOME - cd $PKG + "$WITH_PYTHON" virtualenv.py "$PY_HOME" + cd "$PKG" rm -r $VENV_DIR - if [ ! -x $PY ]; then + if [ ! -x "$PY" ]; then echo "\nFailed to create virtual environment for $WITH_PYTHON" exit 1 fi - cd $PY_HOME/bin + cd "$PY_HOME"/bin if [ ! -x python ]; then # add a symlink so that it's easy to use - ln -s $PYBNAME python + ln -s "$PYBNAME" python fi - cd $CWD + cd "$CWD" PY=$PY_HOME/bin/python else # use already-placed python or build one PY_HOME=$PLONE_HOME/Python-2.4 PY=$PY_HOME/bin/python - if [ -x $PY ]; then + if [ -x "$PY" ]; then # no point in installing zlib -- too late! INSTALL_ZLIB=no # let's see if we've already got PIL - if $PY -c "import _imaging" 2> /dev/null + if "$PY" -c "import _imaging" 2> /dev/null then INSTALL_JPEG=no fi @@ -626,10 +627,10 @@ BUILDOUT_CACHE=$PLONE_HOME/buildout-cache -if [ ! -x $LOCAL_HOME ]; then - mkdir $LOCAL_HOME +if [ ! -x "$LOCAL_HOME" ]; then + mkdir "$LOCAL_HOME" fi -if [ ! -x $LOCAL_HOME ]; then +if [ ! -x "$LOCAL_HOME" ]; then echo "Unable to create $LOCAL_HOME" exit 1 fi @@ -641,22 +642,22 @@ . helper_scripts/build_readline.sh -if [ -x $PY ]; then +if [ -x "$PY" ]; then echo "Python found at $PY; Skipping Python install." else . helper_scripts/build_python.sh fi -if [ ! -x $EI ]; then +if [ ! -x "$EI" ]; then echo "Installing setuptools..." - cd $PKG - untar $SETUP_TB - cd $SETUP_DIR - $PY ./setup.py install >> $INSTALL_LOG 2>&1 - cd $PKG - rm -r $SETUP_DIR - if [ ! -x $EI ]; then + cd "$PKG" + untar "$SETUP_TB" + cd "$SETUP_DIR" + "$PY" ./setup.py install >> "$INSTALL_LOG" 2>&1 + cd "$PKG" + rm -r "$SETUP_DIR" + if [ ! -x "$EI" ]; then echo "$EI missing. Aborting." seelog exit 1 @@ -664,12 +665,12 @@ fi -$PY -c "import _imaging" 2> /dev/null +"$PY" -c "import _imaging" 2> /dev/null if [ $? -gt 0 ]; then echo "Installing PIL" - cd $PKG - $EI PIL* >> $INSTALL_LOG 2>&1 - $PY -c "import _imaging" > /dev/null + cd "$PKG" + "$EI" PIL* >> "$INSTALL_LOG" 2>&1 + "$PY" -c "import _imaging" > /dev/null if [ $? -gt 0 ]; then echo "Python imaging support is missing; something went wrong in the PIL or python build." seelog @@ -678,17 +679,17 @@ fi -$PY -c "import Cheetah" 2> /dev/null +"$PY" -c "import Cheetah" 2> /dev/null if [ $? -gt 0 ]; then echo "Installing Cheetah template engine" - cd $PKG + cd "$PKG" if [ -e Cheetah-*.tar.gz ]; then - $EI Cheetah-* >> $INSTALL_LOG 2>&1 + "$EI" Cheetah-* >> "$INSTALL_LOG" 2>&1 else - $EI Cheetah >> $INSTALL_LOG 2>&1 + "$EI" Cheetah >> "$INSTALL_LOG" 2>&1 fi fi -$PY -c "import Cheetah" 2> /dev/null +"$PY" -c "import Cheetah" 2> /dev/null if [ $? -gt 0 ]; then echo "Cheetah install failed; unable to continue." seelog @@ -696,17 +697,17 @@ fi -$PY -c "import iniparse" 2> /dev/null +"$PY" -c "import iniparse" 2> /dev/null if [ $? -gt 0 ]; then echo "Installing iniparse configuration parser" - cd $PKG + cd "$PKG" if [ -e iniparse-*.tar.tz ]; then - $EI iniparse-* >> $INSTALL_LOG 2>&1 + "$EI" iniparse-* >> "$INSTALL_LOG" 2>&1 else - $EI iniparse >> $INSTALL_LOG 2>&1 + "$EI" iniparse >> "$INSTALL_LOG" 2>&1 fi fi -$PY -c "import iniparse" 2> /dev/null +"$PY" -c "import iniparse" 2> /dev/null if [ $? -gt 0 ]; then echo "iniparse install failed; unable to continue." seelog @@ -714,17 +715,17 @@ fi -$PY -c "import zc.buildout" 2> /dev/null +"$PY" -c "import zc.buildout" 2> /dev/null if [ $? -gt 0 ]; then echo "Installing zc.buildout" - cd $PKG + cd "$PKG" if [ -e iniparse-*.tar.tz ]; then - $EI zc.buildout-* >> $INSTALL_LOG 2>&1 + "$EI" zc.buildout-* >> "$INSTALL_LOG" 2>&1 else - $EI zc.buildout >> $INSTALL_LOG 2>&1 + "$EI" zc.buildout >> "$INSTALL_LOG" 2>&1 fi fi -$PY -c "import zc.buildout" 2> /dev/null +"$PY" -c "import zc.buildout" 2> /dev/null if [ $? -gt 0 ]; then echo "zc.buildout install failed; unable to continue." seelog @@ -732,51 +733,51 @@ fi -cd $CWD +cd "$CWD" -if [ -e $PKG/buildout-cache.tar.bz2 ]; then - if [ -x $BUILDOUT_CACHE ]; then +if [ -e "$PKG"/buildout-cache.tar.bz2 ]; then + if [ -x "$BUILDOUT_CACHE" ]; then echo "Found existing buildout cache at $BUILDOUT_CACHE; skipping step." else echo "Unpacking buildout cache to $BUILDOUT_CACHE" cd $PLONE_HOME - untar $PKG/buildout-cache.tar.bz2 + untar "$PKG"/buildout-cache.tar.bz2 # Copy Cheetah, which was a binary install into the egg cache # This is necessary because of a bug in zc.buildout's off-line # behavior. # echo "$PY -c 'import Cheetah, os; print os.sep.join(Cheetah.__file__.split(os.sep)[:-2])'" - EGGLOC=`$PY -c 'import Cheetah, os; print os.sep.join(Cheetah.__file__.split(os.sep)[:-2])'` + EGGLOC=`"$PY" -c 'import Cheetah, os; print os.sep.join(Cheetah.__file__.split(os.sep)[:-2])'` echo "Copying Cheetah egg from $EGGLOC" - cp -r $EGGLOC $BUILDOUT_CACHE/eggs/ >> $INSTALL_LOG 2>&1 + cp -r "$EGGLOC" "$BUILDOUT_CACHE"/eggs/ >> "$INSTALL_LOG" 2>&1 # compile .pyc files in cache echo "Compiling .py files in egg cache" - $PY $PLONE_HOME/Python*/lib/python*/compileall.py $BUILDOUT_CACHE/eggs > /dev/null 2>&1 + "$PY" "$PLONE_HOME"/Python*/lib/python*/compileall.py "$BUILDOUT_CACHE"/eggs > /dev/null 2>&1 fi - if [ ! -x $BUILDOUT_CACHE/eggs ]; then + if [ ! -x "$BUILDOUT_CACHE"/eggs ]; then echo "Buildout cache unpack failed. Unable to continue." seelog exit 1 fi else - mkdir $BUILDOUT_CACHE - mkdir $BUILDOUT_CACHE/eggs - mkdir $BUILDOUT_CACHE/downloads + mkdir "$BUILDOUT_CACHE" + mkdir "$BUILDOUT_CACHE"/eggs + mkdir "$BUILDOUT_CACHE"/downloads fi if [ $SEPARATE_ZOPE -eq 1 ]; then - MYZOPE=${PLONE_HOME}/$ZOPE - if [ -e $MYZOPE ]; then + MYZOPE="$PLONE_HOME"/"$ZOPE" + if [ -e "$MYZOPE" ]; then echo "$MYZOPE found; skipping separate Zope install." else - cd $PKG + cd "$PKG" echo "Installing separate $ZOPE" - untar $BUILDOUT_CACHE/downloads/${ZOPE}.* - cd $ZOPE - ./configure --with-python=$PY --prefix=$MYZOPE >> $INSTALL_LOG 2>&1 - make install >> $INSTALL_LOG 2>&1 - cd $PKG - rm -r $ZOPE - if [ ! -x ${MYZOPE}/bin/mkzopeinstance.py ]; then + untar "$BUILDOUT_CACHE"/downloads/"$ZOPE".* + cd "$ZOPE" + ./configure --with-python="$PY" --prefix="$MYZOPE" >> "$INSTALL_LOG" 2>&1 + make install >> "$INSTALL_LOG" 2>&1 + cd "$PKG" + rm -r "$ZOPE" + if [ ! -x "$MYZOPE"/bin/mkzopeinstance.py ]; then echo "Installation of Zope failed. Unable to continue" seelog exit 1 @@ -792,7 +793,7 @@ ###################### -cd $CWD +cd "$CWD" if [ $ROOT_INSTALL -eq 1 ]; then . helper_scripts/make_plone_user.sh @@ -802,55 +803,55 @@ fi fi # if $ROOT_INSTALL -cd $CWD +cd "$CWD" -if [ ! $PASSWORD ]; then +if [ "x$PASSWORD" = "x" ]; then ########################## # Generate random password echo "Generating random password ..." PASSWORD_SCRIPT=helper_scripts/generateRandomPassword.py - PASSWORD=`$PY $PASSWORD_SCRIPT` + PASSWORD=`"$PY" $PASSWORD_SCRIPT` fi ################################################ # Install the zeocluster or stand-alone instance if [ $INSTALL_ZEO -eq 1 ]; then - if [ -x $ZEOCLUSTER_HOME ]; then + if [ -x "$ZEOCLUSTER_HOME" ]; then echo "Instance target $ZEOCLUSTER_HOME already exists; aborting install." exit 1 fi - $PY helper_scripts/create_instance.py \ - $CWD \ - $PLONE_HOME \ - $ZEOCLUSTER_HOME \ - $EFFECTIVE_USER \ - $ZEO_USER \ - $PASSWORD \ - $ROOT_INSTALL \ - $MYZOPE \ - $RUN_BUILDOUT \ - $OFFLINE \ + "$PY" helper_scripts/create_instance.py \ + "$CWD" \ + "$PLONE_HOME" \ + "$ZEOCLUSTER_HOME" \ + "$EFFECTIVE_USER" \ + "$ZEO_USER" \ + "$PASSWORD" \ + "$ROOT_INSTALL" \ + "$MYZOPE" \ + "$RUN_BUILDOUT" \ + "$OFFLINE" \ "cluster" PWFILE=$ZEOCLUSTER_HOME/adminPassword.txt RMFILE=$ZEOCLUSTER_HOME/README.txt elif [ $INSTALL_STANDALONE -eq 1 ]; then - if [ -x $RINSTANCE_HOME ]; then + if [ -x "$RINSTANCE_HOME" ]; then echo "Instance target $RINSTANCE_HOME already exists; aborting install." exit 1 fi - $PY helper_scripts/create_instance.py \ - $CWD \ - $PLONE_HOME \ - $RINSTANCE_HOME \ - $EFFECTIVE_USER \ + "$PY" helper_scripts/create_instance.py \ + "$CWD" \ + "$PLONE_HOME" \ + "$RINSTANCE_HOME" \ + "$EFFECTIVE_USER" \ "0" \ - $PASSWORD \ - $ROOT_INSTALL \ - $MYZOPE \ - $RUN_BUILDOUT \ - $OFFLINE \ + "$PASSWORD" \ + "$ROOT_INSTALL" \ + "$MYZOPE" \ + "$RUN_BUILDOUT" \ + "$OFFLINE" \ "standalone" @@ -862,7 +863,7 @@ ####################### # Conclude installation -if [ -d $PLONE_HOME ]; then +if [ -d "$PLONE_HOME" ]; then if [ $SKIP_TOOL_TESTS -eq 0 ]; then echo " " echo "#####################################################################" @@ -885,7 +886,7 @@ echo 'For install problems, specify component "Installer (Unified)."' echo " " fi - echo "Finished at `date`" >> $INSTALL_LOG + echo "Finished at `date`" >> "$INSTALL_LOG" else echo "There were errors during the install. Please read readme.txt and try again." echo "To report errors with the installer, visit http://dev.plone.org/plone" @@ -893,4 +894,4 @@ exit 1 fi -cd $ORIGIN_PATH +cd "$ORIGIN_PATH" Modified: Installers/UnifiedInstaller/trunk/tests/tests.txt ============================================================================== --- Installers/UnifiedInstaller/trunk/tests/tests.txt (original) +++ Installers/UnifiedInstaller/trunk/tests/tests.txt Sun Nov 30 20:28:36 2008 @@ -52,7 +52,7 @@ Test a ZEO install ------------------ - >>> stdout, stderr, returncode = doCommand('./install.sh zeo --target=%s --password=admin' % testTarget) + >>> stdout, stderr, returncode = doCommand('./install.sh zeo --target=%s --password=admin --libjpeg=local --libz=local --libreadline=local' % testTarget) >>> returncode 0 |