X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=bin%2Fparse-contents;h=22a72e8b507a5ae9adfd8219da3be4b1cf0e2c88;hb=5db229e24c1403bdb4f49ba1f7d463c8e4a274af;hp=2ee39d71b88e62517410d2378bdfe1e3ca988ed7;hpb=c38147cababd110747a260727ba28a4c4f2463e1;p=deb%2Fpackages.git diff --git a/bin/parse-contents b/bin/parse-contents index 2ee39d7..22a72e8 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( './' ); @@ -45,6 +46,8 @@ use Packages::Config qw( $TOPDIR $DBDIR @ARCHIVES @SUITES @ARCHITECTURES ); my @archives = @ARCHIVES; my @suites = @SUITES; my @archs = @ARCHITECTURES; +my %deborts_hash; +@deborts_hash{qw( avr32 m68k powerpcspe sh4 sparc64 )} = (); $DBDIR .= "/contents"; mkdirp( $DBDIR ); @@ -84,9 +87,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 +145,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 (not exists $deborts_hash{$arch}) { + system("ln", "-sf", basename($filelist_db), "$DBDIR/filelists_${suite}_all.db") == 0 or die "Oops"; }