From abf6bca7593bc75c8bdbcabe043742d54b848bb1 Mon Sep 17 00:00:00 2001
From: Andrew Yates <ayates@ebi.ac.uk>
Date: Wed, 6 Jun 2012 11:43:24 +0000
Subject: [PATCH] If it was already a test db we were dumping then the user and
 test_db prefix got added onto the species name.

---
 misc-scripts/db/dump_mysql.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc-scripts/db/dump_mysql.pl b/misc-scripts/db/dump_mysql.pl
index 86ec2108bf..06c312b973 100755
--- a/misc-scripts/db/dump_mysql.pl
+++ b/misc-scripts/db/dump_mysql.pl
@@ -486,7 +486,7 @@ sub _setup_dir {
   my ($self, $db) = @_;
   my @path = ($self->opts()->{directory});
   if($self->opts()->{testcompatible}) {
-    if( $db =~ /^([a-zA-Z0-9_]+)_([a-z]+)_\d+/) {
+    if( $db =~ /^(?:\w+_test_db_)?([a-zA-Z0-9_]+)_([a-z]+)_\d+/) {
       push(@path, $1, $2);
     }
     else {
-- 
GitLab