X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=bin%2Fparse-contents;h=1f4f58d9aea8f414201bd6f894fd694d3ddf25d3;hb=655b2eb3a319370039897127a65666b536af901e;hp=c254375f10a9403d4d0bf27731020db03604b125;hpb=ba785a886ccbfb71d6ad84d0c615479939a0c62f;p=deb%2Fpackages.git diff --git a/bin/parse-contents b/bin/parse-contents index c254375..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 () { @@ -140,9 +143,12 @@ for my $suite (@suites) { rename("$DBDIR/reverse.tmp", "$DBDIR/reverse_${suite}_${arch}.txt"); activate($filelist_db); - system("ln", "-sf", $filelist_db, - "$DBDIR/filelists_${suite}_all.db") == 0 - or die "Oops"; + #FIXME: hardcoded archs. (debports has no contrib/non-free) + if ($arch !~ m/^kfreebsd-.*$/) { + system("ln", "-sf", basename($filelist_db), + "$DBDIR/filelists_${suite}_all.db") == 0 + or die "Oops"; + } } }