[dpkg] 66/192: dpkg-genbuildinfo: Always use the binary version for the .buildinfo filename

Ximin Luo infinity0 at debian.org
Tue Oct 17 11:03:59 UTC 2017


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

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

commit f02d4572568398a55503351d9e5d04212a4207fc
Author: Guillem Jover <guillem at debian.org>
Date:   Wed Jul 5 16:33:41 2017 +0200

    dpkg-genbuildinfo: Always use the binary version for the .buildinfo filename
    
    We should use the binary (instead of the source) version for the
    .buildinfo filename, otherwise on binNMUs the filename will be wrong.
    
    Reported-by: Raphaël Hertzog <hertzog at debian.org>
---
 debian/changelog             | 2 ++
 man/deb-buildinfo.man        | 4 ++--
 man/dpkg-buildpackage.man    | 4 ++--
 man/dpkg-genbuildinfo.man    | 2 +-
 scripts/dpkg-genbuildinfo.pl | 5 +++--
 5 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 79a1cfd..0487b55 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ dpkg (1.19.0) UNRELEASED; urgency=medium
     -u and -c correctly. Reported by Bodo Eggert <7eggert at online.de>.
   * Cache the result of «dpkg-query --control-path» calls in dpkg-shlibdeps.
     Based on a patch by Niels Thykier <niels at thykier.net>. Closes: #846405
+  * Always use the binary version for the .buildinfo filename in
+    dpkg-genbuildinfo. Reported by Raphaël Hertzog <hertzog at debian.org>.
   * Perl modules:
     - Switch from Dpkg::Util to List::Util, now that the module in the
       new required Perl contains the needed functions.
diff --git a/man/deb-buildinfo.man b/man/deb-buildinfo.man
index 60109ba..82a7fc7 100644
--- a/man/deb-buildinfo.man
+++ b/man/deb-buildinfo.man
@@ -49,9 +49,9 @@ as specified in RFC4880.
 The name of the \fB.buildinfo\fP file will depend on the type of build and
 will be as specific as necessary but not more;
 for a build that includes \fBany\fP the name will be
-\fIsource-name\fP\fB_\fP\fIsource-version\fP\fB_\fP\fIarch\fP\fB.buildinfo\fP,
+\fIsource-name\fP\fB_\fP\fIbinary-version\fP\fB_\fP\fIarch\fP\fB.buildinfo\fP,
 or otherwise for a build that includes \fBall\fP the name will be
-\fIsource-name\fP\fB_\fP\fIsource-version\fP\fB_\fP\fBall.buildinfo\fP,
+\fIsource-name\fP\fB_\fP\fIbinary-version\fP\fB_\fP\fBall.buildinfo\fP,
 or otherwise for a build that includes \fBsource\fP the name will be
 \fIsource-name\fP\fB_\fP\fIsource-version\fP\fB_\fP\fBsource.buildinfo\fP.
 .
diff --git a/man/dpkg-buildpackage.man b/man/dpkg-buildpackage.man
index 49597b5..2b5983e 100644
--- a/man/dpkg-buildpackage.man
+++ b/man/dpkg-buildpackage.man
@@ -73,9 +73,9 @@ generate a \fB.changes\fP file.
 The name of the \fB.changes\fP file will depend on the type of build and
 will be as specific as necessary but not more;
 for a build that includes \fBany\fP the name will be
-\fIsource-name\fP\fB_\fP\fIsource-version\fP\fB_\fP\fIarch\fP\fB.changes\fP,
+\fIsource-name\fP\fB_\fP\fIbinary-version\fP\fB_\fP\fIarch\fP\fB.changes\fP,
 or otherwise for a build that includes \fBall\fP the name will be
-\fIsource-name\fP\fB_\fP\fIsource-version\fP\fB_\fP\fBall.changes\fP,
+\fIsource-name\fP\fB_\fP\fIbinary-version\fP\fB_\fP\fBall.changes\fP,
 or otherwise for a build that includes \fBsource\fP the name will be
 \fIsource-name\fP\fB_\fP\fIsource-version\fP\fB_\fP\fBsource.changes\fP.
 Many \fBdpkg\-buildpackage\fP options are forwarded to
diff --git a/man/dpkg-genbuildinfo.man b/man/dpkg-genbuildinfo.man
index 98f9107..aaf54a3 100644
--- a/man/dpkg-genbuildinfo.man
+++ b/man/dpkg-genbuildinfo.man
@@ -92,7 +92,7 @@ for information about alternative formats.
 .BR \-O [\fIfilename\fP]
 Print the buildinfo file to standard output (or \fIfilename\fP if specified)
 rather than to
-.IB dir / source-name _ source-version _ arch .buildinfo
+.IB dir / source-name _ binary-version _ arch .buildinfo
 (where \fIdir\fP is \fB..\fP by default or \fIupload-files-dir\fP
 if \fB\-u\fP was used).
 .TP
diff --git a/scripts/dpkg-genbuildinfo.pl b/scripts/dpkg-genbuildinfo.pl
index be4ca97..d1da726 100755
--- a/scripts/dpkg-genbuildinfo.pl
+++ b/scripts/dpkg-genbuildinfo.pl
@@ -356,7 +356,7 @@ my $prev_changelog = changelog_parse(%options);
 
 my $sourceversion = $changelog->{'Binary-Only'} ?
                     $prev_changelog->{'Version'} : $changelog->{'Version'};
-my $binaryversion = $changelog->{'Version'};
+my $binaryversion = Dpkg::Version->new($changelog->{'Version'});
 
 # Include .dsc if available.
 my $spackage = $changelog->{'Source'};
@@ -451,7 +451,8 @@ if ($stdout) {
         $arch = 'source';
     }
 
-    $buildinfo = "${spackage}_${sversion}_${arch}.buildinfo";
+    my $bversion = $binaryversion->as_string(omit_epoch => 1);
+    $buildinfo = "${spackage}_${bversion}_${arch}.buildinfo";
     $outputfile = "$uploadfilesdir/$buildinfo";
 }
 

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