Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ swpackage(8) — HP-UX 9.10

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

swacl(8)

swagentd(8)

swconfig(8)

swcopy(8)

swdepot(8)

swinstall(8)

swlist(8)

swremove(8)

swverify(8)

swpackage(4)

sd(4)

sd(5)

swpackage(8)  —  SD 2.0 Release

NAME

swpackage − Package software products into a target depot or tape

SYNOPSIS

swpackage [-p] [-v[v]] [-V] [-s product_specification_file|directory] [-d directory|device] [-x option=value] [-X option_file] [-f file] [software_selections]

DESCRIPTION

The swpackage command packages software products into:

• a distribution directory (which can be accessed directly, or copied onto a CD-ROM),

• a distribution tape (such as DDS, nine-track or cartridge tapes). 

A software product is organized into a three-level hierarchy: products, subproducts, and filesets. The actual files that make up a product are packaged into filesets. Subproducts can be used to partition or subset the filesets into logical groupings.  (Subproducts are optional.)  A product, subproduct, and fileset also have attributes associated with them.

Both directory and tape distributions use the same format.  The swpackage command:

• Organizes the software to be packaged into products, subproducts, and filesets,

• Provides flexible mechanisms to package source files into filesets,

• Modifies existing products in a distribution directory,

• Repackages products in a distribution directory into a distribution tape. 

Both the swpackage and swcopy commands create or modify a target depot.  The differences between these commands are:

• The swcopy command copies products from an existing depot to another depot.  The swpackage command creates products based on the user’s specification, and packages these products into a depot. 

• swpackage can be used to re-package software_selections from an existing distribution directory to a distribution tape. 

• The swcopy command can copy from a local or remote source to a set of local or remote targets.  The swpackage command packages source files from the local filesystem into a product, for insertion into a local distribution directory or tape. 

• After creating a target depot, swcopy registers that directory with the local swagentd so that it can be found by swlist, swinstall, etc.  With swpackage, the depot is not registered; the user must explicitly invoke the swdepot command. 

Options

swpackage supports the following options:

-p Previews a package session without actually creating or modifying the directory (tape). 

-v[v] Turns on verbose output to stdout.  (The swpackage logfile is not affected by this option.)  A second -v will turn on very verbose output.  Verbose output is enable by default, see the verbose option below. 

-V List the SDU data model revision(s) which swpackage supports.  By default, swpackage always packages using the latest SDU data model revision. 

-s product_specification_file|directory
The source Product Specification File (PSF) describes the product, subproduct, fileset, and file definitions used to build a software product from a set of source files. 

The source can also be an existing directory depot (which already contains products). 

-d directory|device
If creating a distribution directory, this option defines the pathname of the directory.

If creating a distribution tape, this option defines the device file on which to write the distribution.  When creating a distribution tape, the tape device (file) must exist, and the -x target_type=tape option must be specified (see below). 

-x option=value
Set the session option to value and override the default value (or a value in an alternate options_file specified with the -X option).  Multiple -x options can be specified. 

-X option_file
Read the session options and behaviors from options_file.

-f file Read the list of software_selections from file instead of (or in addition to) the command line. 

Operands

The swpackage command supports the following syntax for each software_selection:

product[.subproduct][.fileset][,version]

The version component supports either of these syntaxes:

[r=revision][,a=arch][,v=vendor][,vid=vendor_uuid]

[instance_id]

If specified, the operands cause swpackage to only (re)package those software selections from the full set defined in the source product_specification_file. If no software_selections are specified, then swpackage will (re)package all the products defined in the source product_specification_file.

EXTERNAL INFLUENCES

Defaults File

In addition to the standard options, several swpackage behaviors and policy options can be changed by editing the default values found in:

/var/adm/sw/defaults - the system-wide default values,

$HOME/.sw/defaults - the user-specific default values. 

Values must be specified in the defaults file using this syntax:

swpackage.option=value

The default values can be overridden by specifying an options file with the -X option, or by specifying -x option=value on the command line. 

Command Options
These keywords define source and target options as well as output and logging behavior:

swpackage.source_type=file
Defines the type of source to package; allowed values are file and directory. 

swpackage.source_file=psf
Defines the default product_specification_file to read as the source (when the source_type is file). The -s option overrides this default. 

swpackage.source_directory=/var/spool/sw
Defines the default distribution directory to read as the source (when the source_type is directory).  The -s option overrides this default. 

swpackage.target_type=directory
Defines the type of distribution to create.  The recognized types are directory and tape. 

swpackage.target_directory=/var/spool/sw
Defines the default distribution directory in which products will be packaged. The -d option overrides this default. 

swpackage.target_tape=/dev/swtape
Defines the default distribution tape in which products will be packaged.  The -d options overrides this default. 

swpackage.verbose=1
Controls the verbosity of the swpackage output (stdout).  A value of 0 disables output to stdout.  (Error and warning messages are always written to stderr).  A value of 1 enables verbose messaging to stdout.  A value of 2 enables very verbose messaging to stdout. 

swpackage.loglevel=1
Controls the log level for the events logged to the swpcackage logfile.  A value of 1 enables verbose logging to the logfile.  A value of 2 enables very verbose logging to the logfile. 

swpackage.logfile=/var/adm/sw/swpackage.log
Defines the file where all messages get logged.

swpackage.software=
Defines the default software_selections.  There is no supplied default.  If there is more than software selection, they must be separated by spaces. 

Source and Target Options
These options define swpackage behavior in reading the packaging source and packaging the target depot (tape). 

swpackage.follow_symlinks=false
Do not follow symbolic links in the package source files, but include the symbolic links in the packaged product(s).  A value of true for this keyword causes swpackage to follow symbolic links in the package source files and include the file(s) they reference in the packaged product(s). 

swpackage.include_file_revisions=false
Controls whether or not swpackage includes each source file’s revision attribute in the product(s) being packaged.  Because this operation is time consuming, by default the revision attributes are not included.  A value of true for this keyword causes swpackage to execute what(1) and possibly ident(1) (in that order) to try to determine a file’s revision. 

swpackage.enforce_dsa=true
A value of true for this keyword causes swpackage to terminate if the disc space required to package the software_selections into the target depot exceeds the minfree threshold for the impacted filesystem(s).  A value of false will cause swpackage to write into minfree space, up to the absolute limit of the filesystem(s). 

swpackage.package_in_place=false
A value of true for this keyword causes swpackage to package the specified products such that the target depot will not contain the files that make up a product.  Instead, swpackage inserts references to the original source files used to build a product.  This behavior allows the packaging of products in a development or test environment without consuming the full disc space of copying all the source files into the target depot. 

swpackage.reinstall_files=true
Controls whether or not swpackage re-installs files which have not changed (in a fileset which already exists in the target depot and is being repackaged).  A value of false for this keyword causes swpackage to only re-install those files which have changed (source file is different from the file in the target depot). 

swpackage.reinstall_files_use_cksum=false
If the reinstall_files keyword is false, this keyword controls how swpackage determines if files being re-installed (re-packaged) have changed.  By default, swpackage compares only the files’ size and modification time.  A value of true for this keyword causes swpackage to also compare the files’ checksum values. 

swpackage.write_remote_files=false
This option controls whether swpackage will write to a target depot which exists on a remote (NFS) filesystem.  If this option is set to true and the superuser has write permission on the remote filesystem, then swpackage will create or modify a target depot on that filesystem. 

swpackage.create_target_acls=true
If creating a target depot, this keyword determines whether swpackage will create Access Control Lists (ACLs) in the depot.  If the user is the superuser, a value of false for this keyword causes swpackage to not create ACLs for each new product being packaged (and for the depot if the depot is new).  When swpackage is invoked by any other user, it will always create ACLs in the target depot.  This keyword has no impact on the ACLs which already exist in the depot.  (The swpackage command never creates ACLs when software is packaged on to a distribution tape.) 

swpackage.media_capacity=1330
If creating a distribution tape, this keyword specifies the capacity of the tape in one-million byte units.  This option is required if the media is not a DDS tape or a disk file.  Without this option, swpackage sets the size to 1330 Mbytes for tape and "free space up to minfree" on a disk file. 

Session File

The swpackage command does not use a session file. 

Environment Variables

The swpackage command does not use any environment variables.  Each SDU command provides the following environment variables to the the control scripts defined for a product or fileset. 

SW_PATH

A PATH variable which defines a minimum set of commands available to for use in a control script (e.g.  /bin:/usr/bin). 

SW_ROOT_DIRECTORY

Defines the root directory in which the session is operating, either "/" or an alternate root directory.  This variable tells control scripts the root directory in which the products are installed.  A script must use this directory as a prefix to SW_LOCATION to locate the product’s installed files.  (The configure script is only run when SW_ROOT_DIRECTORY is "/".) 

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 the product files are located. 

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). 

The control scripts recognized by swpackage are described below. 

Signals

The swpackage command catches the signals SIGQUIT & SIGINT.  If these signals are received, swpackage prints a message and then exits.  Any products or filesets in the process of being (re)packaged are marked as CORRUPT, and need to be repackaged.  A tape distribution in the process of being created will also be corrupt and need to be re-generated. 

PRODUCT SPECIFICATION FILE

This section summarized the product_specification_file (PSF) which drives the swpackage session.  See swpackage(4) for a detailed description of a PSF’s syntax and semantics. 

A PSF is structured as follows:

[<depot specification>]

[<vendor specification>]

<product specification>

[<vendor specification>]

[<subproduct specifications>]

[<control script specifications>]

<fileset specification>

[<control script specifications>]

[<file specifications>]

[<fileset specification>]

 ... 

 

[<product specification>]

 ... 

If errors are encountered while parsing the PSF result in no valid product definitions, then swpackage terminates.  (All errors are logged to both stderr and the logfile.)  In summary, the swpackage user can:

• Specify attributes for the target depot/tape (optional);

• Specify one or more products;

• Specify vendor information (optional) for groups of products (including all products), or for individual products. 

• For each product, specify one or more subproducts (optional);

• For each product, specify one or more filesets. 

• For each fileset, specify one or more files. 

• For each product or fileset, specify one or more control scripts. 

See swpackage(4) for details. 

RETURN VALUES

The swpackage command returns:

0 The products specified in the product_specification_file were successfully packaged into the target depot/tape. 

1 An error occurred during the swpackage session (e.g. bad syntax in the product_specification_file.) Review stderr or the log file for details.

DIAGNOSTICS

The swpackage command writes to stdout, stderr, and to the logfile. 

Standard Output

The swpackage command writes messages for significant events.  These include:

• a begin and end session message,

• selection, analysis, packaging, and tape creation messages. 

Standard Error

The swpackage command writes messages for all WARNING and ERROR conditions to stderr. 

Logfile

The swpackage command logs detailed events to the log file /var/adm/sw/swpackage.log.  (The user can specify a different logfile by modifying the logfile option.) 

EXAMPLES

Package the products defined in the PSF products into the default target depot:

swpackage -s products

Preview the same operation (do not create the target depot), and generate very verbose output:

swpackage -p -vv -s products

Package the products into the target depot no_files, insert references to the source files instead of copying them into the depot:

swpackage -s products -d no_files -x package_in_place=true

Re-package a specific fileset:

swpackage -s products -d no_files -x package_in_place=true product.fileset

Re-package the entire contents of the depot /var/spool/sw onto the tape at /dev/rmt/0:

swpackage -s /var/spool/sw -d /dev/rmt/0 -x target_type=tape

FILES

/var/adm/sw/

The directory which contains all of the configurable (and non-configurable) data for SD.  This directory is also the default location of logfiles. 

/var/adm/sw/defaults

Contains the system-wide default values for some or all SD options. 

$HOME/.sw/defaults

Contains the user-specific default values for some or all SD options. 

/var/spool/sw/

The default location of a source and target software depot. 

/dev/swtape

The default location of a source and target tape. 

AUTHOR

swpackage was developed by the Hewlett-Packard Company. 

SEE ALSO

swacl(8), swagentd(8), swconfig(8), swcopy(8), swdepot(8), swinstall(8), swlist(8), swremove(8), swverify(8), swpackage(4), sd(4), sd(5), and the HP OpenView Software Distributor Administrator’s Guide.

Hewlett-Packard Company  —  Software Distributor 2.0

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026