dev-server: camdbinit is now camtool dbinit

Change-Id: I6e59c831b85b5abe3a4727d8da13e08762ef1a99
This commit is contained in:
mpl 2013-03-07 21:44:28 +01:00
parent bde1f51a98
commit d44cf25894
1 changed files with 11 additions and 9 deletions

View File

@ -74,13 +74,13 @@ unless ($opt_fast) {
$ENV{CAMLI_HTTP_DEBUG} = 1 if $opt_verbose; $ENV{CAMLI_HTTP_DEBUG} = 1 if $opt_verbose;
my $camlistored; my $camlistored;
my $camdbinit; # closure to return path my $camtool; # closure to return path
if ($opt_nobuild) { if ($opt_nobuild) {
$camlistored = find_bin("./server/camlistored"); $camlistored = find_bin("./server/camlistored");
$camdbinit = sub { scalar find_bin("./cmd/camdbinit") }; $camtool = sub { scalar find_bin("./cmd/camtool") };
} else { } else {
$camlistored = build_bin("./server/camlistored"); $camlistored = build_bin("./server/camlistored");
$camdbinit = sub { scalar build_bin("./cmd/camdbinit") }; $camtool = sub { scalar build_bin("./cmd/camtool") };
} }
my $root = "/tmp/camliroot-$ENV{USER}/port$port/"; my $root = "/tmp/camliroot-$ENV{USER}/port$port/";
@ -122,22 +122,24 @@ if ($opt_memory) {
} elsif ($opt_postgres) { } elsif ($opt_postgres) {
$ENV{"CAMLI_POSTGRES_ENABLED"} = "true"; $ENV{"CAMLI_POSTGRES_ENABLED"} = "true";
$ENV{"CAMLI_INDEXER_PATH"} = "/index-postgres/"; $ENV{"CAMLI_INDEXER_PATH"} = "/index-postgres/";
system($camdbinit->(), system($camtool->(),
"dbinit",
"-postgres", "-postgres",
"-user=postgres", "-user=postgres",
"-password=postgres", "-password=postgres",
"-host=localhost", "-host=localhost",
"-database=$DBNAME", "-dbname=$DBNAME",
@opts) and die "Failed to run camdbinit.\n"; @opts) and die "Failed to run camtool dbinit.\n";
} else { } else {
$ENV{"CAMLI_MYSQL_ENABLED"} = "true"; $ENV{"CAMLI_MYSQL_ENABLED"} = "true";
$ENV{"CAMLI_INDEXER_PATH"} = "/index-mysql/"; $ENV{"CAMLI_INDEXER_PATH"} = "/index-mysql/";
system($camdbinit->(), system($camtool->(),
"dbinit",
"-user=root", "-user=root",
"-password=root", "-password=root",
"-host=localhost", "-host=localhost",
"-database=$DBNAME", "-dbname=$DBNAME",
@opts) and die "Failed to run camdbinit.\n"; @opts) and die "Failed to run camtool dbinit.\n";
} }
my $base = "http://localhost:$port"; my $base = "http://localhost:$port";