tag 493538 = pending fixed-upstream confirmed
stop

        Hi

 I reworked this patch and merged it in the attached form.

   Bye
-- 
Loïc Minier
>From 282d18c7c43af310c6d2adb52478b2cacdc1da53 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Lo=C3=AFc=20Minier?= <[email protected]>
Date: Fri, 11 Dec 2009 18:32:01 +0100
Subject: [PATCH] Add support for building packages twice; #493538
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Add support for building packages twice; based on a patch by
Nicolas Valcárcel; closes: #493538
---
 pbuilder-buildpackage |    4 ++--
 pbuilder-checkparams  |    5 +++++
 pbuilder-modules      |    1 +
 pbuilder.8            |    5 +++++
 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"
-- 
1.6.3.3

Reply via email to