configLang.src 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. XCOMM!/bin/ksh
  2. XCOMM $XConsortium: configLang.src /main/3 1996/04/23 19:33:13 drk $
  3. ConfigureBackdropsForLang()
  4. {
  5. if [ ! -d /etc/dt/backdrops/$thelang ]
  6. then
  7. mkdir -p /etc/dt/backdrops/$thelang
  8. fi
  9. typeset -L1 firstchar
  10. exec 3< ${build_tree}/cde1/localized/${thelang}/backdrops/backdrops.msg
  11. while read -u3 SRC
  12. do
  13. firstchar=$SRC
  14. if [ "$SRC" != "" -a "$firstchar" != "!" ]
  15. then
  16. set -A tokens $SRC
  17. if [ "${tokens[1]}" = "" ]
  18. then
  19. ln -s /usr/dt/backdrops/C/${tokens[0]} \
  20. /etc/dt/backdrops/$thelang/${tokens[0]}
  21. else
  22. ln -s /usr/dt/backdrops/C/${tokens[0]} \
  23. /etc/dt/backdrops/$thelang/${tokens[1]}
  24. fi
  25. fi
  26. done
  27. exec 3<&-
  28. }
  29. ConfigurePalettesForLang()
  30. {
  31. if [ ! -d /etc/dt/palettes/$thelang ]
  32. then
  33. mkdir -p /etc/dt/palettes/$thelang
  34. fi
  35. typeset -L1 firstchar
  36. exec 3< ${build_tree}/cde1/localized/${thelang}/palettes/palettes.msg
  37. while read -u3 SRC
  38. do
  39. firstchar=$SRC
  40. if [ "$SRC" != "" -a "$firstchar" != "!" ]
  41. then
  42. set -A tokens $SRC
  43. if [ "${tokens[1]}" = "" ]
  44. then
  45. ln -s /usr/dt/palettes/C/${tokens[0]} \
  46. /etc/dt/palettes/$thelang/${tokens[0]}
  47. else
  48. ln -s /usr/dt/palettes/C/${tokens[0]} \
  49. /etc/dt/palettes/$thelang/${tokens[1]}
  50. fi
  51. fi
  52. done
  53. exec 3<&-
  54. }
  55. #include "option.func"
  56. XCOMM ##################################################################
  57. XCOMM
  58. XCOMM Main Body
  59. XCOMM
  60. XCOMM ##################################################################
  61. build_tree=$PWD
  62. build_tree=${build_tree%/admin/IntegTools/post_install}
  63. thelang=$2
  64. if [ "$thelang" = "" -o "$thelang" = "-e" -o "$thelang" = "-d" ]
  65. then
  66. echo "Usage: configLang [ -e | -d ] <Lang>"
  67. return 1
  68. fi
  69. HandleOption $*
  70. if [ "$OPERATION" = "configure" ]
  71. then
  72. ConfigureBackdropsForLang
  73. ConfigurePalettesForLang
  74. elif [ "$OPERATION" = "deconfigure" ]
  75. then
  76. rm -rf /etc/dt/backdrops/$thelang
  77. rm -rf /etc/dt/palettes/$thelang
  78. fi