[debhelper-devel] [debhelper] 03/09: dh_builddeb: Pass --root-owner-group to dpkg-deb under R³

Niels Thykier nthykier at moszumanska.debian.org
Sat Oct 21 18:06:39 UTC 2017


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

nthykier pushed a commit to branch master
in repository debhelper.

commit aa81c9a0b93ef49dbe7126a363f95efd751ec3dc
Author: Niels Thykier <niels at thykier.net>
Date:   Sun Oct 15 14:24:11 2017 +0000

    dh_builddeb: Pass --root-owner-group to dpkg-deb under R³
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog |  2 ++
 dh_builddeb      | 12 ++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 9247cd4..065b6f4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,8 @@ debhelper (10.9.3) UNRELEASED; urgency=medium
   * dh_testroot: Update check for root to support R³.
   * makefile.pm: Call "make install" with DPKG_GAIN_ROOT_CMD when
     R³ contains the "debhelper/upstream-make-install" keyword.
+  * dh_builddeb: Pass --root-owner-group to dpkg-deb in packages
+    with R³ (except for "binary-targets").
 
  -- Niels Thykier <niels at thykier.net>  Sat, 14 Oct 2017 11:18:19 +0000
 
diff --git a/dh_builddeb b/dh_builddeb
index c41fe4c..3c13db1 100755
--- a/dh_builddeb
+++ b/dh_builddeb
@@ -1,5 +1,7 @@
 #!/usr/bin/perl
 
+=encoding UTF-8
+
 =head1 NAME
 
 dh_builddeb - build Debian binary packages
@@ -25,6 +27,9 @@ and L<dh_gencontrol(1)> have prepared them.
 It supports building multiple binary packages in parallel, when enabled by
 DEB_BUILD_OPTIONS.
 
+In a non-legacy R³ build, B<dh_builddeb> will pass
+B<--root-owner-group> to L<dpkg-deb(1)>.
+
 =head1 OPTIONS
 
 =over 4
@@ -99,6 +104,8 @@ sub build_and_rename_deb {
 }
 
 my @items;
+my @dpkg_options;
+push(@dpkg_options, '--root-owner-group') if not should_use_root();
 
 for my $package (@{$dh{DOPACKAGES}}) {
 	push(@items, [$package, 0]);
@@ -123,7 +130,7 @@ on_items_in_parallel(\@items, sub {
 
 		if ($dbgsym) {
 			my $dbgsym_tmpdir = dbgsym_tmpdir($package);
-			doit("dpkg-deb", @{$dh{U_PARAMS}},
+			doit("dpkg-deb", @dpkg_options, @{$dh{U_PARAMS}},
 				"--build", $dbgsym_tmpdir, $dh{DESTDIR});
 			next;
 		}
@@ -139,11 +146,12 @@ on_items_in_parallel(\@items, sub {
 			}
 		}
 		if (! is_udeb($package)) {
-			doit("dpkg-deb", @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$dh{FILENAME});
+			doit("dpkg-deb", @dpkg_options, @{$dh{U_PARAMS}}, "--build", $tmp, $dh{DESTDIR}.$dh{FILENAME});
 		}
 		else {
 			my $filename=$dh{FILENAME};
 			my @cmd = qw(dpkg-deb -z6 -Zxz -Sextreme);
+			push(@cmd, @dpkg_options);
 			push(@cmd, @{$dh{U_PARAMS}}) if $dh{U_PARAMS};
 			push(@cmd, '--build', $tmp);
 			if (! $filename) {

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




More information about the debhelper-devel mailing list