From: Frank Lichtenheld Date: Sun, 12 Nov 2006 18:17:32 +0000 (+0000) Subject: The "back from the dark" Commit :) X-Git-Tag: switch-to-templates~5 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=b1bca50fbb77456ecc2ba20dfbd1218a5b7eb422;p=deb%2Fpackages.git The "back from the dark" Commit :) Handle missing packages_small.db better to produce a more meaningful error message in the log --- diff --git a/lib/Packages/DB.pm b/lib/Packages/DB.pm index 0c0ebdc..6d5db62 100644 --- a/lib/Packages/DB.pm +++ b/lib/Packages/DB.pm @@ -18,8 +18,8 @@ our @EXPORT = qw( %packages %sources %src2bin %did2pkg %descriptions our $db_read_time ||= 0; sub init { - my $dbmodtime = (stat("$DBDIR/packages_small.db"))[9]; - if ($dbmodtime > $db_read_time) { + my $dbmodtime = (stat("$DBDIR/packages_small.db"))[9] || 0; + if ($dbmodtime >= $db_read_time) { $obj = tie %packages, 'DB_File', "$DBDIR/packages_small.db", O_RDONLY, 0666, $DB_BTREE or die "couldn't tie DB $DBDIR/packages_small.db: $!";