Forráskód Böngészése

dpkg-genchanges: Include .buildinfo files also for source-only uploads

The .buildinfo file also makes sense on source-only uploads, because it is
still a build. And more so when we have done a full build, but filtered the
changes to only include the sources in the upload.

In any case, this was the intended behavior from the beginning.

Closes: #846164
Guillem Jover 9 éve
szülő
commit
0701185eae

+ 2 - 0
debian/changelog

@@ -31,6 +31,8 @@ dpkg (1.18.19) UNRELEASED; urgency=medium
     architectures for artifacts we are not going to distribute, and do not
     architectures for artifacts we are not going to distribute, and do not
     unnecessarily recompute the checksums for artifacts like the sources.
     unnecessarily recompute the checksums for artifacts like the sources.
   * Do not compute the architecture list twice in dpkg-genchanges.
   * Do not compute the architecture list twice in dpkg-genchanges.
+  * Include .buildinfo files also for source-only uploads in dpkg-genchanges.
+    Closes: #846164
   * Portability:
   * Portability:
     - On GNU/Hurd try to use the new process executable name attribute from
     - On GNU/Hurd try to use the new process executable name attribute from
       libps, to properly match on start-stop-daemon --exec.
       libps, to properly match on start-stop-daemon --exec.

+ 6 - 0
scripts/dpkg-genchanges.pl

@@ -313,6 +313,12 @@ error(g_('binary build with no binary artifacts found; cannot distribute'))
 foreach my $file ($dist->get_files()) {
 foreach my $file ($dist->get_files()) {
     my $f = $file->{filename};
     my $f = $file->{filename};
 
 
+    if (defined $file->{package} && $file->{package_type} eq 'buildinfo') {
+        # We always distribute the .buildinfo file.
+        $checksums->add_from_file("$uploadfilesdir/$f", key => $f);
+        next;
+    }
+
     # If this is a source-only upload, ignore any other artifacts.
     # If this is a source-only upload, ignore any other artifacts.
     next if build_has_none(BUILD_BINARY);
     next if build_has_none(BUILD_BINARY);
 
 

+ 3 - 0
scripts/t/dpkg_buildpackage/test-source_0_source.changes

@@ -19,9 +19,12 @@ Changes:
 Checksums-Sha1:
 Checksums-Sha1:
  0000000000000000000000000000000000000000 0 test-source_0.dsc
  0000000000000000000000000000000000000000 0 test-source_0.dsc
  0000000000000000000000000000000000000000 0 test-source_0.tar.xz
  0000000000000000000000000000000000000000 0 test-source_0.tar.xz
+ 0000000000000000000000000000000000000000 0 test-source_0_source.buildinfo
 Checksums-Sha256:
 Checksums-Sha256:
  0000000000000000000000000000000000000000000000000000000000000000 0 test-source_0.dsc
  0000000000000000000000000000000000000000000000000000000000000000 0 test-source_0.dsc
  0000000000000000000000000000000000000000000000000000000000000000 0 test-source_0.tar.xz
  0000000000000000000000000000000000000000000000000000000000000000 0 test-source_0.tar.xz
+ 0000000000000000000000000000000000000000000000000000000000000000 0 test-source_0_source.buildinfo
 Files:
 Files:
  00000000000000000000000000000000 0 test optional test-source_0.dsc
  00000000000000000000000000000000 0 test optional test-source_0.dsc
  00000000000000000000000000000000 0 test optional test-source_0.tar.xz
  00000000000000000000000000000000 0 test optional test-source_0.tar.xz
+ 00000000000000000000000000000000 0 test optional test-source_0_source.buildinfo