[pbuilder] 01/01: pdebuild: Use dpkg-source instead of dpkg-buildpackage to build the source package

Mattia Rizzolo mattia at debian.org
Sun Jan 15 14:36:37 UTC 2017


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository pbuilder.

commit c49fbef11fb34d7fd7bc0064f03f35adc2683456
Author: James Clarke <jrtc27 at jrtc27.com>
Date:   Tue Jan 10 17:03:04 2017 +0000

    pdebuild: Use dpkg-source instead of dpkg-buildpackage to build the source package
    
    The sequence of dpkg-source commands used now roughly represent what
    dpkg-buildpackage does anyway.
    
    Although, generate the _sources.changes only if the parent directory is
    not BUILDRESULT.
    
    This will avoid generating a .changes that can't be used in the case
    the source package is rebuilt (as the rebuilt source package is not
    guaranteed to be the same as the original one).
    
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 pdebuild             | 15 +++++++++++----
 pdebuild-checkparams |  3 ++-
 pdebuild.1           | 43 ++++++++++++++++++++-----------------------
 3 files changed, 33 insertions(+), 28 deletions(-)

diff --git a/pdebuild b/pdebuild
index 41e7819..8de3ed7 100644
--- a/pdebuild
+++ b/pdebuild
@@ -38,6 +38,7 @@ PKG_VERSION=$(dpkg-parsechangelog|sed -n 's/^Version: \(.*:\|\)//p')
 ARCHITECTURE="${ARCHITECTURE:-$(dpkg-architecture -qDEB_HOST_ARCH)}"
 CHANGES="${PKG_SOURCENAME}_${PKG_VERSION}_${ARCHITECTURE}.changes"
 SOURCE_CHANGES="${PKG_SOURCENAME}_${PKG_VERSION}_source.changes"
+DSC="${PKG_SOURCENAME}_${PKG_VERSION}.dsc"
 
 if [ -z "${PBUILDER_BUILD_LOGFILE}" ]; then
     PBUILDER_BUILD_LOGFILE="../${PKG_SOURCENAME}_${PKG_VERSION}_${ARCHITECTURE}.build"
@@ -80,10 +81,16 @@ else
     if ! dpkg-checkbuilddeps -B ; then
         log.w "Unmet build-dependency in source"
     fi
-    echo "dpkg-buildpackage -S -d -us -uc -r${BUILDSOURCEROOTCMD} $DEBBUILDOPTS" | \
-        perl -pe 's/(^|\s|=|'\'')-[AbBFgG]('\''|\s|$)/$1$2/g' | \
-        perl -pe 's/(^|\s|=)['\'']['\''](\s|$)/$1$2/g' | \
-        /bin/bash
+    dpkg-source --before-build .
+    "${BUILDSOURCEROOTCMD}" debian/rules clean
+    dpkg-source -b .
+    if ! [ "../${DSC}" -ef "${BUILDRESULT}/${DSC}" ]; then
+        log.i "Generating source changes file for original dsc"
+        dpkg-genchanges -S > "../${SOURCE_CHANGES}"
+    else
+        log.i "Generated dsc will be overwritten by build result; not generating changes file"
+    fi
+    dpkg-source --after-build .
     ${PBUILDERROOTCMD} \
         ${PDEBUILD_PBUILDER} \
         --build \
diff --git a/pdebuild-checkparams b/pdebuild-checkparams
index 87b1f30..ed845b5 100644
--- a/pdebuild-checkparams
+++ b/pdebuild-checkparams
@@ -42,7 +42,8 @@ while [ -n "$1" ]; do
 	    shift; shift;
 	    ;;
 	--debbuildopts)
-	    DEBBUILDOPTS="${2:+$DEBBUILDOPTS $2}";
+        # deprecated since v0.228
+        # wait some more before nagging about its deprecation
 	    shift; shift;
 	    ;;
 	--configfile)
diff --git a/pdebuild.1 b/pdebuild.1
index 5ce6cbb..a437349 100644
--- a/pdebuild.1
+++ b/pdebuild.1
@@ -27,7 +27,8 @@ appear later take precedence.
 .TP
 .BI "\-\-buildsourceroot [" "fakeroot" "]"
 The command used to gain root privilege for 
-invoking dpkg-buildpackage
+invoking
+.B "debian/rules clean"
 
 .TP
 .BI "\-\-pbuilderroot [" "sudo -E" "]"
@@ -78,6 +79,8 @@ The configuration file is used, and passed on to
 .TP
 .BI "\-\-debbuildopts [" "options to pass to dpkg-buildpackage" "]"
 
+.B "Deprecated; please pass this as a pbuilder option instead"
+
 The space-delimited list of options are passed to dpkg-buildpackage.
 This option appends to pbuilder option
 .B "\-\-debbuildopts"
@@ -86,8 +89,10 @@ string.
 
 Multiple options are delimited with spaces.
 
-Note that for pdebuild, debbuildopts needs to be specified as a pdebuild
-option in the command-line, not as a pbuilder option.
+Note that for pdebuild,
+.B "dpkg-source"
+is used to build the source package which is given to pbuilder. This option has
+no effect on the arguments used to build this source package.
 
 .TP
 .BI "\-\-use\-pdebuild\-internal"
@@ -130,9 +135,7 @@ See pbuilder(8) for a full list of options.
 
 There is an exception that
 .B "\-\-buildresult"
-and
-.B "\-\-debbuildopts"
-need to be specified as pdebuild options before the 
+needs to be specified as a pdebuild option before the
 .B "\-\-"
 in order to be effective.
 
@@ -163,23 +166,17 @@ $ pwd
 $ ls debian/rules
 debian/rules
 $ pdebuild
-W: /home/dancer/.pbuilderrc does not exist
-dpkg-buildpackage: source package is cowdancer
-dpkg-buildpackage: source version is 0.26
-dpkg-buildpackage: source changed by Junichi Uekawa <dancer at debian.org>
-dpkg-buildpackage: source version without epoch 0.26
- fakeroot debian/rules clean
-dh_testdir
-dh_testroot
-rm \-f build-stamp configure-stamp
-/usr/bin/make clean
-make[1]: Entering directory `/home/dancer/DEBIAN/cowdancer/cowdancer'
-rm \-f *~ *.o *.lo libcowdancer.so cow-shell cowbuilder
-make[1]: Leaving directory `/home/dancer/DEBIAN/cowdancer/cowdancer'
-dh_clean
- dpkg-source \-b cowdancer
-dpkg-source: warning: source directory `./cowdancer' is not <sourcepackage>-<upstreamversion> `cowdancer-0.26'
-dpkg-source: building cowdancer in cowdancer_0.26.tar.gz
+dh clean
+   dh_testdir
+   dh_auto_clean
+   dh_autoreconf_clean
+   dh_clean
+	.
+	.
+	.
+dpkg-source: info: using source format '3.0 (native)'
+dpkg-source: info: building cowdancer in cowdancer_0.84.tar.xz
+dpkg-source: info: building cowdancer in cowdancer_0.84.dsc
 	.
 	.
 	.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pbuilder/pbuilder.git



More information about the Pbuilder-maint mailing list