]> git.deb.at Git - deb/packages.git/blobdiff - lib/Packages/DB.pm
The Big, the Fat and the Ugly commit ;)
[deb/packages.git] / lib / Packages / DB.pm
index 0c0ebdc2288a24f2196f75dc395e41036c1f9388..6d5db6295e5b550589724ed58831e72d1d7a94d7 100644 (file)
@@ -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: $!";