configManDev.src 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. XCOMM! /bin/ksh
  2. XCOMM #######
  3. XCOMM Product: CDE
  4. XCOMM Fileset: CDE-MAN-DEV
  5. XCOMM customize
  6. XCOMM @(#) $XConsortium: configManDev.src /main/4 1996/04/23 19:33:22 drk $
  7. XCOMM #######
  8. XCOMM
  9. XCOMM (c) Copyright Hewlett-Packard Company, 1993
  10. XCOMM
  11. XCOMM #######
  12. #define STAR *
  13. XCOMM ############################################
  14. RemoveManDevFiles()
  15. {
  16. while read -r SRC
  17. do
  18. if [ "$SRC" != "" ]
  19. then
  20. if [ -L "$SRC" ] && [ -d "$SRC" ]
  21. then
  22. results=$(find -name "$SRC")
  23. if [ ! -s "$SRC" ]
  24. then
  25. rm -f "$SRC"
  26. else
  27. continue
  28. fi
  29. else
  30. rm -f "$SRC"
  31. fi
  32. dirname=${SRC%/STAR}
  33. if [ -d "$dirname" ]
  34. then
  35. cd "$dirname" || exit
  36. while [ "$dirname" != "$CDE_TOP" ]
  37. do
  38. cd ..
  39. rmdir "${dirname##STAR/}" >/dev/null 2>/dev/null
  40. dirname=${dirname%/STAR}
  41. done
  42. fi
  43. fi
  44. done <<-EOF
  45. #include "CDE-MAN-DEV.list"
  46. EOF
  47. }
  48. VerifyInstalledFiles()
  49. {
  50. echo "Status mode owner group filename"
  51. echo "-----------------------------------------"
  52. XCOMM exists correct correct correct /usr/dt/foo1
  53. XCOMM MISSING WRONG WRONG WRONG /usr/dt/foo2
  54. XCOMM exists the link is correct /usr/dt/link
  55. while read -r SRC
  56. do
  57. #include "verify.func"
  58. done <<-EOF
  59. #include "CDE-MAN-DEV.lst"
  60. EOF
  61. }
  62. #include "option.func"
  63. XCOMM ##########################################################################
  64. XCOMM
  65. XCOMM Main Body
  66. XCOMM
  67. XCOMM ##########################################################################
  68. retval=0
  69. CDE_TOP=CDE_INSTALLATION_TOP
  70. HandleOption "$*"
  71. if [ "$OPERATION" = "deconfigure" ]
  72. then
  73. echo "de-Configuring for CDE-MAN-DEV..."
  74. RemoveManDevFiles
  75. VerifyInstalledFiles
  76. elif [ "$OPERATION" = "verify" ]
  77. then
  78. VerifyInstalledFiles
  79. fi
  80. return $retval