[Reproducible-commits] [dpkg] 01/02: Dpkg::Vendor::Debian: Support getting the build path from the environment
Mattia Rizzolo
mattia at debian.org
Mon Jun 13 20:11:24 UTC 2016
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 d0b6618d62a7cde8f67e7a8eed56ab92371e9182
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.
---
man/dpkg-buildflags.1 | 4 ++++
scripts/Dpkg/Vendor/Debian.pm | 3 ++-
scripts/t/mk.t | 2 ++
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/man/dpkg-buildflags.1 b/man/dpkg-buildflags.1
index 3aa79c7..456a0cb 100644
--- a/man/dpkg-buildflags.1
+++ b/man/dpkg-buildflags.1
@@ -432,6 +432,10 @@ various area features that affect build flags.
The \fBDEB_BUILD_MAINT_OPTIONS\fP variable overrides any setting in the
\fBDEB_BUILD_OPTIONS\fP feature areas.
See the \fBFEATURE AREAS\fP section for details.
+.TP
+.B DEB_BUILD_PATH
+This variable sets the build path to use in features such as
+\fBfixdebugpath\fP so that they can be controlled by the caller.
.
.SH FILES
.SS Configuration files
diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
index 3921405..4aa74d6 100644
--- a/scripts/Dpkg/Vendor/Debian.pm
+++ b/scripts/Dpkg/Vendor/Debian.pm
@@ -174,7 +174,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