Skip to content
Snippets Groups Projects
Commit 14a86999 authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

To specify a too new release is an error.

parent b4fcf91c
No related branches found
No related tags found
No related merge requests found
......@@ -203,6 +203,7 @@ if ( defined($opt_type) &&
die( sprintf( "Unknown schema type: %s\n", $opt_type ) );
}
my $latest_release;
my %patches;
# Get available patches.
......@@ -230,6 +231,12 @@ foreach my $thing ( [ 'ensembl', 'core' ],
if ( $file_name =~ /^patch_\d+_(\d+)_?[a-z]?\.sql$/ ) {
my $patch_release = $1;
if ( !defined($latest_release) ||
$latest_release < $patch_release )
{
$latest_release = $patch_release;
}
if ($opt_verbose) {
printf( "Found %s patch file '%s' for release %d\n",
$schema_type, $file_name, $patch_release );
......@@ -244,6 +251,12 @@ foreach my $thing ( [ 'ensembl', 'core' ],
} ## end foreach my $thing ( [ 'ensembl'...])
if ( $opt_release > $latest_release ) {
die( sprintf( "Release %d is too new, " .
"last release with patches is release %d\n",
$opt_release, $latest_release ) );
}
my $dsn = sprintf( "DBI:mysql:host=%s;port=%d", $opt_host, $opt_port );
my $dbh = DBI->connect( $dsn, $opt_user, $opt_pass,
......
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