[debrepatch] 01/01: toolchain-patches: dpkg: update

Ximin Luo infinity0 at debian.org
Mon Oct 16 13:32:50 UTC 2017


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

infinity0 pushed a commit to branch master
in repository debrepatch.

commit 90cc8e3970559689457dfe234d171077cb49a7f5
Author: Ximin Luo <infinity0 at debian.org>
Date:   Mon Oct 16 15:32:36 2017 +0200

    toolchain-patches: dpkg: update
---
 toolchain-patches/dpkg_BPPM.patch | 166 ++++++++++++++++++++++++++------------
 1 file changed, 114 insertions(+), 52 deletions(-)

diff --git a/toolchain-patches/dpkg_BPPM.patch b/toolchain-patches/dpkg_BPPM.patch
index 6c9ec0d..0bfe401 100644
--- a/toolchain-patches/dpkg_BPPM.patch
+++ b/toolchain-patches/dpkg_BPPM.patch
@@ -1,48 +1,103 @@
-From 6bac6d8a6c0aa697ae084e696d3d2c40c7e68771 Mon Sep 17 00:00:00 2001
+From 9cb8b730d5672b3f3531d543c8fdd85cabd1e5da Mon Sep 17 00:00:00 2001
 From: Ximin Luo <infinity0 at debian.org>
-Date: Sat, 1 Apr 2017 10:02:40 -0400
-Subject: [PATCH] BUILD_PATH_PREFIX_MAP
+Date: Fri, 7 Apr 2017 17:04:26 +0200
+Subject: [PATCH] Support BUILD_PATH_PREFIX_MAP
+ https://reproducible-builds.org/specs/build-path-prefix-map/
 
 ---
- debian/changelog              |  6 +++---
- scripts/Dpkg/Path.pm          | 17 +++++++++++++++++
+ debian/changelog              | 13 +++++++++++++
+ man/dpkg-buildflags.man       |  8 ++++++--
+ man/dpkg-buildpackage.man     |  9 +++++++++
+ scripts/Dpkg/Path.pm          | 29 +++++++++++++++++++++++++++++
  scripts/Dpkg/Vendor/Debian.pm |  2 +-
- scripts/dpkg-buildpackage.pl  |  4 +++-
+ scripts/dpkg-buildpackage.pl  |  5 ++++-
  scripts/dpkg-genbuildinfo.pl  |  5 ++++-
- scripts/dpkg-source.pl        |  3 +++
  scripts/mk/pkg-info.mk        | 15 ++++++++++++++-
- 7 files changed, 45 insertions(+), 7 deletions(-)
+ scripts/t/dpkg_buildpackage.t |  1 +
+ 9 files changed, 81 insertions(+), 6 deletions(-)
 
 diff --git a/debian/changelog b/debian/changelog
-index 374573c..97918d8 100644
+index 6538c61eb..886a4cbbb 100644
 --- a/debian/changelog
 +++ b/debian/changelog
-@@ -1,2 +1,8 @@
-+dpkg (1.18.23.0~reproducible1) UNRELEASED; urgency=medium
+@@ -1,3 +1,16 @@
++dpkg (1.18.23.0~reproducible2) unstable; urgency=medium
 +
-+  * BUILD_PATH_PREFIX_MAP
++  * dpkg-buildpackage: Append ${pkg}_${ver} to the BUILD_PATH_PREFIX_MAP envvar
++    as described by https://reproducible-builds.org/specs/build-path-prefix-map/
++  * dpkg-buildflags: Don't set -fdebug-prefix-map by default, and explain why
++    in the documentation.
++  * dpkg-genbuildinfo: Also whitelist the BUILD_PATH_PREFIX_MAP envvar when
++    build-paths are requested to be written in the buildinfo.
++  * pkg-info.mk: Set and export the BUILD_PATH_PREFIX_MAP envvar, as described
++    by the aforementioned specification.
 +
 + -- Ximin Luo <infinity0 at debian.org>  Fri, 31 Mar 2017 15:58:56 -0400
 +
  dpkg (1.18.23) unstable; urgency=medium
  
+   * Handle unmatched arch-qualified virtual packages in dpkg-genbuildinfo,
+diff --git a/man/dpkg-buildflags.man b/man/dpkg-buildflags.man
+index 60f67a5ce..57bb1b8d1 100644
+--- a/man/dpkg-buildflags.man
++++ b/man/dpkg-buildflags.man
+@@ -427,13 +427,17 @@ This will cause warnings when the \fB__TIME__\fP, \fB__DATE__\fP and
+ .
+ .TP
+ .B fixdebugpath
+-This setting (enabled by default) adds
++This setting (disabled by default) adds
+ .BI \-fdebug\-prefix\-map= BUILDPATH =.
+ to \fBCFLAGS\fP, \fBCXXFLAGS\fP, \fBOBJCFLAGS\fP, \fBOBJCXXFLAGS\fP,
+ \fBGCJFLAGS\fP, \fBFFLAGS\fP and \fBFCFLAGS\fP where \fBBUILDPATH\fP is
+ set to the top-level directory of the package being built.
+ This has the effect of removing the build path from any generated debug
+-symbols.
++symbols.  However, other build tools may save these flags into other
++parts of the build output, thereby causing the overall package to be
++unreproducible again - which is why this setting is disabled by default.
++A newer better alternative is \fBBUILD_PATH_PREFIX_MAP\fP, which is set
++automatically by \fBdpkg-buildpackage\fP(1).
+ .
+ .SH ENVIRONMENT
+ There are 2 sets of environment variables doing the same operations, the
+diff --git a/man/dpkg-buildpackage.man b/man/dpkg-buildpackage.man
+index 79aa18f58..4d4be4f5c 100644
+--- a/man/dpkg-buildpackage.man
++++ b/man/dpkg-buildpackage.man
+@@ -519,6 +519,15 @@ option is integrated in the build environment.
+ This variable is set to the Unix timestamp since the epoch of the
+ latest entry in \fIdebian/changelog\fP, if it is not already defined.
+ .
++.TP
++.B BUILD_PATH_PREFIX_MAP
++This variable has the value
++\fIsource-name\fP\fB_\fP\fIsource-version\fP\fB=\fP\fIBUILDPATH\fP
++appended onto it, prepended by \fB:\fP if the old value was non-empty.
++\fIsource-name\fP and \fIsource-version\fP are further encoded by
++replacing \fB%\fP with \fB%#\fP, \fB=\fP with \fB%+\fP, and \fB:\fP with
++\fB%.\fP.
++.
+ .SH FILES
+ .TP
+ .I %PKGCONFDIR%/buildpackage.conf
 diff --git a/scripts/Dpkg/Path.pm b/scripts/Dpkg/Path.pm
-index f352cac..058ac85 100644
+index f352cac35..0443ca7fe 100644
 --- a/scripts/Dpkg/Path.pm
 +++ b/scripts/Dpkg/Path.pm
 @@ -30,6 +30,7 @@ our @EXPORT_OK = qw(
      get_pkg_root_dir
      guess_pkg_root_dir
      relative_to_pkg_root
-+    bppm_append
++    path_prefix_map_append
  );
  
  use Exporter qw(import);
-@@ -277,6 +278,22 @@ sub find_build_file($) {
+@@ -277,6 +278,34 @@ sub find_build_file($) {
      return;
  }
  
-+sub bppm_enquote {
++sub path_prefix_map_enquote {
 +    my $part = shift;
 +    $part =~ s/%/%#/g;
 +    $part =~ s/=/%+/g;
@@ -50,19 +105,31 @@ index f352cac..058ac85 100644
 +    return $part;
 +}
 +
-+sub bppm_append($$) {
++=item $var = path_prefix_map_append($var, $dst, $src)
++
++Appends a new mapping "$dst=$src" onto the encoded prefix map in $var,
++according to the C<BUILD_PATH_PREFIX_MAP>
++L<specification|https://reproducible-builds.org/specs/build-path-prefix-map/>.
++$dst and $src are encoded as described therein, namely with
++
++    "%" substrings replaced by "%#"
++    "=" substrings replaced by "%+"
++    ":" substrings replaced by "%."
++
++=cut
++sub path_prefix_map_append($$$) {
++    my $curmap = shift;
 +    my $dst = shift;
 +    my $src = shift;
-+    my $curmap = $ENV{"BUILD_PATH_PREFIX_MAP"};
-+    $ENV{"BUILD_PATH_PREFIX_MAP"} = ($curmap ? $curmap . ":" : "") .
-+        bppm_enquote($dst) . "=" . bppm_enquote($src);
++    return (length($curmap) ? $curmap . ":" : "") .
++        path_prefix_map_enquote($dst) . "=" . path_prefix_map_enquote($src);
 +}
 +
  =back
  
  =head1 CHANGES
 diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
-index 091ec42..2562b29 100644
+index 091ec42ad..2562b29e0 100644
 --- a/scripts/Dpkg/Vendor/Debian.pm
 +++ b/scripts/Dpkg/Vendor/Debian.pm
 @@ -145,7 +145,7 @@ sub _add_reproducible_flags {
@@ -75,29 +142,30 @@ index 091ec42..2562b29 100644
  
      my $build_path;
 diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
-index 2eea203..0543205 100755
+index 2eea20391..9f5f3dc40 100755
 --- a/scripts/dpkg-buildpackage.pl
 +++ b/scripts/dpkg-buildpackage.pl
-@@ -43,7 +43,7 @@
+@@ -43,7 +43,7 @@ use Dpkg::Version;
  use Dpkg::Control;
  use Dpkg::Control::Info;
  use Dpkg::Changelog::Parse;
 -use Dpkg::Path qw(find_command);
-+use Dpkg::Path qw(find_command bppm_append);
++use Dpkg::Path qw(find_command path_prefix_map_append);
  use Dpkg::IPC;
  
  textdomain('dpkg-dev');
-@@ -449,6 +449,8 @@ sub usage {
+@@ -449,6 +449,9 @@ if ($changedby) {
  
  # <https://reproducible-builds.org/specs/source-date-epoch/>
  $ENV{SOURCE_DATE_EPOCH} ||= $changelog->{timestamp} || time;
 +# <https://reproducible-builds.org/specs/build-path-prefix-map/>
-+bppm_append("${pkg}_${version}", $cwd);
++$ENV{"BUILD_PATH_PREFIX_MAP"} = path_prefix_map_append(
++    $ENV{"BUILD_PATH_PREFIX_MAP"}, "${pkg}_${version}", $cwd);
  
  my @arch_opts;
  push @arch_opts, ('--host-arch', $host_arch) if $host_arch;
 diff --git a/scripts/dpkg-genbuildinfo.pl b/scripts/dpkg-genbuildinfo.pl
-index 27bf7dc..1e2d056 100755
+index 27bf7dcef..1e2d056ed 100755
 --- a/scripts/dpkg-genbuildinfo.pl
 +++ b/scripts/dpkg-genbuildinfo.pl
 @@ -249,11 +249,14 @@ sub collect_installed_builddeps {
@@ -116,29 +184,8 @@ index 27bf7dc..1e2d056 100755
  
      # Record flags from dpkg-buildflags.
      my $bf = Dpkg::BuildFlags->new();
-diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl
-index dbb182f..c5fcaaa 100755
---- a/scripts/dpkg-source.pl
-+++ b/scripts/dpkg-source.pl
-@@ -48,6 +48,7 @@
- use Dpkg::Version;
- use Dpkg::Vars;
- use Dpkg::Changelog::Parse;
-+use Dpkg::Path qw(bppm_append);
- use Dpkg::Source::Package qw(get_default_diff_ignore_regex
-                              set_default_diff_ignore_regex
-                              get_default_tar_ignore_pattern);
-@@ -238,6 +239,8 @@
- 
-     # <https://reproducible-builds.org/specs/source-date-epoch/>
-     $ENV{SOURCE_DATE_EPOCH} ||= $changelog->{timestamp} || time;
-+    # <https://reproducible-builds.org/specs/build-path-prefix-map/>
-+    bppm_append($changelog->{source} . "_" . $changelog->{version}, Cwd::abs_path($dir));
- 
-     my $srcpkg = Dpkg::Source::Package->new(options => \%options);
-     my $fields = $srcpkg->{fields};
 diff --git a/scripts/mk/pkg-info.mk b/scripts/mk/pkg-info.mk
-index 15322ce..ae2ce03 100644
+index 15322cedd..6f42d3292 100644
 --- a/scripts/mk/pkg-info.mk
 +++ b/scripts/mk/pkg-info.mk
 @@ -9,6 +9,10 @@
@@ -159,12 +206,27 @@ index 15322ce..ae2ce03 100644
 -
  export SOURCE_DATE_EPOCH
 +
-+bppm_enquote = $(subst :,%.,$(subst =,%+,$(subst %,%\#,$(1))))
++path_prefix_map_enquote = $(subst :,%.,$(subst =,%+,$(subst %,%\#,$(1))))
 +BUILD_PATH_PREFIX_MAP ?= $(call dpkg_late_eval,BUILD_PATH_PREFIX_MAP,echo\
 +"$${BUILD_PATH_PREFIX_MAP:+$$BUILD_PATH_PREFIX_MAP:}"$(call\
-+bppm_enquote,$(DEB_SOURCE)_$(DEB_VERSION))=$(call\
-+bppm_enquote,$(CURDIR)))
++path_prefix_map_enquote,$(DEB_SOURCE)_$(DEB_VERSION))=$(call\
++path_prefix_map_enquote,$(CURDIR)))
 +export BUILD_PATH_PREFIX_MAP
 +
 +# FIXME: "export" makes dpkg_late_eval completely pointless since it forces
 +# evaluation. This is true for both SOURCE_DATE_EPOCH and BUILD_PATH_PREFIX_MAP
+diff --git a/scripts/t/dpkg_buildpackage.t b/scripts/t/dpkg_buildpackage.t
+index faae2cba4..6f6a2ef07 100644
+--- a/scripts/t/dpkg_buildpackage.t
++++ b/scripts/t/dpkg_buildpackage.t
+@@ -44,6 +44,7 @@ delete $ENV{MAKEFLAGS};
+ 
+ # Delete variables that can affect the tests.
+ delete $ENV{SOURCE_DATE_EPOCH};
++delete $ENV{BUILD_PATH_PREFIX_MAP};
+ 
+ # Delete other variables that can affect the tests.
+ delete $ENV{$_} foreach grep { m/^DEB_/ } keys %ENV;
+-- 
+2.14.2
+

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



More information about the Reproducible-commits mailing list