pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/pbulk Fix an inconsistency for package database dir...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f44de4814947
branches:  trunk
changeset: 375310:f44de4814947
user:      triaxx <triaxx%pkgsrc.org@localhost>
date:      Thu Feb 08 12:59:28 2018 +0000

description:
Fix an inconsistency for package database directory.

The pkgdb variable generated for pbulk.conf is ${PREFIX}/var/db/pkg but
bootstrap generates by default PKG_DBDIR=${PREFIX}/pkgdb.
This fix add a common PKGDBDIR variable used for both pbulk.conf and
bootstrapkit.

diffstat:

 mk/pbulk/pbulk.sh |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (48 lines):

diff -r b9dd28b92cf0 -r f44de4814947 mk/pbulk/pbulk.sh
--- a/mk/pbulk/pbulk.sh Thu Feb 08 12:58:41 2018 +0000
+++ b/mk/pbulk/pbulk.sh Thu Feb 08 12:59:28 2018 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: pbulk.sh,v 1.6 2017/08/27 18:18:57 sevan Exp $
+# $NetBSD: pbulk.sh,v 1.7 2018/02/08 12:59:28 triaxx Exp $
 set -e
 
 usage="usage: ${0##*/} [-lun] [-c mk.conf.fragment] [-d nodes]"
@@ -38,6 +38,11 @@
 # almost constant:
 : ${PKGSRCDIR:=/usr/pkgsrc}
 
+# setting pkgdb directory:
+if [ -n "$unprivileged" -o -n "${PREFIX}" ]; then
+: ${PKGDBDIR:=${PREFIX}/var/db/pkg} 
+fi
+
 # Do it early since adding it after it fails is problematic:
 if [ ! -n "$unprivileged" ]; then
 case "$(uname)" in
@@ -124,7 +129,7 @@
 pkgsrc=${PKGSRCDIR}
 prefix=${PREFIX}
 varbase=${PREFIX}/var
-pkgdb=${PREFIX}/var/db/pkg
+pkgdb=${PKGDBDIR}
 EOF
 elif [ -n "${PREFIX}" ]; then
 # Non-default prefix:
@@ -132,7 +137,7 @@
 # Non-default prefix overrides:
 prefix=${PREFIX}
 varbase=${PREFIX}/var
-pkgdb=${PREFIX}/var/db/pkg
+pkgdb=${PKGDBDIR}
 EOF
 fi
 
@@ -187,6 +192,7 @@
   ${PREFIX:+--prefix=${PREFIX}} \
   ${mk_fragment:+--mk-fragment="$mk_fragment"} \
   --workdir=${TMPDIR}/work \
+  ${PKGDBDIR:+--pkgdbdir=${PKGDBDIR}} \
   --gzip-binary-kit=${PACKAGES}/bootstrap.tar.gz
 rm -rf ${TMPDIR}/work
 rm -f ${TMPDIR}/mk.conf.inc



Home | Main Index | Thread Index | Old Index