]> git.deb.at Git - deb/packages.git/blobdiff - bin/parse-contents
parse-contents: Fix display of progress
[deb/packages.git] / bin / parse-contents
index 414dc8ac0a623c1f11e04154423881f033478cc7..b8cc8e4158a2b7cffb1566f09d674ac7f560796d 100755 (executable)
@@ -82,8 +82,11 @@ for my $suite (@suites) {
                
                open CONT, "zcat $filename|$what"
                    or die $!;
-               while (<CONT>) {last if /^FILE/mo;}
-               open CONT, "zcat $filename|$what" if eof(CONT);
+               while (<CONT>) { last if /^FILE/mo; }
+               if (eof(CONT)) { # no header found
+                   close CONT; # explicit close to reset $.
+                   open CONT, "zcat $filename|$what";
+               }
                while (<CONT>) {
                    my $data = "";
                    my %data = ();