summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjmmv <jmmv>2010-01-20 22:34:47 +0000
committerjmmv <jmmv>2010-01-20 22:34:47 +0000
commit1af6f9d0183d0ca168dc99fae658e745269075fd (patch)
treebaeae25fbf3500ed69013cad81e865f4660a92e5 /pkgtools
parent405e2a24d902a399e43fe79c24e3ef5715bb2067 (diff)
downloadpkgsrc-1af6f9d0183d0ca168dc99fae658e745269075fd.tar.gz
Update to 20100120:
- Make PKG_DBDIR customizable through pkg_install.conf. Things seem to work fine after a few tests but... where are the tests for these tools?!
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_install/Makefile4
-rw-r--r--pkgtools/pkg_install/files/add/pkg_add.120
-rw-r--r--pkgtools/pkg_install/files/add/pkg_add.cat116
-rw-r--r--pkgtools/pkg_install/files/admin/pkg_admin.122
-rw-r--r--pkgtools/pkg_install/files/admin/pkg_admin.cat116
-rw-r--r--pkgtools/pkg_install/files/create/main.c12
-rw-r--r--pkgtools/pkg_install/files/create/pkg_create.125
-rw-r--r--pkgtools/pkg_install/files/create/pkg_create.cat115
-rw-r--r--pkgtools/pkg_install/files/delete/pkg_delete.120
-rw-r--r--pkgtools/pkg_install/files/delete/pkg_delete.c4
-rw-r--r--pkgtools/pkg_install/files/delete/pkg_delete.cat116
-rw-r--r--pkgtools/pkg_install/files/info/main.c12
-rw-r--r--pkgtools/pkg_install/files/info/pkg_info.120
-rw-r--r--pkgtools/pkg_install/files/info/pkg_info.cat119
-rw-r--r--pkgtools/pkg_install/files/lib/parse-config.c11
-rw-r--r--pkgtools/pkg_install/files/lib/pkg_install.conf.5.in8
-rw-r--r--pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in6
-rw-r--r--pkgtools/pkg_install/files/lib/version.h4
18 files changed, 148 insertions, 102 deletions
diff --git a/pkgtools/pkg_install/Makefile b/pkgtools/pkg_install/Makefile
index 3cbd6eb9157..58d152b705a 100644
--- a/pkgtools/pkg_install/Makefile
+++ b/pkgtools/pkg_install/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.166 2010/01/17 13:24:27 tron Exp $
+# $NetBSD: Makefile,v 1.167 2010/01/20 22:34:47 jmmv Exp $
# Notes to package maintainers:
#
@@ -24,7 +24,7 @@ CONFLICTS+= audit-packages-[0-9]*
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR:Q}
-CONFIGURE_ARGS+= --with-pkgdbdir=${PKG_DBDIR:Q}
+CONFIGURE_ARGS+= --with-pkgdbdir=/var/db/pkg # ${PKG_DBDIR:Q}
USE_FEATURES= nbcompat
diff --git a/pkgtools/pkg_install/files/add/pkg_add.1 b/pkgtools/pkg_install/files/add/pkg_add.1
index b0d7737e9c4..6aa5647889c 100644
--- a/pkgtools/pkg_install/files/add/pkg_add.1
+++ b/pkgtools/pkg_install/files/add/pkg_add.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_add.1,v 1.38 2009/08/06 18:14:15 wiz Exp $
+.\" $NetBSD: pkg_add.1,v 1.39 2010/01/20 22:34:47 jmmv Exp $
.\"
.\" FreeBSD install - a package for the installation and maintenance
.\" of non-core utilities.
@@ -17,7 +17,7 @@
.\"
.\" @(#)pkg_add.1
.\"
-.Dd August 6, 2009
+.Dd January 20, 2010
.Dt PKG_ADD 1
.Os
.Sh NAME
@@ -131,11 +131,9 @@ If an installation script exists for a given package, do not execute it.
Set
.Ar pkg_dbdir
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
-.Ev PKG_DBDIR
-if it's set, otherwise it defaults to
-.Pa /var/db/pkg .
+See the
+.Sx ENVIRONMENT
+section below for details on how the default value is calculated.
.It Fl L
Don't add the package to any views after installation.
.It Fl m
@@ -408,10 +406,12 @@ directory is
.It Ev PKG_DBDIR
If the
.Fl K
-flag isn't given, then
+flag isn't given, then the value of the
.Ev PKG_DBDIR
-is the location of the package database directory.
-The default package database directory is
+variable overrides the
+.Xr pkg_install.conf 5
+variable of the same name.
+If all of this fails to locate a value, then it typically defaults to
.Pa /var/db/pkg .
.It Ev PKG_PATH
The value of the
diff --git a/pkgtools/pkg_install/files/add/pkg_add.cat1 b/pkgtools/pkg_install/files/add/pkg_add.cat1
index ad8fb06fe09..113c208a838 100644
--- a/pkgtools/pkg_install/files/add/pkg_add.cat1
+++ b/pkgtools/pkg_install/files/add/pkg_add.cat1
@@ -64,10 +64,9 @@ OOPPTTIIOONNSS
cute it.
--KK _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.
+ Set _p_k_g___d_b_d_i_r as the package database directory. See the
+ _E_N_V_I_R_O_N_M_E_N_T section below for details on how the default value is
+ calculated.
--LL Don't add the package to any views after installation.
@@ -232,9 +231,10 @@ EENNVVIIRROONNMMEENNTT
the views are managed. The default _v_i_e_w_b_a_s_e directory is
_/_u_s_r_/_p_k_g.
- PKG_DBDIR If the --KK 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_DBDIR If the --KK flag isn't given, then the value of the PKG_DBDIR
+ variable overrides the pkg_install.conf(5) variable of the
+ same name. If all of this fails to locate a value, then it
+ typically defaults to _/_v_a_r_/_d_b_/_p_k_g.
PKG_PATH The value of the PKG_PATH variable overrides the
pkg_install.conf(5) variable of the same name. It is used if
@@ -316,4 +316,4 @@ BBUUGGSS
Sure to be others.
-NetBSD 5.0 August 6, 2009 NetBSD 5.0
+NetBSD 5.0 January 20, 2010 NetBSD 5.0
diff --git a/pkgtools/pkg_install/files/admin/pkg_admin.1 b/pkgtools/pkg_install/files/admin/pkg_admin.1
index aa13a4147aa..45d6466b5c1 100644
--- a/pkgtools/pkg_install/files/admin/pkg_admin.1
+++ b/pkgtools/pkg_install/files/admin/pkg_admin.1
@@ -1,6 +1,6 @@
-.\" $NetBSD: pkg_admin.1,v 1.28 2009/10/07 12:53:26 joerg Exp $
+.\" $NetBSD: pkg_admin.1,v 1.29 2010/01/20 22:34:47 jmmv Exp $
.\"
-.\" Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
+.\" Copyright (c) 1999-2010 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
@@ -34,7 +34,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd August 16, 2009
+.Dd January 20, 2010
.Dt PKG_ADMIN 1
.Os
.Sh NAME
@@ -75,11 +75,9 @@ and
Set
.Ar pkg_dbdir
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
-.Ev PKG_DBDIR
-if it's set, otherwise it defaults to
-.Pa /var/db/pkg .
+See the
+.Sx ENVIRONMENT
+section below for details on how the default value is calculated.
.It Fl q
Perform checks in a quiet manner.
In normal operation,
@@ -312,10 +310,12 @@ Remove an installation variable.
.It Ev PKG_DBDIR
If the
.Fl K
-flag isn't given, then
+flag isn't given, then the value of the
.Ev PKG_DBDIR
-is the location of the package database directory.
-The default package database directory is
+variable overrides the
+.Xr pkg_install.conf 5
+variable of the same name.
+If all of this fails to locate a value, then it typically defaults to
.Pa /var/db/pkg .
.El
.Sh CONFIGURATION VARIABLES
diff --git a/pkgtools/pkg_install/files/admin/pkg_admin.cat1 b/pkgtools/pkg_install/files/admin/pkg_admin.cat1
index cdfdbee9362..5b2c350e3de 100644
--- a/pkgtools/pkg_install/files/admin/pkg_admin.cat1
+++ b/pkgtools/pkg_install/files/admin/pkg_admin.cat1
@@ -26,10 +26,9 @@ OOPPTTIIOONNSS
package names for llssaallll and llssbbeesstt.
--KK _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.
+ Set _p_k_g___d_b_d_i_r as the package database directory. See the
+ _E_N_V_I_R_O_N_M_E_N_T section below for details on how the default value is
+ calculated.
--qq Perform checks in a quiet manner. In normal operation, ppkkgg__aaddmmiinn
prints a `.' to standard output to indicate progress. This
@@ -207,9 +206,10 @@ OOPPTTIIOONNSS
EENNVVIIRROONNMMEENNTT
PKG_DBDIR
- If the --KK flag isn't given, then PKG_DBDIR is the location of the
- package database directory. The default package database direc-
- tory is _/_v_a_r_/_d_b_/_p_k_g.
+ If the --KK flag isn't given, then the value of the PKG_DBDIR vari-
+ able overrides the pkg_install.conf(5) variable of the same name.
+ If all of this fails to locate a value, then it typically
+ defaults to _/_v_a_r_/_d_b_/_p_k_g.
CCOONNFFIIGGUURRAATTIIOONN VVAARRIIAABBLLEESS
The following variables change the behavior of ppkkgg__aaddmmiinn and are
@@ -243,4 +243,4 @@ HHIISSTTOORRYY
AAUUTTHHOORRSS
The ppkkgg__aaddmmiinn command was written by Hubert Feyrer.
-NetBSD 5.0 August 16, 2009 NetBSD 5.0
+NetBSD 5.0 January 20, 2010 NetBSD 5.0
diff --git a/pkgtools/pkg_install/files/create/main.c b/pkgtools/pkg_install/files/create/main.c
index b2b62bae163..67faf147b1b 100644
--- a/pkgtools/pkg_install/files/create/main.c
+++ b/pkgtools/pkg_install/files/create/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.17 2009/11/05 16:22:32 joerg Exp $ */
+/* $NetBSD: main.c,v 1.18 2010/01/20 22:34:47 jmmv Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -7,7 +7,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: main.c,v 1.17 2009/11/05 16:22:32 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.18 2010/01/20 22:34:47 jmmv Exp $");
/*
* FreeBSD install - a package for the installation and maintainance
@@ -73,6 +73,7 @@ int
main(int argc, char **argv)
{
int ch;
+ const char *pkgdb = NULL;
setprogname(argv[0]);
while ((ch = getopt(argc, argv, Options)) != -1)
@@ -134,7 +135,7 @@ main(int argc, char **argv)
break;
case 'K':
- _pkgdb_setPKGDB_DIR(optarg);
+ pkgdb = optarg;
break;
case 'k':
@@ -194,6 +195,11 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
+ pkg_install_config();
+
+ if (pkgdb != NULL)
+ _pkgdb_setPKGDB_DIR(pkgdb);
+
if (argc == 0) {
warnx("missing package name");
usage();
diff --git a/pkgtools/pkg_install/files/create/pkg_create.1 b/pkgtools/pkg_install/files/create/pkg_create.1
index ea11998e761..3b9f760b409 100644
--- a/pkgtools/pkg_install/files/create/pkg_create.1
+++ b/pkgtools/pkg_install/files/create/pkg_create.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_create.1,v 1.21 2009/11/05 16:22:32 joerg Exp $
+.\" $NetBSD: pkg_create.1,v 1.22 2010/01/20 22:34:47 jmmv Exp $
.\"
.\" FreeBSD install - a package for the installation and maintenance
.\" of non-core utilities.
@@ -24,7 +24,7 @@
.\" [jkh] Took John's changes back and made some additional extensions for
.\" better integration with FreeBSD's new ports collection.
.\"
-.Dd November 15, 2009
+.Dd January 20, 2010
.Dt PKG_CREATE 1
.Os
.Sh NAME
@@ -196,11 +196,9 @@ It will be invoked automatically when the package is later installed.
Set
.Ar pkg_dbdir
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
-.Ev PKG_DBDIR
-if it's set, otherwise it defaults to
-.Pa /var/db/pkg .
+See the
+.Sx ENVIRONMENT
+section below for details on how the default value is calculated.
.It Fl k Ar dscript
Set
.Ar dscript
@@ -479,6 +477,19 @@ Declare a conflict with the
package, as the two packages contain references to the same files,
and so cannot co-exist on the same system.
.El
+.Sh ENVIRONMENT
+.Bl -tag -width PKG_DBDIR
+.It Ev PKG_DBDIR
+If the
+.Fl K
+flag isn't given, then the value of the
+.Ev PKG_DBDIR
+variable overrides the
+.Xr pkg_install.conf 5
+variable of the same name.
+If all of this fails to locate a value, then it typically defaults to
+.Pa /var/db/pkg .
+.El
.Sh SEE ALSO
.Xr pkg_add 1 ,
.Xr pkg_admin 1 ,
diff --git a/pkgtools/pkg_install/files/create/pkg_create.cat1 b/pkgtools/pkg_install/files/create/pkg_create.cat1
index 03429d2267a..be1995dfc5e 100644
--- a/pkgtools/pkg_install/files/create/pkg_create.cat1
+++ b/pkgtools/pkg_install/files/create/pkg_create.cat1
@@ -84,10 +84,9 @@ OOPPTTIIOONNSS
invoked automatically when the package is later installed.
--KK _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.
+ Set _p_k_g___d_b_d_i_r as the package database directory. See the
+ _E_N_V_I_R_O_N_M_E_N_T section below for details on how the default value is
+ calculated.
--kk _d_s_c_r_i_p_t
Set _d_s_c_r_i_p_t to be the de-install procedure for the package. This
@@ -263,6 +262,12 @@ PPAACCKKIINNGG LLIISSTT DDEETTAAIILLSS
ages contain references to the same files, and so cannot co-exist
on the same system.
+EENNVVIIRROONNMMEENNTT
+ PKG_DBDIR If the --KK flag isn't given, then the value of the PKG_DBDIR
+ variable overrides the pkg_install.conf(5) variable of the
+ same name. If all of this fails to locate a value, then it
+ typically defaults to _/_v_a_r_/_d_b_/_p_k_g.
+
SSEEEE AALLSSOO
pkg_add(1), pkg_admin(1), pkg_delete(1), pkg_info(1), sysconf(3),
pkgsrc(7)
@@ -279,4 +284,4 @@ AAUUTTHHOORRSS
NetBSD wildcard dependency processing, pkgdb, pkg size recording
etc.
-NetBSD 5.0 November 15, 2009 NetBSD 5.0
+NetBSD 5.0 January 20, 2010 NetBSD 5.0
diff --git a/pkgtools/pkg_install/files/delete/pkg_delete.1 b/pkgtools/pkg_install/files/delete/pkg_delete.1
index 08458a9f31c..67e1437f162 100644
--- a/pkgtools/pkg_install/files/delete/pkg_delete.1
+++ b/pkgtools/pkg_install/files/delete/pkg_delete.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_delete.1,v 1.23 2009/08/16 21:10:15 joerg Exp $
+.\" $NetBSD: pkg_delete.1,v 1.24 2010/01/20 22:34:47 jmmv Exp $
.\"
.\" FreeBSD install - a package for the installation and maintenance
.\" of non-core utilities.
@@ -17,7 +17,7 @@
.\"
.\" from FreeBSD: @(#)pkg_delete.1
.\"
-.Dd August 16, 2009
+.Dd January 20, 2010
.Dt PKG_DELETE 1
.Os
.Sh NAME
@@ -134,11 +134,9 @@ option.
Set
.Ar pkg_dbdir
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
-.Ev PKG_DBDIR
-if it's set, otherwise it defaults to
-.Pa /var/db/pkg .
+See the
+.Sx ENVIRONMENT
+section below for details on how the default value is calculated.
.It Fl k
Silently skip all packages that are marked as
.Cm preserved .
@@ -281,10 +279,12 @@ will be set to
.It Ev PKG_DBDIR
If the
.Fl K
-flag isn't given, then
+flag isn't given, then the value of the
.Ev PKG_DBDIR
-is the location of the package database directory.
-The default package database directory is
+variable overrides the
+.Xr pkg_install.conf 5
+variable of the same name.
+If all of this fails to locate a value, then it typically defaults to
.Pa /var/db/pkg .
.It Ev PKG_REFCOUNT_DBDIR
Location of the package reference counts database directory.
diff --git a/pkgtools/pkg_install/files/delete/pkg_delete.c b/pkgtools/pkg_install/files/delete/pkg_delete.c
index 20aa62bbd40..9a806d526ba 100644
--- a/pkgtools/pkg_install/files/delete/pkg_delete.c
+++ b/pkgtools/pkg_install/files/delete/pkg_delete.c
@@ -34,7 +34,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: pkg_delete.c,v 1.8 2009/08/06 16:53:34 joerg Exp $");
+__RCSID("$NetBSD: pkg_delete.c,v 1.9 2010/01/20 22:34:47 jmmv Exp $");
#if HAVE_ERR_H
#include <err.h>
@@ -831,6 +831,8 @@ main(int argc, char *argv[])
}
}
+ pkg_install_config();
+
if (destdir != NULL) {
char *pkgdbdir;
diff --git a/pkgtools/pkg_install/files/delete/pkg_delete.cat1 b/pkgtools/pkg_install/files/delete/pkg_delete.cat1
index f3ae4504473..db9963ba060 100644
--- a/pkgtools/pkg_install/files/delete/pkg_delete.cat1
+++ b/pkgtools/pkg_install/files/delete/pkg_delete.cat1
@@ -62,10 +62,9 @@ OOPPTTIIOONNSS
also the --kk option.
--KK _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.
+ Set _p_k_g___d_b_d_i_r as the package database directory. See the
+ _E_N_V_I_R_O_N_M_E_N_T section below for details on how the default value is
+ calculated.
--kk Silently skip all packages that are marked as pprreesseerrvveedd.
@@ -147,9 +146,10 @@ TTEECCHHNNIICCAALL DDEETTAAIILLSS
ppkkgg__ddeelleettee, PKG_DESTDIR will be set to _d_e_s_t_d_i_r.
EENNVVIIRROONNMMEENNTT
- PKG_DBDIR If the --KK 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_DBDIR If the --KK flag isn't given, then the value of the PKG_DBDIR
+ variable overrides the pkg_install.conf(5) variable of the
+ same name. If all of this fails to locate a value, then it
+ typically defaults to _/_v_a_r_/_d_b_/_p_k_g.
PKG_REFCOUNT_DBDIR
Location of the package reference counts database directory.
@@ -172,4 +172,4 @@ AAUUTTHHOORRSS
Rewrote most of the code to compute correct order of deinstalla-
tion and to improve error handling.
-NetBSD 5.0 August 16, 2009 NetBSD 5.0
+NetBSD 5.0 January 20, 2010 NetBSD 5.0
diff --git a/pkgtools/pkg_install/files/info/main.c b/pkgtools/pkg_install/files/info/main.c
index 1ca01ce00cb..42ec95b0aa3 100644
--- a/pkgtools/pkg_install/files/info/main.c
+++ b/pkgtools/pkg_install/files/info/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.28 2009/09/11 18:00:13 joerg Exp $ */
+/* $NetBSD: main.c,v 1.29 2010/01/20 22:34:47 jmmv Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -7,7 +7,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: main.c,v 1.28 2009/09/11 18:00:13 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.29 2010/01/20 22:34:47 jmmv Exp $");
/*
*
@@ -67,6 +67,7 @@ main(int argc, char **argv)
{
char *CheckPkg = NULL;
char *BestCheckPkg = NULL;
+ const char *pkgdb = NULL;
lpkg_t *lpp;
int ch;
int rc;
@@ -126,7 +127,7 @@ main(int argc, char **argv)
break;
case 'K':
- _pkgdb_setPKGDB_DIR(optarg);
+ pkgdb = optarg;
break;
case 'k':
@@ -212,6 +213,11 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
+ pkg_install_config();
+
+ if (pkgdb != NULL)
+ _pkgdb_setPKGDB_DIR(pkgdb);
+
if (argc == 0 && !Flags && !CheckPkg) {
/* No argument or relevant flags specified - assume -I */
Flags = SHOW_INDEX;
diff --git a/pkgtools/pkg_install/files/info/pkg_info.1 b/pkgtools/pkg_install/files/info/pkg_info.1
index df22fbf626a..3d816721ddb 100644
--- a/pkgtools/pkg_install/files/info/pkg_info.1
+++ b/pkgtools/pkg_install/files/info/pkg_info.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_info.1,v 1.24 2009/03/02 17:13:49 joerg Exp $
+.\" $NetBSD: pkg_info.1,v 1.25 2010/01/20 22:34:47 jmmv Exp $
.\"
.\" FreeBSD install - a package for the installation and maintenance
.\" of non-core utilities.
@@ -17,7 +17,7 @@
.\"
.\" @(#)pkg_info.1
.\"
-.Dd March 2, 2009
+.Dd January 20, 2010
.Dt PKG_INFO 1
.Os
.Sh NAME
@@ -132,11 +132,9 @@ Show the install script (if any) for each package.
Set
.Ar pkg_dbdir
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
-.Ev PKG_DBDIR
-if it's set, otherwise it defaults to
-.Pa /var/db/pkg .
+See the
+.Sx ENVIRONMENT
+section below for details on how the default value is calculated.
.It Fl k
Show the de-install script (if any) for each package.
.It Fl L
@@ -299,10 +297,12 @@ and has the same value as a dot in the dewey-decimal ordering schemes.
.It Ev PKG_DBDIR
If the
.Fl K
-flag isn't given, then
+flag isn't given, then the value of the
.Ev PKG_DBDIR
-is the location of the package database directory.
-The default package database directory is
+variable overrides the
+.Xr pkg_install.conf 5
+variable of the same name.
+If all of this fails to locate a value, then it typically defaults to
.Pa /var/db/pkg .
.El
.Sh SEE ALSO
diff --git a/pkgtools/pkg_install/files/info/pkg_info.cat1 b/pkgtools/pkg_install/files/info/pkg_info.cat1
index ecfd7b20c4c..a211f0ecdad 100644
--- a/pkgtools/pkg_install/files/info/pkg_info.cat1
+++ b/pkgtools/pkg_install/files/info/pkg_info.cat1
@@ -70,10 +70,9 @@ DDEESSCCRRIIPPTTIIOONN
--ii Show the install script (if any) for each package.
--KK _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.
+ Set _p_k_g___d_b_d_i_r as the package database directory. See the
+ _E_N_V_I_R_O_N_M_E_N_T section below for details on how the default value is
+ calculated.
--kk Show the de-install script (if any) for each package.
@@ -107,7 +106,8 @@ DDEESSCCRRIIPPTTIIOONN
--RR For each package, show the packages that require it.
- --rr For each package, recursively show the packages that require it.
+ --rr For each package, show the packages that require it. Continue
+ recursively to show all dependents.
--SS Show the size of this package and all the packages it requires,
in bytes.
@@ -169,9 +169,10 @@ PPAACCKKAAGGEE WWIILLDDCCAARRDDSS
ordering schemes.
EENNVVIIRROONNMMEENNTT
- PKG_DBDIR If the --KK 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_DBDIR If the --KK flag isn't given, then the value of the PKG_DBDIR
+ variable overrides the pkg_install.conf(5) variable of the
+ same name. If all of this fails to locate a value, then it
+ typically defaults to _/_v_a_r_/_d_b_/_p_k_g.
SSEEEE AALLSSOO
pkg_add(1), pkg_admin(1), pkg_create(1), pkg_delete(1), mktemp(3),
@@ -186,4 +187,4 @@ AAUUTTHHOORRSS
NetBSD wildcard dependency processing, pkgdb, depends displaying,
pkg size display etc.
-NetBSD 5.0 March 2, 2009 NetBSD 5.0
+NetBSD 5.0 January 20, 2010 NetBSD 5.0
diff --git a/pkgtools/pkg_install/files/lib/parse-config.c b/pkgtools/pkg_install/files/lib/parse-config.c
index 50ac2a72823..1effd47f0d1 100644
--- a/pkgtools/pkg_install/files/lib/parse-config.c
+++ b/pkgtools/pkg_install/files/lib/parse-config.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse-config.c,v 1.12 2009/10/21 17:10:36 joerg Exp $ */
+/* $NetBSD: parse-config.c,v 1.13 2010/01/20 22:34:47 jmmv Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -7,7 +7,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: parse-config.c,v 1.12 2009/10/21 17:10:36 joerg Exp $");
+__RCSID("$NetBSD: parse-config.c,v 1.13 2010/01/20 22:34:47 jmmv Exp $");
/*-
* Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg@NetBSD.org>.
@@ -59,6 +59,7 @@ const char *cert_chain_file;
const char *certs_packages;
const char *certs_pkg_vulnerabilities;
const char *check_vulnerabilities;
+const char *config_pkg_dbdir;
const char *config_pkg_path;
const char *do_license_check;
const char *verified_installation;
@@ -94,6 +95,7 @@ static struct config_variable {
{ "GPG_SIGN_AS", &gpg_sign_as },
{ "IGNORE_PROXY", &ignore_proxy },
{ "IGNORE_URL", &ignore_advisories },
+ { "PKG_DBDIR", &config_pkg_dbdir },
{ "PKG_PATH", &config_pkg_path },
{ "PKGVULNDIR", &pkg_vulnerabilities_dir },
{ "PKGVULNURL", &pkg_vulnerabilities_url },
@@ -159,6 +161,11 @@ pkg_install_config(void)
char *value;
parse_pkg_install_conf();
+ if ((value = getenv("PKG_DBDIR")) != NULL)
+ config_pkg_dbdir = value;
+ else if (config_pkg_dbdir != NULL)
+ _pkgdb_setPKGDB_DIR(config_pkg_dbdir);
+
if (pkg_vulnerabilities_dir == NULL)
pkg_vulnerabilities_dir = _pkgdb_getPKGDB_DIR();
pkg_vulnerabilities_file = xasprintf("%s/pkg-vulnerabilities",
diff --git a/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in b/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in
index a55f189f06d..2b547e7e79f 100644
--- a/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in
+++ b/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_install.conf.5.in,v 1.11 2009/10/15 12:41:41 joerg Exp $
+.\" $NetBSD: pkg_install.conf.5.in,v 1.12 2010/01/20 22:34:47 jmmv Exp $
.\"
.\" Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -27,7 +27,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd October 15, 2009
+.Dd January 19, 2010
.Dt PKG_INSTALL.CONF 5
.Os
.Sh NAME
@@ -133,6 +133,10 @@ One line per advisory which should be ignored when running
The URL from the
.Pa pkg-vulnerabilities
file should be used as value.
+.It Dv PKG_DBDIR
+Location of the packages database.
+Overridden by the environment variable
+.Ev PKG_DBDIR .
.It Dv PKG_PATH
Search path as used by
.Nm pkg_add .
diff --git a/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in b/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in
index 9ad75bcc147..e883b66280c 100644
--- a/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in
+++ b/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in
@@ -102,6 +102,10 @@ DDEESSCCRRIIPPTTIIOONN
The URL from the _p_k_g_-_v_u_l_n_e_r_a_b_i_l_i_t_i_e_s file should be used as
value.
+ PKG_DBDIR
+ Location of the packages database. Overridden by the environment
+ variable PKG_DBDIR.
+
PKG_PATH
Search path as used by ppkkgg__aadddd. Overridden by the environment
variable PKG_PATH.
@@ -146,4 +150,4 @@ FFIILLEESS
SSEEEE AALLSSOO
pkg_add(1), pkg_admin(1)
-NetBSD 5.0 October 15, 2009 NetBSD 5.0
+NetBSD 5.0 January 19, 2010 NetBSD 5.0
diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h
index 85f7ceb6e1d..d834757c001 100644
--- a/pkgtools/pkg_install/files/lib/version.h
+++ b/pkgtools/pkg_install/files/lib/version.h
@@ -1,4 +1,4 @@
-/* $NetBSD: version.h,v 1.143 2009/11/05 16:22:32 joerg Exp $ */
+/* $NetBSD: version.h,v 1.144 2010/01/20 22:34:47 jmmv Exp $ */
/*
* Copyright (c) 2001 Thomas Klausner. All rights reserved.
@@ -27,6 +27,6 @@
#ifndef _INST_LIB_VERSION_H_
#define _INST_LIB_VERSION_H_
-#define PKGTOOLS_VERSION "20091115"
+#define PKGTOOLS_VERSION "20100120"
#endif /* _INST_LIB_VERSION_H_ */