Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Software Distributor Administration Guide: HP-UX 11i v1, 11i v2, and 11i v3 > Chapter 3 Managing Installed Software

Modifying the IPD (swmodify)

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

SD-UX keeps track of software installations, products, and filesets on your system with the Installed Products Database (IPD) for installed software and with catalog files for software in depots.

Both the IPD and catalog files are created and constantly modified by other SD-UX operations (swinstall, swcopy, and swremove), they are not directly accessible if you want to change the information they contain. If you need to edit the information in either the IPD or in any depots’ catalog files, you must use the swmodify command.

The swmodify command adds, modifies, or deletes software objects or attributes defined in a software depot, primary root or alternate root. It is a direct interface to a depot’s catalog files or a root’s Installed Products Database. It does not change the files that make up the object, it only manipulates the information that describes the object.

Using swmodify, you can

  • Add new bundle, product, subproduct, fileset, control script or file definitions to existing objects

  • Remove the description of software objects from a depot catalog file or root IPD

  • Change attribute values for any existing object.

  • Define attributes for new objects that you add.

The equivalent IPD files for a depot are called catalog files. When a depot is created or modified using swcopy, catalog files are built (by default in /var/spool/sw/catalog) that describe the depot and its contents.

IPD Contents

Located in the directory /var/adm/sw/products, the IPD is a series of files and subdirectories that contain information about all the products that are installed under the root directory (/). This information includes “tags” or product names, one-line title fields, paragraph-or-longer description text, long README files, copyright information, vendor information and part numbers on each product installed. In addition, the IPD contains revision information and a user-targeted architecture field including the four uname attributes (operating system name, release, version and hardware machine type). Here is what the IPD INFO file for a product called “Accounting” looks like:

fileset tag ACCOUNTNG data_model_revision 2.4 instance_id 1 control_directory ACCOUNTNG size 292271 revision B.11.00 description Vendor Name: Hewlett-Packard Company Product Name: Accounting Fileset Name: ACCOUNTING Text: "HP-UX System Accounting feature set. Use these  features to gather billing data for such items as disk space  usage, connect time or CPU resource usage. " timestamp 797724879 install_date 199504121614.39 install_source hpfclc.fc.hp.com:/release/11.00_gsL/goodsystem state configured ancestor HPUX10.20.ACCOUNTNG corequisite OS-Core.CMDS-MIN,r>=B.11.00,a=HP-UX_B.11.00_32/64,fa=HP-UX_B.11.00_32/64,v=HP

Catalog files are the equivalent IPD files but they are for software stored in a depot. When a depot is created or modified using swcopy, these files are created and placed in the specified depot (or in the default /var/spool/sw depot). They describe the depot and its contents.

The swinstall, swconfig, swcopy, and swremove tasks automatically add to, change and delete IPD and catalog file information as the commands are executed. swlist and swverify tasks read the IPD information and use it to affect command behavior.

The IPD also contains the swlock file, which manages simultaneous read and/or write access to software objects.

Using swmodify

Syntax

swmodify [-d] [-p] [-r] [-u] [-v [-V] [-a attribute=[value]] [-c catalog][-C session file] [-f software_file] [-P pathname_file] [-s product_specification_file] [-S session_file] [-x option=value][-X option_file]  [software_selections] [@ target_selection]

Options and Operands

-d

Perform modifications on a depot (not on a primary or alternate root). Your target_selection must be a depot.

-p

Previews a modify session without changing anything within the target_selection.

-r

Perform modifications on an alternate root instead of the primary root. Your target_selection must be an alternate root.

-u

If no -a attribute options are specified, then delete the specified software_selections from within your target_selection. This action deletes the definitions of the software objects from the depot catalog or Installed Products Database.

If -a attribute options are specified, then delete them from within the given target_selection.

-v

Turns on verbose output to stdout. (The swmodify logfile is not affected by this option.)

-V

Lists all the SD layout_versions this command supports.

-a attribute=value

Add, change, or deletes the attribute value. Otherwise, it adds/changes the attribute for each software_selection by setting it to the given value.

Multiple -a options can be specified. Each attribute modification will be applied to every software_selection.

The -s and -a options are mutually exclusive: the -s option cannot be specified when the -a option is specified.

You cannot use the -a option to change the following attributes: tag, revision, instance_id, vendor_tag, corequisite or prerequisite.

-c catalog

Writes full catalog structure information into the directory specified by catalog. All attributes down to the file level and control scripts are written. See “Requesting User Responses (swask)”.

-C session_file

Run the command and save the current option and operand values to a session_file for reuse in another session. See “Session Files”.

-f software_file

Read a list of software selections from a separate file instead of (or in addition to) the command line. See “Software Files”.

-P pathname_file

Specifies a file containing the pathnames of files being added to or deleted from the IPD.

-sproduct_specification_file

The source Product Specification File (PSF) describes the product, subproduct, fileset, and/or file definitions that will be added or modified by swmodify.

If you specify a product_specification_file, swmodify selects the individual software_selections from the full set that is defined in the PSF. If no software_selections are specified, then swmodify will select all of the software defined in the PSF. The software selected from a PSF is then applied to the target_selection, with the selected software objects either added to, modified in, or deleted from it.

If a PSF is not specified, then software_selections must be specified. swmodify will select the software_selections from the software defined in the given (or default) target_selection.

The product specification file (PSF) for swmodify uses the same swpackage PSF format as defined in “Creating a Product Specification File (PSF) ”.

-S session_file

Run the command based on values saved from a previous installation session, as defined in session_file. See “Session Files”.

-x option=value

Sets a command option to value and overrides default values or a values in options files. See “Changing Command Options ”.

-X option_file

Read session options and behaviors from option_file. See “Changing Command Options ”.

software_selections

The software objects for which information will be modified. See “Software Selections”.

target_selection

A single, local target_selection. (See “Target Selections”.) If you are operating on the primary root, you do not need to specify a target_selection because the target / is assumed.

When operating on a software depot, the target_selection specifies the path to that depot. If the -d option is specified and no target_selection is specified, then the default depot_directory is assumed.

NOTE: In general, use caution when using the -u option with the -a option. If -u is used and -a is also specified, the -a option deletes the attribute from the given software_selections (or deletes the value from the set of values currently defined for the attribute).

Changing Command Options

You can change the behavior of this command by specifying additional command-line options when you invoke the command (using the -xoption) or by reading predefined values from a file. The following table shows the defaults and options that apply to swmodify.

Table 3-7 swmodify Command Options and Default Values

  • admin_directory=/var/adm/sw

  • allow_large_files=false

  • compress_index=false

  • control_files=

  • distribution_target_directory=/var/spool/sw

  • files=

  • installed_software_catalog=products

  • layout_version=1.0

  • log_msgid=0

  • logdetail=false

  • logfile=/var/adm/sw/swmodify.log

  • loglevel=1

  • patch_commit=false

  • run_as_superuser=true

  • software=

  • source_file=

  • target_directory=

  • targets=

  • verbose=1

 

For More Information

See Appendix A for complete descriptions of each default.

swmodify Tasks and Examples

Here are some examples of how you can use swmodify to change catalog files or IPDs:

Adding Information to the IPD

To add descriptions of files /tmp/a, /tmp/b, and /tmp/c to an existing fileset:

swmodify -x files=/tmp/a /tmp/b /tmp/c  PRODUCT.FILESET

If a control script adds new files to the installed file system, the script can use swmodify to make a record of the new files.

Changing Existing IPD Information

To create some new bundle definitions for products in an existing depot:

# swmodify -d -s new_bundle_definitions \          \* @ /mfg/master_depot

If a product provides a more complex configuration process, a script can set the fileset’s state to configured upon successful completion.

To change the values of a fileset’s attributes:

# swmodify -a state=installed PRODUCT.FILESET

To change the attributes of a depot:

# swmodify -a title=Master Depot \
         -a description=/tmp/mfg.description \
         @ /mfg/master_depot

Defining New Objects

You can import an existing application (not installed by SD-UX) by constructing a simple Product Specification File (PSF) describing the product and then invoke swmodify to load that definition into the IPD.

To create a new fileset definition (if the PSF contains file definitions, then add those files to the new fileset):

swmodify -s new_fileset_definition

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1997, 2000-2003, 2006, 2007, 2008 Hewlett-Packard Development Company, L.P.