aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpbuilder-buildpackage4
-rwxr-xr-xpbuilder-checkparams5
-rw-r--r--pbuilder-modules1
-rw-r--r--pbuilder.85
4 files changed, 13 insertions, 2 deletions
diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage
index 72181f5..e13380d 100755
--- a/pbuilder-buildpackage
+++ b/pbuilder-buildpackage
@@ -116,11 +116,11 @@ log "I: Building the package"
executehooks "A"
-DPKG_COMMANDLINE="cd tmp/buildd/*/; dpkg-buildpackage -us -uc ${DEBEMAIL:+\"-e$DEBEMAIL\"} $DEBBUILDOPTS"
+DPKG_COMMANDLINE="dpkg-buildpackage -us -uc ${DEBEMAIL:+\"-e$DEBEMAIL\"} $DEBBUILDOPTS"
(
: Build process
- echo "${DPKG_COMMANDLINE}" | $CHROOTEXEC $SUTOUSER
+ echo "cd tmp/buildd/*/ && ${DPKG_COMMANDLINE}${TWICE:+ && ${DPKG_COMMANDLINE}}" | $CHROOTEXEC $SUTOUSER
) &
BUILD_PID=$!
if [ -n "${TIMEOUT_TIME}" ]; then
diff --git a/pbuilder-checkparams b/pbuilder-checkparams
index 356a969..ef81878 100755
--- a/pbuilder-checkparams
+++ b/pbuilder-checkparams
@@ -26,6 +26,7 @@
#default value for this option is !empty!
INTERNAL_BUILD_UML=""
+TWICE=""
CHROOTEXEC=""
OVERRIDE_APTLINES="no"
OVERRIDE_APTLINES_WARN="" # set this if --override-config option should be set.
@@ -234,6 +235,10 @@ while [ -n "$1" ]; do
IGNORE_UMOUNT="no"
shift;
;;
+ --twice)
+ TWICE="yes"
+ shift;
+ ;;
--) # end of processing for this
shift;
break;
diff --git a/pbuilder-modules b/pbuilder-modules
index 8f604eb..4b4ba1c 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -72,6 +72,7 @@ pbuilder-options:
--preserve-buildplace
--bindmounts [bind-mount-point]
--debug
+ --twice
--autocleanaptcache
--debootstrapopts [debootstrap options]
--save-after-login/--save-after-exec
diff --git a/pbuilder.8 b/pbuilder.8
index b30d125..64b6e29 100644
--- a/pbuilder.8
+++ b/pbuilder.8
@@ -491,6 +491,11 @@ of
.B "pbuilder."
.TP
+.BI "\-\-twice"
+Build the package twice in a row. Useful to ensure the package cleans up
+properly. The resulting packages are the ones from the second build.
+
+.TP
.BI "\-\-preserve\-buildplace"
Do not clean the
.B "\-\-buildplace"