PKGDEPEND(1) | User Commands | PKGDEPEND(1) |
pkgdepend
— Image
Packaging System dependency analyzer
pkgdepend |
[options] command
[cmd_options] [operands] |
pkgdepend |
generate [-IMm ]
-d dir
[-d dir]
[-D
name= value]
[-k path]
manifest_file |
pkgdepend |
resolve [-EmoSv ]
[-d output_dir]
[-e
external_package_file]...
[-s suffix]
manifest_file... |
The pkgdepend
command generates and
resolves dependencies for packages. A package might depend on files from
other packages. The pkgdepend
command is typically
used in two passes: file dependency generation and file-to-package
resolution.
The generate
subcommand examines the
content of a package and determines what external files the package
needs.
The resolve
subcommand takes the list of
files from the generate
step, and searches a
reference set of packages to determine the names of the packages that
contain those dependent files. The reference set of packages that are
searched for the dependent files are the packages that are currently
installed on the publisher's system.
Several components of delivered files are used as sources of dependency information:
-k
and -D
options
modifying the information obtained. For more details on ELF dependencies,
see ldd(1) and the
Linker and Libraries Guide.The following options are supported:
--help
,
-?
-R
dirThe following subcommands are supported:
pkgdepend
generate
[-IMm
] -d
dir [-d
dir] [-D
name=
value]
[-k
path]
manifest_fileProduce the dependencies on files of the manifest specified by manifest_file.
-I
-I
with pkgdepend
resolve
.-M
-m
-d
dir-D
name=
value-k
path-k
option
removes the default paths, which are /kernel
and /usr/kernel.
Run paths such as those specified by the
-k
option can also be specified per action
or per manifest by using the action or manifest attribute
pkg.depend.runpath. The value of the
pkg.depend.runpath attribute is a colon-separated
string of the paths to use. Setting any
pkg.depend.runpath attributes in the manifest or
action overrides paths specified with the -k
option.
The special token $PKGDEPEND_RUNPATH can be used as one component of the pkg.depend.runpath attribute value in order to include the standard system run path for the file being analyzed.
In some cases, you might want to prevent automatic generation of dependencies. For example, if a package delivers a sample Python script that imports a set of modules, those modules imported by the sample script are not dependencies for the package that delivers the sample script. Use the action or manifest attribute pkg.depend.bypass-generate to prevent generating dependencies against the specified files.
The pkg.depend.bypass-generate values are Python regular expressions that match file names. The regular expressions are implicitly anchored at the start and end of the file path. The value given in the following example matches this/that but does not match something/this/that/the/other.
pkg.depend.bypass-generate=this/that
For more information about Python regular expression syntax, see the documentation at http://docs.python.org/dev/howto/regex.html.
When
pkgdepend
generate
input
manifests contain SMF manifest files, any SMF services or instances
declared by those SMF manifest files are included in the
pkgdepend
output. These SMF services or
instances are included in the form of a set
action with the name
org.opensolaris.smf.fmri.
pkgdepend
resolve
[-EmoSv
] [-d
output_dir] [-e
external_package_file]... [-s
suffix] manifest_file...Transform dependencies on files into dependencies on the packages that deliver those files. Dependencies are first resolved against the manifests given on the command line and then against the packages installed on the system. By default, the dependencies for each manifest are placed in a file named manifest_file.res
-e
external_package_file-e
option
cannot be used with the -S
option.-E
-e
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
external_package_file.
If -e
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.
-m
generate
step removed, before adding the
resolved dependencies.-o
-d
or
-s
options are strongly recommended instead of
-o
for use in a pipeline for manifest
processing.-d
output_dir-s
suffix-S
-v
The following environment variable is supported:
PKG_IMAGE
-R
is
specified.The following exit values are returned:
Example 1 Generate Dependencies
Generate the dependencies for the manifest written in foo, whose content directory is in (./bar/baz), and store the results in foo.fdeps.
pkgdepend generate -d ./bar/baz foo > foo.fdeps
Example 2 Resolve Dependencies
Resolve the file dependencies in foo.fdeps and bar.fdeps against each other and against the packages currently installed on the system.
pkgdepend resolve foo.fdeps bar.fdeps ls *.res foo.fdeps.res bar.fdeps.res
Example 3 Generate and Resolve Dependencies For Two Manifests
Generate the file dependencies for two manifests () foo and bar and retain all the information in the original manifests. Then resolve the file dependencies and place the resulting manifests in ./res. These resulting manifests can be used with pkgsend publish.
pkgdepend generate -d /proto/foo -m foo > ./deps/foo pkgdepend generate -d /proto/bar -m bar > ./deps/bar pkgdepend resolve -m -d ./res ./deps/foo ./deps/bar ls ./res foo bar
Example 4 Add Values To Tokens For ELF File Dependencies
Replace all PLATFORM tokens in the run paths in ELF files with sun4v and sun4u while generating the dependencies for the manifest written in foo whose content directory is in /.
Bpkgdepend generate -d / -D 'PLATFORM=sun4v' \ -D 'PLATFORM=sun4u' foo
Example 5 Specify a Kernel Module Directory
Specify /kmod as the directory in which to find kernel modules when generating the dependencies for the manifest written in foo whose content directory is in /.
pkgdepend generate -d / -k /kmod foo
Example 6 Bypass Dependency Generation
Append opt/python to the standard Python run path for a given Python script, and bypass dependency generation against all Python modules called test for a file delivered as opt/python/foo/file.py.
Avoid generating dependencies against any file delivered in usr/lib/python2.6/vendor-packages/xdg.
cat manifest.py 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 \ pkg.depend.bypass-generate=.*/test.py.* \ pkg.depend.bypass-generate=.*/testmodule.so \ pkg.depend.bypass-generate=.*/test.so \ pkg.depend.bypass-generate=usr/lib/python2.6/vendor-packages/xdg/.* \ pkg.depend.runpath=$PKGDEPEND_RUNPATH:/opt/python pkgdepend generate -d proto manifest.py
The command line interface of pkgdepend
is
Uncommitted.
The output of pkgdepend
is
Not-An-Interface
and may change at any time.
Linker and Libraries Guide.
February 17, 2022 | OmniOS |