]> git.deb.at Git - deb/packages.git/blobdiff - bin/parse-contents
Merge branch 'master' into ubuntu-master
[deb/packages.git] / bin / parse-contents
index ab7df273fb3a20f16fd4e483712bbbcd82836324..22a72e8b507a5ae9adfd8219da3be4b1cf0e2c88 100755 (executable)
@@ -87,9 +87,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>) {