summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/bsd.pkg.mk4
-rw-r--r--mk/pbulk/pbulk-index.mk5
-rw-r--r--pkgtools/pbulk/files/pbulk/pbulk.conf9
-rwxr-xr-xpkgtools/pbulk/files/pbulk/scripts/pkg-build8
4 files changed, 21 insertions, 5 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 9b9b3177882..1fd1e225450 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1922 2007/08/18 00:30:21 joerg Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1923 2007/09/07 15:51:53 rillig Exp $
#
# This file is in the public domain.
#
@@ -801,7 +801,7 @@ ${_MAKEVARS_MK.${_phase_}}: ${WRKDIR}
${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
.endfor
-.if make(pbulk-index) || make(pbulk-index-item)
+.if make(pbulk-index) || make(pbulk-index-item) || make(pbulk-save-wrkdir)
.include "${.PARSEDIR}/pbulk/pbulk-index.mk"
.endif
diff --git a/mk/pbulk/pbulk-index.mk b/mk/pbulk/pbulk-index.mk
index e128f13d09a..d6678c00fea 100644
--- a/mk/pbulk/pbulk-index.mk
+++ b/mk/pbulk/pbulk-index.mk
@@ -1,4 +1,4 @@
-# $NetBSD: pbulk-index.mk,v 1.2 2007/05/16 16:48:12 joerg Exp $
+# $NetBSD: pbulk-index.mk,v 1.3 2007/09/07 15:51:53 rillig Exp $
# This Makefile fragment is included by bsd.pkg.mk and provides all
# variables and targets related to the parallel bulk build
@@ -99,3 +99,6 @@ pbulk-index-item:
.endfor
@printf "\n"
.endif
+
+pbulk-save-wrkdir:
+ ${PAX} -w -z -f ${INTO:Q} ${WRKDIR}
diff --git a/pkgtools/pbulk/files/pbulk/pbulk.conf b/pkgtools/pbulk/files/pbulk/pbulk.conf
index 4d11953fa7d..3416ad4cd20 100644
--- a/pkgtools/pbulk/files/pbulk/pbulk.conf
+++ b/pkgtools/pbulk/files/pbulk/pbulk.conf
@@ -1,4 +1,4 @@
-# $NetBSD: pbulk.conf,v 1.7 2007/08/24 06:32:41 rillig Exp $
+# $NetBSD: pbulk.conf,v 1.8 2007/09/07 15:51:53 rillig Exp $
# The URL where the build report will be made available. This is only
# used in the .txt version of the report.
@@ -78,6 +78,13 @@ pbuild=@PREFIX@/bin/pbulk-build
presolve=@PREFIX@/bin/pbulk-resolve
pscan=@PREFIX@/bin/pbulk-scan
+# When a package build fails, it is often necessary to have a look at
+# the working directory or the installed files. When these options are
+# set to "yes", they will be archived in the log directory.
+#
+keep_wrkdir=no
+keep_prefix=no
+
pkg_up_to_date_script=@PREFIX@/libexec/pbulk/pkg-up-to-date
pbuild_script=@PREFIX@/libexec/pbulk/pkg-build
pbuild_start_script=@PREFIX@/libexec/pbulk/build-client-start
diff --git a/pkgtools/pbulk/files/pbulk/scripts/pkg-build b/pkgtools/pbulk/files/pbulk/scripts/pkg-build
index 9c31eb61d50..d47d3aa8d8f 100755
--- a/pkgtools/pbulk/files/pbulk/scripts/pkg-build
+++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-build
@@ -1,5 +1,5 @@
#!@SH@
-# $NetBSD: pkg-build,v 1.4 2007/08/24 07:17:46 rillig Exp $
+# $NetBSD: pkg-build,v 1.5 2007/09/07 15:51:53 rillig Exp $
#
# Copyright (c) 2007 Joerg Sonnenberger <joerg@NetBSD.org>.
# All rights reserved.
@@ -33,6 +33,12 @@
. @PBULK_CONFIG@
cleanup() {
+ if [ $keep_wrkdir = yes ]; then
+ ${make} pbulk-save-wrkdir INTO=${bulklog}/${pkgname}/wrkdir.tar.gz
+ fi
+ if [ $keep_prefix = yes ]; then
+ tar cfz ${bulklog}/${pkgname}/prefix.tar.gz ${prefix}
+ fi
${make} clean > /dev/null 2>&1 || true
exit 1
}