checkRoot() {
if [ $(id -u) == "0" ]; then
- cat <<EOF
+ cat 1>&2 <<EOF
WARNING: This install script is meant to be run as a non-root
user, but you are running it as root.
# CatalogManager.properties file found
if [ -z "$CLASSPATH" ]; then
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: There is no CLASSPATH variable set in your environment.
No attempt was made to find a CatalogManager.properties
if [ -f "$existingCatalogManager" ]; then
# a non-writable CatalogManager.properties exists, so emit a
# note saying that it won't be used
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: $existingCatalogManager file found,
but you don't have permission to write to it.
Will instead use $thisCatalogManager
else
# CLASSPATH is set, but no CatalogManager.properties found
if [ -n "$CLASSPATH" ]; then
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: No CatalogManager.properties found from CLASSPATH.
Will instead use $thisCatalogManager
EOF
catalogsLine=$(grep "^catalogs=" $myCatalogManager)
if [ -f /etc/xml/catalog ] && [ "$osName" != "Cygwin" ] \
&& [ "${catalogsLine#*/etc/xml/catalog*}" = "$catalogsLine" ]; then
- cat <<EOF
+ cat 1>&2 <<EOF
WARNING: /etc/xml/catalog exists but was not found in the
$myCatalogManager file. If the
updateUserStartupFiles() {
if [ ! "$batchmode" = "Yes" ]; then
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: To source your environment correctly for using the catalog
files in this distribution, you need to update one or more
fi
case $REPLY in
[nNqQ])
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: No change made to $HOME/$file. You either need
to add the following line to it, or manually source
mv $HOME/$file $dotFileBackup || exit 1
cp $dotFileBackup $HOME/$file || exit 1
echo "$appendLine" >> $HOME/$file || exit 1
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: $HOME/$file file successfully updated.
Backup written to $dotFileBackup
EOF
else
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: $HOME/$file already contains information for this distribution.
$HOME/$file not updated.
if [ ! "$batchmode" = "Yes" ]; then
emit_message
fi
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: No shell startup files updated. You can source the
environment for this distribution manually, each time you
want to use it, by typing the following.
updateUserDotEmacs() {
if [ -f $thisLocatingRules ]; then
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: This distribution includes a "schema locating rules" file
for Emacs/nXML. To use it, you should update either your
touch $myEmacsFile
;;
*)
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: No Emacs changes made. To use this distribution with,
Emacs/nXML, you can create a .emacs file and manually add
the following line to it, or you can run it as a command
fi
case $REPLY in
[nNqQ])
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: No change made to $myEmacsFile. To use this distribution
with Emacs/nXML, you can manually add the following line
mv $myEmacsFile $dotEmacsBackup || exit 1
cp $dotEmacsBackup $myEmacsFile || exit 1
echo "$emacsAppendLine" >> $myEmacsFile || exit 1
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: $myEmacsFile file successfully updated.
Backup written to $dotEmacsBackup
EOF
else
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: $myEmacsFile already contains information for this distribution.
$myEmacsFile not updated.
uninstall() {
if [ ! "$batchmode" = "Yes" ]; then
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: To "uninstall" this distribution, the changes made to your
CatalogManagers.properties, startup files, and/or .emacs
fi
case $REPLY in
[nNqQ]*)
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: No change made to $myCatalogManager. You need to manually
remove the following path from the "catalog=" line.
mv $myCatalogManager $catalogBackup || exit 1
sed "s#^catalogs=\(.*\)$thisXmlCatalog\(.*\)\$#catalogs=\1\2#" $catalogBackup \
| sed 's/;\+/;/' | sed 's/;$//' | sed 's/=;/=/' > $myCatalogManager || exit 1
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: $myCatalogManager file successfully reverted.
Backup written to $catalogBackup
emit_message
fi
else
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: No data for this distribution found in $myCatalogManager
So, nothing to revert in $myCatalogManager
EOF
fi
case $REPLY in
[nNqQ]*)
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: No change made to $myEmacsFile. You need to manually
remove the following line.
mv $myEmacsFile $dotEmacsBackup || exit 1
cp $dotEmacsBackup $myEmacsFile || exit 1
sed -i "/$revertLine/d" $myEmacsFile || exit 1
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: $myEmacsFile file successfully reverted.
Backup written to $dotEmacsBackup
fi
case $REPLY in
[nNqQ]*)
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: No change made to $HOME/$file. You need to manually remove
the following line from it.
mv $HOME/$file $dotFileBackup || exit 1
cp $dotFileBackup $HOME/$file || exit 1
sed -i "/$revertLineEsc/d" $HOME/$file || exit 1
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: $HOME/$file file successfully updated.
Backup written to $dotFileBackup
}
printExitMessage() {
- cat <<EOF
+ cat 1>&2 <<EOF
Type the following to source your shell environment for the distribution
$appendLine
checkForResolver() {
resolverResponse="$(java org.apache.xml.resolver.apps.resolver uri -u foo 2>/dev/null)"
if [ -z "$resolverResponse" ]; then
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: Your environment does not seem to contain the Apache XML Commons
Resolver; without that, you can't use XML catalogs with Java.
}
emitNoChangeMsg() {
- cat <<EOF
+ cat 1>&2 <<EOF
NOTE: No changes was made to CatalogManagers.properties. To
provide your Java tools with XML catalog information for
testCatalogs() {
readlinkResponse="$(readlink -f . 2>/dev/null)"
if [ -z "$readlinkResponse" ]; then
- cat <<EOF
+ cat 1>&2 <<EOF
FATAL: Cannot locate the "readlink" command. Stopping.
EOF
fi
if [ ! -f "$thisXmlCatalog" ]; then
- cat <<EOF
+ cat 1>&2 <<EOF
FATAL: $thisXmlCatalog file needed but not found. Stopping.
EOF
else
xmlCatalogResponse="$(xmlcatalog 2>/dev/null)"
if [ -z "$xmlCatalogResponse" ]; then
- cat <<EOF
+ cat 1>&2 <<EOF
WARNING: Cannot locate the "xmlcatalog" command. Make sure that
you have libxml2 and its associated utilities installed.