added some workarounds due lost sources on hub (disk crash)
This commit is contained in:
parent
8e5370c02a
commit
151703e1f5
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/www/; revision=7406
1 changed files with 21 additions and 8 deletions
|
@ -26,32 +26,31 @@
|
||||||
#
|
#
|
||||||
# Search a mail by Message-ID, References or In-Reply-To field
|
# Search a mail by Message-ID, References or In-Reply-To field
|
||||||
#
|
#
|
||||||
# $FreeBSD$
|
# $FreeBSD: www/en/cgi/mid.cgi,v 1.8 1999/09/06 07:02:40 peter Exp $
|
||||||
|
|
||||||
$hsty_base = '';
|
$hsty_base = '';
|
||||||
|
|
||||||
require "./cgi-lib.pl";
|
require "./cgi-lib.pl";
|
||||||
require "./cgi-style.pl";
|
require "./cgi-style.pl";
|
||||||
|
|
||||||
$home = '/g/www/mid';
|
$home = '/usr/local/www/mailindex';
|
||||||
$prefix= "/usr/local/www/db";
|
$prefix= "/usr/local/www/db/text";
|
||||||
$lookupdir = "$home/index"; # database(s) directory
|
$lookupdir = "$home/message-id"; # database(s) directory
|
||||||
$databaseDefault = 'mid'; # default database
|
$databaseDefault = 'mid'; # default database
|
||||||
$bindir = "$home/bin"; # where search scripts located
|
$bindir = "$home/bin"; # where search scripts located
|
||||||
$script = $ENV{'SCRIPT_NAME'};
|
$script = $ENV{'SCRIPT_NAME'};
|
||||||
$shortid = 1;
|
$shortid = 1;
|
||||||
$lookCommand = "$home/bin/look";
|
$lookCommand = "/usr/bin/look";
|
||||||
|
|
||||||
sub get_id {
|
sub get_id {
|
||||||
local($query, $db) = @_;
|
local($query, $db) = @_;
|
||||||
|
|
||||||
open(DB, "-|") ||
|
open(DB, "-|") ||
|
||||||
exec("$lookCommand", $query,
|
exec("$lookCommand", $query, "$lookupdir/mid-current.$db") ||
|
||||||
"$lookupdir/mid-current.$db", "$lookupdir/mid.$db") ||
|
|
||||||
do {
|
do {
|
||||||
print &midheader .
|
print &midheader .
|
||||||
"Cannot connect to Message-ID database.<p>\n" . &foot;
|
"Cannot connect to Message-ID database.<p>\n" . &foot;
|
||||||
exit;
|
exit;
|
||||||
};
|
};
|
||||||
|
|
||||||
local(@idlist);
|
local(@idlist);
|
||||||
|
@ -59,6 +58,20 @@ sub get_id {
|
||||||
push(@idlist, $_);
|
push(@idlist, $_);
|
||||||
}
|
}
|
||||||
close DB;
|
close DB;
|
||||||
|
#warn "$lookCommand $query, $lookupdir/mid.$db";
|
||||||
|
open(DB, "-|") ||
|
||||||
|
exec("$lookCommand", $query, "$lookupdir/mid.$db") ||
|
||||||
|
do {
|
||||||
|
print &midheader .
|
||||||
|
"Cannot connect to Message-ID database.<p>\n" . &foot;
|
||||||
|
exit;
|
||||||
|
};
|
||||||
|
|
||||||
|
while(<DB>) {
|
||||||
|
push(@idlist, $_);
|
||||||
|
}
|
||||||
|
close DB;
|
||||||
|
|
||||||
|
|
||||||
if ($#idlist < 0) { # nothing found
|
if ($#idlist < 0) { # nothing found
|
||||||
print &midheader;
|
print &midheader;
|
||||||
|
|
Loading…
Reference in a new issue