summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authortnn <tnn@pkgsrc.org>2007-05-10 02:55:31 +0000
committertnn <tnn@pkgsrc.org>2007-05-10 02:55:31 +0000
commit4b071d966b60272d19f1016f164b42704ae6b90c (patch)
tree35e90f53f701786931af7a2ddcbc8120b17847d6 /pkgtools
parentf4a65179d126da692578f5bf14bc4e4782622e30 (diff)
downloadpkgsrc-4b071d966b60272d19f1016f164b42704ae6b90c.tar.gz
Get PKGSRCDIR from mk.conf. In turn, Get path of mk.conf from MAKECONF
or default to /etc/mk.conf if unset. Bump PKGREVISON.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_rolling-replace/Makefile4
-rw-r--r--pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.814
-rwxr-xr-xpkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh17
3 files changed, 23 insertions, 12 deletions
diff --git a/pkgtools/pkg_rolling-replace/Makefile b/pkgtools/pkg_rolling-replace/Makefile
index 1848e78d5a9..a5e4a128b16 100644
--- a/pkgtools/pkg_rolling-replace/Makefile
+++ b/pkgtools/pkg_rolling-replace/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.4 2007/01/07 09:14:08 rillig Exp $
+# $NetBSD: Makefile,v 1.5 2007/05/10 02:55:31 tnn Exp $
DISTNAME= pkg_rolling-replace-0.04
-PKGREVISION= 3
+PKGREVISION= 4
CATEGORIES= pkgtools
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8 b/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8
index 4f6c7fd0e25..003d2062b51 100644
--- a/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8
+++ b/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_rolling-replace.8,v 1.2 2006/12/06 10:41:29 wiz Exp $
+.\" $NetBSD: pkg_rolling-replace.8,v 1.3 2007/05/10 02:55:31 tnn Exp $
.Dd August 7, 2006
.Dt PKG_ROLLING-REPLACE 8
.Os
@@ -86,10 +86,18 @@ is given (does not exclude unsafe or rebuild-requested packages).
.Nm
uses the following environment variables.
.Bl -tag -width xxxx
+.It Ev MAKECONF
+Path to
+.Pa mk.conf .
+Defaults to
+.Pa /etc/mk.conf
+with a fallback to
+.Pa /usr/pkgsrc/etc/mk.conf .
.It Ev PKGSRCDIR
Base of pkgsrc tree.
-Defaults to
-.Pa /usr/pkgsrc .
+Defaults to value configured in MAKECONF or
+.Pa /usr/pkgsrc
+if unset.
.It Ev PKG_DBDIR
pkgsrc database directory.
If not set in environment then defaults to
diff --git a/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh b/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh
index a963c575447..11189ee9931 100755
--- a/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh
+++ b/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# $NetBSD: pkg_rolling-replace.sh,v 1.2 2006/12/18 12:36:17 gdt Exp $
+# $NetBSD: pkg_rolling-replace.sh,v 1.3 2007/05/10 02:55:31 tnn Exp $
#<license>
# Copyright (c) 2006 BBN Technologies Corp. All rights reserved.
#
@@ -60,16 +60,19 @@
# of foo pulls in foo-share which conflicts with foo. This needlessly
# loses.
#
-# Parse mk.conf for PKGSRCDIR, etc.
-
-test -n "$PKG_DBDIR" || PKG_DBDIR=/var/db/pkg
-test -n "$PKGSRCDIR" || PKGSRCDIR=/usr/pkgsrc
-
-unset PKG_PATH || true #or pkgsrc makefiles will complain
# Substituted by pkgsrc at pre-configure time.
MAKE=@MAKE@
+test -z "$PKG_DBDIR" && PKG_DBDIR=/var/db/pkg
+test -z "$MAKECONF" && M=/etc/mk.conf && test -f $M && MAKECONF=$M
+test -z "$MAKECONF" && M=/usr/pkg/etc/mk.conf && test -f $M && MAKECONF=$M
+test -z "$PKGSRCDIR" && test -f "$MAKECONF" && \
+ PKGSRCDIR="`$MAKE -f \"$MAKECONF\" BSD_PKG_MK=1 -V PKGSRCDIR`"
+test -z "$PKGSRCDIR" && PKGSRCDIR=/usr/pkgsrc
+
+unset PKG_PATH || true #or pkgsrc makefiles will complain
+
usage()
{
echo "Usage: pkg_rolling-replace [opts]