123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- XCOMM! KORNSHELL
- XCOMM $XConsortium: dinstallCDE.src /main/8 1996/11/25 14:20:36 drk $
- XCOMM
- XCOMM This script uses the 'CDE' configuration scripts to de-install the Desktop
- XCOMM environment.
- XCOMM
- XCOMM this script accepts the following parameters:
- XCOMM
- XCOMM Optional parameters:
- XCOMM
- XCOMM -f <filesets> -- a quoted, space-separated list of
- XCOMM filesets to unload. The .udb
- XCOMM extension is not required.
- XCOMM
- XCOMM -clean -- remove the temporaray and configuration directories
- XCOMM -cleanVar-- remove the temporary directory but NOT the
- XCOMM configuration directory
- XCOMM -prog -- load only the development environment
- XCOMM -runtime -- load only the runtime environment
- XCOMM
- XCOMM ##########################################################################
- #define HASH #
- #define STAR *
- REVISION="$(echo "$Revision: /main/8 $" | awk '{print $2}')"
- Log()
- {
- echo "$1" | tee -a /tmp/dinstallCDE.log
- }
- DoFilesetScript()
- {
- typeset ScriptName
- FilesetName=$1
- ScriptName=$2 # use long config file name (configFoo)
- test_string=${DATABASE_FILES#*$FilesetName}
- if (( ${#DATABASE_FILES} > ${#test_string} ))
- then
- if [ -x $POST_INSTALL_DIR/$PLATFORM_SCRIPT_DIR/$ScriptName ]
- then
- Log "Executing $PLATFORM specific $FilesetName de-customize script"
- $POST_INSTALL_DIR/$PLATFORM_SCRIPT_DIR/$ScriptName -d 2>&1 | \
- tee -a /tmp/$ScriptName.dverify
- elif [ -x $POST_INSTALL_DIR/$ScriptName ]
- then
- Log "Executing $FilesetName de-customize script"
- $POST_INSTALL_DIR/$ScriptName -d 2>&1 | tee -a /tmp/$ScriptName.dverify
- fi
- fi
- }
- DoLangScript()
- {
- typeset ScriptName
- if [ "$BUILD_TREE" = "" ]; then
- ScriptName=$2 # use short config file name (foo.cfg)
- else
- ScriptName=$1 # use long config file name (configFoo)
- fi
- if [ $CDECONFIGDIR = "CONFIG" ]; then
- typeset -u ScriptName
- fi
- if [ -x $POST_INSTALL_DIR/$PLATFORM_SCRIPT_DIR/$ScriptName ]
- then
- Log "Executing $PLATFORM specific $FilesetName de-customize script"
- KORNSHELL $POST_INSTALL_DIR/$PLATFORM_SCRIPT_DIR/$ScriptName -d $3 2>&1 | \
- tee -a /tmp/$ScriptName.dverify
- elif [ -x $POST_INSTALL_DIR/$ScriptName ]
- then
- Log "Executing $FilesetName de-customize script"
- KORNSHELL $POST_INSTALL_DIR/$ScriptName -d $3 2>&1 | tee -a /tmp/$ScriptName.dverify
- fi
- }
- DoScripts()
- {
- Log " "
- DoFilesetScript CDE-TT configTT tt.cfg
- DoFilesetScript CDE-MIN configMin min.cfg
- DoFilesetScript CDE-RUN configRun run.cfg
- DoFilesetScript CDE-HELP-C configHelp help.cfg
- DoFilesetScript CDE-HELP-PRG configHelpPrg helpprg.cfg
- DoFilesetScript CDE-HELP-RUN configHelpRun helprun.cfg
- DoFilesetScript CDE-SHLIBS configShlibs shlibs.cfg
- DoFilesetScript CDE-DEMOS configDemos demos.cfg
- DoFilesetScript CDE-FONTS configFonts fonts.cfg
- DoFilesetScript CDE-ICONS configIcons icons.cfg
- DoFilesetScript CDE-INC configInc inc.cfg
- DoFilesetScript CDE-MAN configMan man.cfg
- DoFilesetScript CDE-MAN-DEV configManDev mandev.cfg
- DoFilesetScript CDE-MSG-C configMsgCat msgcat.cfg
- DoFilesetScript CDE-PRG configPrg prg.cfg
- HASH see if a lang has been specified and configure backdrops and
- HASH palettes if it has.
- if [ "$LangOption" != "" ]
- then
- DoLangScript configLang lang.cfg $theLang
- fi
- }
- USAGE()
- {
- echo "Usage: $(basename $0) [options]"
- echo ""
- echo "\tOptions:"
- echo ""
- echo "\t[-a <udb directory>]\t\talternate place to get the"
- echo "\t\t\t\t\tudb files from."
- echo "\t[-f <filesets>]\t\t\tspecify filesets to be unloaded."
- echo "\t\t\t\t\tThe list should be double-quoted,"
- echo "\t\t\t\t\tspace-separated, with no .udb"
- echo "\t\t\t\t\textensions."
- echo ""
- echo "\t[-clean]\t\t\tremove the temporary and configuration"
- echo "\t\t\t\t\tdirectories"
- echo "\t[-cleanVar]\t\t\tremove the temporary but NOT the "
- echo "\t\t\t\t\tconfiguration directory"
- echo "\t[-prog]\t\t\t\tload only the development environment"
- echo "\t[-runtime]\t\t\tload only the runtime environment"
- echo "\t[-relative]\t\t\trun the relative-located config scripts"
- echo "\t[-lang LANG]\t\t\tspecify LANG to use for backdrops and"
- echo "\t\t\t\t\tpalettes"
- echo ""
- }
- ORIGINAL_COMMAND_LINE="$*"
- XCOMM Set which system we are on
- BUILDSYSTEM=$(uname)
- PLATFORM=""
- PLATFORM_SCRIPT_DIR=""
- XCOMM
- XCOMM Set system
- XCOMM
- if [ $BUILDSYSTEM = "AIX" ];
- then
- PLATFORM=aix
- PLATFORM_SCRIPT_DIR=ibm
- elif [ $BUILDSYSTEM = "SunOS" ];
- then
- PLATFORM=sun
- PLATFORM_SCRIPT_DIR=sun
- elif [ $BUILDSYSTEM = "UNIX_SV" ];
- then
- PLATFORM=usl
- PLATFORM_SCRIPT_DIR=usl
- elif [ $BUILDSYSTEM = "UNIX_System_V" ];
- then
- PLATFORM=uxp
- PLATFORM_SCRIPT_DIR=uxp
- elif [ $BUILDSYSTEM = "OSF1" ];
- then
- PLATFORM=dec
- PLATFORM_SCRIPT_DIR=dec
- else # Build system = HP
- PLATFORM=hp-ux
- PLATFORM_SCRIPT_DIR=hp
- fi
- if [ "$PLATFORM" = "aix" ];
- then
- USER=`/bin/whoami`
- elif [ "$PLATFORM" = "sun" -o "$PLATFORM" = "usl" -o "$PLATFORM" = "uxp" ];
- then
- USER=`/usr/ucb/whoami`
- else
- USER=`/usr/bin/whoami`
- fi
- if [ "$USER" != "root" ];
- then
- USAGE
- echo ""
- echo "You must be root to run this script"
- echo ""
- exit 1
- fi
- PATH=/bin:/usr/bin:/etc:/usr/bin/X11:
- export PATH
- CLEANING="no"
- CLEANING_ETC="no"
- USE_ALTERNATE_UDB_DIR="no"
- USE_RELATIVE="no"
- STARTING_DIR=$PWD
- DATABASE_FILES=""
- LeaveLinks="no"
- REMOVE_LINKS="no"
- CLEAN_DAEMONS="yes"
- theLang=""
- DEVELOP_ENV="yes"
- RUNTIME_ENV="yes"
- rm -f /tmp/dinstallCDE.log
- Log "Options specified..."
- while [ $# -ne 0 ]; do
- case $1 in
- -a) Log " - alternate place to get the udb files from"
- shift;
- [ $# -ne 0 ] || {
- USAGE
- exit 1;
- }
- ALTERNATE_UDB_DIR=$1
- USE_ALTERNATE_UDB_DIR="yes"
- shift;
- ;;
- -f) Log " - load specific filesets"
- shift;
- [ $# -ne 0 ] || {
- USAGE
- exit 1;
- }
- DATABASE_FILES=$1
- shift;
- ;;
- -clean) Log " - delete all three cde directories"
- CLEANING="yes"
- CLEANING_ETC="yes"
- shift;
- ;;
- -cleanVar) Log " - delete only temporary and installation directories"
- CLEANING="yes"
- shift;
- ;;
- -relative) Log " - run the relative-located config scripts"
- USE_RELATIVE="yes"
- shift;
- ;;
- -prog) Log " - remove only the development environment"
- RUNTIME_ENV="no"
- shift;
- ;;
- -runtime) Log " - remove only the runtime environment"
- DEVELOP_ENV="no"
- shift;
- ;;
- -lang) Log " - configure backdrops and palettes for LANG"
- shift;
- [ $# -ne 0 ] || {
- USAGE
- exit 1;
- }
- theLang=$1
- shift;
- ;;
- esac
- done
- echo ""
- TOOL_DIR=$BUILD_TREE/admin/IntegTools/dbTools
- if [ "$USE_RELATIVE" = "yes" ]
- then
- POST_INSTALL_DIR=../post_install
- else
- POST_INSTALL_DIR=$BUILD_TREE/admin/IntegTools/post_install
- fi
- if [ "$USE_ALTERNATE_UDB_DIR" = "yes" ]
- then
- DATABASE_DIR=$ALTERNATE_UDB_DIR/databases
- else
- DATABASE_DIR=$BUILD_TREE/databases
- fi
- if [ "$DATABASE_FILES" = "" ]
- then
- if [ "$DEVELOP_ENV" = "yes" -a "$RUNTIME_ENV" = "yes" ]
- then
- DATABASE_FILES="CDE-RUN CDE-MIN CDE-TT CDE-MAN CDE-HELP-RUN CDE-C \
- CDE-MSG-C CDE-HELP-C CDE-SHLIBS CDE-HELP-PRG \
- CDE-PRG CDE-INC CDE-DEMOS CDE-MAN-DEV CDE-ICONS \
- CDE-FONTS"
- elif [ "$DEVELOP_ENV" = "yes" ]
- then
- DATABASE_FILES="CDE-HELP-PRG CDE-PRG CDE-INC CDE-DEMOS \
- CDE-MAN-DEV CDE-SHLIBS"
- elif [ "$RUNTIME_ENV" = "yes" ]
- then
- DATABASE_FILES="CDE-RUN CDE-MIN CDE-TT CDE-MAN CDE-HELP-RUN CDE-C \
- CDE-HELP-C CDE-MSG-C CDE-SHLIBS CDE-ICONS CDE-FONTS"
- fi
- fi
- INSTALL_LOCATION=CDE_INSTALLATION_TOP
- CONFIGURE_LOCATION=CDE_CONFIGURATION_TOP
- LOGFILES_LOCATION=CDE_LOGFILES_TOP
- DoScripts
-
- echo "Done."
- echo ""
- echo "See /tmp/dinstallCDE.log for a log of this de-install session."
- echo ""
|