From: Michael Smith Date: Thu, 13 Apr 2006 10:30:52 +0000 (+0000) Subject: Corrected behavior of test.sh script so that in can be invoked X-Git-Tag: release/1.79.1~6^2~2876 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6a5028cfd8d4a895354cad289cbb844127747d0;p=docbook-dsssl Corrected behavior of test.sh script so that in can be invoked from anywhere and still work correctly. --- diff --git a/releasetools/install.sh b/releasetools/install.sh index 5a1c80dac..f08ac14c6 100755 --- a/releasetools/install.sh +++ b/releasetools/install.sh @@ -42,9 +42,15 @@ thisCatalogManager=$HOME/.resolver/CatalogManager.properties if [ ! "${*#--batch}" = "$*" ]; then batchmode="Yes"; - echo "Using batch mode." else batchmode="No"; + echo + if [ ! "$1" = "--test" ]; then + echo "NOTE: For non-interactive installs/uninstalls, use --batch" + if [ ! "$1" = "--uninstall" ]; then + echo + fi + fi fi osName=$(uname -o) @@ -157,6 +163,9 @@ NOTE: No CatalogManager.properties found from CLASSPATH. EOF fi fi + if [ "$batchmode" = "Yes" ]; then + echo + fi # end of check for existing writable CatalogManager.properties if [ -f $thisCatalogManager ]; then @@ -231,7 +240,8 @@ EOF REPLY="" if [ ! "$batchmode" = "Yes" ]; then echo - read -s -n1 -p "Add $thisJavaXmlCatalog to $myCatalogManager file? [Yes] " + echo "Add $thisJavaXmlCatalog" + read -s -n1 -p "to $myCatalogManager file? [Yes] " echo "$REPLY" echo fi @@ -384,6 +394,7 @@ return 0 } updateUserStartupFiles() { + if [ ! "$batchmode" = "Yes" ]; then cat <> $HOME/$file || exit 1 cat < $myCatalogManager || exit 1 cat < $testFile || exit 1 - echo "./install.sh --test" >> $testFile || exit 1 + echo "mydir=\$(readlink -f \$(dirname \$0))" >> $testFile || exit 1 + echo "\$mydir/install.sh --test" >> $testFile || exit 1 chmod 755 $testFile || exit 1 } printExitMessage() { cat <