From: Dobrica Pavlinusic Date: Sun, 3 Aug 2008 06:31:00 +0000 (+0000) Subject: switch back to GDBM_File which is included in recent X-Git-Url: http://git.rot13.org/?p=webpac;a=commitdiff_plain;h=4459131acc9982d3f4a1b1caafc0d3794a58d88b switch back to GDBM_File which is included in recent Debian, and TDB_File won't compile against tdb-dev git-svn-id: file:///home/dpavlin/private/svn/webpac/trunk@775 13eb9ef6-21d5-0310-b721-a9d68796d827 --- diff --git a/INSTALL b/INSTALL index 7da6934..bd6e769 100644 --- a/INSTALL +++ b/INSTALL @@ -57,7 +57,7 @@ don't work for you. SWISH::API XML::Simple Text::Iconv - TDB_File + GDBM_File HTML::Entities (part of HTML::Parser) CPAN shell will also download some more modules to satisfy dependencies. @@ -91,7 +91,6 @@ don't work for you. libhtml-template-perl libxml-simple-perl libtext-iconv-perl - tdb-dev (for TDB_File module later) libhtml-parser-perl and install following packages by hand from CPAN diff --git a/all2xml.pl b/all2xml.pl index a7e7ade..e87fdbf 100755 --- a/all2xml.pl +++ b/all2xml.pl @@ -8,9 +8,9 @@ use XML::Simple; use Text::Iconv; use Config::IniFiles; use Encode; -#use GDBM_File; +use GDBM_File; use Fcntl; # for O_RDWR -use TDB_File; +#use TDB_File; use Carp; $|=1; @@ -673,12 +673,12 @@ foreach my $database ($cfg->Sections) { # create new lookup file my $lookup_file = $cfg -> val($database, 'lookup_newfile'); # optional if ($lookup_file) { - #tie %lhash, 'GDBM_File', $lookup_file, &GDBM_NEWDB, 0644; if (! -e $lookup_file) { open(LOOKUP, "> $lookup_file") || die "can't create $lookup_file': $!"; close(LOOKUP); } - tie %lhash, 'TDB_File', $lookup_file, TDB_CLEAR_IF_FIRST, O_RDWR, 0644; + tie %lhash, 'GDBM_File', $lookup_file, &GDBM_NEWDB, 0644; + #tie %lhash, 'TDB_File', $lookup_file, TDB_CLEAR_IF_FIRST, O_RDWR, 0644; print STDERR "creating lookup file '$lookup_file'\n"; # delete memory cache for lookup file delete $cache->{lhash}; @@ -687,8 +687,8 @@ foreach my $database ($cfg->Sections) { # open existing lookup file $lookup_file = $cfg -> val($database, 'lookup_open'); # optional if ($lookup_file) { - #tie %lhash, 'GDBM_File', $lookup_file, &GDBM_READER, 0644; - tie %lhash, 'TDB_File', $lookup_file, TDB_DEFAULT, O_RDWR, 0644; + tie %lhash, 'GDBM_File', $lookup_file, &GDBM_READER, 0644; + #tie %lhash, 'TDB_File', $lookup_file, TDB_DEFAULT, O_RDWR, 0644; print STDERR "opening lookup file '$lookup_file'\n"; }