From: Michael Smith Date: Thu, 13 Apr 2006 14:50:12 +0000 (+0000) Subject: Made install.sh send all messages to standard error instead of X-Git-Tag: release/1.79.1~6^2~2874 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b204f4b2c419b2ed9473ea863eec351d53310cc;p=docbook-dsssl Made install.sh send all messages to standard error instead of standard out. --- diff --git a/releasetools/install.sh b/releasetools/install.sh index f08ac14c6..1f716c78b 100755 --- a/releasetools/install.sh +++ b/releasetools/install.sh @@ -40,15 +40,19 @@ thisUriList=$mydir/.urilist exampleCatalogManager=$mydir/.CatalogManager.properties.example thisCatalogManager=$HOME/.resolver/CatalogManager.properties +emit_message() { + echo $1 1>&2 +} + if [ ! "${*#--batch}" = "$*" ]; then batchmode="Yes"; else batchmode="No"; - echo + emit_message if [ ! "$1" = "--test" ]; then - echo "NOTE: For non-interactive installs/uninstalls, use --batch" + emit_message "NOTE: For non-interactive installs/uninstalls, use --batch" if [ ! "$1" = "--uninstall" ]; then - echo + emit_message fi fi fi @@ -90,12 +94,12 @@ WARNING: This install script is meant to be run as a non-root EOF read -s -n1 -p "Are you sure you want to continue? [No] " - echo "$REPLY" + emit_message "$REPLY" case $REPLY in [yY]) - echo + emit_message ;; - *) echo "OK, exiting without making changes." + *) emit_message "OK, exiting without making changes." exit ;; esac @@ -164,7 +168,7 @@ EOF fi fi if [ "$batchmode" = "Yes" ]; then - echo + emit_message fi # end of check for existing writable CatalogManager.properties @@ -173,10 +177,10 @@ EOF else REPLY="" if [ ! "$batchmode" = "Yes" ]; then - echo + emit_message read -s -n1 -p "Create $thisCatalogManager file? [Yes] " - echo "$REPLY" - echo + emit_message "$REPLY" + emit_message fi case $REPLY in [nNqQ]) @@ -187,7 +191,7 @@ EOF mkdir -p ${thisCatalogManager%/*} fi cp $mydir/.CatalogManager.properties.example $thisCatalogManager || exit 1 - echo "NOTE: $thisCatalogManager file created" + emit_message "NOTE: $thisCatalogManager file created" myCatalogManager=$thisCatalogManager ;; esac @@ -218,11 +222,11 @@ EOF REPLY="" if [ ! "$batchmode" = "Yes" ]; then read -s -n1 -p "Add /etc/xml/catalog to $myCatalogManager? [Yes] " - echo "$REPLY" + emit_message "$REPLY" fi case $REPLY in [nNqQ]) - echo + emit_message ;; *) etcXmlCatalog=/etc/xml/catalog @@ -232,18 +236,18 @@ EOF catalogBackup="$myCatalogManager.$$.bak" if [ ! -w "${myCatalogManager%/*}" ]; then - echo - echo "WARNING: ${myCatalogManager%/*} directory is not writable." - echo + emit_message + emit_message "WARNING: ${myCatalogManager%/*} directory is not writable." + emit_message emitNoChangeMsg else REPLY="" if [ ! "$batchmode" = "Yes" ]; then - echo - echo "Add $thisJavaXmlCatalog" + emit_message + emit_message "Add $thisJavaXmlCatalog" read -s -n1 -p "to $myCatalogManager file? [Yes] " - echo "$REPLY" - echo + emit_message "$REPLY" + emit_message fi case $REPLY in [nNqQ]) @@ -252,22 +256,22 @@ EOF *) if [ "$catalogsLine" ] ; then if [ "${catalogsLine#*$thisJavaXmlCatalog*}" != "$catalogsLine" ]; then - echo "NOTE: $thisJavaXmlCatalog already" - echo " in $myCatalogManager" + emit_message "NOTE: $thisJavaXmlCatalog already" + emit_message " in $myCatalogManager" else mv $myCatalogManager $catalogBackup || exit 1 sed "s#^catalogs=\(.*\)\$#catalogs=$thisJavaXmlCatalog;\1;$etcXmlCatalog#" $catalogBackup \ | sed 's/;\+/;/' | sed 's/;$//' > $myCatalogManager || exit 1 - echo "NOTE: $myCatalogManager file successfully updated." - echo " Backup written to $catalogBackup" + emit_message "NOTE: $myCatalogManager file successfully updated." + emit_message " Backup written to $catalogBackup" fi else mv $myCatalogManager $catalogBackup || exit 1 cp $catalogBackup $myCatalogManager echo "catalogs=$thisJavaXmlCatalog;$etcXmlCatalog" \ | sed 's/;\+/;/' | sed 's/;$//' >> $myCatalogManager || exit 1 - echo "NOTE: \"catalogs=\" line added to $myCatalogManager." - echo " Backup written to $catalogBackup" + emit_message "NOTE: \"catalogs=\" line added to $myCatalogManager." + emit_message " Backup written to $catalogBackup" fi ;; esac @@ -405,7 +409,7 @@ NOTE: To source your environment correctly for using the catalog EOF else - echo + emit_message fi # if user is running csh or tcsh, target .cshrc and .tcshrc @@ -426,7 +430,7 @@ EOF REPLY="" if [ ! "$batchmode" = "Yes" ]; then read -s -n1 -p "Update $HOME/$file? [Yes] " - echo "$REPLY" + emit_message "$REPLY" fi case $REPLY in [nNqQ]) @@ -465,7 +469,7 @@ EOF done if [ -z "$dotFileBackup" ]; then if [ ! "$batchmode" = "Yes" ]; then - echo + emit_message fi cat <