pkgdepend.1 revision 3356
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<!--Arbortext, Inc., 1988-2008, v.4002-->
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<!DOCTYPE refentry PUBLIC "-//Sun Microsystems//DTD SolBook-XML 3.7//EN" "xsolbook.dtd" [
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<!ENTITY % ent SYSTEM "entities.ent">
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<refmeta><refentrytitle>pkgdepend</refentrytitle><manvolnum>1</manvolnum>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<refmiscinfo class="date">28 Jan 2015</refmiscinfo>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<refmiscinfo class="sectdesc">&man1;</refmiscinfo>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<refmiscinfo class="software">&release;</refmiscinfo>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<refmiscinfo class="copyright">Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.</refmiscinfo>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<refname>pkgdepend</refname><refpurpose>Image Packaging System dependency analyzer</refpurpose></refnamediv>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<synopsis>/usr/bin/pkgdepend [<replaceable>options</replaceable>] <replaceable>command
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</replaceable> [<replaceable>cmd_options</replaceable>] [<replaceable>operands</replaceable>]
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<synopsis>/usr/bin/pkgdepend generate [-IMm] -d <replaceable>dir</replaceable> [-d <replaceable>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelendir</replaceable>]
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen [-D <replaceable>name</replaceable>=<replaceable>value</replaceable>] [-k <replaceable>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenpath</replaceable>] <replaceable>manifest_file</replaceable></synopsis>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<synopsis>/usr/bin/pkgdepend resolve [-EmoSv] [-d <replaceable>output_dir</replaceable>]
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen [-e <replaceable>external_package_file</replaceable>]... [-s <replaceable>suffix
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</replaceable>]
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen <replaceable>manifest_file</replaceable> ...</synopsis>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</refsynopsisdiv>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<refsect1 id="pkgdepend-1-desc" role="description"><title></title>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<para>The <command>pkgdepend</command> command generates and resolves dependencies
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenfor packages. A package might depend on files from other packages. The <command>pkgdepend
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</command> command is typically used in two passes: file dependency generation
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenand file-to-package resolution.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<para>The <command>generate</command> subcommand examines the content of a
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenpackage and determines what external files the package needs.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<para>The <command>resolve</command> subcommand takes the list of files from
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenthe <command>generate</command> step, and searches a reference set of packages
981b809bc6ed10a21e89444d9447e5475801874fjohanengelento determine the names of the packages that contain those dependent files.
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenThe reference set of packages that are searched for the dependent files are
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenthe packages that are currently installed on the publisher's system.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<para>Several components of delivered files are used as sources of dependency
981b809bc6ed10a21e89444d9447e5475801874fjohanengeleninformation:</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<variablelist>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>ELF headers in delivered files are analyzed for dependency information, with the
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<option>k</option> and <option>D</option> options modifying the information obtained. For more
981b809bc6ed10a21e89444d9447e5475801874fjohanengelendetails on ELF dependencies, see <command>ldd</command> and the <olink targetdoc="OSLLG"><citetitle
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenremap="book">Oracle Solaris 11.2 Linkers and Libraries Guide</citetitle></olink>. </para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Shell scripts that contain <literal>#!</literal> lines referencing
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenan interpreter result in a dependency on the package that delivers that interpreter.
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Python scripts are first analyzed as scripts. In addition,
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenany imports the script declares might also serve as sources of dependency
981b809bc6ed10a21e89444d9447e5475801874fjohanengeleninformation.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Hard links in manifests result in a dependency on the package
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenthat delivers the link target.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Delivered SMF service manifests that include <literal>require_all
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</literal> dependencies result in dependencies on the packages that deliver
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenthe SMF manifests that provide those FMRIs.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</variablelist>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<para>The following options are supported:</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term><option>?</option></term><term><option>-help</option></term>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term><option>R</option> <replaceable>dir</replaceable></term>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Operate on the image rooted at <replaceable>dir</replaceable>.
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenIf no directory was specified or determined based on environment, the default
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenis /. See the “Environment Variables” section for more information.</para>
bacf092e612ad1911c5a4db58261865e54953b34johanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</variablelist>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<para>The following subcommands are supported:</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term><command>pkgdepend generate</command> [<option>IMm</option>] <option>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelend</option> <replaceable>dir</replaceable> [<option>d</option> <replaceable>dir</replaceable>]
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen[<option>D</option> <replaceable>name</replaceable>=<replaceable>value</replaceable>]
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen[<option>k</option> <replaceable>path</replaceable>] <replaceable>manifest_file</replaceable></term>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Produce the dependencies on files of the manifest specified
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenby <replaceable>manifest_file</replaceable>.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Show the dependencies that are satisfied within <replaceable>manifest_file
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</replaceable>. Do not use the result of <option>I</option> with <command>pkgdepend resolve</command>.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Display a list of file types that could not be analyzed.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Repeat the original manifest with any discovered dependencies
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenadded after.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term><option>d</option> <replaceable>dir</replaceable></term>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Add <replaceable>dir</replaceable> to a list of directories
981b809bc6ed10a21e89444d9447e5475801874fjohanengelento search for the manifest's files.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term><option>D</option> <replaceable>name</replaceable>=<replaceable>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Add the <replaceable>value</replaceable> as a way to expand
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenthe token <replaceable>name</replaceable> in run paths for ELF file dependencies.
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term><option>k</option> <replaceable>path</replaceable></term>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Add the <replaceable>path</replaceable> to the list of run
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenpaths to search for kernel modules. Using the <option>k</option> option removes
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenthe default paths, which are <filename>/kernel</filename> and <filename>/usr/kernel
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<para>Run paths such as those specified by the <option>k</option> option can
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenalso be specified per action or per manifest by using the action or manifest
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenattribute <literal>pkg.depend.runpath</literal>. The value of the <literal>pkg.depend.runpath
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</literal> attribute is a colon-separated string of the paths to use. Setting
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenany <literal>pkg.depend.runpath</literal> attributes in the manifest or action
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenoverrides paths specified with the <option>k</option> option.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<para>The special token <envar>$PKGDEPEND_RUNPATH</envar> can be used as one
981b809bc6ed10a21e89444d9447e5475801874fjohanengelencomponent of the <literal>pkg.depend.runpath</literal> attribute value in
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenorder to include the standard system run path for the file being analyzed.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</variablelist>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<para>In some cases, you might want to prevent automatic generation of dependencies.
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenFor example, if a package delivers a sample Python script that imports a set
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenof modules, those modules imported by the sample script are not dependencies
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenfor the package that delivers the sample script. Use the action or manifest
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenattribute <literal>pkg.depend.bypass-generate</literal> to prevent generating
981b809bc6ed10a21e89444d9447e5475801874fjohanengelendependencies against the specified files.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<para>The <literal>pkg.depend.bypass-generate</literal> values are Python
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenregular expressions that match file names. The regular expressions are implicitly
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenanchored at the start and end of the file path. The value given in the following
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenexample matches <literal>this/that</literal> but does not match <literal>something/this/that/the/other
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<programlisting>pkg.depend.bypass-generate=this/that</programlisting>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<para>For more information about Python regular expression syntax, use the
981b809bc6ed10a21e89444d9447e5475801874fjohanengelencommand <command>pydoc re</command> or see more complete documentation at <literal>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenhttp://docs.python.org/dev/howto/regex.html</literal>.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<para>When <command>pkgdepend generate</command> input manifests contain SMF
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenmanifest files, any SMF services or instances declared by those SMF manifest
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenfiles are included in the <command>pkgdepend</command> output. These SMF services
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenor instances are included in the form of a <literal>set</literal> action with
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenthe name <literal>org.opensolaris.smf.fmri</literal>.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term><command>pkgdepend resolve</command> [<option>EmoSv</option>]
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen[<option>d</option> <replaceable>output_dir</replaceable>] [<option>e</option> <replaceable>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenexternal_package_file</replaceable>]... [<option>s</option> <replaceable>suffix</replaceable>] <replaceable>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Transform dependencies on files into dependencies on the packages
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenthat deliver those files. Dependencies are first resolved against the manifests
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelengiven on the command line and then against the packages installed on the system.
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelenBy default, the dependencies for each manifest are placed in a file named <filename><replaceable>
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelenmanifest_file</replaceable>.res</filename>.</para>
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelen<varlistentry><term><option>e</option> <replaceable>external_package_file</replaceable></term>
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelen<listitem><para>Only resolve against packages from the system whose names
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelenmatch a pattern in <replaceable>external_package_file</replaceable>. This
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelenoption can be specified multiple times. The <option>e</option> option cannot
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelenbe used with the <option>S</option> option.</para>
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelen</varlistentry>
<para>Avoid generating dependencies against any file delivered in <filename>usr/lib/python2.7/vendor-packages/xdg
set name=pkg.fmri value=pkg:/mypackage@1.0,1.0
set name=pkg.summary value="My test package"