aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordancer <dancer>2002-08-20 07:58:52 +0000
committerdancer <dancer>2002-08-20 07:58:52 +0000
commit99cb3e753737119665efcbf6f5e6b85f5f96df56 (patch)
tree820549a4538a064d33cddf5506f32106aa27849b
parent7d6ea6086216aaf0ff48a0fa19a9d0f2a946bbec (diff)
downloadpbuilder-99cb3e753737119665efcbf6f5e6b85f5f96df56.tar
pbuilder-99cb3e753737119665efcbf6f5e6b85f5f96df56.tar.gz
+2002-08-20 Junichi Uekawa <dancer@debian.org>
+ + * pbuilder-modules: document --timeout option. + + * pbuilder.8: document --timeout option + + * pbuilder-checkparams: add --timeout option + + * pbuilderrc.5: document TIMEOUT_TIME + + * pbuilder-buildpackage (CHROOTEXEC): add missing executehooks "C" to a + case. + (CHROOTEXEC): clean the command-line a bit, so that it's easier to use. + (BUILD_PID): add timeout for build process.
-rw-r--r--ChangeLog15
-rwxr-xr-xpbuilder-buildpackage35
-rwxr-xr-xpbuilder-checkparams4
-rw-r--r--pbuilder-modules1
-rw-r--r--pbuilder.88
-rw-r--r--pbuilderrc.54
6 files changed, 56 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index b245193..af241b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2002-08-20 Junichi Uekawa <dancer@debian.org>
+
+ * pbuilder-modules: document --timeout option.
+
+ * pbuilder.8: document --timeout option
+
+ * pbuilder-checkparams: add --timeout option
+
+ * pbuilderrc.5: document TIMEOUT_TIME
+
+ * pbuilder-buildpackage (CHROOTEXEC): add missing executehooks "C" to a
+ case.
+ (CHROOTEXEC): clean the command-line a bit, so that it's easier to use.
+ (BUILD_PID): add timeout for build process.
+
2002-08-18 Junichi Uekawa <dancer@debian.org>
* AUTHORS: added section about History and
diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage
index d56ef1d..109a65b 100755
--- a/pbuilder-buildpackage
+++ b/pbuilder-buildpackage
@@ -118,19 +118,32 @@ export PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin"
executehooks "A"
+
+
if [ -z "$DEBEMAIL" ]; then
- if ! $CHROOTEXEC /bin/bash -c "cd tmp/buildd/*/; $SUTOUSER dpkg-buildpackage -us -uc $DEBBUILDOPTS"; then
- echo "pbuilder: Failed autobuilding of package" >&2
- umountproc_cleanbuildplace
- exit 1;
- fi
+ DPKG_COMMANDLINE="cd tmp/buildd/*/; $SUTOUSER dpkg-buildpackage -us -uc $DEBBUILDOPTS"
else
- if ! $CHROOTEXEC /bin/bash -c "cd tmp/buildd/*/; $SUTOUSER dpkg-buildpackage -us -uc \"-m$DEBEMAIL\" $DEBBUILDOPTS"; then
- echo "pbuilder: Failed autobuilding of package" >&2
- executehooks "C"
- umountproc_cleanbuildplace
- exit 1;
- fi
+ DPKG_COMMANDLINE="cd tmp/buildd/*/; $SUTOUSER dpkg-buildpackage -us -uc \"-m$DEBEMAIL\" $DEBBUILDOPTS"
+fi
+
+($CHROOTEXEC /bin/bash -c "${DPKG_COMMANDLINE}") &
+BUILD_PID=$!
+if [ -n ${TIMEOUT_TIME} ]; then
+ ( sleep "${TIMEOUT_TIME}"; kill ${BUILD_PID} )& # timeout process
+ KILL_WAIT_PID="kill $!"
+else
+ KILL_WAIT_PID=""
+fi
+
+if ! wait ${BUILD_PID}; then
+ ${KILL_WAIT_PID}
+ echo "pbuilder: Failed autobuilding of package" >&2
+ executehooks "C"
+ umountproc_cleanbuildplace
+ exit 1;
+else
+ ${KILL_WAIT_PID}
+ # build was successful
fi
executehooks "B"
diff --git a/pbuilder-checkparams b/pbuilder-checkparams
index 3de8880..7075e55 100755
--- a/pbuilder-checkparams
+++ b/pbuilder-checkparams
@@ -106,6 +106,10 @@ while [ -n "$1" ]; do
APTCONFDIR="$2";
shift; shift;
;;
+ --timeout)
+ TIMEOUT_TIME="$2"
+ shift; shift;
+ ;;
--help)
showhelp
;;
diff --git a/pbuilder-modules b/pbuilder-modules
index 6b593eb..fad0574 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -60,6 +60,7 @@ pbuilder options
--debbuildopts [dpkg-buildpackage options]
--logfile [filename to output log]
--aptconfdir [overriding apt config dir]
+ --timeout [timeout time]
pdebuild options
--pbuilderroot [command to obtain root privilege for pbuilder]
diff --git a/pbuilder.8 b/pbuilder.8
index f2279c8..b37813c 100644
--- a/pbuilder.8
+++ b/pbuilder.8
@@ -267,6 +267,14 @@ chroot.
This option overrides other options, and may cause some inconsistency
problems.
+.TP
+.BI "--timeout [" "timeout in sleep time" "]"
+Time out building after sleeping set time.
+Specify something like
+.B "--timeout 10h"
+in the command line.
+Default is no timeout.
+
.SH "FILES"
.TP
.I "/etc/pbuilderrc"
diff --git a/pbuilderrc.5 b/pbuilderrc.5
index e59ab36..1615921 100644
--- a/pbuilderrc.5
+++ b/pbuilderrc.5
@@ -227,6 +227,10 @@ allowing the usual configuration options
to take effect.
Setting this variable overrides other options.
+.TP
+.BI "TIMEOUT_TIME=" "2h"
+Sets timeout time.
+Build will be stoped with SIGTERM after the set time.
.SH "FILES"
.I "/etc/pbuilderrc"