From 53587f49de72318957d060278451ca0eabcab43c Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 13 Apr 2006 10:30:52 +0000 Subject: [PATCH] Corrected behavior of test.sh script so that in can be invoked from anywhere and still work correctly. --- releasetools/install.sh | 44 +++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 15 deletions(-) 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 <