From: dbs Date: Tue, 25 Nov 2008 21:32:43 +0000 (+0000) Subject: Backport r11348 from trunk; fix initial database schema creation X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0273536f51acf4fd22a6e4996dfe2f03d6301ff5;p=Evergreen.git Backport r11348 from trunk; fix initial database schema creation git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_4@11349 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/support-scripts/eg_db_config.pl b/Open-ILS/src/support-scripts/eg_db_config.pl index 2e3dcacd21..3a7cbc757f 100644 --- a/Open-ILS/src/support-scripts/eg_db_config.pl +++ b/Open-ILS/src/support-scripts/eg_db_config.pl @@ -128,11 +128,13 @@ sub get_settings { my $parser = XML::LibXML->new(); my $opensrf_config = $parser->parse_file($config_file); - $settings->{host} = $opensrf_config->findnodes($host); - $settings->{port} = $opensrf_config->findnodes($port); - $settings->{db} = $opensrf_config->findnodes($dbname); - $settings->{user} = $opensrf_config->findnodes($user); - $settings->{pw} = $opensrf_config->findnodes($pw); + # If the user passed in settings at the command line, + # we don't want to override them + $settings->{host} = $settings->{host} || $opensrf_config->findnodes($host); + $settings->{port} = $settings->{port} || $opensrf_config->findnodes($port); + $settings->{db} = $settings->{db} || $opensrf_config->findnodes($dbname); + $settings->{user} = $settings->{user} || $opensrf_config->findnodes($user); + $settings->{pw} = $settings->{pw} || $opensrf_config->findnodes($pw); } # Creates the database schema by calling build-db.sh @@ -140,10 +142,11 @@ sub create_schema { my $settings = shift; chdir(dirname($build_db_sh)); - system(File::Spec->catfile('.', basename($build_db_sh)) . " " . + my $cmd = File::Spec->catfile('.', basename($build_db_sh)) . " " . $settings->{host} ." ". $settings->{port} ." ". $settings->{db} ." ". $settings->{user} ." ". - $settings->{pw}); + $settings->{pw}; + system($cmd); chdir($script_dir); }