package: release.debian.org
user: release.debian....@packages.debian.org
usertags: unblock

Hi!

I just uploaded a pbuilder adding a very small undocumented feature to
help with the reproducible builds project.
You can find the small debdiff attached.

Previously r-b was using an undocumented and undefined behaviour of
pbuilder that just `cd /build/*/debian/..` to move into the unpackaged
source; 0.228 changed this with a well defined `cd /build/$pkg-$ver`
(also started to call `dpkg-source` with that parameter).  r-b has been
test building packages in different build paths
    /build/1st/$pkg-$ver     vs   /build/$pkg-$ver/2nd
and using a hook to mangle the paths, etc; with 0.228 this wouldn't be
possible at all (as the `cd` call would fail).
0.228.4 adds an undocumented conf variable BUILDSUBDIR to specify the
name of the final source directory, making this work pssible again.

Thanks for considering!

-- 
regards,
                        Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
more about me:  https://mapreri.org                             : :'  :
Launchpad user: https://launchpad.net/~mapreri                  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-
diffstat for pbuilder-0.228.3 pbuilder-0.228.4

 debian/changelog      |   19 +++++++++++++++++++
 pbuilder-buildpackage |   11 +++++++----
 pbuilder-modules      |    2 +-
 pbuilderrc.5          |   14 +++++++++-----
 4 files changed, 36 insertions(+), 10 deletions(-)

diff -Nru pbuilder-0.228.3/debian/changelog pbuilder-0.228.4/debian/changelog
--- pbuilder-0.228.3/debian/changelog	2017-01-24 16:29:13.000000000 +0100
+++ pbuilder-0.228.4/debian/changelog	2017-02-06 20:16:31.000000000 +0100
@@ -1,3 +1,22 @@
+pbuilder (0.228.4) unstable; urgency=medium
+
+  [ James Clarke ]
+  * modules: Fix bind-mounts on kFreeBSD.
+
+  [ Mattia Rizzolo ]
+  * buildpackage:
+    + rename internal variable SUBDIR_NAME to BUILDSUBDIR (the subdirectory of
+      BUILDDIR where the source will be unpacked).
+    + make it possible to specify BUILDSUBDIR externally, i.e. through
+      pbuilderrc.  Closes: #854255
+  * pbuilderrc.5:
+    + remove stale information: BUILDDIR is not (by default) the HOME of the
+      build user anymore.
+    + document what will happen inside BUILDDIR, and where the unpacked source
+      will be.
+
+ -- Mattia Rizzolo <mat...@debian.org>  Mon, 06 Feb 2017 20:16:31 +0100
+
 pbuilder (0.228.3) unstable; urgency=medium
 
   * pbuilder-modules: Add get_source_options function to extract options for
diff -Nru pbuilder-0.228.3/pbuilder-buildpackage pbuilder-0.228.4/pbuilder-buildpackage
--- pbuilder-0.228.3/pbuilder-buildpackage	2017-01-23 11:26:48.000000000 +0100
+++ pbuilder-0.228.4/pbuilder-buildpackage	2017-02-06 09:09:28.000000000 +0100
@@ -128,8 +128,11 @@
 copydsc "$PACKAGENAME" "${BUILDPLACE}$BUILDDIR"
 copyinputfile "${BUILDPLACE}$BUILDDIR"
 
-SUBDIR_NAME=$(dsc_get_basename "$PACKAGENAME" "no")
-SUBDIR_NAME=${SUBDIR_NAME//_/-}
+# don't allow empty values of BUILDSUBDIR
+if [ -z "${BUILDSUBDIR:-}" ]; then
+    BUILDSUBDIR="$(dsc_get_basename "$PACKAGENAME" "no")"
+    BUILDSUBDIR="${BUILDSUBDIR//_/-}"
+fi
 
 log.i "Extracting source"
 if echo "chown $BUILDUSERNAME:$BUILDUSERNAME $BUILDDIR $BUILDDIR/*" | $CHROOTEXEC /bin/bash; then
@@ -138,7 +141,7 @@
     log.e "pbuilder: Failed chowning to $BUILDUSERNAME:$BUILDUSERNAME"
     exit 1;
 fi
-if echo "( cd $BUILDDIR; env PATH=\"$PATH\" dpkg-source -x $(basename "$PACKAGENAME") "$SUBDIR_NAME" )" | $UNSHARE $CHROOTEXEC env $SUTOUSER ; then
+if echo "( cd $BUILDDIR; env PATH=\"$PATH\" dpkg-source -x $(basename "$PACKAGENAME") "$BUILDSUBDIR" )" | $UNSHARE $CHROOTEXEC env $SUTOUSER ; then
     : # success
 else
     log.e "pbuilder: Failed extracting the source"
@@ -181,7 +184,7 @@
     if [ -n "$TWICE" ]; then
         DPKG_COMMANDLINE="$DPKG_COMMANDLINE && $DPKG_COMMANDLINE"
     fi
-    DPKG_COMMANDLINE="cd ${BUILDDIR}/$SUBDIR_NAME/ && $DPKG_COMMANDLINE"
+    DPKG_COMMANDLINE="cd ${BUILDDIR}/$BUILDSUBDIR/ && $DPKG_COMMANDLINE"
     log.i "Running $DPKG_COMMANDLINE"
     echo "$DPKG_COMMANDLINE" | $UNSHARE $CHROOTEXEC env $SUTOUSER
 ) &
diff -Nru pbuilder-0.228.3/pbuilder-modules pbuilder-0.228.4/pbuilder-modules
--- pbuilder-0.228.3/pbuilder-modules	2017-01-24 15:29:51.000000000 +0100
+++ pbuilder-0.228.4/pbuilder-modules	2017-02-05 16:07:34.000000000 +0100
@@ -412,7 +412,7 @@
             log.i "Mounting $mnt to $mntpoint"
         fi
         if mkdir -p "$BUILDPLACE/$mntpoint" &&
-            mount -obind "$mnt" "$BUILDPLACE/$mntpoint"; then
+            mount $MOUNTPARAMS "$mnt" "$BUILDPLACE/$mntpoint"; then
             # successful.
             mounted[${#mounted[@]}]="$BUILDPLACE/$mnt"
         else
diff -Nru pbuilder-0.228.3/pbuilderrc.5 pbuilder-0.228.4/pbuilderrc.5
--- pbuilder-0.228.3/pbuilderrc.5	2017-01-18 13:38:23.000000000 +0100
+++ pbuilder-0.228.4/pbuilderrc.5	2017-02-05 16:28:58.000000000 +0100
@@ -82,14 +82,18 @@
 .EE
 .TP
 .BI "BUILDDIR=" "/build"
-The directory inside the chroot where the build happens. This will also be the
-.B HOME
-of the build user.
+The directory inside the chroot where the build happens.
+This directory will contain the build products; the source packages will be
+unpacked in a subdirectory therein contained, named
+.IR $srcpkg - $ver ,
+with
+.I $ver
+being the upstream part of the version, without epoch and debian revision.
 
 Attention! Some directories \(em such as
 .B /tmp
-\(em are not safe to use since they can be world-writable, and external user can
-temper with the build process.
+\(em are not safe to use since they can be world-writable, and external users
+can temper with the build process.
 .TP
 .BI "BUILDPLACE=" "/var/cache/pbuilder/build/"
 The default place which the chroot is constructed.

Attachment: signature.asc
Description: PGP signature

Reply via email to