From: Frank Lichtenheld Date: Tue, 14 Feb 2006 22:09:22 +0000 (+0000) Subject: Create DBDIR if it doesn't exist X-Git-Tag: switch-to-templates~123 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=15ff8be69313dffae9e18b9fde479a3e74ea1ad3;p=deb%2Fpackages.git Create DBDIR if it doesn't exist --- diff --git a/bin/parse-contents b/bin/parse-contents index 550b6ee..541cba2 100755 --- a/bin/parse-contents +++ b/bin/parse-contents @@ -35,6 +35,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 +44,7 @@ my @suites = @SUITES; my @archs = @ARCHITECTURES; $DBDIR .= "/contents"; +-d $DBDIR || mkpath( $DBDIR ); for my $archive (@archives) { for my $suite (@suites) { @@ -64,9 +66,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 = "";