From b1bca50fbb77456ecc2ba20dfbd1218a5b7eb422 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sun, 12 Nov 2006 18:17:32 +0000 Subject: [PATCH] The "back from the dark" Commit :) Handle missing packages_small.db better to produce a more meaningful error message in the log --- lib/Packages/DB.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: $!"; -- 2.39.2