HP-UX Reference (11i v1 05/09) - 4 File Formats (vol 8)

s
swpackage(4) swpackage(4)
(HP-UX Software Distributor)
supported for filesets only. It should undo the steps taken by the
postinstall script.
unpreinstall
Defines the installation post-restore script executed by
swinstall. A fileset script is executed
immediately after the fileset files are restored if there is an error and the
autorecover_product
option is set to true. A product script is executed after all filesets
for that product have been restored. It should undo the steps taken by the
preinstall
scripts.
verify
Defines the verification script executed by
swverify. This script verifies the configuration per-
formed by the
configure script.
Space Files
The space control_file is not a script. It lets you define additional disk space requirements for the filesets
and notes positive disk space impact on any directory or file that results from the actions of control scripts.
Each fileset or product may contain a space file. The space file lists a path and a byte size for each path:
/tmp/space_dummy1 2000
/opt/space_dummy2 2000
/tmp/space_dummy3 3000
/mydir/ 4000
For each directory or file path listed in the space file, swinstall adds the size in bytes to the disk space
requirements. The size reflects the maximum transient or permanent disk space required for the install.
Script Interpreter
By default, SD interprets scripts with a POSIX shell (
sh). Control scripts can also define their own inter-
preter in the first line of the script. You can use the interpreter keyword to define a different inter-
preter for specific scripts. The syntax is:
interpreter interpreter_name
For example:
control_file
source scripts
tag checkinstall
interpreter ksh
SD checks that the interpreter is available. If not, the script fails. If SD finds the interpreter, it processes
the script normally using the specified interpreter.
You can use a checkinstall script to verify the existence of any script interpreters that you specify.
Environment Variables for Scripts
The following environment variables affect scripts:
SW_CATALOG
Holds the path to the Installed Products Database (IPD), relative to the path in the
SW_ROOT_DIRECTORY environment variable. Note that you can specify a path for the IPD
using the installed_software_catalog default option.
SW_CONTROL_DIRECTORY
Defines the current directory of the script being executed, either a temporary catalog directory,
or a directory within in the Installed Products Database (IPD). This variable tells scripts where
other control scripts for the software are located (e.g. subscripts).
SW_CONTROL_TAG
Holds the tag name of the control_file being executed. When packaging software, you can define
a physical name and path for a control file in a depot. This lets you define the control_file with a
name other than its tag and lets you use multiple control file definitions to point to the same file.
A control_file can query the SW_CONTROL_TAG variable to determine which tag is being exe-
cuted.
SW_LOCATION
Defines the location of the product, which may have been changed from the default product
directory. When combined with the SW_ROOT_DIRECTORY, this variable tells scripts where
HP-UX 11i Version 1: September 2005 19 Hewlett-Packard Company Section 4307