configRun.src 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. XCOMM! /bin/ksh
  2. XCOMM #######
  3. XCOMM Product: CDE
  4. XCOMM Fileset: CDE-RUN
  5. XCOMM configure
  6. XCOMM @(#) $TOG: configRun.src /main/1 1998/03/11 16:18:24 mgreess $
  7. XCOMM #######
  8. #define HASH #
  9. #define STAR *
  10. retval=0
  11. CreateAppConfigDirectory()
  12. {
  13. HASH
  14. HASH Create the APPCONFIG directory inside DT_CONFIG_TOP and create
  15. HASH all of its subdirectories
  16. HASH
  17. cd "$DT_CONFIG_TOP" || exit
  18. if [ ! -d "$APPCONFIG" ]
  19. then
  20. mkdir "$APPCONFIG"
  21. fi
  22. cd "$APPCONFIG" || exit
  23. for i in $APPCONFIG_DIRS
  24. do
  25. (
  26. if [ ! -d "$i" ]
  27. then
  28. mkdir "$i"
  29. fi
  30. cd "$i" || exit
  31. HASH
  32. HASH for each locale
  33. HASH
  34. for j in $DT_TOP/$APPCONFIG/$i/STAR
  35. do
  36. if [ ! -d "$(basename "$j")" ]
  37. then
  38. mkdir "$(basename "$j")"
  39. fi
  40. done
  41. )
  42. done
  43. }
  44. doDttermTerminfo()
  45. {
  46. if [ -f "$DT_TOP/config/dtterm.ti" ]
  47. then
  48. tic "$DT_TOP/config/dtterm.ti"
  49. if [ -f /usr/share/lib/terminfo/d/dtterm ]
  50. then
  51. chown bin /usr/share/lib/terminfo/d/dtterm
  52. chgrp bin /usr/share/lib/terminfo/d/dtterm
  53. chmod 644 /usr/share/lib/terminfo/d/dtterm
  54. else
  55. if [ -f /usr/share/terminfo/d/dtterm ]
  56. then
  57. chown bin /usr/share/terminfo/d/dtterm
  58. chgrp bin /usr/share/terminfo/d/dtterm
  59. chmod 644 /usr/share/terminfo/d/dtterm
  60. fi
  61. fi
  62. if [ ! -f /usr/share/lib/terminfo/d/dtterm ] && [ ! -f /usr/share/terminfo/d/dtterm ]
  63. then
  64. echo "Unable to compile $DT_TOP/config/dtterm.ti"
  65. fi
  66. else
  67. echo "Unable to find $DT_TOP/config/dtterm.ti"
  68. fi
  69. }
  70. RemoveRunFiles()
  71. {
  72. while read -r SRC
  73. do
  74. if [ "$SRC" != "" ]
  75. then
  76. rm -f "$SRC"
  77. dirname=${SRC%/STAR}
  78. if [ -d "$dirname" ]
  79. then
  80. cd "$dirname" || exit
  81. while [ "$dirname" != "$CDE_TOP" ]
  82. do
  83. cd ..
  84. rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null
  85. dirname=${dirname%/STAR}
  86. done
  87. fi
  88. fi
  89. done <<-EOF
  90. #include "CDE-RUN.list"
  91. EOF
  92. }
  93. VerifyInstalledFiles()
  94. {
  95. echo "Status mode owner group filename"
  96. echo "-----------------------------------------"
  97. XCOMM exists correct correct correct /usr/dt/foo1
  98. XCOMM MISSING WRONG WRONG WRONG /usr/dt/foo2
  99. XCOMM exists the link is correct /usr/dt/link
  100. while read SRC
  101. do
  102. #include "../verify.func"
  103. done <<-EOF
  104. #include "CDE-RUN.lst"
  105. EOF
  106. }
  107. PrintUsage()
  108. {
  109. echo "Usage:" "$0" "[OPERATION]"
  110. echo ""
  111. echo "Operations:"
  112. echo " -e configure"
  113. echo " -d deconfigure"
  114. echo " -v verify"
  115. echo " -s size"
  116. echo " -h help"
  117. }
  118. #include "../option.func"
  119. XCOMM ##########################################################################
  120. XCOMM
  121. XCOMM Main Body
  122. XCOMM
  123. XCOMM ##########################################################################
  124. DT_TOP=CDE_INSTALLATION_TOP
  125. DT_CONFIG_TOP=CDE_CONFIGURATION_TOP
  126. DT_TEMP_TOP=CDE_LOGFILES_TOP
  127. retval=0
  128. APPCONFIG=appconfig
  129. APPCONFIG_DIRS="appmanager help icons types"
  130. HandleOption "$*"
  131. if [ "$OPERATION" = "usage" ]
  132. then
  133. PrintUsage
  134. exit 0
  135. fi
  136. if [ "$OPERATION" = "configure" ]
  137. then
  138. HASH
  139. HASH create the CDE_LOGFILES_TOP directory
  140. HASH
  141. if [ ! -d $DT_TEMP_TOP/$APPCONFIG/appmanager ]
  142. then
  143. mkdir -p $DT_TEMP_TOP/$APPCONFIG/appmanager
  144. fi
  145. cd "$DT_TEMP_TOP" || exit
  146. mv $APPCONFIG/appmanager .hidden-appmanager
  147. chmod -R 755 -- *
  148. chmod 755 .hidden-appmanager
  149. chown -R bin -- *
  150. chgrp -R bin -- *
  151. mv .hidden-appmanager $APPCONFIG/appmanager
  152. chmod 755 .
  153. chown bin .
  154. chgrp bin .
  155. HASH
  156. HASH create the CDE_CONFIGURATION_TOP and its config directory
  157. HASH
  158. if [ ! -d $DT_CONFIG_TOP ]
  159. then
  160. mkdir -p $DT_CONFIG_TOP
  161. fi
  162. if [ ! -d $DT_CONFIG_TOP/config ]
  163. then
  164. mkdir -p $DT_CONFIG_TOP/config
  165. fi
  166. CreateAppConfigDirectory
  167. HASH
  168. HASH ConfigurePrintersDir
  169. HASH
  170. HASH env LANG=C /usr/dt/bin/dtprintinfo -populate
  171. HASH
  172. HASH Configure Xsession.d
  173. HASH
  174. cd $DT_CONFIG_TOP/config || exit
  175. if [ ! -d Xsession.d ]
  176. then
  177. mkdir Xsession.d
  178. fi
  179. cd $DT_CONFIG_TOP || exit
  180. chmod -R 755 -- *
  181. doDttermTerminfo
  182. elif [ "$OPERATION" = "deconfigure" ]
  183. then
  184. RemoveRunFiles
  185. VerifyInstalledFiles
  186. elif [ "$OPERATION" = "verify" ]
  187. then
  188. VerifyInstalledFiles
  189. fi
  190. return $retval