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

dpkg-source: fail properly when debian/source/format is empty

Reported-by: Eduard Bloch <blade@debian.org>
Raphaël Hertzog лет назад: 15
Родитель
Сommit
fb82caee40
2 измененных файлов с 6 добавлено и 1 удалено
  1. 3 0
      debian/changelog
  2. 3 1
      scripts/dpkg-source.pl

+ 3 - 0
debian/changelog

@@ -3,6 +3,9 @@ dpkg (1.16.0) UNRELEASED; urgency=low
   [ Guillem Jover ]
   * Fix realloc usage on compat scandir() implementation.
 
+  [ Raphaël Hertzog ]
+  * Fail properly when debian/source/format is empty. Closes: #600854
+
   [ Updated programs translations ]
   * Swedish (Peter Krefting).
 

+ 3 - 1
scripts/dpkg-source.pl

@@ -308,7 +308,9 @@ if ($options{'opmode'} =~ /^(-b|--print-format|--(before|after)-build)$/) {
 	    open(FORMAT, "<", "$dir/debian/source/format") ||
 		syserr(_g("cannot read %s"), "$dir/debian/source/format");
 	    $build_format = <FORMAT>;
-	    chomp($build_format);
+	    chomp($build_format) if defined $build_format;
+	    error(_g("%s is empty"), "$dir/debian/source/format")
+		unless defined $build_format and length $build_format;
 	    close(FORMAT);
 	} else {
 	    warning(_g("no source format specified in %s, " .