pkgtrans Command

Purpose

Translates package format.

Syntax

pkgtrans [ -i -o -n -s] [ -z Blocksize] Device1 Device2 [ Pkginst1 [ Pkginst2 [...]]]

Description

The pkgtrans command translates an installable package from one format to another. It translates the following:
  • A file system format to a datastream
  • A datastream to a file system format

You cannot run pkgtrans from csh.

Flags

Table 1. Flags
Item Description
-i Copies the pkginfo and Pkgmap files. If the packages category is defined as "set" for Set Installation Packages (SIPs) (see setinfo file format), then that packages' setinfo file is also copied.
-o Overwrites the same instance on the destination device. The package instance is overwritten if it exists.
-n Creates a new instance of the package on the destination device. If the package instance exists on the destination device, it is left unchanged and a new instance is created. The new instance has a sequence number that is attached to distinguish it from the existing instance. For example, assume that the destination device already contained an instance of the package X. If you use pkgtrans with the -n flag to write a new instance of package X to the device, the existing instance of package X remains on the destination device, and a new instance, called X.2, can be created on the device. If you executed pkgtrans again with the -n flag, a third instance, called X.3, is created.
-s Indicates that the package must be written to Device2 as a datastream rather than as a file system. The default behavior is to write to Device2 in the file system format.
-z Blocksize Indicates the blocksizes to be used when transferring to cartridge tape. Packages that are written to tape by using the -z flag and a value not equal to 512 are always read by using a blocksize of 32768. Thus, the -z flag is not applicable when reading from cartridge tape.
Device1 Indicates the source device. Can be - (hyphen) which specifies packages in datastream format that is read from standard input. The packages or packages on this device are translated and placed on Device2. If Device1 is a regular file or directory, you must use the absolute pathname, rather than a relative pathname.
Device2 Indicates the destination device. Can be - (hyphen) which specifies packages that are written to standard output in datastream format. Translated packages are placed on this device. If Device2 is a regular file or directory, you must specify it as an absolute pathname, rather than a relative pathname.
Pkginst Specifies which package on Device1 must be translated. The token all can be used to indicate all packages. Pkginst.* can be used to indicate all instances of a package. If no packages are defined, a prompt shows all packages on the device and asks which to translate. If a set is being transferred to datastream format, the Pkginst arguments must begin with the SIP and be followed by the packages that are listed in the SIP's setinfo file, in the order in which they appear in that file.
Note: By default, pkgtrans does not transfer any instance of a package if any instance of that package exists on the destination device. Use of the -n flag creates a new instance if an instance of this package exists. Use of the -o flag overwrites the same instance if it exists. Neither of these flags are useful if the destination device is a datastream because the entire datastream is overwritten anyway.

Exit Status

This command returns the following exit values:
Table 2. Exit Status
Item Description
0 Successful completion of script.
1 Fatal error. The installation process is terminated.

Files

Table 3. Files
Item Description
/usr/sbin/pkgtrans Contains the pkgtrans command.

Examples

  1. To translate all packages that are on the drive Device and place the translations in /tmp, type:
    pkgtrans Device /tmp all
  2. To translate pkg1 and pkg2 in tmp and place them on Device in a datastream format, type:
    pkgtrans -s /tmp Device pkg1 pkg2