pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_rolling-replace Bump version to pkg_rolli...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/919b0cebc071
branches:  trunk
changeset: 542117:919b0cebc071
user:      apb <apb%pkgsrc.org@localhost>
date:      Fri May 02 19:04:03 2008 +0000

description:
Bump version to pkg_rolling-replace-0.16:
* Look for $MAKECONF in @MAKECONF@, @PREFIX@/etc/mk.conf,
  and /etc/mk.conf, in that order.
* Look for $PKGSRCDIR in the Makefile referred to by $MAKECONF,
  ".", "..", "../..", and "/usr/pkgsrc", in that order.

Proposed in tech-pkg; OK Greg Troxel.

diffstat:

 pkgtools/pkg_rolling-replace/Makefile                     |  15 +++++--
 pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8  |  24 +++++++----
 pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh |  29 +++++++++++++-
 3 files changed, 52 insertions(+), 16 deletions(-)

diffs (148 lines):

diff -r 9d6f0afcc38b -r 919b0cebc071 pkgtools/pkg_rolling-replace/Makefile
--- a/pkgtools/pkg_rolling-replace/Makefile     Fri May 02 16:03:48 2008 +0000
+++ b/pkgtools/pkg_rolling-replace/Makefile     Fri May 02 19:04:03 2008 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.18 2008/03/31 11:41:09 gdt Exp $
+# $NetBSD: Makefile,v 1.19 2008/05/02 19:04:03 apb Exp $
 
-DISTNAME=      pkg_rolling-replace-0.15
+DISTNAME=      pkg_rolling-replace-0.16
 CATEGORIES=    pkgtools
 MASTER_SITES=  # empty
 DISTFILES=     # empty
@@ -30,10 +30,16 @@
 SUBST_FILES.tools=     pkg_rolling-replace.sh
 SUBST_VARS.tools=      PKG_INFO_CMD MAKE PKG_CHK AWK
 
+SUBST_CLASSES+=                prefix
+SUBST_STAGE.prefix=    pre-configure
+SUBST_MESSAGE.prefix=  Substituting PREFIX location.
+SUBST_FILES.prefix=    pkg_rolling-replace.8
+SUBST_VARS.prefix=     PREFIX
+
 SUBST_CLASSES+=                makeconf
 SUBST_STAGE.makeconf=  pre-configure
 SUBST_MESSAGE.makeconf=        Recording default path of mk.conf.
-SUBST_FILES.makeconf=  pkg_rolling-replace.sh
+SUBST_FILES.makeconf=  pkg_rolling-replace.sh pkg_rolling-replace.8
 SUBST_SED.makeconf=    -e 's,@MAKECONF@,${MAKE:T:Mbmake:S/bmake/${PREFIX}/g}/etc/mk.conf,g'
 
 REPLACE_SH+=           pkg_rolling-replace.sh
@@ -43,11 +49,12 @@
 # target exists only to force check-pkgsrc-patch prior to install
 do-extract: check-pkgsrc-patch
        cp ${FILESDIR}/pkg_rolling-replace.sh ${WRKSRC}
+       cp ${FILESDIR}/pkg_rolling-replace.8 ${WRKSRC}
 
 do-install: check-pkgsrc-patch
        ${INSTALL_SCRIPT} ${WRKSRC}/pkg_rolling-replace.sh \
                ${PREFIX}/sbin/pkg_rolling-replace
-       ${INSTALL_MAN} ${FILESDIR}/pkg_rolling-replace.8 \
+       ${INSTALL_MAN} ${WRKSRC}/pkg_rolling-replace.8 \
                ${PREFIX}/${PKGMANDIR}/man8/pkg_rolling-replace.8
 
 check-pkgsrc-patch:
diff -r 9d6f0afcc38b -r 919b0cebc071 pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8
--- a/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8  Fri May 02 16:03:48 2008 +0000
+++ b/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8  Fri May 02 19:04:03 2008 +0000
@@ -1,5 +1,5 @@
-.\" $NetBSD: pkg_rolling-replace.8,v 1.10 2008/03/11 01:53:05 tnn Exp $
-.Dd March 11, 2008
+.\" $NetBSD: pkg_rolling-replace.8,v 1.11 2008/05/02 19:04:03 apb Exp $
+.Dd May 2, 2008
 .Dt PKG_ROLLING-REPLACE 8
 .Os
 .Sh NAME
@@ -113,12 +113,14 @@
 .El
 .Sh EXAMPLES
 .Pp
-To update all packages on the system and ensure correct shared library dependencies:
+To update all packages on the system and ensure correct shared library
+dependencies:
 .Bd -literal -offset indent
 pkg_rolling-replace -rsuv
 .Ed
 .Pp
-To update all packages on the system, do as little rebuilding as possible, and also produce binary packages:
+To update all packages on the system, do as little rebuilding as possible,
+and also produce binary packages:
 .Bd -literal -offset indent
 pkg_rolling-replace -uv
 .Ed
@@ -136,15 +138,19 @@
 Path to
 .Pa mk.conf .
 Defaults to
-.Pa /etc/mk.conf
+.Pa @MAKECONF@ , @PREFIX@/etc/mk.conf ,
 or
-.Pa ${PREFIX}/etc/mk.conf
-(if using bmake).
+.Pa /etc/mk.conf .
 .It Ev PKGSRCDIR
 Base of pkgsrc tree.
-Defaults to value configured in MAKECONF or
+If not set in the environment, then this variable is read from
+.Pa ${MAKECONF} .
+If it is still not set, and if the current working directory
+appears to be inside a pkgsrc tree, then this variable
+is set to the base of that pkgsrc tree.
+Finally, if
 .Pa /usr/pkgsrc
-if unset.
+appears to contain a pkgsrc tree, then that is used as a last resort.
 .It Ev PKG_DBDIR
 pkgsrc database directory.
 If not set in environment then defaults to
diff -r 9d6f0afcc38b -r 919b0cebc071 pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh
--- a/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh Fri May 02 16:03:48 2008 +0000
+++ b/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh Fri May 02 19:04:03 2008 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# $NetBSD: pkg_rolling-replace.sh,v 1.18 2008/03/31 11:41:09 gdt Exp $
+# $NetBSD: pkg_rolling-replace.sh,v 1.19 2008/05/02 19:04:03 apb Exp $
 #<license>
 # Copyright (c) 2006 BBN Technologies Corp.  All rights reserved.
 #
@@ -65,14 +65,37 @@
 MAKE="@MAKE@"
 AWK="@AWK@"
 
-test -z "$MAKECONF" && MAKECONF="@MAKECONF@"
+if [ -z "$MAKECONF" ] ; then
+    for mkconf in "@MAKECONF@" "@PREFIX@/etc/mk.conf" /etc/mk.conf ; do
+       if [ -f "$mkconf" ] ; then
+           MAKECONF="$mkconf"
+           break
+       fi
+    done
+fi
+if [ -z "$MAKECONF" -o ! -f "$MAKECONF" ] ; then
+    MAKECONF=/dev/null
+fi
 test -f "$MAKECONF" && test -z "$PKGSRCDIR" && PKGSRCDIR="` \
     printf '.include "%s"\n_print_pkgsrcdir:\n\t@echo "${PKGSRCDIR}"\n' \
     "$MAKECONF" | "$MAKE" -f - BSD_PKG_MK=1 _print_pkgsrcdir`"
-test -z "$PKGSRCDIR" && PKGSRCDIR=/usr/pkgsrc
+if [ -z "$PKGSRCDIR" ] ; then
+    for dir in . .. ../.. /usr/pkgsrc ; do
+       if [ -f "${dir}/mk/bsd.pkg.mk" ]; then
+           case "${dir}" in
+           /*) PKGSRCDIR="${dir}" ;;
+           *)  PKGSRCDIR="$( cd "${dir}" >/dev/null 2>&1 && pwd )" ;;
+           esac
+           break
+       fi
+    done
+fi
+test -z "$PKGSRCDIR" && echo >&2 "Please set PKGSRCDIR" && exit 1
 test -z "$PKG_CHK" && PKG_CHK="@PKG_CHK@"
 test -z "$PKG_INFO" && PKG_INFO="@PKG_INFO_CMD@"
 
+export PKGSRCDIR
+
 unset PKG_PATH || true  #or pkgsrc makefiles will complain
 
 usage()



Home | Main Index | Thread Index | Old Index