Prechádzať zdrojové kódy

dpkg-genchanges: Clarify error message on binary builds w/o binaries

Only load the files list file if it exists, so that we can check if
there's any binary file being distributed.

When all binary packages are for different architectures than the
requested one, and no additional files have been shipped for
distribution (via dpkg-distaddfile), we should error out early and
with a better and more clear error, than just "no files list file found".

Closes: #726520
Guillem Jover 12 rokov pred
rodič
commit
9947ec14e5
2 zmenil súbory, kde vykonal 8 pridanie a 1 odobranie
  1. 2 0
      debian/changelog
  2. 6 1
      scripts/dpkg-genchanges.pl

+ 2 - 0
debian/changelog

@@ -25,6 +25,8 @@ dpkg (1.17.7) UNRELEASED; urgency=low
     Closes: #735975
     Closes: #735975
   * Do not generate perl warnings on undef versions in
   * Do not generate perl warnings on undef versions in
     Dpkg::Deps::deps_compare(). See: #737731
     Dpkg::Deps::deps_compare(). See: #737731
+  * Clarify dpkg-genchanges error message on binary builds without any binary
+    artifact built. Closes: #726520
 
 
   [ Updated dpkg translations ]
   [ Updated dpkg translations ]
   * German (Sven Joachim).
   * German (Sven Joachim).

+ 6 - 1
scripts/dpkg-genchanges.pl

@@ -240,7 +240,12 @@ if (defined($prev_changelog) and
 my $dist = Dpkg::Dist::Files->new();
 my $dist = Dpkg::Dist::Files->new();
 
 
 if (not is_sourceonly) {
 if (not is_sourceonly) {
-    $dist->load($fileslistfile);
+    my $dist_count = 0;
+
+    $dist_count = $dist->load($fileslistfile) if -e $fileslistfile;
+
+    error(_g('binary build with no binary artifacts found; cannot distribute'))
+        if $dist_count == 0;
 
 
     foreach my $file ($dist->get_files()) {
     foreach my $file ($dist->get_files()) {
         if (defined $file->{package} && $file->{package_type} =~ m/^u?deb$/) {
         if (defined $file->{package} && $file->{package_type} =~ m/^u?deb$/) {