Packaging and Delivering Software With the Image Packaging System in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

Verify the Package

The last step before publication is to run pkglint(1) on the manifest to find errors that can be identified before publication and testing. Some of the errors that pkglint can find would also be found either at publication time or when a user attempts to install the package, but of course you want to identify errors as early as possible in the package authoring process.

Examples of errors that pkglint reports include:

  • Delivering files already owned by another package.

  • Difference in metadata for shared, reference-counted actions such as directories. An example of this error is discussed at the end of Generate a Package Manifest.

Use the pkglint -L command to show the full list of checks that pkglint performs. Detailed information about how to enable, disable, and bypass particular checks is given in the pkglint (1) man page. The man page also details how to extend pkglint to run additional checks.

You can run pkglint in one of the following modes:

  • Directly on the package manifest. This mode is usually sufficient to quickly check the validity of your manifests.

  • On the package manifest, also referencing a package repository. Use this mode at least once before publication to a repository.

    By referencing a repository, pkglint can perform additional checks to ensure that the package interacts well with other packages in that repository.

The following output shows problems with the example manifest:

$ pkglint mypkg.p5m.4.res
Lint engine setup...
Starting lint run...
WARNING pkglint.action005.1       obsolete dependency check skipped: unable
to find dependency pkg:/system/library@0.5.11-0.175.2.0.0.18.0 for
pkg:/mypkg@1.0,5.11-0

This warning is acceptable for this example. The pkglint.action005.1 warning says that pkglint could not find a package called pkg:/system/library@0.5.11-0.175.2.0.0.18.0, on which this example package depends. The dependency package is in a package repository and could not be found since pkglint was called with only the manifest file as an argument.

In the following command, the -r option references a repository that contains the dependency package. The -c option specifies a local directory used for caching package metadata from the lint and reference repositories:

$ pkglint -c ./solaris-reference -r http://pkg.oracle.com/solaris/release mypkg.p5m.4.res