This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch master in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=4a4619831de8b8972f86b489660dc98f187cfa34 commit 4a4619831de8b8972f86b489660dc98f187cfa34 Author: Guillem Jover <[email protected]> AuthorDate: Sat Nov 10 03:23:19 2018 +0100 dpkg-genchanges: Only reference binary packages being uploaded The .changes file describes an upload, and its Binary and Description fields should contain (as documented) only references to the packages being uploaded. In case of a source-only upload, the Binary and Description fields should be empty. Closes: #818618 --- debian/changelog | 3 +++ man/deb-changes.man | 4 +++- scripts/dpkg-genchanges.pl | 20 ++++++++++---------- .../t/dpkg_buildpackage/test-source_0_all.changes | 3 +-- .../t/dpkg_buildpackage/test-source_0_any.changes | 3 +-- .../t/dpkg_buildpackage/test-source_0_source.changes | 4 ---- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/debian/changelog b/debian/changelog index e34532939..c6c1e191a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,9 @@ dpkg (1.19.3) UNRELEASED; urgency=medium [ Guillem Jover ] * dpkg-source: Stop filtering @builddeps@ from Testsuite-Triggers field. Closes: #910734 + * dpkg-genchanges: Only reference binary packages being uploaded, which + means that for a source-only upload, the Binary and Description fields + should be empty. Closes: #818618 * Perl modules: - Dpkg::Changelog::Debian: Preserve modelines at EOF. Closes: #916056 Thanks to Chris Lamb <[email protected]> for initial test cases. diff --git a/man/deb-changes.man b/man/deb-changes.man index e1a43e4fa..be8f6d579 100644 --- a/man/deb-changes.man +++ b/man/deb-changes.man @@ -70,8 +70,9 @@ If the source version differs from the binary version, then the \fIsource-name\fP will be followed by a \fIsource-version\fP in parenthesis. This can happen when the upload is a binary-only non-maintainer upload. .TP -.BR Binary: " \fIbinary-package-list\fP (required)" +.BR Binary: " \fIbinary-package-list\fP (required in context)" This folded field is a space-separated list of binary packages to upload. +If the upload is source-only, then the field is omitted (since dpkg 1.19.3). .TP .BR Architecture: " \fIarch-list\fP" Lists the architectures of the files currently being uploaded. @@ -113,6 +114,7 @@ typically the person who prepared the package changes for this release. This multiline field contains a list of binary package names followed by a space, a dash (‘\fB\-\fP’) and their possibly truncated short descriptions. +If the upload is source-only, then the field is omitted (since dpkg 1.19.3). .TP .BI Closes: " bug-number-list" A space-separated list of bug report numbers that have been resolved with diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl index 690a4e59d..8def2f98f 100755 --- a/scripts/dpkg-genchanges.pl +++ b/scripts/dpkg-genchanges.pl @@ -353,15 +353,6 @@ foreach my $pkg ($control->get_packages()) { my $pkg_type = $pkg->{'Package-Type'} || $pkg->get_custom_field('Package-Type') || 'deb'; - my @f; # List of files for this binary package - push @f, @{$p2f{$p}} if defined $p2f{$p}; - - # Add description of all binary packages - $d = $substvars->substvars($d); - my $desc = encode_utf8(sprintf('%-10s - %-.65s', $p, decode_utf8($d))); - $desc .= " ($pkg_type)" if $pkg_type ne 'deb'; - push @descriptions, $desc; - my @restrictions; @restrictions = parse_build_profiles($bp) if defined $bp; @@ -379,6 +370,15 @@ foreach my $pkg ($control->get_packages()) { next; # and skip it } + # Add description of all binary packages + $d = $substvars->substvars($d); + my $desc = encode_utf8(sprintf('%-10s - %-.65s', $p, decode_utf8($d))); + $desc .= " ($pkg_type)" if $pkg_type ne 'deb'; + push @descriptions, $desc; + + # List of files for this binary package. + my @f = @{$p2f{$p}}; + foreach (keys %{$pkg}) { my $v = $pkg->{$_}; @@ -465,7 +465,7 @@ if (!defined($fields->{'Date'})) { setlocale(LC_TIME, ''); } -$fields->{'Binary'} = join(' ', map { $_->{'Package'} } $control->get_packages()); +$fields->{'Binary'} = join ' ', sort keys %p2f; # Avoid overly long line by splitting over multiple lines if (length($fields->{'Binary'}) > 980) { $fields->{'Binary'} =~ s/(.{0,980}) /$1\n/g; diff --git a/scripts/t/dpkg_buildpackage/test-source_0_all.changes b/scripts/t/dpkg_buildpackage/test-source_0_all.changes index ebe0890e2..c6c444f45 100644 --- a/scripts/t/dpkg_buildpackage/test-source_0_all.changes +++ b/scripts/t/dpkg_buildpackage/test-source_0_all.changes @@ -1,7 +1,7 @@ Format: 1.8 Date: Thu, 30 Jun 2016 20:15:12 +0200 Source: test-source -Binary: test-binary-all test-binary-any +Binary: test-binary-all Architecture: all Version: 0 Distribution: unstable @@ -10,7 +10,6 @@ Maintainer: Dpkg Developers <[email protected]> Changed-By: Dpkg Developers <[email protected]> Description: test-binary-all - architecture independent binary package - test-binary-any - architecture dependent binary package Closes: 12345 Changes: test-source (0) unstable; urgency=low diff --git a/scripts/t/dpkg_buildpackage/test-source_0_any.changes b/scripts/t/dpkg_buildpackage/test-source_0_any.changes index 098277f14..d67460cba 100644 --- a/scripts/t/dpkg_buildpackage/test-source_0_any.changes +++ b/scripts/t/dpkg_buildpackage/test-source_0_any.changes @@ -1,7 +1,7 @@ Format: 1.8 Date: Thu, 30 Jun 2016 20:15:12 +0200 Source: test-source -Binary: test-binary-all test-binary-any +Binary: test-binary-any Architecture: amd64 Version: 0 Distribution: unstable @@ -9,7 +9,6 @@ Urgency: low Maintainer: Dpkg Developers <[email protected]> Changed-By: Dpkg Developers <[email protected]> Description: - test-binary-all - architecture independent binary package test-binary-any - architecture dependent binary package Closes: 12345 Changes: diff --git a/scripts/t/dpkg_buildpackage/test-source_0_source.changes b/scripts/t/dpkg_buildpackage/test-source_0_source.changes index 95ea1be6a..8c2f3d1e3 100644 --- a/scripts/t/dpkg_buildpackage/test-source_0_source.changes +++ b/scripts/t/dpkg_buildpackage/test-source_0_source.changes @@ -1,16 +1,12 @@ Format: 1.8 Date: Thu, 30 Jun 2016 20:15:12 +0200 Source: test-source -Binary: test-binary-all test-binary-any Architecture: source Version: 0 Distribution: unstable Urgency: low Maintainer: Dpkg Developers <[email protected]> Changed-By: Dpkg Developers <[email protected]> -Description: - test-binary-all - architecture independent binary package - test-binary-any - architecture dependent binary package Closes: 12345 Changes: test-source (0) unstable; urgency=low -- Dpkg.Org's dpkg

