[Reproducible-commits] [dpkg] 52/74: Dpkg::Vendor::Debian: Support getting the build path from the environment

Mattia Rizzolo mattia at debian.org
Sun Jul 3 22:22:57 UTC 2016


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

mattia pushed a commit to annotated tag 1.18.8
in repository dpkg.

commit 5d2873e1f64ef7f6ed0e0783946a2156fd2d322f
Author: Guillem Jover <guillem at debian.org>
Date:   Mon Jun 13 20:32:43 2016 +0200

    Dpkg::Vendor::Debian: Support getting the build path from the environment
    
    Having dpkg-buildflags change its output depending on its current
    working directory is not very friendly. We add a new environment
    variable to be able to specify it so that we can control the output.
    
    And use it from the test suite so make sure we always use the same
    path regardless of where we execute the makefile snippets from.
---
 debian/changelog              | 2 ++
 man/dpkg-buildflags.1         | 5 +++++
 scripts/Dpkg/Vendor/Debian.pm | 3 ++-
 scripts/t/mk.t                | 2 ++
 4 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 2184024..4a7a97d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -67,6 +67,8 @@ dpkg (1.18.8) UNRELEASED; urgency=medium
       Dpkg::Index to support these.
     - Fix Dpkg::Deps so that architecture qualifiers only imply one another
       if they are the same. Closes: #745366, #827628
+    - Add support for new environment variable DEB_BUILD_PATH to be able to
+      control the path in the fixdebugpath feature in Dpkg::Vendor::Debian.
   * Test suite:
     - Bump perlcritic ValuesAndExpressions::RequireNumberSeparators minimum
       to 99999.
diff --git a/man/dpkg-buildflags.1 b/man/dpkg-buildflags.1
index 8898689..6c30d60 100644
--- a/man/dpkg-buildflags.1
+++ b/man/dpkg-buildflags.1
@@ -465,6 +465,11 @@ See the \fBFEATURE AREAS\fP section for details.
 This setting defines the current vendor.
 If not set, it will discover the current vendor by reading
 \fB\%/etc/dpkg/origins/default\fP.
+.TP
+.B DEB_BUILD_PATH
+This variable sets the build path (since dpkg 1.18.8) to use in features
+such as \fBfixdebugpath\fP so that they can be controlled by the caller.
+This variable is currently Debian and derivatives-specific.
 .
 .SH FILES
 .SS Configuration files
diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
index fa5e1c2..160d9f9 100644
--- a/scripts/Dpkg/Vendor/Debian.pm
+++ b/scripts/Dpkg/Vendor/Debian.pm
@@ -172,7 +172,8 @@ sub _add_reproducible_flags {
     # Avoid storing the build path in the debug symbols.
     if ($use_feature{fixdebugpath}) {
         require Cwd;
-        my $map = '-fdebug-prefix-map=' . Cwd::cwd() . '=.';
+        my $build_path = $ENV{DEB_BUILD_PATH} || Cwd::cwd();
+        my $map = '-fdebug-prefix-map=' . $build_path . '=.';
         $flags->append('CFLAGS', $map);
         $flags->append('CXXFLAGS', $map);
         $flags->append('OBJCFLAGS', $map);
diff --git a/scripts/t/mk.t b/scripts/t/mk.t
index 04f88a7..a0453b0 100644
--- a/scripts/t/mk.t
+++ b/scripts/t/mk.t
@@ -33,6 +33,8 @@ $ENV{$_} = rel2abs($ENV{$_}) foreach qw(srcdir DPKG_DATADIR DPKG_ORIGINS_DIR);
 # Delete variables that can affect the tests.
 delete $ENV{$_} foreach grep { m/^DEB_/ } keys %ENV;
 
+$ENV{DEB_BUILD_PATH} = rel2abs($datadir);
+
 sub test_makefile {
     my $makefile = shift;
 

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