pkgdepend.1 revision 3356
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<?xml version="1.0" encoding="iso-8859-1"?>
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%ent;
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen]>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<refentry id="pkgdepend-1">
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="arch">generic</refmiscinfo>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<refmiscinfo class="copyright">Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.</refmiscinfo>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</refmeta>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<refnamediv>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<refname>pkgdepend</refname><refpurpose>Image Packaging System dependency analyzer</refpurpose></refnamediv>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<refsynopsisdiv><title></title>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<synopsis>/usr/bin/pkgdepend [<replaceable>options</replaceable>] <replaceable>command
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</replaceable> [<replaceable>cmd_options</replaceable>] [<replaceable>operands</replaceable>]
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</synopsis>
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<varlistentry><term>ELF</term>
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</listitem>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term>Scripts</term>
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</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</listitem>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term>Python</term>
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</listitem>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term>Hard links</term>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Hard links in manifests result in a dependency on the package
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenthat delivers the link target.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</listitem>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term>SMF</term>
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</listitem>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</variablelist>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</refsect1>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<refsect1 role="options"><title></title>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<para>The following options are supported:</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<variablelist termlength="wholeline">
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term><option>?</option></term><term><option>-help</option></term>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Display a usage message.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</listitem>
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 &ldquo;Environment Variables&rdquo; section for more information.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</listitem>
bacf092e612ad1911c5a4db58261865e54953b34johanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</variablelist>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</refsect1>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<refsect1 role="subcommands"><title></title>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<para>The following subcommands are supported:</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<variablelist termlength="wholeline">
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<variablelist termlength="wholeline">
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term><option>I</option></term>
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</listitem>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term><option>M</option></term>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Display a list of file types that could not be analyzed.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</listitem>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term><option>m</option></term>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<listitem><para>Repeat the original manifest with any discovered dependencies
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenadded after.</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</listitem>
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</listitem>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</varlistentry>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen<varlistentry><term><option>D</option> <replaceable>name</replaceable>=<replaceable>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenvalue</replaceable></term>
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</para>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelen</listitem>
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</filename>.</para>
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</listitem>
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</literal>.</para>
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</listitem>
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>
981b809bc6ed10a21e89444d9447e5475801874fjohanengelenmanifest_file</replaceable> ...</term>
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<variablelist termlength="wholeline">
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</listitem>
63267518b4ce196caab66ef8cbdcfc0921206b3djohanengelen</varlistentry>
<varlistentry><term><option>E</option></term>
<listitem><para>If <option>e</option> is specified, show the packages that
were expected to be external dependencies but were not external dependencies.
Packages that were expected to be external dependencies are packages from
the system whose names match a pattern in <replaceable>external_package_file</replaceable>.
</para>
<para>If <option>e</option> is not specified, show the external dependencies
of the resolved packages. External dependencies of the resolved packages are
packages not named on the command line that are targets of dependencies in
the resolved packages.</para>
</listitem>
</varlistentry>
<varlistentry><term><option>m</option></term>
<listitem><para>Repeat the manifest, with any dependencies produced by the <command>
generate</command> step removed, before adding the resolved dependencies.</para>
</listitem>
</varlistentry>
<varlistentry><term><option>o</option></term>
<listitem><para>Write the results to standard output. This option is intended
for human consumption. Appending this output to a file might result in an
invalid manifest. The <option>d</option> or <option>s</option> options are
strongly recommended instead of <option>o</option> for use in a pipeline for
manifest processing.</para>
</listitem>
</varlistentry>
<varlistentry><term><option>d</option> <replaceable>output_dir</replaceable></term>
<listitem><para>Write the resolved dependencies for each manifest provided
in a separate file in <replaceable>output_dir</replaceable>. By default, each
file has the same base name as the manifest that was the source of the dependencies
written to that file.</para>
</listitem>
</varlistentry>
<varlistentry><term><option>s</option> <replaceable>suffix</replaceable></term>
<listitem><para>For each output file, append <replaceable>suffix</replaceable> to
the base name of the file that was the source of the resolved dependencies.
If <replaceable>suffix</replaceable> is not <replaceable>.suffix</replaceable>,
a period (.) is prepended to <replaceable>suffix</replaceable>.</para>
</listitem>
</varlistentry>
<varlistentry><term><option>S</option></term>
<listitem><para>Only resolve against the manifests given on the command line
and not against the manifests installed on the system.</para>
</listitem>
</varlistentry>
<varlistentry><term><option>v</option></term>
<listitem><para>Include additional package dependency debugging metadata.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="examples"><title></title>
<example><title>Generate Dependencies</title>
<para>Generate the dependencies for the manifest written in <filename>foo</filename>,
whose content directory is in <filename>/bar/baz</filename>, and store the
results in <filename>foo.fdeps.</filename></para>
<screen>$ <userinput>pkgdepend generate -d /bar/baz foo > foo.fdeps</userinput></screen>
</example>
<example><title>Resolve Dependencies</title>
<para>Resolve the file dependencies in <filename>foo.fdeps</filename> and <filename>
bar.fdeps</filename> against each other and against the packages currently
installed on the system.</para>
<screen>$ <userinput>pkgdepend resolve foo.fdeps bar.fdeps</userinput>
$ <userinput>ls *.res</userinput>
foo.fdeps.res bar.fdeps.res</screen>
</example>
<example><title>Generate and Resolve Dependencies For Two Manifests</title>
<para>Generate the file dependencies for two manifests (<literal>foo</literal> and <literal>
bar</literal>) and retain all the information in the original manifests. Then
resolve the file dependencies and place the resulting manifests in <filename>/res
</filename>. These resulting manifests can be used with <command>pkgsend publish</command>.
</para>
<screen>$ <userinput>pkgdepend generate -d /proto/foo -m foo > /deps/foo</userinput>
$ <userinput>pkgdepend generate -d /proto/bar -m bar > /deps/bar</userinput>
$ <userinput>pkgdepend resolve -m -d /res /deps/foo /deps/bar</userinput>
$ <userinput>ls /res</userinput>
foo bar</screen>
</example>
<example><title>Add Values To Tokens For ELF File Dependencies</title>
<para>Replace all <envar>PLATFORM</envar> tokens in the run paths in ELF files
with <literal>sun4v</literal> and <literal>sun4u</literal> while generating
the dependencies for the manifest written in <literal>foo</literal> whose
content directory is in /.</para>
<screen>$ <userinput>pkgdepend generate -d / -D 'PLATFORM=sun4v' &bsol;</userinput>
<userinput>-D 'PLATFORM=sun4u' foo</userinput></screen>
</example>
<example><title>Specify a Kernel Module Directory</title>
<para>Specify <filename>/kmod</filename> as the directory in which to find
kernel modules when generating the dependencies for the manifest written in <filename>
foo</filename> whose content directory is in /.</para>
<screen>$ <userinput>pkgdepend generate -d / -k /kmod foo</userinput></screen>
</example>
<example><title>Bypass Dependency Generation</title>
<para>Append <filename>opt/python</filename> to the standard Python run path
for a given Python script, and bypass dependency generation against all Python
modules called <literal>test</literal> for a file delivered as <filename>opt/python/foo/file.py
</filename>.</para>
<para>Avoid generating dependencies against any file delivered in <filename>usr/lib/python2.7/vendor-packages/xdg
</filename>.</para>
<screen>$ <userinput>cat manifest.py</userinput>
set name=pkg.fmri value=pkg:/mypackage@1.0,1.0
set name=pkg.summary value="My test package"
dir path=opt mode=0755 group=sys owner=root
dir path=opt/python mode=0755 group=sys owner=root
dir path=opt/python/foo mode=0755 group=sys owner=root
file path=opt/python/__init__.py mode=0644 group=sys owner=root
file path=opt/python/foo/__init__.py mode=0644 group=sys owner=root
#
# Add runpath and bypass-generate attributes:
#
file path=opt/python/foo/file.py mode=0644 group=sys owner=root &bsol;
pkg.depend.bypass-generate=.*/test.py.* &bsol;
pkg.depend.bypass-generate=.*/testmodule.so &bsol;
pkg.depend.bypass-generate=.*/test.so &bsol;
pkg.depend.bypass-generate=usr/lib/python2.7/vendor-packages/xdg/.* &bsol;
pkg.depend.runpath=$PKGDEPEND_RUNPATH:/opt/python
$ <userinput>pkgdepend generate -d proto manifest.py</userinput></screen>
</example>
</refsect1>
<refsect1 role="environment-variables"><title></title>
<variablelist>
<varlistentry><term><envar>PKG_IMAGE</envar></term>
<listitem><para>Specifies the directory that contains the image to use for
package operations. This value is ignored if <option>R</option> is specified.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="exit-status"><title></title>
<para>The following exit values are returned:</para>
<variablelist>
<varlistentry><term><returnvalue>0</returnvalue></term>
<listitem><para>Everything worked.</para>
</listitem>
</varlistentry>
<varlistentry><term><returnvalue>1</returnvalue></term>
<listitem><para>An error occurred.</para>
</listitem>
</varlistentry>
<varlistentry><term><returnvalue>2</returnvalue></term>
<listitem><para>Invalid command line options were specified.</para>
</listitem>
</varlistentry>
<varlistentry><term><returnvalue>99</returnvalue></term>
<listitem><para>An unanticipated exception occurred.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="attributes"><title></title>
<para>See <literal>attributes</literal>(7) for descriptions of the following
attributes:</para>
<informaltable frame="all" orient="port">
<tgroup cols="2" colsep="1" rowsep="1"><colspec colname="col1" colwidth="198*"
align="left"/><colspec colname="col2" colwidth="198*" align="left"/><thead>
<row>
<entry align="center">
<para>ATTRIBUTE TYPE</para>
</entry>
<entry align="center">
<para>ATTRIBUTE VALUE</para>
</entry>
</row>
</thead>
<tbody>
<row>
<entry align="left">
<para>Availability</para>
</entry>
<entry align="left">
<para><literal>package/pkg</literal></para>
</entry>
</row>
<row>
<entry align="left">
<para>Interface Stability</para>
</entry>
<entry align="left">
<para>Uncommitted</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable></refsect1>
<refsect1 role="see-also"><title></title>
<para><olink targetdoc="refman" targetptr="pkg-7"><citerefentry><refentrytitle>pkg
</refentrytitle><manvolnum>7</manvolnum></citerefentry></olink></para>
<para><literal>https://java.net/projects/ips/pages/Home</literal></para>
</refsect1>
</refentry>