PKG_INFO(1)             NetBSD General Commands Manual             PKG_INFO(1)

NNAAMMEE
     ppkkgg__iinnffoo - a utility for displaying information on software packages

SSYYNNOOPPSSIISS
     ppkkgg__iinnffoo [--BBbbccDDddFFffhhIIiikkLLmmNNnnppqqRRrrSSssVVvv] [--ee _p_a_c_k_a_g_e] [--KK _p_k_g___d_b_d_i_r]
              [--ll _p_r_e_f_i_x] _p_k_g_-_n_a_m_e _._._.
     ppkkgg__iinnffoo [--aa _f_l_a_g_s]

DDEESSCCRRIIPPTTIIOONN
     The ppkkgg__iinnffoo command is used to dump out information for packages, which
     may be either packed up in files or already installed on the system with
     the pkg_create(1) command.

     The _p_k_g_-_n_a_m_e may be the name of an installed package (with our without
     version), a pattern matching several installed packages (see the --ee
     switch for a description of possible patterns), the pathname to a package
     distribution file, a filename belonging to an installed package (if --FF is
     also given), or a URL to an ftp-available package.

     The following command-line options are supported:

     --aa      Show information for all currently installed packages.

     --BB      Show some of the important definitions used when building the
             binary package (the "Build information") for each package.

     --bb      Show the NetBSD RCS Id strings from the files used in the con-
             struction of the binary package (the "Build version") for each
             package.  These files are the package Makefile, any patch files,
             any checksum files, and the packing list file.

     --cc      Show the one-line comment field for each package.

     --DD      Show the install-message file (if any) for each package.

     --dd      Show the long-description field for each package.

     --ee _p_k_g_-_n_a_m_e
             This option allows you to test for the presence of another (per-
             haps prerequisite) package from a script.  If the package identi-
             fied by _p_k_g_-_n_a_m_e is currently installed, return 0, otherwise
             return 1.  In addition, the names of any package(s) found
             installed are printed to stdout unless turned off using the --qq
             option.

             If the given _p_k_g_-_n_a_m_e contains a shell meta character, it will be
             matched against all installed packages using fnmatch(3).  csh(1)
             style {,} alternates have also been implemented in addition to
             this.  Package version numbers can also be matched in a rela-
             tional manner using the _>_=_, _<_=_, _> and _< operators.  For example,
             _p_k_g___i_n_f_o _-_e _'_n_a_m_e_>_=_1_._3_' will match versions 1.3 and later of the
             _n_a_m_e package.  The collating sequence of the various package ver-
             sion numbers is unusual, but strives to be consistent.  The magic
             string ``alpha'' equates to _a_l_p_h_a _v_e_r_s_i_o_n and sorts before a beta
             version.  The magic string ``beta'' equates to _b_e_t_a _v_e_r_s_i_o_n and
             sorts before a release candidate.  The magic string ``rc''
             equates to _r_e_l_e_a_s_e _c_a_n_d_i_d_a_t_e and sorts before a release.  For
             example, _n_a_m_e_-_1_._3_r_c_3 will sort before _n_a_m_e_-_1_._3 and after
             _n_a_m_e_-_1_._2_._9 Similarly _n_a_m_e_-_1_._3_a_l_p_h_a_2 will sort before
             _n_a_m_e_-_1_._3_b_e_t_a_1 and they both sort before _n_a_m_e_-_1_._3_r_c_1 In addition,
             alphabetic characters sort in the same place as their numeric
             counterparts, so that _n_a_m_e_-_1_._2_e has the same sorting value as
             _n_a_m_e_-_1_._2_._5 The magic string ``pl'' equates to a _p_a_t_c_h _l_e_v_e_l and
             has the same value as a dot in the dewey-decimal ordering
             schemes.

     --FF      Interpret any pkg-name given as filename, and translate it to a
             package name using the Package Database.  This can be used to
             query information on a per-file basis, e.g. in conjunction with
             the --ee flag to find out which package a file belongs to.

     --ff      Show the packing list instructions for each package.

     --II      Show the index entry for each package.

     --ii      Show the install script (if any) for each package.

     --KK _p_k_g___d_b_d_i_r
             Set _p_k_g___d_b_d_i_r as the package database directory.  If this option
             isn't specified, then the package database directory is taken
             from the value of the environment variable PKG_DBDIR if it's set,
             otherwise it defaults to _/_v_a_r_/_d_b_/_p_k_g.

     --kk      Show the de-install script (if any) for each package.

     --LL      Show the files within each package.  This is different from just
             viewing the packing list, since full pathnames for everything are
             generated.

     --ll _s_t_r  Prefix each information category header (see --qq) shown with _s_t_r.
             This is primarily of use to front-end programs that want to
             request a lot of different information fields at once for a pack-
             age, but don't necessary want the output intermingled in such a
             way that they can't organize it.  This lets you add a special
             token to the start of each field.

     --mm      Show the mtree file (if any) for each package.

     --NN      Show which packages each package was built with (exact dependen-
             cies), if any.

     --nn      Show which packages each package needs (depends upon), if any.

     --pp      Show the installation prefix for each package.

     --qq      Be ``quiet'' in emitting report headers and such, just dump the
             raw info (basically, assume a non-human reading).

     --RR      Show which packages are required by each package.

     --rr      Show the requirements script (if any) for each package.

     --SS      Show the size of this package and all the packages it requires,
             in bytes.

     --ss      Show the size of this package in bytes.  The size is calculated
             by adding up the size of each file of the package.

     --VV      Print version number and exit.

     --vv      Turn on verbose output.

EENNVVIIRROONNMMEENNTT
     PKG_DBDIR  If the --KK flag isn't given, then PKG_DBDIR is the location of
                the package database directory.  The default package database
                directory is _/_v_a_r_/_d_b_/_p_k_g.

     PKG_PATH   This can be used to specify a semicolon-separated list of
                paths and URLs to search for package files.  If PKG_PATH is
                used, the suffix _._t_g_z is automatically appended to the
                _p_k_g_-_n_a_m_e, whereas searching in the current directory uses
                _p_k_g_-_n_a_m_e literally.

     PKG_TMPDIR, TMPDIR
                These are tried in turn (if set) as candidate directories in
                which to create a ``staging area'' for any files extracted by
                ppkkgg__iinnffoo from package files.  If neither PKG_TMPDIR nor TMPDIR
                yields a suitable scratch directory, _/_v_a_r_/_t_m_p, _/_t_m_p, and
                _/_u_s_r_/_t_m_p are tried in turn.  Note that _/_u_s_r_/_t_m_p may be cre-
                ated, if it doesn't already exist.

                Since ppkkgg__iinnffoo requires very little information to be
                extracted from any package files examined, it is unlikely that
                these environment variables would ever need to be used to work
                around limited available space in the default locations.

TTEECCHHNNIICCAALL DDEETTAAIILLSS
     Package info is either extracted from package files named on the command
     line, or from already installed package information in
     _/_v_a_r_/_d_b_/_p_k_g_/_<_p_k_g_-_n_a_m_e_>.

     A filename can be given instead of a (installed) package name to query
     information on the package this file belongs to.  This filename is then
     resolved to a package name using the Package Database.  For this transla-
     tion to take place, the --FF flag must be given.  The filename must be
     absolute, compare the output of pkg_info --aaFF.

SSEEEE AALLSSOO
     pkg_add(1), pkg_admin(1), pkg_create(1), pkg_delete(1), mktemp(3),
     packages(7), mtree(8)

AAUUTTHHOORRSS
     Jordan Hubbard
             most of the work
     John Kohl
             refined it for NetBSD
     Hubert Feyrer
             NetBSD wildcard dependency processing, pkgdb, depends displaying,
             pkg size display etc.

NetBSD 1.6                     September 2, 2003                    NetBSD 1.6
