1 XCOMM $XConsortium: install.dt.usl.src /main/4 1996/04/23 11:19:27 drk $
2 XCOMM ==========================================================================
3 XCOMM ==========================================================================
6 XCOMM Platform specific function overrides for the April 1994 Snapshot
7 XCOMM install script, install.dt.
9 XCOMM This file is sourced by the install.dt script to allow platform
10 XCOMM specific behavior for certain functionality. These functions are:
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
17 XCOMM ==========================================================================
20 XCOMM ==========================================================================
22 XCOMM DtiClearScreen() - clears the screen
24 XCOMM The default DtiClearScreen() uses the 'clear' command to clear the
25 XCOMM screen. If this platform does not have the 'clear' command,
26 XCOMM declare DtiClearScreen() here with the appropriate functionality.
28 XCOMM Note: The default DtiClearScreen() writes to stderr, rather than stdout,
29 XCOMM so be sure to do the same here. DtiPrint() does this automatically, so
30 XCOMM use it if possible.
34 XCOMM DtiClearScreen()
36 XCOMM DtiPrint "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
37 XCOMM DtiPrint "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
44 XCOMM USL uses the default (clear). We'll define it here to ensure usage.
45 XCOMM ==========================================================================
51 XCOMM ==========================================================================
55 XCOMM The default DtiFreeSpace() does not check for free space, rather it
56 XCOMM simply returns a BigNumber that install.dt will assume is large
57 XCOMM enough in which to install the desktop.
59 XCOMM Declare DtiFreeSpace() here to return the actual available space for
60 XCOMM a particular directory.
62 XCOMM The $1 parameter will contain the directory name to test. The directory
63 XCOMM specified will exist. DtiFreeSpace() should return the number of bytes
64 XCOMM available via the DtiReturn() function.
67 XCOMM $1 - directory name
70 XCOMM number of bytes available
72 XCOMM ==========================================================================
76 blocks="$(df "$1" | sed 's/^.*://' | awk '{print $1}')"
78 [0-9]*) let blocks=blocks*512
79 DtiReturn "$blocks" ;;
80 *) DtiReturn "0" ;; # install.dt warn and confirm
84 XCOMM ==========================================================================
86 XCOMM DtiVerifyConfiguration
88 XCOMM The default DtiVerifyConfiguration() does no system configuration
89 XCOMM testing. For a particular platform, one might want to test for
90 XCOMM the presence of X11R5 or the OS version, for example, before allowing
91 XCOMM the desktop to be installed.
93 XCOMM Declare this function to make such platform specific tests. Return
94 XCOMM "yes" if the system passed, or "<message text>" if the system failed
95 XCOMM in which case install.dt will display the <message text> as the reason.
100 XCOMM "yes" - system configuration verified
101 XCOMM "<message text>" - verification failed, display message text
103 XCOMM ==========================================================================
105 DtiVerifyConfiguration()
107 if [ "$(uname -s)" = UNIX_SV -a "$(uname -r)" = 4.2 ]
109 if [ "$(uname -v)" = 1.0 ]
112 "WARNING: THE CDE DESKTOP IS NOT SUPPORTED ON UnixWare 1.0"
114 HASH for all 4.2 releases after 1.0
118 DtiReturn "ERROR: THIS IS NOT A \"UNIX_SV 4.2\" SYSTEM"
122 XCOMM ==========================================================================
126 XCOMM The default DtiWhoami() uses the 'whoami' command to determine
127 XCOMM the user name. If this platform does not have the 'whoami' command,
128 XCOMM declare DtiWhoami() here with the appropriate functionality.
133 XCOMM result of system 'whoami' command
135 XCOMM ==========================================================================
142 XCOMM ==========================================================================
144 XCOMM DtiPrint - echo to stderr and log
147 XCOMM $1 - data to echo to stdout and log
151 XCOMM Override on UnixWare because of printf "%s" integer-const problem
152 XCOMM This coordinates with the leading blank in the passing of " $meg" in master.
153 XCOMM ==========================================================================
161 printf "$1" "$2" "$3" "$4" "$5" "$6" $7 $8 $9 >&2
165 printf "$1" "$2" "$3" "$4" "$5" $6 $7 $8 $9 >&2
167 printf "$1" "$2" $3 $4 $5 $6 $7 $8 $9 >&2
171 printf "$1" $2 $3 $4 $5 $6 $7 $8 $9 >&2
173 Log "$1" $2 $3 $4 $5 $6 $7 $8 $9