Commit 345cba61 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(unpack_db): New proc.

(lyskomd_start): New args: confs, texts and nogarb.
parent 56b7fd9e
......@@ -440,14 +440,36 @@ proc spawn_lyskomd {logfile arg} {
return $pid
}
proc unpack_db {basename} {
global srcdir
# Check that we are in in the correct directory before removing
# directories...
set f [open "../lyskomd" "r"]
close $f
system "rm -rf db etc"
system "mkdir db etc"
system "cp $srcdir/lyskomd.0/$basename.data db/lyskomd-data"
system "cp $srcdir/lyskomd.0/$basename.texts db/lyskomd-texts"
system "chmod 644 db/lyskomd-data db/lyskomd-texts"
if {[file exists "$srcdir/lyskomd.0/$basename.nr"]} {
system "cp $srcdir/lyskomd.0/$basename.nr db/number.txt"
system "chmod 644 db/number.txt"
}
}
proc lyskomd_start {{aux_item_conf_file ""} \
{extra_config ""} \
{base_config ""} \
{args ""} \
{db_suffix ""}
{log_messages {}}
{init_db 1}
{want_stale 0}} {
{db_suffix ""} \
{log_messages {}} \
{init_db 1} \
{want_stale 0} \
{confs 6} \
{texts 1} \
{nogarb 0}} {
global spawn_id
global server_id
......@@ -582,14 +604,16 @@ proc lyskomd_start {{aux_item_conf_file ""} \
simple_expect "Lock File = [pwd]/db/lyskomd-lock"
simple_expect "MSG: init_cache: using datafile."
simple_expect "Database saved on $any*"
simple_expect "Read 6 confs/persons and 1 texts"
simple_expect "Read $confs confs/persons and $texts texts"
foreach logmsg $log_messages {
simple_expect "$logmsg"
}
if {$nogarb == 0} {
simple_expect "MSG: garb started."
simple_expect "MSG: garb ready. 0 texts deleted."
}
if {$unattached} {
send_user "Please attach to lyskomd process $pid and press RETURN\n"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment