Skip to content
Snippets Groups Projects
Commit 26a48226 authored by Andy Yates's avatar Andy Yates
Browse files

Quick error message incase your run found no databases to patch

parent 9338e1ad
No related branches found
No related tags found
No related merge requests found
......@@ -238,7 +238,7 @@ foreach my $thing ( [ 'ensembl', 'core', 'table.sql' ],
my $sql_dir = _sql_dir($cvs_module, $schema_file);
if(! defined $sql_dir) {
if ( !$opt_quiet ) {
warn(printf("No SQL directory found for CVS module %s\n", $cvs_module));
warn(sprintf("No SQL directory found for CVS module %s\n", $cvs_module));
}
next;
}
......@@ -304,6 +304,7 @@ if(! $dbh) {
# patch and filter out the ones that we don't want to patch.
my $sth;
my $found_databases = 0;
if ( defined($opt_database) ) {
$sth = $dbh->prepare("SHOW DATABASES LIKE ?");
......@@ -440,6 +441,7 @@ while ( $sth->fetch() ) {
( ( !$opt_fix && $schema_version < $opt_release ) ||
( $opt_fix && $schema_version <= $opt_release ) ) )
{
$found_databases = 1;
print( '-' x ( $ENV{COLUMNS} || 80 ), "\n" );
printf( "Considering '%s' [%s,%s,%d]\n",
$database, defined($species) ? $species : 'unknown',
......@@ -584,6 +586,12 @@ while ( $sth->fetch() ) {
} ## end while ( $sth->fetch() )
if(!$found_databases) {
printf(('-'x80)."\n");
printf("No databases considered. Check your --database/--type/--release flags\n");
printf(('-'x80)."\n");
}
$dbh->disconnect();
sub _sql_dir {
......
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