Просмотр исходного кода

dpkg-genchanges: Fix check for expected number of binary artifacts

Only count the binaries that we are going to include in the upload,
instead of guessing using implicit counts.
Guillem Jover лет назад: 9
Родитель
Сommit
c9b4ec6a1d
2 измененных файлов с 8 добавлено и 5 удалено
  1. 2 0
      debian/changelog
  2. 6 5
      scripts/dpkg-genchanges.pl

+ 2 - 0
debian/changelog

@@ -33,6 +33,8 @@ dpkg (1.18.19) UNRELEASED; urgency=medium
   * Do not compute the architecture list twice in dpkg-genchanges.
   * Include .buildinfo files also for source-only uploads in dpkg-genchanges.
     Closes: #846164
+  * Fix check for expected number of binary artifacts in dpkg-genchanges, to
+    only take into account the artifacts that we are distributing.
   * Portability:
     - On GNU/Hurd try to use the new process executable name attribute from
       libps, to properly match on start-stop-daemon --exec.

+ 6 - 5
scripts/dpkg-genchanges.pl

@@ -303,12 +303,9 @@ if (build_has_any(BUILD_SOURCE)) {
     $origsrcmsg = g_('binary-only upload (no source code included)');
 }
 
-my $dist_count = 0;
+my $dist_binaries = 0;
 
-$dist_count = $dist->load($fileslistfile) if -e $fileslistfile;
-
-error(g_('binary build with no binary artifacts found; cannot distribute'))
-    if build_has_any(BUILD_BINARY) && $dist_count == 0;
+$dist->load($fileslistfile) if -e $fileslistfile;
 
 foreach my $file ($dist->get_files()) {
     my $f = $file->{filename};
@@ -336,8 +333,12 @@ foreach my $file ($dist->get_files()) {
     }
 
     $checksums->add_from_file("$uploadfilesdir/$f", key => $f);
+    $dist_binaries++;
 }
 
+error(g_('binary build with no binary artifacts found; cannot distribute'))
+    if build_has_any(BUILD_BINARY) && $dist_binaries == 0;
+
 # Scan control info of all binary packages
 foreach my $pkg ($control->get_packages()) {
     my $p = $pkg->{'Package'};