Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
6b6e329d
Commit
6b6e329d
authored
Apr 09, 2015
by
Leo Gordon
Browse files
the -to_param flag has been deprecated for long enough, removing it
parent
c57ebbb3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
14 deletions
+9
-14
modules/Bio/EnsEMBL/Hive/Utils.pm
modules/Bio/EnsEMBL/Hive/Utils.pm
+5
-5
scripts/db_cmd.pl
scripts/db_cmd.pl
+4
-9
No files found.
modules/Bio/EnsEMBL/Hive/Utils.pm
View file @
6b6e329d
...
...
@@ -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
;
...
...
scripts/db_cmd.pl
View file @
6b6e329d
...
...
@@ -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
"
\n
Running command:
\n\t
$flat_cmd
\n\n
"
if
(
$verbose
);
warn
"
\n
Running command:
\n\t
$flat_cmd
\n\n
";
# if($verbose);
exec
(
@cmd
);
}
exec
(
@cmd
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment