X-Git-Url: https://git.deb.at/?p=deb%2Fpackages.git;a=blobdiff_plain;f=bin%2Fparse-contents;h=12b7ed824a40dbb933d0bc7b7a10e675153b9081;hp=550b6eeafeb5c01883a4dc7258c6ce3c0cab7ca9;hb=56d4b3ed57e20359e5ea46feabb850cf4a94caf2;hpb=5eaeeea2aae68dd37e728d66e7d1e2458e6e7a33 diff --git a/bin/parse-contents b/bin/parse-contents index 550b6ee..12b7ed8 100755 --- a/bin/parse-contents +++ b/bin/parse-contents @@ -22,6 +22,8 @@ use strict; use lib './lib'; +$| = 1; + # Important, we want sorting and such to happen like in the C locale: binary, # without any fancy collation. FIXME: is this actually adequate? $ENV{"LC_ALL"} = 'C'; @@ -35,6 +37,7 @@ my $SORT_REVERSE_CONCURRENTLY = 1; use DB_File; use Storable; +use File::Path; use Packages::Config qw( $TOPDIR $DBDIR @ARCHIVES @SUITES @ARCHITECTURES ); &Packages::Config::init( './' ); @@ -43,6 +46,7 @@ my @suites = @SUITES; my @archs = @ARCHITECTURES; $DBDIR .= "/contents"; +-d $DBDIR || mkpath( $DBDIR ); for my $archive (@archives) { for my $suite (@suites) { @@ -64,9 +68,10 @@ for my $archive (@archives) { for my $suite (@suites) { $extra = "|sort" if $SORT_REVERSE_CONCURRENTLY; open REVERSED, "$extra>$DBDIR/reverse.tmp" - or die "Failed to open output reverse file"; + or die "Failed to open output reverse file: $!"; - open CONT, "zcat $filename|$what"; + open CONT, "zcat $filename|$what" + or die $!; while () {last if /^FILE/mo;} while () { my $data = "";