my ($dir) = @_;
my $modtime = (stat( "$dir/config.sh" ))[9] || 0;
$config_read_time ||= 0;
- if ($modtime >= $config_read_time) {
+ if ($modtime > $config_read_time) {
if (!open (C, '<', "$dir/config.sh")) {
error( "Internal: Cannot open configuration file." );
}
s/\$\{?topdir\}?/$TOPDIR/g;
}
close (C);
+ unshift @LANGUAGES, 'en';
+ unshift @DDTP_LANGUAGES, 'en';
debug( "read config ($modtime > $config_read_time)" ) if DEBUG;
$config_read_time = $modtime;
}
$DBDIR = "$TOPDIR/files/db";
- unshift @LANGUAGES, 'en';
- unshift @DDTP_LANGUAGES, 'en';
}
1;
sub init {
my $dbmodtime = (stat("$DBDIR/packages_small.db"))[9] || 0;
- if ($dbmodtime >= $db_read_time) {
+ if ($dbmodtime > $db_read_time) {
+ undef $obj;
+ untie %packages;
$obj = tie %packages, 'DB_File', "$DBDIR/packages_small.db",
O_RDONLY, 0666, $DB_BTREE
or die "couldn't tie DB $DBDIR/packages_small.db: $!";
+ undef $s_obj;
+ untie %sources;
$s_obj = tie %sources, 'DB_File', "$DBDIR/sources_small.db",
O_RDONLY, 0666, $DB_BTREE
or die "couldn't tie DB $DBDIR/sources_small.db: $!";
+ untie %src2bin;
tie %src2bin, 'DB_File', "$DBDIR/sources_packages.db",
O_RDONLY, 0666, $DB_BTREE
or die "couldn't open $DBDIR/sources_packages.db: $!";
+ untie %descriptions;
tie %descriptions, 'DB_File', "$DBDIR/descriptions.db",
O_RDONLY, 0666, $DB_BTREE
or die "couldn't tie DB $DBDIR/descriptions.db: $!";
+ untie %desctrans;
tie %desctrans, 'DB_File', "$DBDIR/descriptions_translated.db",
O_RDONLY, 0666, $DB_BTREE
or die "couldn't tie DB $DBDIR/descriptions_translated.db: $!";
+ untie %did2pkg;
tie %did2pkg, 'DB_File', "$DBDIR/descriptions_packages.db",
O_RDONLY, 0666, $DB_BTREE
or die "couldn't tie DB $DBDIR/descriptions_packages.db: $!";
+ untie %debtags;
tie %debtags, 'DB_File', "$TOPDIR/files/debtags/vocabulary.db",
O_RDONLY, 0666, $DB_BTREE
or die "couldn't tie DB $TOPDIR/files/debtags/vocabulary.db: $!";
+ undef $p_obj;
+ untie %postf;
$p_obj = tie %postf, 'DB_File', "$DBDIR/package_postfixes.db",
O_RDONLY, 0666, $DB_BTREE
or die "couldn't tie postfix db $DBDIR/package_postfixes.db: $!";
+ undef $sp_obj;
+ untie %spostf;
$sp_obj = tie %spostf, 'DB_File', "$DBDIR/source_postfixes.db",
O_RDONLY, 0666, $DB_BTREE
or die "couldn't tie postfix db $DBDIR/source_postfixes.db: $!";