Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: installation fails in Linux when DVD mount path has a space


From   Andrew Schulman <andrex@alumni.utexas.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: installation fails in Linux when DVD mount path has a space
Date   Mon, 02 Jan 2012 07:55:15 -0500

Hi. I'm trying to install Stata 12 in Ubuntu Maverick on amd64. The installation fails with a syntax error:

<installation log>
About to proceed with installation:

To install: 64-bit Stata for Linux on x86-64, glibc 2.5 and newer
        Into directory:    /opt/stata

Okay to proceed (y/n or q to quit)
y

Copying files ...
expr: syntax error
Installation script error
</installation log>

The reason for the failure is that the Stata DVD is mounted on our host at a path that includes a space (/archive/apps/Stata 12). The installation script fails with a syntax error at multiple points, when the mount path inclues a space.

The patch below resolves this problem.
Andrew.


--- install.orig	2012-01-02 07:41:46.924669544 -0500
+++ install	2012-01-02 07:48:57.407142233 -0500
@@ -391,7 +391,7 @@
 echo
 echo "Copying files ..."

-cddir=`expr $cmd : '\(.*\)\/.*'`
+cddir=`expr "$cmd" : '\(.*\)\/.*'`
 case "$cddir" in
 "")	echo "Installation script error"
 	exit 2
@@ -399,11 +399,11 @@
 esac


-if cp $cddir/unix/$plat/ado.taz ado.tar.Z > /dev/null 2>&1
+if cp "$cddir/unix/$plat/ado.taz" ado.tar.Z > /dev/null 2>&1
 then
 	chmod 640 ado.tar.Z
 else
-	if cp $cddir/UNIX/$platU/ADO.TAZ ado.tar.Z > /dev/null 2>&1
+	if cp "$cddir/UNIX/$platU/ADO.TAZ" ado.tar.Z > /dev/null 2>&1
 	then
 		chmod 640 ado.tar.Z
 	else
@@ -414,11 +414,11 @@
 fi


-if cp $cddir/unix/$plat/base.taz base.tar.Z > /dev/null 2>&1
+if cp "$cddir/unix/$plat/base.taz" base.tar.Z > /dev/null 2>&1
 then
 	chmod 640 base.tar.Z
 else
-	if cp $cddir/UNIX/$platU/BASE.TAZ base.tar.Z > /dev/null 2>&1
+	if cp "$cddir/UNIX/$platU/BASE.TAZ" base.tar.Z > /dev/null 2>&1
 	then
 		chmod 640 base.tar.Z
 	else
@@ -428,11 +428,11 @@
 	fi
 fi

-if cp $cddir/unix/$plat/bins.taz bins.tar.Z > /dev/null 2>&1
+if cp "$cddir/unix/$plat/bins.taz" bins.tar.Z > /dev/null 2>&1
 then
 	chmod 640 bins.tar.Z
 else
-	if cp $cddir/UNIX/$platU/BINS.TAZ bins.tar.Z > /dev/null 2>&1
+	if cp "$cddir/UNIX/$platU/BINS.TAZ" bins.tar.Z > /dev/null 2>&1
 	then
 		chmod 640 bins.tar.Z
 	else
@@ -442,11 +442,11 @@
 	fi
 fi

-if cp $cddir/unix/$plat/docs.taz docs.tar.Z > /dev/null 2>&1
+if cp "$cddir/unix/$plat/docs.taz" docs.tar.Z > /dev/null 2>&1
 then
 	chmod 640 docs.tar.Z
 else
-	if cp $cddir/UNIX/$platU/DOCS.TAZ docs.tar.Z > /dev/null 2>&1
+	if cp "$cddir/UNIX/$platU/DOCS.TAZ" docs.tar.Z > /dev/null 2>&1
 	then
 		chmod 640 docs.tar.Z
 	else
@@ -457,11 +457,11 @@
 fi


-if cp $cddir/unix/$plat/setrwxp setrwxp > /dev/null 2>&1
+if cp "$cddir/unix/$plat/setrwxp" setrwxp > /dev/null 2>&1
 then
 	chmod 750 setrwxp
 else
-	if cp $cddir/UNIX/$platU/SETRWXP setrwxp > /dev/null 2>&1
+	if cp "$cddir/UNIX/$platU/SETRWXP" setrwxp > /dev/null 2>&1
 	then
 		chmod 750 setrwxp
 	else
@@ -473,11 +473,11 @@

 if [ -n "$needlibs" ]
 then
-	if cp $cddir/unix/$plat/statalib.taz statalib.tar.Z > /dev/null 2>&1
+ if cp "$cddir/unix/$plat/statalib.taz" statalib.tar.Z > /dev/null 2>&1
 	then
 		chmod 640 statalib.tar.Z
 	else
- if cp $cddir/UNIX/$platU/STATALIB.TAZ statalib.tar.Z > /dev/null 2>&1 + if cp "$cddir/UNIX/$platU/STATALIB.TAZ" statalib.tar.Z > /dev/null 2>&1
 		then
 			chmod 640 statalib.tar.Z
 		else
@@ -488,11 +488,11 @@
 	fi
 fi

-if cp $cddir/unix/$plat/install inst2 > /dev/null 2>&1
+if cp "$cddir/unix/$plat/install" inst2 > /dev/null 2>&1
 then
 	chmod 750 inst2
 else
-	if cp $cddir/UNIX/$platU/INSTALL inst2 > /dev/null 2>&1
+	if cp "$cddir/UNIX/$platU/INSTALL" inst2 > /dev/null 2>&1
 	then
 		chmod 750 inst2
 	else

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index