[dpkg] 10/13: spec/R³: Add new DEB_RULES_REQUIRES_ROOT variable

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 44aac36c26877b7659f3b29766cd28bec5ea04fe
Author: Guillem Jover <guillem at debian.org>
Date:   Wed Jan 3 02:20:20 2018 +0100

    spec/R³: Add new DEB_RULES_REQUIRES_ROOT variable
    
    This variable is set by the builder to notify debian/rules that it
    supports this specification.
    
    Wordsmithing-by: Niels Thykier <niels at thykier.net>
    (cherry picked from commit 566a4b61b6c3359c3d4cffa05519ecbc967b292c)
---
 debian/changelog             | 1 +
 doc/rootless-builds.txt      | 9 +++++++++
 man/dpkg-buildpackage.man    | 7 +++++++
 scripts/dpkg-buildpackage.pl | 3 +++
 4 files changed, 20 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 76b04da..0a7f593 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ dpkg (1.19.0.5) UNRELEASED; urgency=medium
     <implementations-keywords>, following the specification.
   * Specify that DEB_GAIN_ROOT_CMD in R³ should preserve the environment.
     Proposed by Josh Triplett <josh at joshtriplett.org>.
+  * Specify new DEB_RULES_REQUIRES_ROOT variable for R³ support.
   * Architecture support:
     - Add support for riscv64 CPU. Closes: #822914
       Thanks to Manuel A. Fernandez Montecelo <mafm at debian.org>
diff --git a/doc/rootless-builds.txt b/doc/rootless-builds.txt
index 68617d5..a17a5ad 100644
--- a/doc/rootless-builds.txt
+++ b/doc/rootless-builds.txt
@@ -52,6 +52,15 @@ The values are defined as:
      a command, it MUST behave like "Rules-Requires-Root" was set to
      "binary-targets", i.e. run "debian/rules binary" under (fake)root.
 
+When the builder supports this specification, it MUST notify this fact to
+the rules file via the "DEB_RULES_REQUIRES_ROOT" environment variable, with
+the value it has obtained from the Rules-Requires-Root field or some builder
+specific override mechanism, which will denote the level of support the
+builder has choosen to commit to take effect during the build. When set,
+it MUST be a valid value for the Rules-Requires-Root field. If unset,
+the build system SHOULD assume that the builder does not recognize the
+Rules-Requires-Root field at all.
+
 It is always permissible for a builder to ignore this field and fall back to
 running the binary targets under (fake)root. This is to ensure backwards
 compatibility when builds are performed by legacy builders or older versions
diff --git a/man/dpkg-buildpackage.man b/man/dpkg-buildpackage.man
index cfce8a8..fa04ea3 100644
--- a/man/dpkg-buildpackage.man
+++ b/man/dpkg-buildpackage.man
@@ -514,6 +514,13 @@ standalone should be supported.
 parameters forwarded. Any variable that is output by its \fB\-s\fP
 option is integrated in the build environment.
 .TP
+.B DEB_RULES_REQUIRES_ROOT
+This variable is set to the value obtained from the \fBRules\-Requires\-Root\fP
+field or from the command-line.
+When set, it will be a valid value for the \fBRules\-Requires\-Root\fP field.
+It is used to notify \fBdebian/rules\fP whether the \fBrootless\-builds.txt\fP
+specification is supported.
+.TP
 .B DEB_GAIN_ROOT_CMD
 This variable is set to \fIgain-root-command\fP when the field
 \fBRules\-Requires\-Root\fP is set to a value different to \fBno\fP and
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index a77300a..6c9763e 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -725,6 +725,9 @@ sub parse_rules_requires_root {
         setup_rootcommand();
     }
 
+    # Notify the childs we do support R³.
+    $ENV{DEB_RULES_REQUIRES_ROOT} = join ' ', sort keys %rrr;
+
     if ($keywords_base > 1 or $keywords_base and $keywords_impl) {
         error(g_('%s field contains both global and implementation specific keywords'),
               'Rules-Requires-Root');

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