Source-Changes-HG archive

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

[src/pkgviews]: src/usr.sbin/pkg_install Teach pkg_view(1), the only tool tha...



details:   https://anonhg.NetBSD.org/src/rev/d79d4fba3836
branches:  pkgviews
changeset: 534257:d79d4fba3836
user:      jlam <jlam%NetBSD.org@localhost>
date:      Thu Aug 21 01:57:22 2003 +0000

description:
Teach pkg_view(1), the only tool that used PKG_DBDIR differently from
the other tools, to use PKG_DBDIR_DFLT to represent the package
database directory for the default view.

Now, this does screw people who've set PKG_DBDIR in their shell
environment or in /etc/mk.conf in order to point the package database
directory to somewhere else, e.g PKG_DBDIR=/usr/pkg/.pkgdb.  However,
I think this is a tiny change that we can stomach instead of changing
the way that the rest of the pkgsrc users have used the pkg_* tools in
the past.  We just need to inform people to change the PKG_DBDIR
setting into a PKG_DBDIR_DFLT setting.

The only bad thing that can happen if a user fails to make this change
is that when they try to pkg_add(1) a binary depoted package, the
package metadata files will be stored in /var/db/pkg instead of
wherever the user normally stores the package metadata files.  If
anyone knows of a nice way to warn the user that this is happening,
I'd love to know, so that I can modify pkg_view(1) to check for this
case.

diffstat:

 usr.sbin/pkg_install/add/perform.c    |  12 ++++--------
 usr.sbin/pkg_install/lib/version.h    |   4 ++--
 usr.sbin/pkg_install/view/pkg_view.1  |   8 ++++----
 usr.sbin/pkg_install/view/pkg_view.sh |   4 ++--
 4 files changed, 12 insertions(+), 16 deletions(-)

diffs (100 lines):

diff -r 40af066edc4e -r d79d4fba3836 usr.sbin/pkg_install/add/perform.c
--- a/usr.sbin/pkg_install/add/perform.c        Wed Aug 20 01:52:38 2003 +0000
+++ b/usr.sbin/pkg_install/add/perform.c        Thu Aug 21 01:57:22 2003 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: perform.c,v 1.70.2.6 2003/08/20 01:52:38 jlam Exp $    */
+/*     $NetBSD: perform.c,v 1.70.2.7 2003/08/21 01:57:22 jlam Exp $    */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.70.2.6 2003/08/20 01:52:38 jlam Exp $");
+__RCSID("$NetBSD: perform.c,v 1.70.2.7 2003/08/21 01:57:22 jlam Exp $");
 #endif
 #endif
 
@@ -766,9 +766,7 @@
        /* Add the package to a default view. */
        if (!NoView && is_depoted_pkg) {
                if (Verbose) {
-                       printf("env %s=%s %s/pkg_view %s%s %s%s %sadd %s\n",
-                               PKG_DBDIR,
-                               DEF_LOG_DIR,
+                       printf("%s/pkg_view %s%s %s%s %sadd %s\n",
                                BINDIR,
                                View ? "-w " : "",
                                View ? View : "",
@@ -777,9 +775,7 @@
                                Verbose ? "-v " : "",
                                PkgName);
                }
-               vsystem("env %s=%s %s/pkg_view %s%s %s%s %sadd %s",
-                               PKG_DBDIR,
-                               DEF_LOG_DIR,
+               vsystem("%s/pkg_view %s%s %s%s %sadd %s",
                                BINDIR,
                                View ? "-w " : "",
                                View ? View : "",
diff -r 40af066edc4e -r d79d4fba3836 usr.sbin/pkg_install/lib/version.h
--- a/usr.sbin/pkg_install/lib/version.h        Wed Aug 20 01:52:38 2003 +0000
+++ b/usr.sbin/pkg_install/lib/version.h        Thu Aug 21 01:57:22 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.13.4.10 2003/08/17 22:02:21 jlam Exp $   */
+/*     $NetBSD: version.h,v 1.13.4.11 2003/08/21 01:57:23 jlam Exp $   */
 
 /*
  * Copyright (c) 2001 Thomas Klausner.  All rights reserved.
@@ -33,6 +33,6 @@
 #ifndef _INST_LIB_VERSION_H_
 #define _INST_LIB_VERSION_H_
 
-#define PKGTOOLS_VERSION "20030810"
+#define PKGTOOLS_VERSION "20030819"
 
 #endif /* _INST_LIB_VERSION_H_ */
diff -r 40af066edc4e -r d79d4fba3836 usr.sbin/pkg_install/view/pkg_view.1
--- a/usr.sbin/pkg_install/view/pkg_view.1      Wed Aug 20 01:52:38 2003 +0000
+++ b/usr.sbin/pkg_install/view/pkg_view.1      Thu Aug 21 01:57:22 2003 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkg_view.1,v 1.1.2.8 2003/08/17 04:55:23 jlam Exp $
+.\"    $NetBSD: pkg_view.1,v 1.1.2.9 2003/08/21 01:57:24 jlam Exp $
 .\"
 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -142,11 +142,11 @@
 .El
 .Sh ENVIRONMENT
 .Bl -tag -width indent
-.It Ev PKG_DBDIR
-The standard package database directory,
+.It Ev PKG_DBDIR_DFLT
+The package database directory for the default view,
 .Pa /var/db/pkg ,
 can be overridden by specifying an alternative directory in the
-.Ev PKG_DBDIR
+.Ev PKG_DBDIR_DFLT
 environment variable.
 .It Ev PLIST_IGNORE_FILES
 This can be used to specify files in
diff -r 40af066edc4e -r d79d4fba3836 usr.sbin/pkg_install/view/pkg_view.sh
--- a/usr.sbin/pkg_install/view/pkg_view.sh     Wed Aug 20 01:52:38 2003 +0000
+++ b/usr.sbin/pkg_install/view/pkg_view.sh     Thu Aug 21 01:57:22 2003 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: pkg_view.sh,v 1.1.2.22 2003/08/17 22:02:21 jlam Exp $
+# $NetBSD: pkg_view.sh,v 1.1.2.23 2003/08/21 01:57:24 jlam Exp $
 
 #
 # Copyright (c) 2001 Alistair G. Crooks.  All rights reserved.
@@ -73,7 +73,7 @@
 viewbase=${PKG_VIEWBASE:-/usr/pkg}
 view=${PKG_VIEW:-""}
 ignorefiles=${PLIST_IGNORE_FILES:-"info/dir *[~#] *.OLD *.orig *,v"}
-dflt_pkg_dbdir=${PKG_DBDIR:-/var/db/pkg}
+dflt_pkg_dbdir=${PKG_DBDIR_DFLT:-/var/db/pkg}
 verbose=no
 
 while [ $# -gt 0 ]; do



Home | Main Index | Thread Index | Old Index