6dcfa7d1962d9e9dbfa5cbe651b6e301101287ef
hiram
  Fri Sep 25 12:51:58 2026 -0700
beginning to get a miniMap2 process in place refs #34360

diff --git src/hg/utils/automation/HgAutomate.pm src/hg/utils/automation/HgAutomate.pm
index f7e3164df17..39524db3a5e 100755
--- src/hg/utils/automation/HgAutomate.pm
+++ src/hg/utils/automation/HgAutomate.pm
@@ -845,30 +845,48 @@
   my $count = `$HgAutomate::runSSH $mach ls -1 $file 2>>/dev/null | wc -l`;
   chomp $count;
   return $count + 0;
 }
 
 sub databaseExists {
   my ($dbHost, $db) = @_;
   return 0 if ($dbHost =~ m/nohost/i);
   confess "Must have exactly 2 arguments" if (scalar(@_) != 2);
   my $query = "show databases like \"$db\";";
   my $line = `echo '$query' | $HgAutomate::runSSH $dbHost $centralDbSql`;
   chomp $line;
   return length($line);     # will be zero if not existing, >0 if exists
 }
 
+sub isUcscDb {
+  # True if $db is a registered assembly name in hgcentraltest.dbDb's
+  # 'name' column.  Unlike databaseExists() (which checks for a MySQL
+  # schema of that name on $dbHost), this checks the dbDb metadata table
+  # specifically -- the right check for "is this a real UCSC assembly
+  # name" as opposed to "does some database happen to exist with this
+  # name."  Like all hgcentraltest access, this always runs on $dbHost
+  # (hgcentraltest is only reachable from hgwdev) via ssh, regardless of
+  # what host is actually calling it.
+  my ($dbHost, $db) = @_;
+  return 0 if ($dbHost =~ m/nohost/i);
+  confess "Must have exactly 2 arguments" if (scalar(@_) != 2);
+  my $query = "select name from dbDb where name = \"$db\";";
+  my $line = `echo '$query' | $HgAutomate::runSSH $dbHost $centralDbSql`;
+  chomp $line;
+  return length($line);     # will be zero if not existing, >0 if exists
+}
+
 sub dbTableExists {
   my ($dbHost, $db, $table) = @_;
   return 0 if ($dbHost =~ m/nohost/i);
   confess "Must have exactly 3 arguments" if (scalar(@_) != 3);
   if (&HgAutomate::databaseExists($dbHost, $db)) {
     my $query = "select count(*) from $db.$table;";
     my $line = `echo '$query' | $HgAutomate::runSSH $dbHost $centralDbSql 2>>/dev/null`;
     chomp $line;
     return length($line);     # will be zero if not existing, >0 if exists
   } else {	# no DB, no table
     return 0;
   }
 }
 
 sub makeGsub {