pkgsrc-Changes archive

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

CVS commit: pkgsrc



Module Name:    pkgsrc
Committed By:   wiz
Date:           Wed Dec  2 10:22:39 UTC 2020

Modified Files:
        pkgsrc/mk/pbulk: pbulk.sh
        pkgsrc/mk/pkgformat/pkg: depends.mk pkgformat-vars.mk
            register-dependencies
        pkgsrc/pkgtools/pkg_install: Makefile
        pkgsrc/pkgtools/pkg_install/files: configure configure.ac
        pkgsrc/pkgtools/pkg_install/files/admin: check.c pkg_admin.1
        pkgsrc/pkgtools/pkg_install/files/lib: Makefile.in pkgdb.c version.h

Log Message:
*: move default database directory from /var/db/pkg to ${PREFIX}/pkgdb

As discussed in August 2020 and previously on pkgsrcCon 2019.

Ok pkgsrc-pmc@


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 pkgsrc/mk/pbulk/pbulk.sh
cvs rdiff -u -r1.11 -r1.12 pkgsrc/mk/pkgformat/pkg/depends.mk
cvs rdiff -u -r1.8 -r1.9 pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk
cvs rdiff -u -r1.1 -r1.2 pkgsrc/mk/pkgformat/pkg/register-dependencies
cvs rdiff -u -r1.231 -r1.232 pkgsrc/pkgtools/pkg_install/Makefile
cvs rdiff -u -r1.44 -r1.45 pkgsrc/pkgtools/pkg_install/files/configure
cvs rdiff -u -r1.43 -r1.44 pkgsrc/pkgtools/pkg_install/files/configure.ac
cvs rdiff -u -r1.10 -r1.11 pkgsrc/pkgtools/pkg_install/files/admin/check.c
cvs rdiff -u -r1.38 -r1.39 \
    pkgsrc/pkgtools/pkg_install/files/admin/pkg_admin.1
cvs rdiff -u -r1.36 -r1.37 pkgsrc/pkgtools/pkg_install/files/lib/Makefile.in
cvs rdiff -u -r1.39 -r1.40 pkgsrc/pkgtools/pkg_install/files/lib/pkgdb.c
cvs rdiff -u -r1.179 -r1.180 pkgsrc/pkgtools/pkg_install/files/lib/version.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/pbulk/pbulk.sh
diff -u pkgsrc/mk/pbulk/pbulk.sh:1.8 pkgsrc/mk/pbulk/pbulk.sh:1.9
--- pkgsrc/mk/pbulk/pbulk.sh:1.8        Mon Oct 29 02:47:08 2018
+++ pkgsrc/mk/pbulk/pbulk.sh    Wed Dec  2 10:22:39 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: pbulk.sh,v 1.8 2018/10/29 02:47:08 sevan Exp $
+# $NetBSD: pbulk.sh,v 1.9 2020/12/02 10:22:39 wiz Exp $
 set -e
 
 usage="usage: ${0##*/} [-lun] [-c mk.conf.fragment] [-d nodes]"
@@ -40,7 +40,7 @@ fi
 
 # setting pkgdb directory:
 if [ -n "$unprivileged" -o -n "${PREFIX}" ]; then
-: ${PKGDBDIR:=${PREFIX}/var/db/pkg} 
+: ${PKGDBDIR:=${PREFIX}/pkgdb} 
 fi
 
 # Do it early since adding it after it fails is problematic:

Index: pkgsrc/mk/pkgformat/pkg/depends.mk
diff -u pkgsrc/mk/pkgformat/pkg/depends.mk:1.11 pkgsrc/mk/pkgformat/pkg/depends.mk:1.12
--- pkgsrc/mk/pkgformat/pkg/depends.mk:1.11     Tue Jan 14 22:22:34 2020
+++ pkgsrc/mk/pkgformat/pkg/depends.mk  Wed Dec  2 10:22:39 2020
@@ -1,4 +1,4 @@
-# $NetBSD: depends.mk,v 1.11 2020/01/14 22:22:34 rillig Exp $
+# $NetBSD: depends.mk,v 1.12 2020/12/02 10:22:39 wiz Exp $
 
 # This command prints out the dependency patterns for all full (run-time)
 # dependencies of the package.
@@ -188,8 +188,12 @@ ${_RRDEPENDS_FILE}: ${_RDEPENDS_FILE}
 # _pkgformat-install-dependencies:
 #      Installs any missing dependencies.
 #
+# The ${TEST} at the beginning is for the default change for the
+# database directory from /var/db/pkg to ${PREFIX}/pkgdb in December 2020.
+#
 _pkgformat-install-dependencies: .PHONY ${_DEPENDS_FILE}
        ${RUN}                                                          \
+       ${TEST} -n "${PKG_DBDIR_ERROR}" && ${ERROR_MSG} ${PKG_DBDIR_ERROR:Q} && exit 1; \
        exec 3<&0;                                                      \
        ${CAT} ${_DEPENDS_FILE} |                                       \
        while read type pattern dir; do                                 \

Index: pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk
diff -u pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk:1.8 pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk:1.9
--- pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk:1.8       Sun Jan 12 23:38:42 2020
+++ pkgsrc/mk/pkgformat/pkg/pkgformat-vars.mk   Wed Dec  2 10:22:39 2020
@@ -1,4 +1,4 @@
-# $NetBSD: pkgformat-vars.mk,v 1.8 2020/01/12 23:38:42 joerg Exp $
+# $NetBSD: pkgformat-vars.mk,v 1.9 2020/12/02 10:22:39 wiz Exp $
 #
 # This Makefile fragment is included indirectly by bsd.prefs.mk and
 # defines some variables which must be defined earlier than where
@@ -16,7 +16,11 @@ USE_TOOLS+=  date
 .endif
 
 # This is the package database directory for the default view.
-PKG_DBDIR?=            /var/db/pkg
+PKG_DBDIR?=            ${PREFIX}/pkgdb
+
+.if exists(/var/db/pkg) && !exists(${PKG_DBDIR})
+PKG_DBDIR_ERROR=       The default package database directory has changed. Please run: mv /var/db/pkg ${PKG_DBDIR}
+.endif
 
 # _PKG_DBDIR is the actual packages database directory where we register
 # packages.
@@ -32,11 +36,7 @@ PKG_INFO_CMD?=               ${PKG_TOOLS_BIN}/pkg_inf
 LINKFARM_CMD?=         ${PKG_TOOLS_BIN}/linkfarm
 
 # Latest versions of tools required for correct pkgsrc operation.
-.if !empty(USE_PKG_ADMIN_DIGEST:M[Yy][Ee][Ss])
-PKGTOOLS_REQD=         20191008
-.else
-PKGTOOLS_REQD=         20100914
-.endif
+PKGTOOLS_REQD=         20200828
 # Latest version of pkg_install required to extract packages
 PKGTOOLS_VERSION_REQD= 20091115
 

Index: pkgsrc/mk/pkgformat/pkg/register-dependencies
diff -u pkgsrc/mk/pkgformat/pkg/register-dependencies:1.1 pkgsrc/mk/pkgformat/pkg/register-dependencies:1.2
--- pkgsrc/mk/pkgformat/pkg/register-dependencies:1.1   Sat Oct 15 00:23:09 2011
+++ pkgsrc/mk/pkgformat/pkg/register-dependencies       Wed Dec  2 10:22:39 2020
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: register-dependencies,v 1.1 2011/10/15 00:23:09 reed Exp $
+# $NetBSD: register-dependencies,v 1.2 2020/12/02 10:22:39 wiz Exp $
 #
 ######################################################################
 #
@@ -18,14 +18,14 @@
 # ENVIRONMENT
 #      PKG_DBDIR
 #              This is the package meta-data directory in which the
-#              packages are registered.  By default, this is /var/db/pkg.
+#              packages are registered.  By default, this is ${PREFIX}/pkgdb .
 #
 ######################################################################
 
 : ${AWK:=awk}
 : ${CP:=cp}
 : ${ECHO:=echo}
-: ${PKG_DBDIR:=/var/db/pkg}
+: ${PKG_DBDIR:=${PREFIX}/pkgdb}
 : ${RM:=rm}
 : ${TEST:=test}
 : ${TOUCH:=touch}

Index: pkgsrc/pkgtools/pkg_install/Makefile
diff -u pkgsrc/pkgtools/pkg_install/Makefile:1.231 pkgsrc/pkgtools/pkg_install/Makefile:1.232
--- pkgsrc/pkgtools/pkg_install/Makefile:1.231  Sun Aug  9 21:40:42 2020
+++ pkgsrc/pkgtools/pkg_install/Makefile        Wed Dec  2 10:22:39 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.231 2020/08/09 21:40:42 rillig Exp $
+# $NetBSD: Makefile,v 1.232 2020/12/02 10:22:39 wiz Exp $
 
 # Notes to package maintainers:
 #
@@ -81,7 +81,7 @@ MAKE_ENV+=            OPSYS=${OPSYS}
 MAKE_ENV+=             CATMAN_SECTION_SUFFIX=${CATMAN_SECTION_SUFFIX:Q}
 MAKE_ENV+=             MANINSTALL=${MANINSTALL:Q}
 
-PKG_DBDIR?=            /var/db/pkg
+PKG_DBDIR?=            ${PREFIX}/pkgdb
 EGDIR=                 ${PREFIX}/share/examples/pkg_install
 
 PLIST_SUBST+=          PKG_DBDIR=${PKG_DBDIR}

Index: pkgsrc/pkgtools/pkg_install/files/configure
diff -u pkgsrc/pkgtools/pkg_install/files/configure:1.44 pkgsrc/pkgtools/pkg_install/files/configure:1.45
--- pkgsrc/pkgtools/pkg_install/files/configure:1.44    Wed Jul  1 10:15:20 2020
+++ pkgsrc/pkgtools/pkg_install/files/configure Wed Dec  2 10:22:39 2020
@@ -1344,7 +1344,7 @@ Optional Features:
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-pkgdbdir=DIR     Where to put the pkg database (/var/db/pkg)
+  --with-pkgdbdir=DIR     Where to put the pkg database (PREFIX/pkgdb)
  --with-ssl            Enable OpenSSL based signature support
 
 Some influential environment variables:
@@ -4025,7 +4025,7 @@ AUTOHEADER=${AUTOHEADER-"$srcdir/missing
 if test "${with_pkgdbdir+set}" = set; then :
   withval=$with_pkgdbdir;  pkgdbdir="$with_pkgdbdir"
 else
-   pkgdbdir="/var/db/pkg"
+   pkgdbdir="${prefix}/pkgdb"
 fi
 
 

Index: pkgsrc/pkgtools/pkg_install/files/configure.ac
diff -u pkgsrc/pkgtools/pkg_install/files/configure.ac:1.43 pkgsrc/pkgtools/pkg_install/files/configure.ac:1.44
--- pkgsrc/pkgtools/pkg_install/files/configure.ac:1.43 Wed Jul  1 10:15:20 2020
+++ pkgsrc/pkgtools/pkg_install/files/configure.ac      Wed Dec  2 10:22:39 2020
@@ -1,4 +1,4 @@
-dnl $NetBSD: configure.ac,v 1.43 2020/07/01 10:15:20 jperkin Exp $
+dnl $NetBSD: configure.ac,v 1.44 2020/12/02 10:22:39 wiz Exp $
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.52)
 AC_INIT([pkg_install], [20200701], [joerg%NetBSD.org@localhost])
@@ -39,9 +39,9 @@ AC_SUBST(AUTOHEADER)
 
 dnl Set the default pkg dbdir
 AC_ARG_WITH(pkgdbdir,
-[  --with-pkgdbdir=DIR     Where to put the pkg database (/var/db/pkg)],
+[  --with-pkgdbdir=DIR     Where to put the pkg database (PREFIX/pkgdb)],
 [ pkgdbdir="$with_pkgdbdir" ],
-[ pkgdbdir="/var/db/pkg" ])
+[ pkgdbdir="${prefix}/pkgdb" ])
 AC_SUBST(pkgdbdir)
 
 AC_ARG_WITH(ssl,

Index: pkgsrc/pkgtools/pkg_install/files/admin/check.c
diff -u pkgsrc/pkgtools/pkg_install/files/admin/check.c:1.10 pkgsrc/pkgtools/pkg_install/files/admin/check.c:1.11
--- pkgsrc/pkgtools/pkg_install/files/admin/check.c:1.10        Fri Jan 22 13:30:41 2010
+++ pkgsrc/pkgtools/pkg_install/files/admin/check.c     Wed Dec  2 10:22:39 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: check.c,v 1.10 2010/01/22 13:30:41 joerg Exp $ */
+/*     $NetBSD: check.c,v 1.11 2020/12/02 10:22:39 wiz Exp $   */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,7 +7,7 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
-__RCSID("$NetBSD: check.c,v 1.10 2010/01/22 13:30:41 joerg Exp $");
+__RCSID("$NetBSD: check.c,v 1.11 2020/12/02 10:22:39 wiz Exp $");
 
 /*-
  * Copyright (c) 1999-2008 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@ __RCSID("$NetBSD: check.c,v 1.10 2010/01
 static int checkpattern_fn(const char *, void *);
 
 /*
- * Assumes CWD is in /var/db/pkg/<pkg>!
+ * Assumes CWD is in the database directory ($PREFIX/pkgdb/<pkg>)!
  */
 static void 
 check1pkg(const char *pkgdir, int *filecnt, int *pkgcnt)

Index: pkgsrc/pkgtools/pkg_install/files/admin/pkg_admin.1
diff -u pkgsrc/pkgtools/pkg_install/files/admin/pkg_admin.1:1.38 pkgsrc/pkgtools/pkg_install/files/admin/pkg_admin.1:1.39
--- pkgsrc/pkgtools/pkg_install/files/admin/pkg_admin.1:1.38    Fri Oct 11 11:57:41 2019
+++ pkgsrc/pkgtools/pkg_install/files/admin/pkg_admin.1 Wed Dec  2 10:22:39 2020
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkg_admin.1,v 1.38 2019/10/11 11:57:41 joerg Exp $
+.\"    $NetBSD: pkg_admin.1,v 1.39 2020/12/02 10:22:39 wiz Exp $
 .\"
 .\" Copyright (c) 1999-2019 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -28,7 +28,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 8, 2019
+.Dd August 22, 2020
 .Dt PKG_ADMIN 1
 .Os
 .Sh NAME
@@ -295,9 +295,9 @@ See
 .Xr pkg_install.conf 5
 for options, that can also be specified using the environment.
 .Sh FILES
-.Bl -tag -width /var/db/pkg/pkgdb.byfile.db -compact
-.It Pa /var/db/pkg/pkgdb.byfile.db
-.It Pa /var/db/pkg/\*[Lt]pkg\*[Gt]/+CONTENTS
+.Bl -tag -width @PREFIX@/pkgdb/pkgdb.byfile.db -compact
+.It Pa @PREFIX@/pkgdb/pkgdb.byfile.db
+.It Pa @PREFIX@/pkgdb/\*[Lt]pkg\*[Gt]/+CONTENTS
 .El
 .Sh SEE ALSO
 .Xr pkg_add 1 ,

Index: pkgsrc/pkgtools/pkg_install/files/lib/Makefile.in
diff -u pkgsrc/pkgtools/pkg_install/files/lib/Makefile.in:1.36 pkgsrc/pkgtools/pkg_install/files/lib/Makefile.in:1.37
--- pkgsrc/pkgtools/pkg_install/files/lib/Makefile.in:1.36      Wed Apr 19 21:42:50 2017
+++ pkgsrc/pkgtools/pkg_install/files/lib/Makefile.in   Wed Dec  2 10:22:39 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.in,v 1.36 2017/04/19 21:42:50 joerg Exp $
+# $NetBSD: Makefile.in,v 1.37 2020/12/02 10:22:39 wiz Exp $
 
 srcdir=                @srcdir@
 
@@ -32,6 +32,7 @@ OBJS= automatic.o conflicts.o dewey.o fe
        str.o var.o version.o vulnerabilities-file.o xwrapper.o
 
 CPPFLAGS+=     -DSYSCONFDIR=\"$(sysconfdir)\"
+CPPFLAGS+=     -DPREFIX=\"$(prefix)\"
 
 .if !empty(BOOTSTRAP)
 CPPFLAGS+=     -DBOOTSTRAP

Index: pkgsrc/pkgtools/pkg_install/files/lib/pkgdb.c
diff -u pkgsrc/pkgtools/pkg_install/files/lib/pkgdb.c:1.39 pkgsrc/pkgtools/pkg_install/files/lib/pkgdb.c:1.40
--- pkgsrc/pkgtools/pkg_install/files/lib/pkgdb.c:1.39  Tue Apr 20 21:22:38 2010
+++ pkgsrc/pkgtools/pkg_install/files/lib/pkgdb.c       Wed Dec  2 10:22:39 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: pkgdb.c,v 1.39 2010/04/20 21:22:38 joerg Exp $ */
+/*     $NetBSD: pkgdb.c,v 1.40 2020/12/02 10:22:39 wiz Exp $   */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,7 +7,7 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
-__RCSID("$NetBSD: pkgdb.c,v 1.39 2010/04/20 21:22:38 joerg Exp $");
+__RCSID("$NetBSD: pkgdb.c,v 1.40 2020/12/02 10:22:39 wiz Exp $");
 
 /*-
  * Copyright (c) 1999-2010 The NetBSD Foundation, Inc.
@@ -70,12 +70,9 @@ __RCSID("$NetBSD: pkgdb.c,v 1.39 2010/04
  * Where we put logging information by default if PKG_DBDIR is unset.
  */
 #ifndef DEF_LOG_DIR
-#define DEF_LOG_DIR            "/var/db/pkg"
+#define DEF_LOG_DIR            PREFIX "/pkgdb"
 #endif
 
-/* just in case we change the environment variable name */
-#define PKG_DBDIR              "PKG_DBDIR"
-
 static DB   *pkgdbp;
 static char pkgdb_dir_default[] = DEF_LOG_DIR;
 static char *pkgdb_dir = pkgdb_dir_default;
@@ -303,8 +300,21 @@ pkgdb_refcount_dir(void)
 const char *
 pkgdb_get_dir(void)
 {
+       /* Except for the return at this end, this code is for
+          migration from the previous location /var/db/pkg to the new
+          default (December 2020). */
+
+       struct stat sb;
+       if (strcmp(pkgdb_dir, DEF_LOG_DIR) == 0 &&
+           stat(pkgdb_dir, &sb) == -1 && errno == ENOENT &&
+           stat("/var/db/pkg", &sb) == 0) {
+               errx(EXIT_FAILURE,
+                    "The default PKG_DBDIR has changed, but this installation still uses the old one.\n"
+                    "Please move the database and re-run this command:\n"
+                    "\tmv /var/db/pkg " DEF_LOG_DIR);
+       }
 
-       return pkgdb_dir;
+        return pkgdb_dir;
 }
 
 /*

Index: pkgsrc/pkgtools/pkg_install/files/lib/version.h
diff -u pkgsrc/pkgtools/pkg_install/files/lib/version.h:1.179 pkgsrc/pkgtools/pkg_install/files/lib/version.h:1.180
--- pkgsrc/pkgtools/pkg_install/files/lib/version.h:1.179       Wed Jul  1 10:15:20 2020
+++ pkgsrc/pkgtools/pkg_install/files/lib/version.h     Wed Dec  2 10:22:39 2020
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.179 2020/07/01 10:15:20 jperkin Exp $    */
+/*     $NetBSD: version.h,v 1.180 2020/12/02 10:22:39 wiz 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 20200701
+#define PKGTOOLS_VERSION 20200828
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index