install.dt.sun.src 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. XCOMM $XConsortium: install.dt.sun.src /main/3 1996/04/21 19:07:03 drk $
  2. XCOMM ==========================================================================
  3. XCOMM ==========================================================================
  4. XCOMM install.dt.sun
  5. XCOMM
  6. XCOMM Platform specific function overrides for the April 1994 Snapshot
  7. XCOMM install script, install.dt.
  8. XCOMM
  9. XCOMM This file is sourced by the install.dt script to allow platform
  10. XCOMM specific behavior for certain functionality. These functions are:
  11. XCOMM
  12. XCOMM DtiClearScreen() - clear the screen
  13. XCOMM DtiFreeSpace() - return available bytes in a directory
  14. XCOMM DtiVerifyConfiguration() - verify system configuration
  15. XCOMM DtiWhoami() - return user name
  16. XCOMM
  17. XCOMM ==========================================================================
  18. XCOMM ==========================================================================
  19. XCOMM
  20. XCOMM DtiClearScreen() - clears the screen
  21. XCOMM
  22. XCOMM The default DtiClearScreen() uses the 'clear' command to clear the
  23. XCOMM screen. If this platform does not have the 'clear' command,
  24. XCOMM declare DtiClearScreen() here with the appropriate functionality.
  25. XCOMM
  26. XCOMM Note: The default DtiClearScreen() writes to stderr, rather than stdout,
  27. XCOMM so be sure to do the same here. DtiPrint() does this automatically, so
  28. XCOMM use it if possible.
  29. XCOMM
  30. XCOMM Example:
  31. XCOMM
  32. XCOMM DtiClearScreen()
  33. XCOMM {
  34. XCOMM DtiPrint "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
  35. XCOMM DtiPrint "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
  36. XCOMM }
  37. XCOMM
  38. XCOMM Input - none
  39. XCOMM Output - none
  40. XCOMM Return -none
  41. XCOMM ==========================================================================
  42. XCOMM DtiClearScreen() {
  43. XCOMM clear 1>&2
  44. XCOMM }
  45. XCOMM ==========================================================================
  46. XCOMM
  47. XCOMM DtiFreeSpace
  48. XCOMM
  49. XCOMM The default DtiFreeSpace() does not check for free space, rather it
  50. XCOMM simply returns a BigNumber that install.dt will assume is large
  51. XCOMM enough in which to install the desktop.
  52. XCOMM
  53. XCOMM Declare DtiFreeSpace() here to return the actual available space for
  54. XCOMM a particular directory.
  55. XCOMM
  56. XCOMM The $1 parameter will contain the directory name to test. The directory
  57. XCOMM specified will exist. DtiFreeSpace() should return the number of bytes
  58. XCOMM available via the DtiReturn() function.
  59. XCOMM
  60. XCOMM Input
  61. XCOMM $1 - directory name
  62. XCOMM Output - none
  63. XCOMM Return
  64. XCOMM number of bytes available
  65. XCOMM
  66. XCOMM ==========================================================================
  67. DtiFreeSpace()
  68. {
  69. BDFOUT=`df -k $1 | awk '{print $4}'`
  70. for i in $BDFOUT
  71. do
  72. if [ "$i" != "avail" ]
  73. then
  74. i=`expr $i \* 1024`
  75. DtiReturn "$i"
  76. fi
  77. done
  78. }
  79. XCOMM ==========================================================================
  80. XCOMM
  81. XCOMM DtiVerifyConfiguration
  82. XCOMM
  83. XCOMM The default DtiVerifyConfiguration() does no system configuration
  84. XCOMM testing. For a particular platform, one might want to test for
  85. XCOMM the presence of X11R5 or the OS version, for example, before allowing
  86. XCOMM the desktop to be installed.
  87. XCOMM
  88. XCOMM Declare this function to make such platform specific tests. Return
  89. XCOMM "yes" if the system passed, or "<message text>" if the system failed
  90. XCOMM in which case install.dt will display the <message text> as the reason.
  91. XCOMM
  92. XCOMM Input - none
  93. XCOMM Output - none
  94. XCOMM Return
  95. XCOMM "yes" - system configuration verified
  96. XCOMM "<message text>" - verification failed, display message text
  97. XCOMM
  98. XCOMM ==========================================================================
  99. XCOMM DtiVerifyConfiguration()
  100. XCOMM {
  101. XCOMM DtiReturn "yes"
  102. XCOMM }
  103. XCOMM ==========================================================================
  104. XCOMM
  105. XCOMM DtiWhoami
  106. XCOMM
  107. XCOMM The default DtiWhoami() uses the 'whoami' command to determine
  108. XCOMM the user name. If this platform does not have the 'whoami' command,
  109. XCOMM declare DtiWhoami() here with the appropriate functionality.
  110. XCOMM
  111. XCOMM Input - none
  112. XCOMM Output - none
  113. XCOMM Return
  114. XCOMM result of system 'whoami' command
  115. XCOMM
  116. XCOMM ==========================================================================
  117. DtiWhoami()
  118. {
  119. /usr/ucb/whoami
  120. }