X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=bin%2Fparse-contents;h=ac88420da74c5834f7e4304533248509e355ac68;hb=0438ce5807cbe2ea9b8aeeb38f5f8a6565b0f3ac;hp=f7fa9a44d3419166435ccb96d8e7311226812080;hpb=4c6c02445d6bd955db66d82946b8c955b1f43615;p=deb%2Fpackages.git diff --git a/bin/parse-contents b/bin/parse-contents index f7fa9a4..ac88420 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 () { @@ -141,8 +144,8 @@ 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, + if ($arch ne 'avr32' and $arch ne 'm68k') { + system("ln", "-sf", basename($filelist_db), "$DBDIR/filelists_${suite}_all.db") == 0 or die "Oops"; }