pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install Update to 20100120:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8bee29d42734
branches:  trunk
changeset: 569931:8bee29d42734
user:      jmmv <jmmv%pkgsrc.org@localhost>
date:      Wed Jan 20 22:34:47 2010 +0000

description:
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:

 pkgtools/pkg_install/Makefile                           |   4 +-
 pkgtools/pkg_install/files/add/pkg_add.1                |  20 ++++++------
 pkgtools/pkg_install/files/add/pkg_add.cat1             |  16 +++++-----
 pkgtools/pkg_install/files/admin/pkg_admin.1            |  22 +++++++-------
 pkgtools/pkg_install/files/admin/pkg_admin.cat1         |  16 +++++-----
 pkgtools/pkg_install/files/create/main.c                |  12 ++++++--
 pkgtools/pkg_install/files/create/pkg_create.1          |  25 ++++++++++++----
 pkgtools/pkg_install/files/create/pkg_create.cat1       |  15 ++++++---
 pkgtools/pkg_install/files/delete/pkg_delete.1          |  20 ++++++------
 pkgtools/pkg_install/files/delete/pkg_delete.c          |   4 ++-
 pkgtools/pkg_install/files/delete/pkg_delete.cat1       |  16 +++++-----
 pkgtools/pkg_install/files/info/main.c                  |  12 ++++++--
 pkgtools/pkg_install/files/info/pkg_info.1              |  20 ++++++------
 pkgtools/pkg_install/files/info/pkg_info.cat1           |  19 ++++++------
 pkgtools/pkg_install/files/lib/parse-config.c           |  11 ++++++-
 pkgtools/pkg_install/files/lib/pkg_install.conf.5.in    |   8 ++++-
 pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in |   6 +++-
 pkgtools/pkg_install/files/lib/version.h                |   4 +-
 18 files changed, 148 insertions(+), 102 deletions(-)

diffs (truncated from 691 to 300 lines):

diff -r 6cb2af9136fd -r 8bee29d42734 pkgtools/pkg_install/Makefile
--- a/pkgtools/pkg_install/Makefile     Wed Jan 20 19:09:00 2010 +0000
+++ b/pkgtools/pkg_install/Makefile     Wed Jan 20 22:34:47 2010 +0000
@@ -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 @@
 
 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 -r 6cb2af9136fd -r 8bee29d42734 pkgtools/pkg_install/files/add/pkg_add.1
--- a/pkgtools/pkg_install/files/add/pkg_add.1  Wed Jan 20 19:09:00 2010 +0000
+++ b/pkgtools/pkg_install/files/add/pkg_add.1  Wed Jan 20 22:34:47 2010 +0000
@@ -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 @@
 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 @@
 .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 -r 6cb2af9136fd -r 8bee29d42734 pkgtools/pkg_install/files/add/pkg_add.cat1
--- a/pkgtools/pkg_install/files/add/pkg_add.cat1       Wed Jan 20 19:09:00 2010 +0000
+++ b/pkgtools/pkg_install/files/add/pkg_add.cat1       Wed Jan 20 22:34:47 2010 +0000
@@ -64,10 +64,9 @@
              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 @@
                  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 @@
 
      Sure to be others.
 
-NetBSD 5.0                      August 6, 2009                      NetBSD 5.0
+NetBSD 5.0                     January 20, 2010                     NetBSD 5.0
diff -r 6cb2af9136fd -r 8bee29d42734 pkgtools/pkg_install/files/admin/pkg_admin.1
--- a/pkgtools/pkg_install/files/admin/pkg_admin.1      Wed Jan 20 19:09:00 2010 +0000
+++ b/pkgtools/pkg_install/files/admin/pkg_admin.1      Wed Jan 20 22:34:47 2010 +0000
@@ -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 @@
 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 @@
 .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 -r 6cb2af9136fd -r 8bee29d42734 pkgtools/pkg_install/files/admin/pkg_admin.cat1
--- a/pkgtools/pkg_install/files/admin/pkg_admin.cat1   Wed Jan 20 19:09:00 2010 +0000
+++ b/pkgtools/pkg_install/files/admin/pkg_admin.cat1   Wed Jan 20 22:34:47 2010 +0000
@@ -26,10 +26,9 @@
              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 @@
 
 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 @@
 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 -r 6cb2af9136fd -r 8bee29d42734 pkgtools/pkg_install/files/create/main.c
--- a/pkgtools/pkg_install/files/create/main.c  Wed Jan 20 19:09:00 2010 +0000
+++ b/pkgtools/pkg_install/files/create/main.c  Wed Jan 20 22:34:47 2010 +0000
@@ -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 @@
 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 @@
                        break;
 
                case 'K':
-                       _pkgdb_setPKGDB_DIR(optarg);
+                       pkgdb = optarg;
                        break;
 
                case 'k':
@@ -194,6 +195,11 @@
        argc -= optind;
        argv += optind;
 
+       pkg_install_config();
+
+       if (pkgdb != NULL)
+               _pkgdb_setPKGDB_DIR(pkgdb);
+
        if (argc == 0) {
                warnx("missing package name");
                usage();
diff -r 6cb2af9136fd -r 8bee29d42734 pkgtools/pkg_install/files/create/pkg_create.1
--- a/pkgtools/pkg_install/files/create/pkg_create.1    Wed Jan 20 19:09:00 2010 +0000
+++ b/pkgtools/pkg_install/files/create/pkg_create.1    Wed Jan 20 22:34:47 2010 +0000
@@ -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 @@
 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 @@
 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 -r 6cb2af9136fd -r 8bee29d42734 pkgtools/pkg_install/files/create/pkg_create.cat1
--- a/pkgtools/pkg_install/files/create/pkg_create.cat1 Wed Jan 20 19:09:00 2010 +0000
+++ b/pkgtools/pkg_install/files/create/pkg_create.cat1 Wed Jan 20 22:34:47 2010 +0000
@@ -84,10 +84,9 @@
              invoked automatically when the package is later installed.
 
      --KK _p_k_g___d_b_d_i_r



Home | Main Index | Thread Index | Old Index