[PATCH] Add support for building packages twice; #493538

=3D?utf-8?q?Lo=3DC3=3DAFc=3D20Minier?=3D lool at dooz.org
Fri Dec 11 17:32:01 UTC 2009


Add support for building packages twice; based on a patch by
Nicolas Valc=E1rcel; 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"
=20
 executehooks "A"
=20
-DPKG_COMMANDLINE=3D"cd tmp/buildd/*/; dpkg-buildpackage -us -uc ${DEBEMA=
IL:+\"-e$DEBEMAIL\"} $DEBBUILDOPTS"
+DPKG_COMMANDLINE=3D"dpkg-buildpackage -us -uc ${DEBEMAIL:+\"-e$DEBEMAIL\=
"} $DEBBUILDOPTS"
=20
 (
     : Build process
-    echo  "${DPKG_COMMANDLINE}" | $CHROOTEXEC $SUTOUSER
+    echo  "cd tmp/buildd/*/ && ${DPKG_COMMANDLINE}${TWICE:+ && ${DPKG_CO=
MMANDLINE}}" | $CHROOTEXEC $SUTOUSER
 ) &
 BUILD_PID=3D$!
 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 @@
=20
 #default value for this option is !empty!
 INTERNAL_BUILD_UML=3D""
+TWICE=3D""
 CHROOTEXEC=3D""
 OVERRIDE_APTLINES=3D"no"
 OVERRIDE_APTLINES_WARN=3D"" # set this if --override-config option shoul=
d be set.
@@ -234,6 +235,10 @@ while [ -n "$1" ]; do
 	    IGNORE_UMOUNT=3D"no"
 	    shift;=20
 	    ;;
+	--twice)
+	    TWICE=3D"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."
=20
 .TP
+.BI "\-\-twice"
+Build the package twice in a row.  Useful to ensure the package cleans u=
p
+properly.  The resulting packages are the ones from the second build.
+
+.TP
 .BI "\-\-preserve\-buildplace"
 Do not clean the
 .B "\-\-buildplace"
--=20
1.6.3.3


--AhhlLboLdkugWU4S--





More information about the Pbuilder-maint mailing list