浏览代码

Merge branch 'master' of ssh://git.debian.org/git/dpkg/dpkg

Christian PERRIER 15 年之前
父节点
当前提交
e6b7685a54
共有 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");