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

dpkg-source: improve the error message "no orig.tar file found"

Now we include the template corresponding to files that we try to look
for.
Raphaël Hertzog лет назад: 15
Родитель
Сommit
7627d80274
2 измененных файлов с 15 добавлено и 2 удалено
  1. 2 0
      debian/changelog
  2. 13 2
      scripts/Dpkg/Source/Package/V2.pm

+ 2 - 0
debian/changelog

@@ -77,6 +77,8 @@ dpkg (1.16.1) UNRELEASED; urgency=low
   * Fix update-alternatives to not remove a real file when dropping a
     symlink for a slave that's not provided by the new current choice.
     Closes: #633627
+  * Improve dpkg-source's error message complaining about the lack
+    of the upstream tarball. Closes: #634510
 
   [ Guillem Jover ]
   * Install deb-src-control(5) man pages in dpkg-dev. Closes: #620520

+ 13 - 2
scripts/Dpkg/Source/Package/V2.pm

@@ -239,12 +239,22 @@ sub unapply_patches {
     unlink($applied);
 }
 
+sub upstream_tarball_template {
+    my ($self) = @_;
+    my $ext = "{" . join(",",
+        sort map {
+            compression_get_property($_, "file_ext")
+        } compression_get_list()) . "}";
+    return "../" . $self->get_basename() . ".orig.tar.$ext";
+}
+
 sub can_build {
     my ($self, $dir) = @_;
     return 1 if $self->find_original_tarballs(include_supplementary => 0);
     return 1 if $self->{'options'}{'create_empty_orig'} and
                 $self->find_original_tarballs(include_main => 0);
-    return (0, _g("no orig.tar file found"));
+    return (0, sprintf(_g("no upstream tarball found at %s"),
+                       $self->upstream_tarball_template()));
 }
 
 sub before_build {
@@ -336,7 +346,8 @@ sub do_build {
         }
     }
 
-    error(_g("no orig.tar file found")) unless $tarfile;
+    error(_g("no upstream tarball found at %s"),
+          $self->upstream_tarball_template()) unless $tarfile;
 
     info(_g("building %s using existing %s"),
 	 $sourcepackage, "@origtarballs");