cdesktopenv/cde/admin/IntegTools/install.dt.uxp.src

176 lines
5.4 KiB
Plaintext

XCOMM $XConsortium: install.dt.uxp.src /main/4 1996/11/19 11:44:17 drk $
XCOMM ==========================================================================
XCOMM ==========================================================================
XCOMM install.dt.usl
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 ==========================================================================
#define HASH #
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 USL uses the default (clear). We'll define it here to ensure usage.
XCOMM ==========================================================================
DtiClearScreen() {
clear 1>&2
}
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()
{
blocks="$(df "$1" | sed 's/^.*://' | awk '{print $1}')"
case "$blocks" in
[0-9]*) let blocks=blocks*512
DtiReturn "$blocks" ;;
*) DtiReturn "0" ;; # install.dt warn and confirm
esac
}
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()
{
if [ "$(uname -s)" = UNIX_System_V -a "$(uname -r)" = 4.2.0 ]
then
DtiReturn "yes"
HASH if [ "$(uname -v)" = 1.0 ]
HASH then
HASH DtiReturn "WARNING: THE CDE DESKTOP IS NOT SUPPORTED ON UnixWare 1.0"
HASH else
HASH for all 4.2 releases after 1.0
HASH DtiReturn "yes"
HASH fi
else
DtiReturn "ERROR: THIS IS NOT A \"UNIX_System_V 4.2.0\" SYSTEM"
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 ==========================================================================
DtiWhoami()
{
/usr/ucb/whoami
}
XCOMM ==========================================================================
XCOMM
XCOMM DtiPrint - echo to stderr and log
XCOMM
XCOMM Input
XCOMM $1 - data to echo to stdout and log
XCOMM Output - none
XCOMM Return -none
XCOMM
XCOMM Override on UnixWare because of printf "%s" integer-const problem
XCOMM This coordinates with the leading blank in the passing of " $meg" in master.
XCOMM ==========================================================================
DtiPrint()
{
if [ "$#" -gt 1 ]
then
if [ "$#" -gt 5 ]
then
printf "$1" "$2" "$3" "$4" "$5" "$6" $7 $8 $9 >&2
else
if [ "$#" -gt 4 ]
then
printf "$1" "$2" "$3" "$4" "$5" $6 $7 $8 $9 >&2
else
printf "$1" "$2" $3 $4 $5 $6 $7 $8 $9 >&2
fi
fi
else
printf "$1" $2 $3 $4 $5 $6 $7 $8 $9 >&2
fi
Log "$1" $2 $3 $4 $5 $6 $7 $8 $9
}