Index: stable/2.2/usr.sbin/pkg_install/add/pkg_add.1 =================================================================== --- stable/2.2/usr.sbin/pkg_install/add/pkg_add.1 (revision 37437) +++ stable/2.2/usr.sbin/pkg_install/add/pkg_add.1 (revision 37438) @@ -1,365 +1,407 @@ .\" .\" FreeBSD install - a package for the installation and maintainance .\" of non-core utilities. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" Jordan K. Hubbard .\" .\" .\" @(#)pkg_add.1 .\" .Dd November 25, 1994 .Dt pkg_add 1 .Os FreeBSD .Sh NAME .Nm pkg_add .Nd a utility for installing software package distributions .Sh SYNOPSIS .Nm .Op Fl vInfRMS .Op Fl t Ar template .Op Fl p Ar prefix .Ar pkg-name [pkg-name ...] .Sh DESCRIPTION The .Nm command is used to extract packages that have been previously created with the .Xr pkg_create 1 command. .Sh WARNING .Bf -emphasis Since the .Nm command may execute scripts or programs contained within a package file, your system may be susceptible to ``trojan horses'' or other subtle attacks from miscreants who create dangerous package files. .Pp You are advised to verify the competence and identity of those who provide installable package files. For extra protection, use the .Fl M flag to extract the package file, and inspect its contents and scripts to insure it poses no danger to your system's integrity. Pay particular attention to any +INSTALL, +DEINSTALL, +REQUIRE or +MTREE_DIRS files, and inspect the +CONTENTS file for .Cm @cwd , .Cm @mode (check for setuid), .Cm @dirrm , .Cm @exec , and .Cm @unexec directives, and/or use the .Xr pkg_info 1 command to examine the package file. .Ef .Sh OPTIONS The following command line arguments are supported: .Bl -tag -width indent .It Ar pkg-name [... pkg-name] The named packages are installed. A package name of - will cause .Nm to read from stdin. If the packages are not found in the current working directory, .Nm will search them in each directory named by .Ev PKG_PATH . .It Fl v Turn on verbose output. .It Fl I If an installation script exists for a given package, do not execute it. .It Fl n Don't actually install a package, just report the steps that would be taken if it was. .It Fl R Do not record the installation of a package. This means that you cannot deinstall it later, so only use this option if you know what you are doing! .It Fl f Force installation to proceed even if prerequisite packages are not installed or the requirements script fails. Although .Nm will still try to find and auto-install missing prerequisite packages, a failure to find one will not be fatal. .It Fl p Ar prefix Set .Ar prefix as the directory in which to extract files from a package. If a package has set its default directory, it will be overridden by this flag. Note that only the first .Cm @cwd directive will be replaced, since .Nm has no way of knowing which directory settings are relative and which are absolute. It is rare in any case to see more than one directory transition made, but when such does happen and you wish to have control over *all* directory transitions, then you may then wish to look into the use of .Cm MASTER and .Cm SLAVE modes (see the .Fl M and .Fl S options). .It Fl t Ar template Use .Ar template as the input to .Xr mktemp 3 when creating a ``staging area.'' By default, this is the string .Pa /var/tmp/instmp.XXXXXX , but it may be necessary to override it in the situation where space in your .Pa /var/tmp directory is limited. Be sure to leave some number of `X' characters for .Xr mktemp 3 to fill in with a unique ID. .Pp You can get a performance boost by setting the staging area .Ar template to reside on the same disk partition as target directories for package file installation; often this is .Pa /usr . .It Fl M Run in .Cm MASTER mode. This is a very specialized mode for running .Nm and is meant to be run in conjunction with .Cm SLAVE mode. When run in this mode, .Nm does no work beyond extracting the package into a temporary staging area (see the .Fl t option), reading in the packing list, and then dumping it (prefaced by the current staging area) to stdout where it may be filtered by a program such as .Xr sed 1 . When used in conjunction with .Cm SLAVE mode, it allows you to make radical changes to the package structure before acting on its contents. .It Fl S Run in .Cm SLAVE mode. This is a very specialized mode for running .Nm and is meant to be run in conjunction with .Cm MASTER mode. When run in this mode, .Nm expects the release contents to be already extracted and waiting in the staging area, the location of which is read as a string from stdin. The complete packing list is also read from stdin, and the contents then acted on as normal. .El .Pp One or more .Ar pkg-name arguments may be specified, each being either a file containing the package (these usually ending with the ``.tgz'' suffix) or a URL pointing at a file available on an ftp site. Thus you may extract files directly from their anonymous ftp locations (e.g. .Nm ftp://ftp.freebsd.org/pub/FreeBSD/packages/shells/bash-1.14.4.tgz). Note: If you wish to use .Bf -emphasis passive mode .Ef ftp in such transfers, set the variable .Bf -emphasis FTP_PASSIVE_MODE .Ef to some value in your environment. Otherwise, the more standard ACTIVE mode may be used. If .Nm consistently fails to fetch a package from a site known to work, it may be because you have a firewall that demands the usage of .Bf -emphasis passive mode .Ef ftp. .Sh TECHNICAL DETAILS .Nm Pkg_add is fairly simple. It extracts each package's "packing list" -into a special staging directory in /tmp (or $PKG_TMPDIR if set), parses it, +into a special staging directory, parses it, and then runs through the following sequence to fully extract the contents: .Bl -enum -indent indent .It Check if the package is already recorded as installed. If so, terminate installation. .It Scan all the package dependencies (from .Cm @pkgdep directives, see .Xr pkg_create 1 ) and make sure each one is met. If not, try and find the missing dependencies' packages and auto-install them; if they can't be found the installation is terminated. .It Search for any .Cm @option directives which control how the package is added to the system. At the time of this writing, the only currently implemented option is .Cm @option extract-in-place which will cause the package to be extracted directly into its prefix directory without moving through a staging area in .Pa /tmp . .It If .Cm @option extract-in-place is enabled, the package is now extracted directly into its final location, otherwise it is extracted into the staging area. .It If the package contains a .Ar require file (see .Xr pkg_create 1 ), then execute it with the following arguments: .Bd -filled -offset indent -compact .Ar pkg-name .Ar INSTALL .Ed where .Ar pkg-name is the name of the package in question and the .Ar INSTALL keyword denotes this as an installation requirements check (useful if you want to have one script serving multiple functions). .It If an .Ar install script exists for the package, it is then executed with the following arguments: .Bd -filled -offset indent -compact .Ar pkg-name .Ar PRE-INSTALL .Ed where .Ar pkg-name is the name of the package in question and .Ar PRE-INSTALL is a keyword denoting this as the preinstallation phase. .It If .Cm @option extract-in-place is not used, then the packing list (this is the .Pa +CONTENTS file) is now used as a guide for moving (or copying, as necessary) files from the staging area into their final locations. .It If the package contains an .Ar mtreefile file (see .Xr pkg_create 1 ), then mtree is invoked as: .Bd -filled -offset indent -compact .Cm mtree .Fl u .Fl f .Ar mtreefile .Fl d .Fl e .Fl p .Pa prefix .Ed where .Pa prefix is either the prefix specified with the .Fl p flag or, if no .Fl p flag was specified, the name of the first directory named by a .Cm @cwd directive within this package. .It If an .Ar install script exists for the package, it is then executed as .Bd -filled -offset indent -compact .Cm script .Ar pkg-name .Ar POST-INSTALL .Ed This all allows you to write a single .Ar install script that does both ``before and after'' actions. .It After installation is complete, a copy of the packing list, .Ar deinstall script, description, and display files are copied into .Pa /var/db/pkg/ for subsequent possible use by .Xr pkg_delete 1 . Any package dependencies are recorded in the other packages' .Pa /var/db/pkg//+REQUIRED_BY file (if the environment variable PKG_DBDIR is set, this overrides the .Pa /var/db/pkg/ path shown above). .It Finally, the staging area is deleted and the program terminates. .El .Pp All the scripts are called with the environment variable .Ev PKG_PREFIX set to the installation prefix (see the .Fl p option above). This allows a package author to write a script that reliably performs some action on the directory where the package is installed, even if the user might change it with the .Fl p flag to .Cm pkg_add . .Sh ENVIRONMENT The value of the .Ev PKG_PATH is used if a given package can't be found. The environment variable should be a series of entries seperated by colons. Each entry consists of a directory name. The current directory may be indicated implicitly by an empty directory name, or explicitly by a single period. +.Pp +The environment variable +.Ev PKG_DBDIR +specifies an alternative location for the installed package database. +.Pp +The environment variables +.Ev PKG_TMPDIR +and +.Ev TMPDIR , +in that order, are taken to name temporary directories where +.Nm +will attempt to create its staging area in. +If these variables are not present or if the directories named lack +sufficient space, then +.Nm +will use the first of +.Pa /var/tmp , +.Pa /tmp +or +.Pa /usr/tmp +with sufficient space. +.Sh FILES +.Bl -tag -width /var/db/pkg -compact +.It Pa /var/tmp +Temporary directory for creating the staging area, if environmental variables +.Ev PKG_TMPDIR +or +.Ev TMPDIR +do not point to a suitable directory. +.It Pa /tmp +Next choice if +.Pa /var/tmp +does not exist or has insufficient space. +.It Pa /usr/tmp +Last choice if +.Pa /var/tmp +and +.Pa /tmp +are not suitable for creating the staging area. +.It Pa /var/db/pkg +Default location of the installed package database. +.El .Sh SEE ALSO .Xr pkg_create 1 , .Xr pkg_delete 1 , .Xr pkg_info 1 , .Xr mktemp 3 , .Xr sysconf 3 , .Xr mtree 8 .Sh AUTHORS .Bl -tag -width indent -compact .It "Jordan Hubbard" Initial work and ongoing development. .It "John Kohl" NetBSD refinements. .El .Sh BUGS Hard links between files in a distribution are only preserved if either (1) the staging area is on the same file system as the target directory of all the links to the file, or (2) all the links to the file are bracketed by .Cm @cwd directives in the contents file, .Em and and the link names are extracted with a single .Cm tar command (not split between invocations due to exec argument-space limitations--this depends on the value returned by .Fn sysconf _SC_ARG_MAX ) . .Pp Sure to be others. Index: stable/2.2/usr.sbin/pkg_install/create/pkg_create.1 =================================================================== --- stable/2.2/usr.sbin/pkg_install/create/pkg_create.1 (revision 37437) +++ stable/2.2/usr.sbin/pkg_install/create/pkg_create.1 (revision 37438) @@ -1,388 +1,422 @@ .\" .\" FreeBSD install - a package for the installation and maintainance .\" of non-core utilities. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" Jordan K. Hubbard .\" .\" .\" @(#)pkg_create.1 -.\" $Id: pkg_create.1,v 1.16.2.7 1998/03/09 12:31:13 jkh Exp $ +.\" $Id: pkg_create.1,v 1.16.2.8 1998/05/24 03:13:00 steve Exp $ .\" .\" hacked up by John Kohl for NetBSD--fixed a few bugs, extended keywords, .\" added dependency tracking, etc. .\" .\" [jkh] Took John's changes back and made some additional extensions for .\" better integration with FreeBSD's new ports collection. .\" .Dd April 21, 1995 .Dt pkg_create 1 .Os FreeBSD .Sh NAME .Nm pkg_create .Nd a utility for creating software package distributions .Sh SYNOPSIS .Nm .Op Fl YNOhv .Op Fl P Ar pkgs .Op Fl p Ar prefix .Op Fl f Ar contents .Op Fl i Ar iscript .Op Fl k Ar dscript .Op Fl r Ar rscript .Op Fl s Ar srcdir .Op Fl t Ar template .Op Fl X Ar excludefile .Op Fl D Ar displayfile .Op Fl m Ar mtreefile .Fl c Ar comment .Fl d Ar description .Fl f Ar packlist .Ar pkg-name .Sh DESCRIPTION The .Nm command is used to create packages that will subsequently be fed to one of the package extraction/info utilities. The input description and command line arguments for the creation of a package are not really meant to be human-generated, though it is easy enough to do so. It is more expected that you will use a front-end tool for the job rather than muddling through it yourself. Nonetheless, a short description of the input syntax is included in this document. .Sh OPTIONS The following command line options are supported: .Bl -tag -width indent .It Fl f Ar packinglist Fetch ``packing list'' for package from the file .Ar packinglist or .Cm stdin if .Ar packinglist is a .Cm - (dash). .It Fl c Ar [-]desc Fetch package ``one line description'' from file .Ar desc or, if preceded by .Cm - , the argument itself. This string should also give some idea of which version of the product (if any) the package represents. .It Fl d Ar [-]desc Fetch long description for package from file .Ar desc or, if preceded by .Cm - , the argument itself. .It Fl Y Assume a default answer of `Yes' for any questions asked. .It Fl N Assume a default answer of `No' for any questions asked. .It Fl O Go into a `packing list Only' mode. This is a custom hack for the .Em "FreeBSD Ports Collection" and is used to do `fake pkg_add' operations when a port is installed. In such cases, it is necessary to know what the final, adjusted packing list will look like. .It Fl v Turn on verbose output. .It Fl h Force tar to follow symbolic links, so that the files they point to are dumped, rather than the links themselves. .It Fl i Ar iscript Set .Ar iscript to be the install procedure for the package. This can be any executable program (or shell script). It will be invoked automatically when the package is later installed. .It Fl P Ar pkgs Set the initial package dependency list to .Ar pkgs . This is assumed to be a whitespace separated list of package names and is meant as a convenient shorthand for specifying multiple .Cm @pkgdep directives in the packing list (see PACKING LIST DETAILS section below). .It Fl p Ar prefix Set .Ar prefix as the initial directory ``base'' to start from in selecting files for the package. .It Fl k Ar dscript Set .Ar dscript to be the de-install procedure for the package. This can be any executable program (or shell script). It will be invoked automatically when the package is later (if ever) de-installed. .It Fl r Ar rscript Set .Ar rscript to be the ``requirements'' procedure for the package. This can be any executable program (or shell script). It will be invoked automatically at installation/deinstallation time to determine whether or not installation/deinstallation should proceed. .It Fl s Ar srcdir .Ar srcdir will override the value of .Cm @cwd during package creation. .It Fl t Ar template Use .Ar template as the input to .Xr mktemp 3 . By default, this is the string .Pa /tmp/instmp.XXXXXX , but it may be necessary to override it in the situation where space in your .Pa /tmp directory is limited. Be sure to leave some number of `X' characters for .Xr mktemp 3 to fill in with a unique ID. .It Fl X Ar excludefile Pass .Ar excludefile as a .Fl exclude-from argument to .Cm tar when creating final package. See .Cm tar man page (or run .Cm tar with .Fl -help flag) for further information on using this flag. .It Fl D Ar displayfile Display the file (using .Xr more 1 ) after installing the package. Useful for things like legal notices on almost-free software, etc. .It Fl m Ar mtreefile Run .Xr mtree 8 with input from mtreefile before the package is installed. Mtree is invoked as .Cm mtree .Fl u .Fl f .Ar mtreefile .Fl d .Fl e .Fl p .Pa prefix , where .Pa prefix is the name of the first directory named by a .Cm @cwd directive. .El .Pp .Sh PACKING LIST DETAILS The ``packing list'' format (see .Fl f ) is fairly simple, being nothing more than a single column of filenames to include in the package. However, since absolute pathnames are generally a bad idea for a package that could be installed potentially anywhere, there is another method of specifying where things are supposed to go and, optionally, what ownership and mode information they should be installed with. This is done by imbeding specialized command sequences in the packing list. Briefly described, these sequences are: .Bl -tag -width indent -compact .It Cm @cwd Ar directory Set the internal directory pointer to point to .Ar directory . All subsequent filenames will be assumed relative to this directory. Note: .Cm @cd is also an alias for this command. .It Cm @srcdir Ar directory Set the internal directory pointer for _creation only_ to .Ar directory . That is to say that it overrides .Cm @cwd for package creation but not extraction. .It Cm @exec Ar command Execute .Ar command as part of the unpacking process. If .Ar command contains any of the following sequences somewhere in it, they will be expanded inline. For the following examples, assume that .Cm @cwd is set to .Pa /usr/local and the last extracted file was .Pa bin/emacs . .Bl -tag -width indent -compact .It Cm "%F" Expands to the last filename extracted (as specified), in the example case .Pa bin/emacs .It Cm "%D" Expand to the current directory prefix, as set with .Cm @cwd , in the example case .Pa /usr/local . .It Cm "%B" Expand to the ``basename'' of the fully qualified filename, that is the current directory prefix, plus the last filespec, minus the trailing filename. In the example case, that would be .Pa /usr/local/bin . .It Cm "%f" Expand to the ``filename'' part of the fully qualified name, or the converse of .Cm %B , being in the example case, .Pa emacs . .El .It Cm @unexec Ar command Execute .Ar command as part of the deinstallation process. Expansion of special .Cm % sequences is the same as for .Cm @exec . This command is not executed during the package add, as .Cm @exec is, but rather when the package is deleted. This is useful for deleting links and other ancillary files that were created as a result of adding the package, but not directly known to the package's table of contents (and hence not automatically removable). The advantage of using .Cm @unexec over a deinstallation script is that you can use the ``special sequence expansion'' to get at files regardless of where they've been potentially redirected (see .Fl p ) . .It Cm @mode Ar mode Set default permission for all subsequently extracted files to .Ar mode . Format is the same as that used by the .Cm chmod command (well, considering that it's later handed off to it, that's no surprise). Use without an arg to set back to default (extraction) permissions. .It Cm @option Ar option Set internal package options, the only two currently supported ones being .Ar extract-in-place , which tells the pkg_add command not to extract the package's tarball into a staging area but rather directly into the target hierarchy (this is typically meant to be used only by distributions or other special package types), and .Ar preserve , which tells pkg_add to move any existing files out of the way, preserving the previous contents (which are also resurrected on pkg_delete, so caveat emptor). .It Cm @owner Ar user Set default ownership for all subsequently extracted files to .Ar user . Use without an arg to set back to default (extraction) ownership. .It Cm @group Ar group Set default group ownership for all subsequently extracted files to .Ar group . Use without an arg to set back to default (extraction) group ownership. .It Cm @comment Ar string Imbed a comment in the packing list. Useful in trying to document some particularly hairy sequence that may trip someone up later. .It Cm @ignore Used internally to tell extraction to ignore the next file (don't copy it anywhere), as it's used for some special purpose. .It Cm @ignore_inst Similar to .Cm @ignore , but the ignoring of the next file is delayed one evaluation cycle. This makes it possible to use this directive in the .Ar packinglist file, so you can pack a specialized datafile in with a distribution for your install script (or something) yet have the installer ignore it. .It Cm @name Ar name Set the name of the package. This is mandatory and is usually put at the top. This name is potentially different than the name of the file it came in, and is used when keeping track of the package for later deinstallation. Note that .Nm will derive this field from the package name and add it automatically if none is given. .It Cm @dirrm Ar name Declare directory .Pa name to be deleted at deinstall time. By default, directories created by a package installation are not deleted when the package is deinstalled; this provides an explicit directory cleanup method. This directive should appear at the end of the package list. If more than one .Cm @dirrm directives are used, the directories are removed in the order specified. The .Pa name directory will not be removed unless it is empty. .It Cm @mtree Ar name Declare .Pa name as an .Xr mtree 8 input file to be used at install time (see .Fl m above). Only the first .Cm @mtree directive is honored. .It Cm @display Ar name Declare .Pa name as the file to be displayed at install time (see .Fl D above). .It Cm @pkgdep Ar pkgname Declare a dependency on the .Ar pkgname package. The .Ar pkgname package must be installed before this package may be installed, and this package must be deinstalled before the .Ar pkgname package is deinstalled. Multiple .Cm @pkgdep directives may be used if the package depends on multiple other packages. +.El +.Sh ENVIRONMENT +The environment variable +.Ev PKG_TMPDIR +names the directory where +.Nm +will attempt to create its temporary files. +If +.Ev PKG_TMPDIR +is not set, +the directory named by the contents of +.Ev TMPDIR +will be used. +If neither of +.Ev PKG_TMPDIR +and +.Ev TMPDIR +are set, the builtin defaults are used. +.Sh FILES +.Bl -tag -width /usr/tmp -compact +.It Pa /var/tmp +Temporary directory if environmental variables +.Ev PKG_TMPDIR +and +.Ev TMPDIR +are not set. +.It Pa /tmp +The next choice if +.Pa /var/tmp +does not exist. +.It Pa /usr/tmp +The last choice if +.Pa /tmp +is unsuitable. .El .Sh SEE ALSO .Xr pkg_add 1 , .Xr pkg_delete 1 , .Xr pkg_info 1 , .Xr sysconf 3 . .Sh HISTORY The .Nm command first appeared in FreeBSD. .Sh AUTHORS .Bl -tag -width indent -compact .It "Jordan Hubbard" most of the work .It "John Kohl" refined it for NetBSD .El .Sh BUGS Hard links between files in a distribution must be bracketed by .Cm @cwd directives in order to be preserved as hard links when the package is extracted. They additionally must not end up being split between .Cm tar invocations due to exec argument-space limitations (this depends on the value returned by .Fn sysconf _SC_ARG_MAX ) . .Pp Sure to be others. Index: stable/2.2/usr.sbin/pkg_install/info/pkg_info.1 =================================================================== --- stable/2.2/usr.sbin/pkg_install/info/pkg_info.1 (revision 37437) +++ stable/2.2/usr.sbin/pkg_install/info/pkg_info.1 (revision 37438) @@ -1,135 +1,165 @@ .\" .\" FreeBSD install - a package for the installation and maintainance .\" of non-core utilities. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" Jordan K. Hubbard .\" .\" .\" @(#)pkg_info.1 .\" .Dd November 25, 1994 .Dt pkg_info 1 .Os FreeBSD .Sh NAME .Nm pkg_info .Nd a utility for displaying information on software packages .Sh SYNOPSIS .Nm pkg_info .Op Fl cdDikrRpLqImv .Op Fl e Ar package .Op Fl l Ar prefix .Ar pkg-name [pkg-name ...] .Nm pkg_info .Fl a .Op Ar flags .Sh DESCRIPTION The .Nm command is used to dump out information for packages, either packed up in files or already installed on the system with the .Xr pkg_create 1 command. .Sh OPTIONS The following command line options are supported: .Bl -tag -width indent .It Ar pkg-name ... The named packages are described. A package name may either be the name of an installed package, the pathname to a package distribution file or a URL to an ftp available package. .It Fl a Show all currently installed packages. .It Fl v Turn on verbose output. .It Fl p Show the installation prefix for each package. .It Fl q Be ``quiet'' in emitting report headers and such, just dump the raw info (basically, assume a non-human reading). .It Fl c Show the comment (one liner) field for each package. .It Fl d Show the long description field for each package. .It Fl D Show the install-message file for each package. .It Fl f Show the packing list instructions for each package. .It Fl i Show the install script (if any) for each package. .It Fl k Show the de-install script (if any) for each package. .It Fl r Show the requirements script (if any) for each package. .It Fl m Show the mtree file (if any) for each package. .It Fl L Show the files within each package. This is different from just viewing the packing list, since full pathnames for everything are generated. .It Fl e Ar pkg-name If the package identified by .Ar pkg-name is currently installed, return 0, otherwise return 1. This option allows you to easily test for the presence of another (perhaps prerequisite) package from a script. .It Fl l Ar str Prefix each information category header (see .Fl q ) shown with .Ar str . This is primarily of use to front-end programs who want to request a lot of different information fields at once for a package, 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. .It Fl t Ar template Use .Ar template as the input to .Xr mktemp 3 when creating a ``staging area.'' By default, this is the string .Pa /tmp/instmp.XXXXXX , but it may be necessary to override it in the situation where space in your .Pa /tmp directory is limited. Be sure to leave some number of `X' characters for .Xr mktemp 3 to fill in with a unique ID. .Bd -filled -offset indent -compact Note: This should really not be necessary with pkg_info, since very little information is extracted from each package and one would have to have a very small .Pa /tmp indeed to overflow it. .Ed .Sh TECHNICAL DETAILS Package info is either extracted from package files named on the command line, or from already installed package information in .Pa /var/db/pkg/ . +.Sh ENVIRONMENT +.Ev PKG_TMPDIR +points to the directory where +.Nm +creates its temporary files. +If this variable is not set, +.Ev TMPDIR +is used. If both are unset, the builtin defaults are used. +.Pp +.Ev PKG_DBDIR +names the location of the installed package database. +.Sh FILES +.Bl -tag -width /var/db/pkg -compact +.It Pa /var/tmp +Used if the environment variables +.Ev PKG_TMPDIR +and +.Ev TMPDIR +are not set, or if the directories named have insufficient space. +.It Pa /tmp +The next choice if +.Pa /var/tmp +does not exist or has insufficient space. +.It Pa /usr/tmp +The last choice if +.Pa /tmp +is unsuitable. +.It Pa /var/db/pkg +Default location of the installed package database. +.El .Sh SEE ALSO .Xr pkg_add 1 , .Xr pkg_create 1 , .Xr pkg_delete 1 , .Xr mktemp 3 , .Xr mtree 8 . .Sh AUTHORS .Bl -tag -width indent -compact .It "Jordan Hubbard" most of the work .It "John Kohl" refined it for NetBSD .El .Sh BUGS Sure to be some.