Skip to content
Snippets Groups Projects
Commit f9d59309 authored by Leo Gordon's avatar Leo Gordon
Browse files

stringification and evaluation of pipeline-wide(meta) parameters

parent 2f98ea58
No related branches found
No related tags found
No related merge requests found
......@@ -109,6 +109,13 @@ sub _parse_meta {
my $sth = $self->db->dbc()->prepare("SELECT meta_key, meta_value FROM meta ORDER BY meta_id");
$sth->execute();
while (my ($meta_key, $meta_value)=$sth->fetchrow_array()) {
if($meta_value=~/^'.*'$/
or $meta_value=~/^".*"$/
or $meta_value=~/^{.*}$/
or $meta_value=~/^[.*]$/) {
$meta_value = eval($meta_value);
}
$meta_params_hash{$meta_key} = $meta_value;
}
$sth->finish();
......
......@@ -17,6 +17,14 @@ sub dbconn_2_url {
return "mysql://$db_conn->{-user}:$db_conn->{-pass}\@$db_conn->{-host}:$db_conn->{-port}/$db_conn->{-dbname}";
}
sub dbconn_2_mysql { # used by pipeline configuration files themselves
my ($db_conn, $with_db) = @_;
return "--host=$db_conn->{-host} --port=$db_conn->{-port} "
."--user=$db_conn->{-user} --pass=$db_conn->{-pass} "
.($with_db ? "--database=$db_conn->{-dbname} " : '');
}
sub main {
my $topup_flag = 0; # do not run initial scripts and only add new analyses+jobs (ignore the fetchable analyses)
......@@ -57,7 +65,7 @@ sub main {
if($topup_flag) {
$meta_container->delete_key($meta_key);
}
$meta_container->store_key_value($meta_key, $meta_value);
$meta_container->store_key_value($meta_key, stringify($meta_value));
}
warn "Done.\n\n";
......
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