From 15ff8be69313dffae9e18b9fde479a3e74ea1ad3 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Tue, 14 Feb 2006 22:09:22 +0000 Subject: [PATCH] Create DBDIR if it doesn't exist --- bin/parse-contents | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 = ""; -- 2.39.2