From: Frank Lichtenheld Date: Tue, 10 Jun 2008 21:29:10 +0000 (+0100) Subject: [UBUNTU] Handle empty Contents files with headers gracefully X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=423d06ae0e7bc1609a0aa1e8bbc2b4dfe93a62de;p=deb%2Fpackages.git [UBUNTU] Handle empty Contents files with headers gracefully The Contents files for dapper currently have headers but no actual content. Handle this case without spewing out a lot of warnings. --- diff --git a/bin/parse-contents b/bin/parse-contents index 82df0b8..1f4f58d 100755 --- a/bin/parse-contents +++ b/bin/parse-contents @@ -85,9 +85,11 @@ for my $suite (@suites) { open CONT, "zcat $filename|$what" or die $!; - while () { last if /^FILE/mo; } - if (eof(CONT)) { # no header found + my $header_found = 0; + while () { /^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 () {