3139N/A<?xml version="1.0" encoding="iso-8859-1"?>
3139N/A<!--Arbortext, Inc., 1988-2008, v.4002-->
3139N/A<!DOCTYPE refentry PUBLIC "-//Sun Microsystems//DTD SolBook-XML 3.7//EN" "xsolbook.dtd" [
3139N/A<!ENTITY % ent SYSTEM "entities.ent">
3139N/A%ent;
3139N/A]>
2709N/A
3139N/A<refentry id="pkgdepend-1">
3139N/A<refmeta><refentrytitle>pkgdepend</refentrytitle><manvolnum>1</manvolnum>
3177N/A<refmiscinfo class="date">28 Jan 2015</refmiscinfo>
3139N/A<refmiscinfo class="sectdesc">&man1;</refmiscinfo>
3139N/A<refmiscinfo class="software">&release;</refmiscinfo>
3139N/A<refmiscinfo class="arch">generic</refmiscinfo>
3356N/A<refmiscinfo class="copyright">Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.</refmiscinfo>
3139N/A</refmeta>
3139N/A<refnamediv>
3139N/A<refname>pkgdepend</refname><refpurpose>Image Packaging System dependency analyzer</refpurpose></refnamediv>
3139N/A<refsynopsisdiv><title></title>
3139N/A<synopsis>/usr/bin/pkgdepend [<replaceable>options</replaceable>] <replaceable>command
3139N/A</replaceable> [<replaceable>cmd_options</replaceable>] [<replaceable>operands</replaceable>]
3139N/A</synopsis>
3139N/A<synopsis>/usr/bin/pkgdepend generate [-IMm] -d <replaceable>dir</replaceable> [-d <replaceable>
3139N/Adir</replaceable>]
3139N/A [-D <replaceable>name</replaceable>=<replaceable>value</replaceable>] [-k <replaceable>
3139N/Apath</replaceable>] <replaceable>manifest_file</replaceable></synopsis>
3139N/A<synopsis>/usr/bin/pkgdepend resolve [-EmoSv] [-d <replaceable>output_dir</replaceable>]
3139N/A [-e <replaceable>external_package_file</replaceable>]... [-s <replaceable>suffix
3139N/A</replaceable>]
3139N/A <replaceable>manifest_file</replaceable> ...</synopsis>
3139N/A</refsynopsisdiv>
3139N/A<refsect1 id="pkgdepend-1-desc" role="description"><title></title>
3139N/A<para>The <command>pkgdepend</command> command generates and resolves dependencies
3139N/Afor packages. A package might depend on files from other packages. The <command>pkgdepend
3139N/A</command> command is typically used in two passes: file dependency generation
3139N/Aand file-to-package resolution.</para>
3139N/A<para>The <command>generate</command> subcommand examines the content of a
3139N/Apackage and determines what external files the package needs.</para>
3139N/A<para>The <command>resolve</command> subcommand takes the list of files from
3139N/Athe <command>generate</command> step, and searches a reference set of packages
3139N/Ato determine the names of the packages that contain those dependent files.
3139N/AThe reference set of packages that are searched for the dependent files are
3139N/Athe packages that are currently installed on the publisher's system.</para>
3139N/A<para>Several components of delivered files are used as sources of dependency
3139N/Ainformation:</para>
3139N/A<variablelist>
3139N/A<varlistentry><term>ELF</term>
3139N/A<listitem><para>ELF headers in delivered files are analyzed for dependency information, with the
3139N/A<option>k</option> and <option>D</option> options modifying the information obtained. For more
3139N/Adetails on ELF dependencies, see <command>ldd</command> and the <olink targetdoc="OSLLG"><citetitle
3139N/Aremap="book">Oracle Solaris 11.2 Linkers and Libraries Guide</citetitle></olink>. </para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term>Scripts</term>
3139N/A<listitem><para>Shell scripts that contain <literal>#!</literal> lines referencing
3139N/Aan interpreter result in a dependency on the package that delivers that interpreter.
3139N/A</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term>Python</term>
3139N/A<listitem><para>Python scripts are first analyzed as scripts. In addition,
3139N/Aany imports the script declares might also serve as sources of dependency
3139N/Ainformation.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term>Hard links</term>
3139N/A<listitem><para>Hard links in manifests result in a dependency on the package
3139N/Athat delivers the link target.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term>SMF</term>
3139N/A<listitem><para>Delivered SMF service manifests that include <literal>require_all
3139N/A</literal> dependencies result in dependencies on the packages that deliver
3139N/Athe SMF manifests that provide those FMRIs.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A</variablelist>
3139N/A</refsect1>
3139N/A<refsect1 role="options"><title></title>
3139N/A<para>The following options are supported:</para>
3139N/A<variablelist termlength="wholeline">
3139N/A<varlistentry><term><option>?</option></term><term><option>-help</option></term>
3139N/A<listitem><para>Display a usage message.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><option>R</option> <replaceable>dir</replaceable></term>
3139N/A<listitem><para>Operate on the image rooted at <replaceable>dir</replaceable>.
3139N/AIf no directory was specified or determined based on environment, the default
3139N/Ais /. See the &ldquo;Environment Variables&rdquo; section for more information.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A</variablelist>
3139N/A</refsect1>
3139N/A<refsect1 role="subcommands"><title></title>
3139N/A<para>The following subcommands are supported:</para>
3139N/A<variablelist termlength="wholeline">
3139N/A<varlistentry><term><command>pkgdepend generate</command> [<option>IMm</option>] <option>
3139N/Ad</option> <replaceable>dir</replaceable> [<option>d</option> <replaceable>dir</replaceable>]
3139N/A[<option>D</option> <replaceable>name</replaceable>=<replaceable>value</replaceable>]
3139N/A[<option>k</option> <replaceable>path</replaceable>] <replaceable>manifest_file</replaceable></term>
3139N/A<listitem><para>Produce the dependencies on files of the manifest specified
3139N/Aby <replaceable>manifest_file</replaceable>.</para>
3139N/A<variablelist termlength="wholeline">
3139N/A<varlistentry><term><option>I</option></term>
3139N/A<listitem><para>Show the dependencies that are satisfied within <replaceable>manifest_file
3139N/A</replaceable>. Do not use the result of <option>I</option> with <command>pkgdepend resolve</command>.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><option>M</option></term>
3139N/A<listitem><para>Display a list of file types that could not be analyzed.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><option>m</option></term>
3139N/A<listitem><para>Repeat the original manifest with any discovered dependencies
3139N/Aadded after.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><option>d</option> <replaceable>dir</replaceable></term>
3139N/A<listitem><para>Add <replaceable>dir</replaceable> to a list of directories
3139N/Ato search for the manifest's files.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><option>D</option> <replaceable>name</replaceable>=<replaceable>
3139N/Avalue</replaceable></term>
3139N/A<listitem><para>Add the <replaceable>value</replaceable> as a way to expand
3139N/Athe token <replaceable>name</replaceable> in run paths for ELF file dependencies.
3139N/A</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><option>k</option> <replaceable>path</replaceable></term>
3139N/A<listitem><para>Add the <replaceable>path</replaceable> to the list of run
3139N/Apaths to search for kernel modules. Using the <option>k</option> option removes
3139N/Athe default paths, which are <filename>/kernel</filename> and <filename>/usr/kernel
3139N/A</filename>.</para>
3139N/A<para>Run paths such as those specified by the <option>k</option> option can
3139N/Aalso be specified per action or per manifest by using the action or manifest
3139N/Aattribute <literal>pkg.depend.runpath</literal>. The value of the <literal>pkg.depend.runpath
3139N/A</literal> attribute is a colon-separated string of the paths to use. Setting
3139N/Aany <literal>pkg.depend.runpath</literal> attributes in the manifest or action
3139N/Aoverrides paths specified with the <option>k</option> option.</para>
3139N/A<para>The special token <envar>$PKGDEPEND_RUNPATH</envar> can be used as one
3139N/Acomponent of the <literal>pkg.depend.runpath</literal> attribute value in
3139N/Aorder to include the standard system run path for the file being analyzed.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A</variablelist>
3139N/A<para>In some cases, you might want to prevent automatic generation of dependencies.
3139N/AFor example, if a package delivers a sample Python script that imports a set
3139N/Aof modules, those modules imported by the sample script are not dependencies
3139N/Afor the package that delivers the sample script. Use the action or manifest
3139N/Aattribute <literal>pkg.depend.bypass-generate</literal> to prevent generating
3139N/Adependencies against the specified files.</para>
3139N/A<para>The <literal>pkg.depend.bypass-generate</literal> values are Python
3139N/Aregular expressions that match file names. The regular expressions are implicitly
3139N/Aanchored at the start and end of the file path. The value given in the following
3139N/Aexample matches <literal>this/that</literal> but does not match <literal>something/this/that/the/other
3139N/A</literal>.</para>
3139N/A<programlisting>pkg.depend.bypass-generate=this/that</programlisting>
3139N/A<para>For more information about Python regular expression syntax, use the
3139N/Acommand <command>pydoc re</command> or see more complete documentation at <literal>
3139N/Ahttp://docs.python.org/dev/howto/regex.html</literal>.</para>
3139N/A<para>When <command>pkgdepend generate</command> input manifests contain SMF
3139N/Amanifest files, any SMF services or instances declared by those SMF manifest
3139N/Afiles are included in the <command>pkgdepend</command> output. These SMF services
3139N/Aor instances are included in the form of a <literal>set</literal> action with
3139N/Athe name <literal>org.opensolaris.smf.fmri</literal>.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><command>pkgdepend resolve</command> [<option>EmoSv</option>]
3139N/A[<option>d</option> <replaceable>output_dir</replaceable>] [<option>e</option> <replaceable>
3139N/Aexternal_package_file</replaceable>]... [<option>s</option> <replaceable>suffix</replaceable>] <replaceable>
3139N/Amanifest_file</replaceable> ...</term>
3139N/A<listitem><para>Transform dependencies on files into dependencies on the packages
3139N/Athat deliver those files. Dependencies are first resolved against the manifests
3139N/Agiven on the command line and then against the packages installed on the system.
3139N/ABy default, the dependencies for each manifest are placed in a file named <filename><replaceable>
3139N/Amanifest_file</replaceable>.res</filename>.</para>
3139N/A<variablelist termlength="wholeline">
3139N/A<varlistentry><term><option>e</option> <replaceable>external_package_file</replaceable></term>
3139N/A<listitem><para>Only resolve against packages from the system whose names
3139N/Amatch a pattern in <replaceable>external_package_file</replaceable>. This
3139N/Aoption can be specified multiple times. The <option>e</option> option cannot
3139N/Abe used with the <option>S</option> option.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><option>E</option></term>
3139N/A<listitem><para>If <option>e</option> is specified, show the packages that
3139N/Awere expected to be external dependencies but were not external dependencies.
3139N/APackages that were expected to be external dependencies are packages from
3139N/Athe system whose names match a pattern in <replaceable>external_package_file</replaceable>.
3139N/A</para>
3139N/A<para>If <option>e</option> is not specified, show the external dependencies
3139N/Aof the resolved packages. External dependencies of the resolved packages are
3139N/Apackages not named on the command line that are targets of dependencies in
3139N/Athe resolved packages.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><option>m</option></term>
3139N/A<listitem><para>Repeat the manifest, with any dependencies produced by the <command>
3139N/Agenerate</command> step removed, before adding the resolved dependencies.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><option>o</option></term>
3139N/A<listitem><para>Write the results to standard output. This option is intended
3139N/Afor human consumption. Appending this output to a file might result in an
3139N/Ainvalid manifest. The <option>d</option> or <option>s</option> options are
3139N/Astrongly recommended instead of <option>o</option> for use in a pipeline for
3139N/Amanifest processing.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><option>d</option> <replaceable>output_dir</replaceable></term>
3139N/A<listitem><para>Write the resolved dependencies for each manifest provided
3139N/Ain a separate file in <replaceable>output_dir</replaceable>. By default, each
3139N/Afile has the same base name as the manifest that was the source of the dependencies
3139N/Awritten to that file.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><option>s</option> <replaceable>suffix</replaceable></term>
3139N/A<listitem><para>For each output file, append <replaceable>suffix</replaceable> to
3139N/Athe base name of the file that was the source of the resolved dependencies.
3139N/AIf <replaceable>suffix</replaceable> is not <replaceable>.suffix</replaceable>,
3139N/Aa period (.) is prepended to <replaceable>suffix</replaceable>.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><option>S</option></term>
3139N/A<listitem><para>Only resolve against the manifests given on the command line
3139N/Aand not against the manifests installed on the system.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><option>v</option></term>
3139N/A<listitem><para>Include additional package dependency debugging metadata.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A</variablelist>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A</variablelist>
3139N/A</refsect1>
3139N/A<refsect1 role="examples"><title></title>
3139N/A<example><title>Generate Dependencies</title>
3139N/A<para>Generate the dependencies for the manifest written in <filename>foo</filename>,
3139N/Awhose content directory is in <filename>/bar/baz</filename>, and store the
3139N/Aresults in <filename>foo.fdeps.</filename></para>
3139N/A<screen>$ <userinput>pkgdepend generate -d /bar/baz foo > foo.fdeps</userinput></screen>
3139N/A</example>
3139N/A<example><title>Resolve Dependencies</title>
3139N/A<para>Resolve the file dependencies in <filename>foo.fdeps</filename> and <filename>
3139N/Abar.fdeps</filename> against each other and against the packages currently
3139N/Ainstalled on the system.</para>
3139N/A<screen>$ <userinput>pkgdepend resolve foo.fdeps bar.fdeps</userinput>
3139N/A$ <userinput>ls *.res</userinput>
3139N/Afoo.fdeps.res bar.fdeps.res</screen>
3139N/A</example>
3139N/A<example><title>Generate and Resolve Dependencies For Two Manifests</title>
3139N/A<para>Generate the file dependencies for two manifests (<literal>foo</literal> and <literal>
3139N/Abar</literal>) and retain all the information in the original manifests. Then
3139N/Aresolve the file dependencies and place the resulting manifests in <filename>/res
3139N/A</filename>. These resulting manifests can be used with <command>pkgsend publish</command>.
3139N/A</para>
3139N/A<screen>$ <userinput>pkgdepend generate -d /proto/foo -m foo > /deps/foo</userinput>
3139N/A$ <userinput>pkgdepend generate -d /proto/bar -m bar > /deps/bar</userinput>
3139N/A$ <userinput>pkgdepend resolve -m -d /res /deps/foo /deps/bar</userinput>
3139N/A$ <userinput>ls /res</userinput>
3139N/Afoo bar</screen>
3139N/A</example>
3139N/A<example><title>Add Values To Tokens For ELF File Dependencies</title>
3139N/A<para>Replace all <envar>PLATFORM</envar> tokens in the run paths in ELF files
3139N/Awith <literal>sun4v</literal> and <literal>sun4u</literal> while generating
3139N/Athe dependencies for the manifest written in <literal>foo</literal> whose
3139N/Acontent directory is in /.</para>
3139N/A<screen>$ <userinput>pkgdepend generate -d / -D 'PLATFORM=sun4v' &bsol;</userinput>
3139N/A<userinput>-D 'PLATFORM=sun4u' foo</userinput></screen>
3139N/A</example>
3139N/A<example><title>Specify a Kernel Module Directory</title>
3139N/A<para>Specify <filename>/kmod</filename> as the directory in which to find
3139N/Akernel modules when generating the dependencies for the manifest written in <filename>
3139N/Afoo</filename> whose content directory is in /.</para>
3139N/A<screen>$ <userinput>pkgdepend generate -d / -k /kmod foo</userinput></screen>
3139N/A</example>
3139N/A<example><title>Bypass Dependency Generation</title>
3139N/A<para>Append <filename>opt/python</filename> to the standard Python run path
3139N/Afor a given Python script, and bypass dependency generation against all Python
3139N/Amodules called <literal>test</literal> for a file delivered as <filename>opt/python/foo/file.py
3139N/A</filename>.</para>
3177N/A<para>Avoid generating dependencies against any file delivered in <filename>usr/lib/python2.7/vendor-packages/xdg
3139N/A</filename>.</para>
3139N/A<screen>$ <userinput>cat manifest.py</userinput>
2494N/Aset name=pkg.fmri value=pkg:/mypackage@1.0,1.0
2494N/Aset name=pkg.summary value="My test package"
2494N/Adir path=opt mode=0755 group=sys owner=root
2494N/Adir path=opt/python mode=0755 group=sys owner=root
2494N/Adir path=opt/python/foo mode=0755 group=sys owner=root
2948N/Afile path=opt/python/__init__.py mode=0644 group=sys owner=root
2948N/Afile path=opt/python/foo/__init__.py mode=0644 group=sys owner=root
2494N/A#
2494N/A# Add runpath and bypass-generate attributes:
2494N/A#
3139N/Afile path=opt/python/foo/file.py mode=0644 group=sys owner=root &bsol;
3139N/A pkg.depend.bypass-generate=.*/test.py.* &bsol;
3139N/A pkg.depend.bypass-generate=.*/testmodule.so &bsol;
3139N/A pkg.depend.bypass-generate=.*/test.so &bsol;
3177N/A pkg.depend.bypass-generate=usr/lib/python2.7/vendor-packages/xdg/.* &bsol;
2494N/A pkg.depend.runpath=$PKGDEPEND_RUNPATH:/opt/python
2494N/A
3139N/A$ <userinput>pkgdepend generate -d proto manifest.py</userinput></screen>
3139N/A</example>
3139N/A</refsect1>
3139N/A<refsect1 role="environment-variables"><title></title>
3139N/A<variablelist>
3139N/A<varlistentry><term><envar>PKG_IMAGE</envar></term>
3139N/A<listitem><para>Specifies the directory that contains the image to use for
3139N/Apackage operations. This value is ignored if <option>R</option> is specified.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A</variablelist>
3139N/A</refsect1>
3139N/A<refsect1 role="exit-status"><title></title>
3139N/A<para>The following exit values are returned:</para>
3139N/A<variablelist>
3139N/A<varlistentry><term><returnvalue>0</returnvalue></term>
3139N/A<listitem><para>Everything worked.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><returnvalue>1</returnvalue></term>
3139N/A<listitem><para>An error occurred.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><returnvalue>2</returnvalue></term>
3139N/A<listitem><para>Invalid command line options were specified.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A<varlistentry><term><returnvalue>99</returnvalue></term>
3139N/A<listitem><para>An unanticipated exception occurred.</para>
3139N/A</listitem>
3139N/A</varlistentry>
3139N/A</variablelist>
3139N/A</refsect1>
3139N/A<refsect1 role="attributes"><title></title>
3356N/A<para>See <literal>attributes</literal>(7) for descriptions of the following
3139N/Aattributes:</para>
3139N/A<informaltable frame="all" orient="port">
3139N/A<tgroup cols="2" colsep="1" rowsep="1"><colspec colname="col1" colwidth="198*"
3139N/Aalign="left"/><colspec colname="col2" colwidth="198*" align="left"/><thead>
3139N/A<row>
3139N/A<entry align="center">
3139N/A<para>ATTRIBUTE TYPE</para>
3139N/A</entry>
3139N/A<entry align="center">
3139N/A<para>ATTRIBUTE VALUE</para>
3139N/A</entry>
3139N/A</row>
3139N/A</thead>
3139N/A<tbody>
3139N/A<row>
3139N/A<entry align="left">
3139N/A<para>Availability</para>
3139N/A</entry>
3139N/A<entry align="left">
3139N/A<para><literal>package/pkg</literal></para>
3139N/A</entry>
3139N/A</row>
3139N/A<row>
3139N/A<entry align="left">
3139N/A<para>Interface Stability</para>
3139N/A</entry>
3139N/A<entry align="left">
3139N/A<para>Uncommitted</para>
3139N/A</entry>
3139N/A</row>
3139N/A</tbody>
3139N/A</tgroup>
3139N/A</informaltable></refsect1>
3139N/A<refsect1 role="see-also"><title></title>
3356N/A<para><olink targetdoc="refman" targetptr="pkg-7"><citerefentry><refentrytitle>pkg
3356N/A</refentrytitle><manvolnum>7</manvolnum></citerefentry></olink></para>
3139N/A<para><literal>https://java.net/projects/ips/pages/Home</literal></para>
3139N/A</refsect1>
3139N/A</refentry>
2494N/A