The following commit has been merged in the master branch:
commit fb82caee40a3b71d5a37735561398a086cc47fdf
Author: Raphaël Hertzog <[email protected]>
Date:   Sun Oct 31 11:09:37 2010 +0100

    dpkg-source: fail properly when debian/source/format is empty
    
    Reported-by: Eduard Bloch <[email protected]>

diff --git a/debian/changelog b/debian/changelog
index f156a95..5b4c7ac 100644
--- a/debian/changelog
+++ b/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).
 
diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl
index 4ae0c41..cca5430 100755
--- a/scripts/dpkg-source.pl
+++ b/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, " .

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to