src/utils/qa/getAssemblies.csh 1.23

1.23 2010/01/22 21:17:19 kuhn
fixed getAssemblies.csh to work with RR machines and several other programs that it depends on. it broke when we went to a single mysql machine and genbank dumps only grab from hgnfs1
Index: src/utils/qa/getAssemblies.csh
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/utils/qa/getAssemblies.csh,v
retrieving revision 1.22
retrieving revision 1.23
diff -b -B -U 4 -r1.22 -r1.23
--- src/utils/qa/getAssemblies.csh	13 Apr 2009 19:38:19 -0000	1.22
+++ src/utils/qa/getAssemblies.csh	22 Jan 2010 21:17:19 -0000	1.23
@@ -16,8 +16,11 @@
 set rr="false"
 set dumpDate=""
 set quiet=1
 
+set debug=true
+set debug=false
+
 if ( "$HOST" != "hgwdev" ) then
  echo "\n error: you must run this script on dev!\n"
  exit 1
 endif
@@ -35,14 +38,11 @@
 else
   set tablename=$argv[1]
 endif
 
-set debug=0
-
 # assign command line arguments
 
-set argNum=$#argv
-if ( $argv[$argNum] == "verbose" ) then
+if ( $argv[$#argv] == "verbose" ) then
   set quiet=0
 endif
 
 if (($#argv > 1 && $quiet == 1) || $#argv == 3 ) then
@@ -53,23 +53,10 @@
 else
 endif
 
 
-if ($debug == 1) then
-  echo "tablename = $tablename"
-  echo "machine   = $machine"
-  echo "host      = $host"
-  echo "found     = $found"
-  echo "dbs       = $dbs"
-  echo "rr        = $rr"
-  echo "quiet     = $quiet"
-  echo "dumpDate  = $dumpDate"
-  echo
-endif
-
 # check machine validity
 checkMachineName.csh $machine
-
 if ( $status ) then
   echo "${0}:"
   $0
   exit 1
@@ -83,17 +71,28 @@
 else
   set host=""
   set dumpDate=`getRRdatabases.csh $machine | grep "last dump" \
      | gawk '{print $NF}'`
-  set dbs=`getRRdatabases.csh $machine | grep -v "last dump"`
-  set checkMach=`echo $dbs | grep "is not a valid"`
+  set dbs=`getRRdatabases.csh $machine | egrep -v "inform|last dump"`
+  echo $dbs | grep "is not a valid" > /dev/null
   if ( $status == 0 ) then
-    echo "  $dbs"
     echo
     exit 1
   endif
 endif
 
+if ( $debug == "true" ) then
+  echo "tablename = $tablename"
+  echo "machine   = $machine"
+  echo "host      = $host"
+  echo "found     = $found"
+  echo "dbs       = $dbs"
+  echo "rr        = $rr"
+  echo "quiet     = $quiet"
+  echo "dumpDate  = $dumpDate"
+  echo
+endif
+
 # -------------------------------------------------
 # get all assemblies containing $tablename
 
 echo
@@ -140,12 +139,13 @@
     if ( $quiet == 0 ) then
       echo "checking "$db
     endif
     # check for chromInfo table on dev 
-    set isChromInfo=1
     hgsql -N $host -e 'SHOW TABLES' $db | grep "chromInfo" > /dev/null
     if ( $status ) then
       set isChromInfo=0
+    else
+      set isChromInfo=1
     endif
     if ( $isChromInfo == 1 ) then
       set chrom=`hgsql -N $host -e 'SELECT chrom FROM chromInfo LIMIT 1' $db` 
       # check if split table (on dev)