Application Packaging Developer's Guide

The checkinstall Script

# checkinstall
script for SUNWstuf to politely suspend
grep quitinstall $1
if [ $? -eq 0 ]; then
	exit 3		# politely suspend installation
exit 0

This approach would not work very well if the base directory was simply /opt. This package has to call out the BASEDIR more precisely since /opt would be difficult to walk. In fact, depending on the mount scheme, it may not be possible. The example walks the base directory by creating a new directory under /opt, which does not introduce any problems.

This example uses a request script and a checkinstall script even though versions of Solaris prior to the 2.5 release cannot run a checkinstall script. The checkinstall script in this example is used for the purpose of politely halting the installation in response to a private message in the form of the string “quitinstall.” If this script executes under the Solaris 2.3 release, the checkinstall script is ignored and the request script halts the installation with an error message.

Remember that prior to the Solaris 2.5 and compatible releases, the BASEDIR parameter is a read-only parameter and cannot be changed by the request script. For this reason, if an old version of the SunOS operating system is detected (by testing for a conditioned CLIENT_BASEDIR environment variable), the request script has only two options—continue or quit.