swlist(8) — SD 2.0 Release
NAME
swlist − Display information about software products
SYNOPSIS
swlist [-d|-r] [-l level] [-v] [-a attribute] [-s source] [-x option=value] [-X option_file] [-f file] [-t target_file] [-S session_file] [software_selections] [ @ target_selections]
DESCRIPTION
The swlist command displays information about software products installed at or available from the specified target_selections. It supports these features:
• Specify products, subproducts, and/or filesets to list.
• Display the files contained in each fileset.
• Display a table of contents from a software source.
• Specify the attributes to display for each software object.
• Display all attributes for products, subproducts, filesets and/or files.
• Display the structure of software selections.
• Display the depots on a specified host.
• Create a list of products, subproducts, and/or filesets to use as input to the swinstall or swremove commands.
Options
When no options or operands are specified, swlist lists the software products installed at the local host. swlist supports the following options:
-d List software available from a depot (instead of software installed on a root filesystem).
-r List products installed on an alternate root filesystem (instead of software installed on /).
-l level List all objects down to the specified level. Only one level can be specified. The supported levels are:
depot Show only the depot level (i.e. depots which exist at the specified target hosts).
product Show all objects down to the product level (i.e. depots and products).
subproduct
Show all objects down to the subproduct level (i.e. depots, products, and subproducts).
fileset Show all objects down to the fileset level (i.e. depots, products, subproducts, and filesets).
file Show all objects down to the file level (i.e. depots, products, subproducts, filesets, and files).
Both the specified level and the depth of the specified software_selections control the depth of the swlist output.
-v If no -a options are specified, then list all the attributes for an object, one attribute per line. The attributes are listed in the format:
keyword value
If one or more -a options are specified, then list on the selected attributes in the above format.
-a attribute Each object has its own set of attributes. These attributes include such things as revision, description, vendor information, size, and many others. The -a option selects a specific attribute to display. You can specify multiple -a options to display multiple attributes.
Note that the tag attribute (i.e. the identifier) is always displayed for product, subproduct, and fileset objects. The path attribute (i.e. the filename) is always displayed for file objects.
The full set of attributes for a given software object can be obtained using the -v option. See also sd(4) for details on these attributes.
-s source Specifies the software source to list. This is an alternate way to list a source depot. Sources can also be specified as target depots and listed using the -d option.
-x option=value Set the session option to value and override the default value (or a value in an alternate option_file specified with the -X option). Multiple -x options can be specified.
-X option_file Read the session options and behaviors from option_file.
-f file Read the list of software_selections from file instead of (or in addition to) the command line.
-t target_file Read the list of target_selections from target_file instead of (or in addition to) the command line.
-S session_file Execute swlist based on the options and operands saved from a previous session, as defined in session_file.
Operands
The swlist 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][,l=location]
[instance_id]
The swlist command supports the following syntax for each target_selection:
[host][:][/directory]
EXTERNAL INFLUENCES
Defaults File
In addition to the standard options, list formats and swlist 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 a defaults file using this syntax:
swlist.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
The following defaults are used to modify the default behavior of the swlist command:
swlist.level=
Defines the default level to which objects are listed. The valid levels are: depot, product, subproduct, fileset, and file.
swlist.one_liner= revision title
Defines the attributes which will be listed for each object when no -a or -v options are specified. Each attribute included in the one_liner definition is separated by <tab> or <space>. Any attributes may be included in the one_liner definition. If a particular attribute does not exist for an object, then that attribute is silently ignored. For example, the description attribute is valid for products, subproducts, and filesets, but the architecture attribute is only valid for products.
swlist.target_directory=/var/spool/sw
Defines the default location of the target depot.
swlist.verbose=0
Controls how attribute values are displayed. A value of 0 displays only the attribute value. A value of 1 displays both the attribute keyword and value. (See the -v option above.)
swlist.select_local=true
If no target_selections are specified, select the default root directory /, or the default target_directory (when the -d option is specified), at the local host as the target of the command.
swlist.targets=
Defines the default target_selections. There is no supplied default (see select_local above). If there is more than target selection, they must be separated by spaces.
swlist.software=
Defines the default software_selections. There is no supplied default. If there is more than software selection, they must be separated by spaces.
Remote Procedure Call Options
These options apply to the DCE Remote Procedure Call used by swlist:
swlist.rpc_binding_info=ncadg_ip_udp:[2121]
Defines the protocol sequence(s) and endpoint(s) which will be used to contact swagentd. This value should be consistent among all hosts that work together. See sd(5) for details on specifying this option.
swlist.rpc_timeout=5
Relative length of the communications timout. This is a value in the range from 0 to 9 and is interpreted by the DCE RPC. Higher values mean longer times; you may need a higher value for a slow or busy network. Lower values will give faster recognition on attempts to contact hosts that are not up, or are not running the swagentd.
Session File
Each invocation of the swlist command defines a list session. The invocation options, source information, software selections, and target hosts are saved before the list task actually commences. This session is saved to the file $HOME/.sw/sessions/swlist.last. This session can be re-executed by using the file as input to swlist (with the -S option.)
The session file uses the same syntax as the defaults files. Values in the defaults file are overridden by values from a session file, if specified. These are in turn overidden by the corresponding command line option or parameter(s), if specified.
Environment Variables
The swlist command does not use environment variables.
Signals
The swlist command catches the signals SIGQUIT and SIGINT. If these signals are received, swlist prints a message, sends a Remote Procedure Call (RPC) to the agents to wrap up, and then exits.
Each agent will complete the list task (if the execution phase has already started) before it wraps up.
OPERATION
The output from swlist follows this rule with all options: only the lowest level listed (product, subproduct, fileset or file) will be uncommented. Among other things, this allows the output from swlist to be used as input to other commands. The one exception is the list that contains files; file-level output is not accepted by other commands.
The types of listings that can be selected are given below. Some of these listings are not exclusive choices, but rather ways to view the objects while controlling the amount of output.
• Default Listing
• Software Listing
• Depot Listing
• Multiple Targets Listing
• Verbose Listing
Default Listing
If swlist is invoked with no software_selections and no target_selections, a listing of all installed products on the local host is produced. This listing contains one line for each product. The line includes the product tag attributes and all other attributes selected via the one_liner option.
If target_selections (i.e. target hosts) are specified, this same format listing is produced for the installed software at each of the specified hosts.
Software Listing
A listing of software objects is controlled by the specified software_selections, and also by the -l option ( swlist.level=).
For each software object specified in the software_selections, swlist lists the contents of each. For example, if you specify product selections, then the subproducts and/or filesets contained immediately below each product will be listed. If you specify fileset selections, then the files contained in each fileset will be listed:
The depth of objects listed is controlled with the -l option. This option can expand or restrict the depth in concert with the specified software selections. By default, the contents of a specified software selection are always listed (as described above). The -l option can defeat this listing by specifying a level equivalent to the level of objects in the software_selections. For example, if you want to list specific product selections but not their contents, use -l product. If you want to list specific fileset selections but not their contained files, use -l fileset.
Depot Listing
Another class of objects that swlist can display are software depots. For example, the user can list all registered depots on a given host. A combination of the -l depot option and target_selections operands can produce a variety of depot listings.
Multiple Targets Listing
Multiple target_selections (i.e. root filesystems, alternate roots, or depots) are listed sequentially: list all the requested objects and attributes from the first target_selection, followed by the second target_selection, etc.
Verbose Listing
The -v option causes a verbose listing to be generated. A verbose listing includes all attributes defined for an object. The swlist command will print the keyword and value for each attribute. The attributes are listed one per line. The user can post-process (filter) the output with grep(1), awk(1), and/or sed(1) to get the fields of interest.
The depot’s attributes are displayed if swlist is called with the -v and -l depot options, and a specific depot target_selection.
Attributes for a particular software level (product/subproduct/fileset/file) are displayed based on the depth of the specified software_selections. For example, swlist -v product1.fileset1 will give all fileset attributes for fileset1. If the -v option is used with the -l option, the different listing are:
• To display attributes for all products, use swlist -v -l product
• To display attributes for all products and subproducts, use swlist -vl subproduct
• To display attributes for all products, subproducts, and filesets, use swlist -vl fileset
• To display attributes for all products, subproducts, and filesets, and files, use swlist -vl file
RETURN VALUE
The swlist command returns:
0 The software_selections and/or target_selections were successfully listed.
1 The list operation failed on all target_selections.
2 The list operation failed on some target_selections.
DIAGNOSTICS
The swlist command writes to stdout, stderr, and to the agent logfile.
Standard Output
All listings are printed to stdout.
Standard Error
The swlist command writes messages for all WARNING and ERROR conditions to stderr.
Logging
The swlist command does not log summary events. It logs events about each read task to the swagent logfile associated with each target_selection.
EXAMPLES
To list all of the products installed on the local host:
swlist
Generate a comprehensive listing that includes all filesets for the product NETWORKING:
swlist -v -l fileset NETWORKING
Produce a verbose listing of the ARPA-RUN fileset:
swlist -v NETWORKING.ARPA.ARPA-RUN
List the C product installed on several remote hosts:
swlist cc @ hostA hostB hostC
List the FRAME product installed at directory /opt/frame on host1:
swlist FRAME,1=/opt @ host1
List all the versions of the FRAME product installed on the toolserver host:
swlist FRAME @ toolserver
List the contents of the local tape, /dev/swtape:
swlist -d @ /dev/swtape
or, alternatively:
swlist -s /dev/swtape
List the tag and revision attributes for all products on the local tape /dev/swtape:
swlist -d -a revision @ /dev/swtape
or, alternatively:
swlist -a revision -s /dev/swtape
Display the README file for the FRAME product:
swlist -a readme FRAME
List the products stored in a remote depot:
swlist -d @ hostA:/depot
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.
$HOME/.sw/sessions/
Contains session files automatically saved by the SD commands, or explicitly saved by the user.
/var/adm/sw/products/
The Installed Products Database (IPD), a catalog of all products installed on a system.
/var/spool/sw/
The default location of a source and target software depot.
/var/adm/sw/host_object
The file which stores the list of depots registered at the local host.
AUTHOR
swlist was developed by the Hewlett-Packard Company.
SEE ALSO
swacl(8), swagentd(8), swconfig(8), swcopy(8), swdepot(8), swinstall(8), swpackage(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