159 lines
4.7 KiB
Plaintext
159 lines
4.7 KiB
Plaintext
XCOMM $XConsortium: install.dt.ibm.src /main/3 1996/04/21 19:06:56 drk $
|
|
XCOMM ==========================================================================
|
|
XCOMM ==========================================================================
|
|
XCOMM install.dt.ibm
|
|
XCOMM
|
|
XCOMM Platform specific function overrides for the April 1994 Snapshot
|
|
XCOMM install script, install.dt.
|
|
XCOMM
|
|
XCOMM This file is sourced by the install.dt script to allow platform
|
|
XCOMM specific behavior for certain functionality. These functions are:
|
|
XCOMM
|
|
XCOMM DtiClearScreen() - clear the screen
|
|
XCOMM DtiFreeSpace() - return available bytes in a directory
|
|
XCOMM DtiVerifyConfiguration() - verify system configuration
|
|
XCOMM DtiWhoami() - return user name
|
|
XCOMM
|
|
XCOMM ==========================================================================
|
|
XCOMM ==========================================================================
|
|
XCOMM
|
|
XCOMM DtiClearScreen() - clears the screen
|
|
XCOMM
|
|
XCOMM The default DtiClearScreen() uses the 'clear' command to clear the
|
|
XCOMM screen. If this platform does not have the 'clear' command,
|
|
XCOMM declare DtiClearScreen() here with the appropriate functionality.
|
|
XCOMM
|
|
XCOMM Note: The default DtiClearScreen() writes to stderr, rather than stdout,
|
|
XCOMM so be sure to do the same here. DtiPrint() does this automatically, so
|
|
XCOMM use it if possible.
|
|
XCOMM
|
|
XCOMM Example:
|
|
XCOMM
|
|
XCOMM DtiClearScreen()
|
|
XCOMM {
|
|
XCOMM DtiPrint "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
|
XCOMM DtiPrint "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
|
XCOMM }
|
|
XCOMM
|
|
XCOMM Input - none
|
|
XCOMM Output - none
|
|
XCOMM Return -none
|
|
XCOMM ==========================================================================
|
|
|
|
XCOMM DtiClearScreen() {
|
|
XCOMM clear 1>&2
|
|
XCOMM }
|
|
|
|
XCOMM ==========================================================================
|
|
XCOMM
|
|
XCOMM DtiFreeSpace
|
|
XCOMM
|
|
XCOMM The default DtiFreeSpace() does not check for free space, rather it
|
|
XCOMM simply returns a BigNumber that install.dt will assume is large
|
|
XCOMM enough in which to install the desktop.
|
|
XCOMM
|
|
XCOMM Declare DtiFreeSpace() here to return the actual available space for
|
|
XCOMM a particular directory.
|
|
XCOMM
|
|
XCOMM The $1 parameter will contain the directory name to test. The directory
|
|
XCOMM specified will exist. DtiFreeSpace() should return the number of bytes
|
|
XCOMM available via the DtiReturn() function.
|
|
XCOMM
|
|
XCOMM Input
|
|
XCOMM $1 - directory name
|
|
XCOMM Output - none
|
|
XCOMM Return
|
|
XCOMM number of bytes available
|
|
XCOMM
|
|
XCOMM ==========================================================================
|
|
|
|
DtiFreeSpace()
|
|
{
|
|
dtspace=`df $1 | awk '
|
|
BEGIN{
|
|
a = 1
|
|
}
|
|
{
|
|
if($1 == "Filesystem") {
|
|
getline
|
|
space = $3*1024
|
|
}
|
|
}
|
|
END{
|
|
a = space
|
|
print a
|
|
} ' `
|
|
DtiReturn $dtspace
|
|
}
|
|
|
|
XCOMM ==========================================================================
|
|
XCOMM
|
|
XCOMM DtiVerifyConfiguration
|
|
XCOMM
|
|
XCOMM The default DtiVerifyConfiguration() does no system configuration
|
|
XCOMM testing. For a particular platform, one might want to test for
|
|
XCOMM the presence of X11R5 or the OS version, for example, before allowing
|
|
XCOMM the desktop to be installed.
|
|
XCOMM
|
|
XCOMM Declare this function to make such platform specific tests. Return
|
|
XCOMM "yes" if the system passed, or "<message text>" if the system failed
|
|
XCOMM in which case install.dt will display the <message text> as the reason.
|
|
XCOMM
|
|
XCOMM Input - none
|
|
XCOMM Output - none
|
|
XCOMM Return
|
|
XCOMM "yes" - system configuration verified
|
|
XCOMM "<message text>" - verification failed, display message text
|
|
XCOMM
|
|
XCOMM ==========================================================================
|
|
|
|
DtiVerifyConfiguration()
|
|
{
|
|
IsX11R5=`lslpp -h | awk '
|
|
BEGIN {
|
|
X11R5=0
|
|
}
|
|
/X11rte.obj/ {
|
|
getline
|
|
if(($1 == "01.02.0003.0000") && ($2 == "COMPLETE")) {
|
|
X11R5=1
|
|
exit 1
|
|
}
|
|
}
|
|
END {
|
|
print X11R5
|
|
}'`
|
|
|
|
if [ $IsX11R5 = 1 ];
|
|
then
|
|
DtiReturn "yes"
|
|
else
|
|
DtiReturn "The Desktop requires that X11R5 be installed on your system.\n
|
|
0) Continue with Desktop Installation
|
|
99) Exit Desktop Installation
|
|
|
|
Please enter selection: "
|
|
fi
|
|
|
|
}
|
|
|
|
XCOMM ==========================================================================
|
|
XCOMM
|
|
XCOMM DtiWhoami
|
|
XCOMM
|
|
XCOMM The default DtiWhoami() uses the 'whoami' command to determine
|
|
XCOMM the user name. If this platform does not have the 'whoami' command,
|
|
XCOMM declare DtiWhoami() here with the appropriate functionality.
|
|
XCOMM
|
|
XCOMM Input - none
|
|
XCOMM Output - none
|
|
XCOMM Return
|
|
XCOMM result of system 'whoami' command
|
|
XCOMM
|
|
XCOMM ==========================================================================
|
|
|
|
XCOMM DtiWhoami()
|
|
XCOMM {
|
|
XCOMM whoami
|
|
XCOMM }
|