[pbuilder] 06/06: buildpackage: Add support for Rules-Requires-Root

Mattia Rizzolo mattia at debian.org
Fri Oct 27 20:53:14 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 d64d1e3c09612d49b53859933fba8f9a7ba44c60
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Fri Oct 27 22:47:28 2017 +0200

    buildpackage: Add support for Rules-Requires-Root
    
    When R³:no fakeroot is not installed in the chroot.
    A distribution with dpkg-dev >= 1.19.0 is required for then be able to
    build the package.
    
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 pbuilder-buildpackage | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage
index 6781309..71eac1e 100755
--- a/pbuilder-buildpackage
+++ b/pbuilder-buildpackage
@@ -48,9 +48,6 @@ if [ -n "$BUILDUSERNAME" -a -n "$BUILDUSERID" ]; then
     # should be running later, so it shouldn't matter.
     # LOGNAME and USER: set this to shut up some tools.
     SUTOUSER="LD_PRELOAD= LOGNAME=$BUILDUSERNAME USER=$BUILDUSERNAME /sbin/start-stop-daemon --start --pidfile /dev/null --chuid $BUILDUSERNAME --startas /bin/sh"
-    DEBBUILDOPTS="${DEBBUILDOPTS:+$DEBBUILDOPTS }-rfakeroot"
-    EXTRAPACKAGES="${EXTRAPACKAGES} fakeroot"
-    log.i "using fakeroot in build."
 else
     # run the build in root
     BUILDUSERID=0
@@ -148,6 +145,15 @@ else
     exit 1;
 fi
 
+RRR="$(get822field Rules-Requires-Root "$BUILDPLACE/$BUILDDIR/$BUILDSUBDIR/debian/control")"
+if [[ "${RRR,,}" != no ]]; then
+    DEBBUILDOPTS="${DEBBUILDOPTS:+$DEBBUILDOPTS }-rfakeroot"
+    EXTRAPACKAGES="${EXTRAPACKAGES} fakeroot"
+    log.i "using fakeroot in build."
+else
+    log.i "Not using root during the build."
+fi
+
 log.i "Installing the build-deps"
 executehooks "D"
 trap saveaptcache_umountproc_cleanbuildplace_trap exit sighup sigpipe

-- 
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