[dpkg] 08/13: dpkg-buildpackage: Do not set DEB_GAIN_ROOT_CMD on <implementations-keywords>

Mattia Rizzolo mattia at debian.org
Mon Jan 22 17:11:51 UTC 2018


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

mattia pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit ef92e1b1bc911b83c7f7c1df686a4fd8439c927d
Author: Guillem Jover <guillem at debian.org>
Date:   Wed Jan 3 01:57:30 2018 +0100

    dpkg-buildpackage: Do not set DEB_GAIN_ROOT_CMD on <implementations-keywords>
    
    The specification is clear on this, and we should not be setting this
    variable when the values are different to "no" and "binary-targets".
    
    (cherry picked from commit f6095fa5db1e4d277a0660806875375d60286250)
---
 debian/changelog             | 2 ++
 scripts/dpkg-buildpackage.pl | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 7db7e64..90ef236 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ dpkg (1.19.0.5) UNRELEASED; urgency=medium
     the variable is expected to be set by any builder, not just dpkg. And
     introduce ephemereal backwards compatibility even though there are no
     known users.
+  * Do not set DEB_GAIN_ROOT_CMD in dpkg-buildpackage when the R³ value is
+    <implementations-keywords>, following the specification.
   * Architecture support:
     - Add support for riscv64 CPU. Closes: #822914
       Thanks to Manuel A. Fernandez Montecelo <mafm at debian.org>
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index 1127298..a77300a 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -733,6 +733,11 @@ sub parse_rules_requires_root {
         $ENV{DEB_GAIN_ROOT_CMD} = join ' ', @rootcommand;
         # XXX: For ephemeral backwards compatibility.
         $ENV{DPKG_GAIN_ROOT_CMD} = $ENV{DEB_GAIN_ROOT_CMD};
+    } else {
+        # We should not provide the variable otherwise.
+        delete $ENV{DEB_GAIN_ROOT_CMD};
+        # XXX: For ephemeral backwards compatibility.
+        delete $ENV{DPKG_GAIN_ROOT_CMD};
     }
 
     return %rrr;

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



More information about the Reproducible-commits mailing list