]> git.deb.at Git - deb/packages.git/commitdiff
[UBUNTU] Handle empty Contents files with headers gracefully
authorFrank Lichtenheld <frank@lichtenheld.de>
Tue, 10 Jun 2008 21:29:10 +0000 (22:29 +0100)
committerFrank Lichtenheld <frank@lichtenheld.de>
Tue, 10 Jun 2008 21:29:10 +0000 (22:29 +0100)
The Contents files for dapper currently have headers but no
actual content. Handle this case without spewing out a lot
of warnings.

bin/parse-contents

index 82df0b87b74341795df60a232670cd17ded0b9fc..1f4f58d9aea8f414201bd6f894fd694d3ddf25d3 100755 (executable)
@@ -85,9 +85,11 @@ for my $suite (@suites) {
 
                open CONT, "zcat $filename|$what"
                    or die $!;
-               while (<CONT>) { last if /^FILE/mo; }
-               if (eof(CONT)) { # no header found
+               my $header_found = 0;
+               while (<CONT>) { /^FILE/mo && do { $header_found = 1; last };}
+               if (eof(CONT)) { # no header found or only header found
                    close CONT; # explicit close to reset $.
+                   next if $header_found;
                    open CONT, "zcat $filename|$what";
                }
                while (<CONT>) {