Commit 6b6e329d authored by Leo Gordon's avatar Leo Gordon
Browse files

the -to_param flag has been deprecated for long enough, removing it

parent c57ebbb3
......@@ -353,7 +353,7 @@ sub throw {
sub dbc_to_cmd {
my ($dbc, $executable, $prepend, $append, $sqlcmd, $to_params) = @_;
my ($dbc, $executable, $prepend, $append, $sqlcmd) = @_;
my $driver = $dbc->driver || 'mysql';
......@@ -389,7 +389,7 @@ sub dbc_to_cmd {
if($driver eq 'mysql') {
$executable ||= 'mysql';
push @cmd, $executable unless $to_params;
push @cmd, $executable;
push @cmd, @$prepend if ($prepend && @$prepend);
push @cmd, '-h'.$dbc->host if $dbc->host;
push @cmd, '-P'.$dbc->port if $dbc->port;
......@@ -402,8 +402,8 @@ sub dbc_to_cmd {
} elsif($driver eq 'pgsql') {
$executable ||= 'psql';
push @cmd, ('env', "PGPASSWORD='$dbc->pass'") if ($to_params && $dbc->pass);
push @cmd, $executable unless $to_params;
push @cmd, ('env', "PGPASSWORD='$dbc->pass'") if ($dbc->pass);
push @cmd, $executable;
push @cmd, @$prepend if ($prepend && @$prepend);
push @cmd, ('-h', $dbc->host) if defined($dbc->host);
push @cmd, ('-p', $dbc->port) if defined($dbc->port);
......@@ -417,7 +417,7 @@ sub dbc_to_cmd {
die "sqlite requires a database (file) name\n" unless $dbname;
push @cmd, $executable unless $to_params;
push @cmd, $executable;
push @cmd, @$prepend if ($prepend && @$prepend);
push @cmd, @$append if ($append && @$append);
push @cmd, $dbname;
......
......@@ -18,7 +18,7 @@ use Bio::EnsEMBL::Hive::Utils ('script_usage', 'report_versions', 'dbc_to_cmd');
sub main {
my ($reg_conf, $reg_type, $reg_alias, $executable, $url, @prepend, @append, $sqlcmd, $to_params, $verbose, $help, $report_versions);
my ($reg_conf, $reg_type, $reg_alias, $executable, $url, @prepend, @append, $sqlcmd, $verbose, $help, $report_versions);
GetOptions(
# connect to the database:
......@@ -31,7 +31,6 @@ sub main {
'prepend=s@' => \@prepend,
'append|extra=s@' => \@append,
'sqlcmd=s' => \$sqlcmd,
'to_params!' => \$to_params, # is being phased out and so no longer documented
'verbose!' => \$verbose,
'help!' => \$help,
......@@ -84,17 +83,13 @@ sub main {
script_usage(1);
}
my @cmd = @{ dbc_to_cmd( $dbc, $executable, \@prepend, \@append, $sqlcmd, $to_params ) };
my @cmd = @{ dbc_to_cmd( $dbc, $executable, \@prepend, \@append, $sqlcmd ) };
my $flat_cmd = join(' ', map { ($_=~/^-?\w+$/) ? $_ : "\"$_\"" } @cmd);
if($to_params) {
print "$flat_cmd\n";
} else {
warn "\nRunning command:\n\t$flat_cmd\n\n" if($verbose);
warn "\nRunning command:\n\t$flat_cmd\n\n"; # if($verbose);
exec(@cmd);
}
exec(@cmd);
}
......
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