Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
af4d2927
Commit
af4d2927
authored
12 years ago
by
Andy Yates
Browse files
Options
Downloads
Patches
Plain Diff
Sorting out opts
parent
f1a23e41
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
misc-scripts/production_database/scripts/populate_species_meta.pl
+29
-17
29 additions, 17 deletions
...ipts/production_database/scripts/populate_species_meta.pl
with
29 additions
and
17 deletions
misc-scripts/production_database/scripts/populate_species_meta.pl
+
29
−
17
View file @
af4d2927
...
...
@@ -13,7 +13,7 @@ sub run {
my
(
$class
)
=
@_
;
my
$self
=
bless
({},
$class
);
$self
->
args
();
$self
->
defaul
ts
();
$self
->
check_op
ts
();
my
$databases
=
$self
->
databases
();
foreach
my
$db
(
@
{
$databases
})
{
$self
->
v
('
Processing %s
',
$db
);
...
...
@@ -25,7 +25,26 @@ sub run {
sub
args
{
my
(
$self
)
=
@_
;
my
$opts
=
{};
my
$opts
=
{
# Master database location:
mhost
=>
'
ens-staging1
',
mport
=>
3306
,
muser
=>
'
ensro
',
mdatabase
=>
'
ensembl_production
',
# Taxonomy database location:
thost
=>
'
ens-staging1
',
tuser
=>
3306
,
tport
=>
3306
,
# User database location (default values):
port
=>
3306
,
backup
=>
1
#default backups on
};
my
@cmd_opts
=
qw/
mhost|mh=s
mport|mP=i
...
...
@@ -44,6 +63,7 @@ sub args {
database|d=s
pattern=s
verbose|v!
backup
help
man
/
;
...
...
@@ -54,23 +74,9 @@ sub args {
return
;
}
sub
defaul
ts
{
sub
check_op
ts
{
my
(
$self
)
=
@_
;
my
$o
=
$self
->
{
opts
};
# Master database location:
$o
->
{
mhost
}
=
'
ens-staging1
'
unless
$o
->
{
mhost
};
$o
->
{
mport
}
=
3306
unless
$o
->
{
mport
};
$o
->
{
muser
}
=
'
ensro
'
unless
$o
->
{
muser
};
$o
->
{
mdatabase
}
=
'
ensembl_production
'
unless
$o
->
{
mdatabase
};
# Taxonomy database location:
$o
->
{
thost
}
=
'
ens-staging1
'
unless
$o
->
{
thost
};
$o
->
{
tuser
}
=
'
ensro
'
unless
$o
->
{
tuser
};
$o
->
{
tport
}
=
3306
unless
$o
->
{
tport
};
# User database location (default values):
$o
->
{
port
}
=
3306
unless
$o
->
{
port
};
foreach
my
$required
(
qw/host user tdatabase/
)
{
my
$msg
=
"
Required parameter --
${required}
was not given
";
...
...
@@ -253,6 +259,7 @@ populate_species_meta.pl
[-mu user] [-mp password] [-md database] \\
[-th host] [-tP port] \\
[-tu user] [-tp password] [-td database] \\
[-nobackup]
[-v]
=head1 DESCRIPTION
...
...
@@ -336,6 +343,11 @@ Database name to search for. Can be a SQL like statement
--database="homo_sapiens_core_65_37"
--database="%core_65%"
=item B<--nobackup>
If specified we will avoid performing backup of the meta table before
a run of the script.
=item B<--verbose>
Make the script chatty
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment