Explorar o código

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

Reported-by: Eduard Bloch <blade@debian.org>
Raphaël Hertzog %!s(int64=15) %!d(string=hai) anos
pai
achega
fb82caee40
Modificáronse 2 ficheiros con 6 adicións e 1 borrados
  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 ]
   [ Guillem Jover ]
   * Fix realloc usage on compat scandir() implementation.
   * Fix realloc usage on compat scandir() implementation.
 
 
+  [ Raphaël Hertzog ]
+  * Fail properly when debian/source/format is empty. Closes: #600854
+
   [ Updated programs translations ]
   [ Updated programs translations ]
   * Swedish (Peter Krefting).
   * 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") ||
 	    open(FORMAT, "<", "$dir/debian/source/format") ||
 		syserr(_g("cannot read %s"), "$dir/debian/source/format");
 		syserr(_g("cannot read %s"), "$dir/debian/source/format");
 	    $build_format = <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);
 	    close(FORMAT);
 	} else {
 	} else {
 	    warning(_g("no source format specified in %s, " .
 	    warning(_g("no source format specified in %s, " .