dinstallCDE.src 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. XCOMM! KORNSHELL
  2. XCOMM $XConsortium: dinstallCDE.src /main/8 1996/11/25 14:20:36 drk $
  3. XCOMM
  4. XCOMM This script uses the 'CDE' configuration scripts to de-install the Desktop
  5. XCOMM environment.
  6. XCOMM
  7. XCOMM this script accepts the following parameters:
  8. XCOMM
  9. XCOMM Optional parameters:
  10. XCOMM
  11. XCOMM -f <filesets> -- a quoted, space-separated list of
  12. XCOMM filesets to unload. The .udb
  13. XCOMM extension is not required.
  14. XCOMM
  15. XCOMM -clean -- remove the temporaray and configuration directories
  16. XCOMM -cleanVar-- remove the temporary directory but NOT the
  17. XCOMM configuration directory
  18. XCOMM -prog -- load only the development environment
  19. XCOMM -runtime -- load only the runtime environment
  20. XCOMM
  21. XCOMM ##########################################################################
  22. #define HASH #
  23. #define STAR *
  24. REVISION="$(echo "$Revision: /main/8 $" | awk '{print $2}')"
  25. Log()
  26. {
  27. echo "$1" | tee -a /tmp/dinstallCDE.log
  28. }
  29. DoFilesetScript()
  30. {
  31. typeset ScriptName
  32. FilesetName=$1
  33. ScriptName=$2 # use long config file name (configFoo)
  34. test_string=${DATABASE_FILES#*$FilesetName}
  35. if (( ${#DATABASE_FILES} > ${#test_string} ))
  36. then
  37. if [ -x $POST_INSTALL_DIR/$PLATFORM_SCRIPT_DIR/$ScriptName ]
  38. then
  39. Log "Executing $PLATFORM specific $FilesetName de-customize script"
  40. $POST_INSTALL_DIR/$PLATFORM_SCRIPT_DIR/$ScriptName -d 2>&1 | \
  41. tee -a /tmp/$ScriptName.dverify
  42. elif [ -x $POST_INSTALL_DIR/$ScriptName ]
  43. then
  44. Log "Executing $FilesetName de-customize script"
  45. $POST_INSTALL_DIR/$ScriptName -d 2>&1 | tee -a /tmp/$ScriptName.dverify
  46. fi
  47. fi
  48. }
  49. DoLangScript()
  50. {
  51. typeset ScriptName
  52. if [ "$BUILD_TREE" = "" ]; then
  53. ScriptName=$2 # use short config file name (foo.cfg)
  54. else
  55. ScriptName=$1 # use long config file name (configFoo)
  56. fi
  57. if [ $CDECONFIGDIR = "CONFIG" ]; then
  58. typeset -u ScriptName
  59. fi
  60. if [ -x $POST_INSTALL_DIR/$PLATFORM_SCRIPT_DIR/$ScriptName ]
  61. then
  62. Log "Executing $PLATFORM specific $FilesetName de-customize script"
  63. KORNSHELL $POST_INSTALL_DIR/$PLATFORM_SCRIPT_DIR/$ScriptName -d $3 2>&1 | \
  64. tee -a /tmp/$ScriptName.dverify
  65. elif [ -x $POST_INSTALL_DIR/$ScriptName ]
  66. then
  67. Log "Executing $FilesetName de-customize script"
  68. KORNSHELL $POST_INSTALL_DIR/$ScriptName -d $3 2>&1 | tee -a /tmp/$ScriptName.dverify
  69. fi
  70. }
  71. DoScripts()
  72. {
  73. Log " "
  74. DoFilesetScript CDE-TT configTT tt.cfg
  75. DoFilesetScript CDE-MIN configMin min.cfg
  76. DoFilesetScript CDE-RUN configRun run.cfg
  77. DoFilesetScript CDE-HELP-C configHelp help.cfg
  78. DoFilesetScript CDE-HELP-PRG configHelpPrg helpprg.cfg
  79. DoFilesetScript CDE-HELP-RUN configHelpRun helprun.cfg
  80. DoFilesetScript CDE-SHLIBS configShlibs shlibs.cfg
  81. DoFilesetScript CDE-DEMOS configDemos demos.cfg
  82. DoFilesetScript CDE-FONTS configFonts fonts.cfg
  83. DoFilesetScript CDE-ICONS configIcons icons.cfg
  84. DoFilesetScript CDE-INC configInc inc.cfg
  85. DoFilesetScript CDE-MAN configMan man.cfg
  86. DoFilesetScript CDE-MAN-DEV configManDev mandev.cfg
  87. DoFilesetScript CDE-MSG-C configMsgCat msgcat.cfg
  88. DoFilesetScript CDE-PRG configPrg prg.cfg
  89. HASH see if a lang has been specified and configure backdrops and
  90. HASH palettes if it has.
  91. if [ "$LangOption" != "" ]
  92. then
  93. DoLangScript configLang lang.cfg $theLang
  94. fi
  95. }
  96. USAGE()
  97. {
  98. echo "Usage: $(basename $0) [options]"
  99. echo ""
  100. echo "\tOptions:"
  101. echo ""
  102. echo "\t[-a <udb directory>]\t\talternate place to get the"
  103. echo "\t\t\t\t\tudb files from."
  104. echo "\t[-f <filesets>]\t\t\tspecify filesets to be unloaded."
  105. echo "\t\t\t\t\tThe list should be double-quoted,"
  106. echo "\t\t\t\t\tspace-separated, with no .udb"
  107. echo "\t\t\t\t\textensions."
  108. echo ""
  109. echo "\t[-clean]\t\t\tremove the temporary and configuration"
  110. echo "\t\t\t\t\tdirectories"
  111. echo "\t[-cleanVar]\t\t\tremove the temporary but NOT the "
  112. echo "\t\t\t\t\tconfiguration directory"
  113. echo "\t[-prog]\t\t\t\tload only the development environment"
  114. echo "\t[-runtime]\t\t\tload only the runtime environment"
  115. echo "\t[-relative]\t\t\trun the relative-located config scripts"
  116. echo "\t[-lang LANG]\t\t\tspecify LANG to use for backdrops and"
  117. echo "\t\t\t\t\tpalettes"
  118. echo ""
  119. }
  120. ORIGINAL_COMMAND_LINE="$*"
  121. XCOMM Set which system we are on
  122. BUILDSYSTEM=$(uname)
  123. PLATFORM=""
  124. PLATFORM_SCRIPT_DIR=""
  125. XCOMM
  126. XCOMM Set system
  127. XCOMM
  128. if [ $BUILDSYSTEM = "AIX" ];
  129. then
  130. PLATFORM=aix
  131. PLATFORM_SCRIPT_DIR=ibm
  132. elif [ $BUILDSYSTEM = "SunOS" ];
  133. then
  134. PLATFORM=sun
  135. PLATFORM_SCRIPT_DIR=sun
  136. elif [ $BUILDSYSTEM = "UNIX_SV" ];
  137. then
  138. PLATFORM=usl
  139. PLATFORM_SCRIPT_DIR=usl
  140. elif [ $BUILDSYSTEM = "UNIX_System_V" ];
  141. then
  142. PLATFORM=uxp
  143. PLATFORM_SCRIPT_DIR=uxp
  144. elif [ $BUILDSYSTEM = "OSF1" ];
  145. then
  146. PLATFORM=dec
  147. PLATFORM_SCRIPT_DIR=dec
  148. else # Build system = HP
  149. PLATFORM=hp-ux
  150. PLATFORM_SCRIPT_DIR=hp
  151. fi
  152. if [ "$PLATFORM" = "aix" ];
  153. then
  154. USER=`/bin/whoami`
  155. elif [ "$PLATFORM" = "sun" -o "$PLATFORM" = "usl" -o "$PLATFORM" = "uxp" ];
  156. then
  157. USER=`/usr/ucb/whoami`
  158. else
  159. USER=`/usr/bin/whoami`
  160. fi
  161. if [ "$USER" != "root" ];
  162. then
  163. USAGE
  164. echo ""
  165. echo "You must be root to run this script"
  166. echo ""
  167. exit 1
  168. fi
  169. PATH=/bin:/usr/bin:/etc:/usr/bin/X11:
  170. export PATH
  171. CLEANING="no"
  172. CLEANING_ETC="no"
  173. USE_ALTERNATE_UDB_DIR="no"
  174. USE_RELATIVE="no"
  175. STARTING_DIR=$PWD
  176. DATABASE_FILES=""
  177. LeaveLinks="no"
  178. REMOVE_LINKS="no"
  179. CLEAN_DAEMONS="yes"
  180. theLang=""
  181. DEVELOP_ENV="yes"
  182. RUNTIME_ENV="yes"
  183. rm -f /tmp/dinstallCDE.log
  184. Log "Options specified..."
  185. while [ $# -ne 0 ]; do
  186. case $1 in
  187. -a) Log " - alternate place to get the udb files from"
  188. shift;
  189. [ $# -ne 0 ] || {
  190. USAGE
  191. exit 1;
  192. }
  193. ALTERNATE_UDB_DIR=$1
  194. USE_ALTERNATE_UDB_DIR="yes"
  195. shift;
  196. ;;
  197. -f) Log " - load specific filesets"
  198. shift;
  199. [ $# -ne 0 ] || {
  200. USAGE
  201. exit 1;
  202. }
  203. DATABASE_FILES=$1
  204. shift;
  205. ;;
  206. -clean) Log " - delete all three cde directories"
  207. CLEANING="yes"
  208. CLEANING_ETC="yes"
  209. shift;
  210. ;;
  211. -cleanVar) Log " - delete only temporary and installation directories"
  212. CLEANING="yes"
  213. shift;
  214. ;;
  215. -relative) Log " - run the relative-located config scripts"
  216. USE_RELATIVE="yes"
  217. shift;
  218. ;;
  219. -prog) Log " - remove only the development environment"
  220. RUNTIME_ENV="no"
  221. shift;
  222. ;;
  223. -runtime) Log " - remove only the runtime environment"
  224. DEVELOP_ENV="no"
  225. shift;
  226. ;;
  227. -lang) Log " - configure backdrops and palettes for LANG"
  228. shift;
  229. [ $# -ne 0 ] || {
  230. USAGE
  231. exit 1;
  232. }
  233. theLang=$1
  234. shift;
  235. ;;
  236. esac
  237. done
  238. echo ""
  239. TOOL_DIR=$BUILD_TREE/admin/IntegTools/dbTools
  240. if [ "$USE_RELATIVE" = "yes" ]
  241. then
  242. POST_INSTALL_DIR=../post_install
  243. else
  244. POST_INSTALL_DIR=$BUILD_TREE/admin/IntegTools/post_install
  245. fi
  246. if [ "$USE_ALTERNATE_UDB_DIR" = "yes" ]
  247. then
  248. DATABASE_DIR=$ALTERNATE_UDB_DIR/databases
  249. else
  250. DATABASE_DIR=$BUILD_TREE/databases
  251. fi
  252. if [ "$DATABASE_FILES" = "" ]
  253. then
  254. if [ "$DEVELOP_ENV" = "yes" -a "$RUNTIME_ENV" = "yes" ]
  255. then
  256. DATABASE_FILES="CDE-RUN CDE-MIN CDE-TT CDE-MAN CDE-HELP-RUN CDE-C \
  257. CDE-MSG-C CDE-HELP-C CDE-SHLIBS CDE-HELP-PRG \
  258. CDE-PRG CDE-INC CDE-DEMOS CDE-MAN-DEV CDE-ICONS \
  259. CDE-FONTS"
  260. elif [ "$DEVELOP_ENV" = "yes" ]
  261. then
  262. DATABASE_FILES="CDE-HELP-PRG CDE-PRG CDE-INC CDE-DEMOS \
  263. CDE-MAN-DEV CDE-SHLIBS"
  264. elif [ "$RUNTIME_ENV" = "yes" ]
  265. then
  266. DATABASE_FILES="CDE-RUN CDE-MIN CDE-TT CDE-MAN CDE-HELP-RUN CDE-C \
  267. CDE-HELP-C CDE-MSG-C CDE-SHLIBS CDE-ICONS CDE-FONTS"
  268. fi
  269. fi
  270. INSTALL_LOCATION=CDE_INSTALLATION_TOP
  271. CONFIGURE_LOCATION=CDE_CONFIGURATION_TOP
  272. LOGFILES_LOCATION=CDE_LOGFILES_TOP
  273. DoScripts
  274. echo "Done."
  275. echo ""
  276. echo "See /tmp/dinstallCDE.log for a log of this de-install session."
  277. echo ""