X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=bin%2Fparse-contents;h=1f4f58d9aea8f414201bd6f894fd694d3ddf25d3;hb=423d06ae0e7bc1609a0aa1e8bbc2b4dfe93a62de;hp=f7fa9a44d3419166435ccb96d8e7311226812080;hpb=0b1112228d65f8030d1df4000aff29b62944d2bd;p=deb%2Fpackages.git diff --git a/bin/parse-contents b/bin/parse-contents index f7fa9a4..1f4f58d 100755 --- a/bin/parse-contents +++ b/bin/parse-contents @@ -38,6 +38,7 @@ use English; use DB_File; use Storable; use File::Path; +use File::Basename; use Packages::CommonCode qw(:all); use Packages::Config qw( $TOPDIR $DBDIR @ARCHIVES @SUITES @ARCHITECTURES ); &Packages::Config::init( './' ); @@ -84,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 () { @@ -142,7 +145,7 @@ for my $suite (@suites) { activate($filelist_db); #FIXME: hardcoded archs. (debports has no contrib/non-free) if ($arch !~ m/^kfreebsd-.*$/) { - system("ln", "-sf", $filelist_db, + system("ln", "-sf", basename($filelist_db), "$DBDIR/filelists_${suite}_all.db") == 0 or die "Oops"; }