X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=bin%2Fparse-contents;h=26f715108530bc1e4ea80e123c018bddc6287a37;hb=7484a3adc951c00fd18c530bb88007b5d4632808;hp=2ee39d71b88e62517410d2378bdfe1e3ca988ed7;hpb=d73f83ba4ee2e4bfaee23913fc1e4cae2c4aaea8;p=deb%2Fpackages.git diff --git a/bin/parse-contents b/bin/parse-contents index 2ee39d7..26f7151 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,9 @@ for my $suite (@suites) { rename("$DBDIR/reverse.tmp", "$DBDIR/reverse_${suite}_${arch}.txt"); activate($filelist_db); - #FIXME: hardcoded archs. (gnuab has no contrib/non-free) - if ($arch !~ m/^(armel|kfreebsd-.*)$/) { - system("ln", "-sf", $filelist_db, + #FIXME: hardcoded archs. (debports has no contrib/non-free) + if ($arch ne 'm68k') { + system("ln", "-sf", basename($filelist_db), "$DBDIR/filelists_${suite}_all.db") == 0 or die "Oops"; }