summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorsno <sno@pkgsrc.org>2010-02-01 09:33:21 +0000
committersno <sno@pkgsrc.org>2010-02-01 09:33:21 +0000
commitafae6cb2d002a1e6fded9dd3144f369cf74aa48c (patch)
treef2fe69456a2893ca941a1a1d37700e2758a04870 /pkgtools
parent8c0db00a38174a0e45962b6b9dda6b37f0947d8b (diff)
downloadpkgsrc-afae6cb2d002a1e6fded9dd3144f369cf74aa48c.tar.gz
Updating pkg_rolling-replace (set new version 0.19):
- Add option '-D' to tune "USE_DESTDIR=" and set this defaultly to 'NO' - Add option '-j' to tune "MAKE_JOBS=" (Default: unset) - Fix an issue with packages with missing origin
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_rolling-replace/Makefile4
-rw-r--r--pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.822
-rwxr-xr-xpkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh87
3 files changed, 86 insertions, 27 deletions
diff --git a/pkgtools/pkg_rolling-replace/Makefile b/pkgtools/pkg_rolling-replace/Makefile
index c86ee51c985..45cbf11ac61 100644
--- a/pkgtools/pkg_rolling-replace/Makefile
+++ b/pkgtools/pkg_rolling-replace/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.25 2009/11/13 19:40:55 sno Exp $
+# $NetBSD: Makefile,v 1.26 2010/02/01 09:33:21 sno Exp $
-DISTNAME= pkg_rolling-replace-0.18
+DISTNAME= pkg_rolling-replace-0.19
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 a05491bf0a1..8db973d58f9 100644
--- a/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8
+++ b/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8
@@ -1,5 +1,5 @@
-.\" $NetBSD: pkg_rolling-replace.8,v 1.16 2009/12/01 14:26:08 tnn Exp $
-.Dd November 13, 2009
+.\" $NetBSD: pkg_rolling-replace.8,v 1.17 2010/02/01 09:33:21 sno Exp $
+.Dd February 1, 2010
.Dt PKG_ROLLING-REPLACE 8
.Os
.Sh NAME
@@ -8,6 +8,8 @@
.Sh SYNOPSIS
.Nm
.Op Fl hFknrsuv
+.Op Fl D Ar bool
+.Op Fl j Ar jobs
.Op Fl L Ar path
.Op Fl X Ar pkgs
.Op Fl x Ar pkgs
@@ -74,6 +76,9 @@ Keep on going, even on error during handling current package.
Warning: This could (potential will) rebuild package depending
on the failed package, anyway. This may cause a broken tree.
Use with caution!
+.It Fl j Ar jobs
+Enables a pkgsrc tunable (MAKE_JOBS=<n>) to allow parallel build while
+compiling a package. It's unset by default.
.It Fl n
Display actions that would be taken, but don't actually run
.Dq make replace
@@ -100,6 +105,17 @@ Use
to check for outdated packages, and replace those too.
.It Fl v
Verbose output.
+.It Fl D Ar bool
+Sets the
+.Dq USE_DESTDIR=<bool>
+for the given bool. The default value is
+.Dq NO
+to ensure the same behaviour for pkgsrc developers when the act as users
+and update their system. To disable the default behaviour, use
+.Dq OFF
+as value for the
+.Dq -D
+parameter.
.It Fl L Ar path
Logs each build (each command output from the commands which are run for
packages) to given path. The full log file name is composed from the path
@@ -210,6 +226,8 @@ were added by
.Aq tnn@NetBSD.org .
The options
.Fl k ,
+.Fl j ,
+.Fl D ,
.Fl F
and
.Fl L
diff --git a/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh b/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh
index 49d49733ee9..b5dfefd0f44 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.22 2009/11/13 19:40:55 sno Exp $
+# $NetBSD: pkg_rolling-replace.sh,v 1.23 2010/02/01 09:33:21 sno Exp $
#<license>
# Copyright (c) 2006 BBN Technologies Corp. All rights reserved.
#
@@ -109,7 +109,9 @@ usage()
-s Replace even if the ABIs are still compatible ("strict")
-u Update outdated packages
-v Verbose
+ -D <bool> set USE_DESTDIR=bool (default: NO)
-L <path> Log to path (<path>/pkgdir/pkg)
+ -j <jobs> set MAKE_JOBS=jobs for building update
-X <pkg> exclude <pkg> from being rebuilt
-x <pkg> exclude <pkg> from outdated check
@@ -310,8 +312,9 @@ todo()
##
EXCLUDE=
+DESTDIR_OVERRIDE="NO"
-args=$(getopt Fhknursvx:X:L: $*)
+args=$(getopt FhknursvD:j:x:X:L: $*)
if [ $? -ne 0 ]; then
opt_h=1
fi
@@ -326,6 +329,8 @@ while [ $# -gt 0 ]; do
-s) opt_s=1 ;;
-u) opt_u=1 ;;
-v) opt_v=1 ;;
+ -D) DESTDIR_OVERRIDE="$2"; shift ;;
+ -j) MAKE_JOBS_OVERRIDE="$2"; shift ;;
-x) EXCLUDE="$EXCLUDE $(echo $2 | sed 's/,/ /g')" ; shift ;;
-X) REALLYEXCLUDE="$REALLYEXCLUDE $(echo $2 | sed 's/,/ /g')" ; shift ;;
-L) LOGPATH="$2"; shift ;;
@@ -338,6 +343,32 @@ if [ -n "$opt_h" ]; then
usage
fi
+BUILD_REPLACE_TUNE_SEP=""
+
+if [ -n "${DESTDIR_OVERRIDE}" ]; then
+ case "${DESTDIR_OVERRIDE}" in
+ [yY][eE][sS]|[nN][oO])
+ BUILD_REPLACE_TUNE="USE_DESTDIR=${DESTDIR_OVERRIDE}"
+ BUILD_REPLACE_TUNE_SEP=" "
+ ;;
+ [oO][fF][fF])
+ # Turn built-in default off
+ ;;
+ *)
+ usage
+ ;;
+ esac
+fi
+
+if [ -n "${MAKE_JOBS_OVERRIDE}" ]; then
+ MAKE_JOBS_VERIFY=`expr ${MAKE_JOBS_OVERRIDE}+0`
+ if [ ${MAKE_JOBS_OVERRIDE} -eq ${MAKE_JOBS_VERIFY} ]; then
+ BUILD_REPLACE_TUNE="${BUILD_REPLACE_TUNE}${BUILD_REPLACE_TUNE_SEP}MAKE_JOBS=${MAKE_JOBS_VERIFY}"
+ else
+ usage
+ fi
+fi
+
if [ -n "$opt_s" ]; then
UNSAFE_VAR=unsafe_depends_strict
else
@@ -457,29 +488,39 @@ while [ -n "$REPLACE_TODO" ]; do
# Do make replace, with clean before, and package and clean afterwards.
fail=
- cd "$PKGSRCDIR/$pkgdir";
- if [ -z "$opt_F" ]; then
- echo "${OPI} Replacing $pkgname"
- cmd="${MAKE} clean || fail=1"
- if [ -n "$opt_n" ]; then
- echo "${OPI} Would run: $cmd"
- else
- if [ -n "$logfile" ]; then
- eval "$cmd" >&3 2>&3
- else
- eval "$cmd"
- fi
- if [ -n "$fail" ]; then
- FAILED="$FAILED$FAILEDSEP$pkg"
- FAILEDSEP=" "
- [ -n "$opt_k" ] || abort "'make clean' failed for package $pkg."
- fi
- fi
- cmd="${MAKE} replace || fail=1" # XXX OLDNAME= support? xmlrpc-c -> xmlrpc-c-ss
+ if [ -d "$PKGSRCDIR/$pkgdir" ]; then
+ cd "$PKGSRCDIR/$pkgdir";
else
- echo "${OPI} Fetching $pkgname"
- cmd="${MAKE} fetch depends-fetch || fail=1"
+ FAILED="$FAILED$FAILEDSEP$pkg"
+ FAILEDSEP=" "
+ [ -n "$opt_k" ] || abort "No package directory '$pkgdir' for $pkg."
fi
+
+ if [ -z "$fail" ]; then
+ if [ -z "$opt_F" ]; then
+ echo "${OPI} Replacing $pkgname"
+ cmd="${MAKE} clean || fail=1"
+ if [ -n "$opt_n" ]; then
+ echo "${OPI} Would run: $cmd"
+ else
+ if [ -n "$logfile" ]; then
+ eval "$cmd" >&3 2>&3
+ else
+ eval "$cmd"
+ fi
+ if [ -n "$fail" ]; then
+ FAILED="$FAILED$FAILEDSEP$pkg"
+ FAILEDSEP=" "
+ [ -n "$opt_k" ] || abort "'make clean' failed for package $pkg."
+ fi
+ fi
+ cmd="${MAKE} ${BUILD_REPLACE_TUNE} replace || fail=1" # XXX OLDNAME= support? xmlrpc-c -> xmlrpc-c-ss
+ else
+ echo "${OPI} Fetching $pkgname"
+ cmd="${MAKE} fetch depends-fetch || fail=1"
+ fi
+ fi
+
if [ -n "$opt_n" -a -z "$fail" ]; then
echo "${OPI} Would run: $cmd"
elif [ -z "$fail" ]; then