Index: src/utils/qa/copyExtSeqRows.csh
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/utils/qa/copyExtSeqRows.csh,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -B -U 4 -r1.4 -r1.5
--- src/utils/qa/copyExtSeqRows.csh	24 Mar 2009 19:10:44 -0000	1.4
+++ src/utils/qa/copyExtSeqRows.csh	11 Apr 2009 00:37:02 -0000	1.5
@@ -1,5 +1,6 @@
 #!/bin/tcsh
+source `which qaConfig.csh`
 
 #################################
 # 
 # Ann Zweig -- 2008 
@@ -138,9 +139,9 @@
  # if this is a data UPDATE, make file containing lists of what will be
  # dropped from hgwbeta for users review.
  # if the file is empty, then that means this must be NEW data.
  foreach oneFile ( $files )
-  hgsql -h hgwbeta -Ne "SELECT * FROM extFile WHERE path = '$oneFile'" $db \
+  hgsql -h $sqlbeta -Ne "SELECT * FROM extFile WHERE path = '$oneFile'" $db \
    >> XXextFileDropFromBetaXX 
  end
 
  # check to make sure that they chose correctly between 'new' and 'update'
@@ -161,9 +162,9 @@
  # get extFile.id of row(s) from extFile on hgwbeta
  set extFileId=`cat XXextFileDropFromBetaXX | awk '{print $1}'`
 
  # it is possible (even common) for there to be no seq table
- set seqTable=`hgsql -h hgwbeta -Ne "SHOW TABLES LIKE 'seq'" $db`
+ set seqTable=`hgsql -h $sqlbeta -Ne "SHOW TABLES LIKE 'seq'" $db`
  if ( "" == $seqTable ) then
   set seqTable=0
   echo "0" > XXseqTableXX
  else
@@ -173,9 +174,9 @@
 
  # create file of row(s) from seq on hgwbeta (if there is a seq table)
  if ( 1 == $seqTable ) then
   foreach id ( "$extFileId" )
-   hgsql -h hgwbeta -Ne "SELECT * FROM seq WHERE extFile = '$id'" $db \
+   hgsql -h $sqlbeta -Ne "SELECT * FROM seq WHERE extFile = '$id'" $db \
     >> XXseqDropFromBetaXX
   end
  else
   echo "empty" > XXseqDropFromBetaXX
@@ -328,9 +329,9 @@
  else
   set tableList="extFile seq"
  endif
  foreach table ( $tableList )
-  set numTables=`hgsql -h hgwbeta -Ne "SHOW TABLES LIKE '$table'" $db`
+  set numTables=`hgsql -h $sqlbeta -Ne "SHOW TABLES LIKE '$table'" $db`
   if ( $numTables == '' ) then
    echo "\n ERROR: the $table table does not exist on hgwbeta."
    echo " You should create an empty $table table in the $db database"
    echo " on hgwbeta and start this script over from the beginning using"
@@ -345,13 +346,13 @@
 
  # Make a backup of seq and extFile tables on hgwbeta.
  foreach table ( $tableList )
   if ( 0 == $DEBUG ) then
-   hgsql -h hgwbeta -e "CREATE TABLE IF NOT EXISTS $table$today \
+   hgsql -h $sqlbeta -e "CREATE TABLE IF NOT EXISTS $table$today \
     SELECT * FROM $table" $db
   else
    # DEBUG mode
-   echo "hgsql -h hgwbeta -e "'CREATE TABLE IF NOT EXISTS '$table''$today' \
+   echo "hgsql -h $sqlbeta -e "'CREATE TABLE IF NOT EXISTS '$table''$today' \
     SELECT * FROM '$table''" $db\n"
   endif
  end
  
@@ -362,9 +363,9 @@
  # Make sure the extFile table on beta hasn't changed since 'setup' was run.
  # If this is a Case II Update, we expect the table to have changed, so skip it.
  if ( 2 != $case ) then
   foreach oneFile ( $files )
-   hgsql -h hgwbeta -Ne 'SELECT * FROM extFile WHERE path = "'$oneFile'"' \
+   hgsql -h $sqlbeta -Ne 'SELECT * FROM extFile WHERE path = "'$oneFile'"' \
     $db >> XXextFileDropFromBetaRealXX
   end
 
   set numDiffs=`diff XXextFileDropFromBetaXX XXextFileDropFromBetaRealXX \
@@ -396,13 +397,13 @@
    # Get the list of id(s) of the rows to drop from the extFile table on beta
    set extFileId=`cat XXextFileDropFromBetaXX | awk '{print $1}'`
    if ( 0 == $DEBUG ) then
     foreach id ( $extFileId )
-     hgsql -h hgwbeta -e "DELETE FROM extFile WHERE id = '$id'" $db
+     hgsql -h $sqlbeta -e "DELETE FROM extFile WHERE id = '$id'" $db
     end
    else
     # DEBUG mode
-    echo "hgsql -h hgwbeta -e "'DELETE FROM extFile WHERE id = '$extFileId''" \
+    echo "hgsql -h $sqlbeta -e "'DELETE FROM extFile WHERE id = '$extFileId''" \
      $db\n"
    endif
 
    # Drop rows from hgwbeta: $db.seq based on: XXseqDropFromBetaXX
@@ -413,12 +414,12 @@
     # get the unique extFile column numbers from the file:
     set seqExtFile=`cat XXseqDropFromBetaXX | awk '{print $5}' | sort -u`
     foreach val ( $seqExtFile )
      if ( 0 == $DEBUG ) then
-      hgsql -h hgwbeta -e "DELETE FROM seq WHERE extFile = '$val'" $db
+      hgsql -h $sqlbeta -e "DELETE FROM seq WHERE extFile = '$val'" $db
      else
       # DEBUG mode
-      echo "hgsql -h hgwbeta -e "'DELETE FROM seq WHERE extFile = '$val''" $db\n"
+      echo "hgsql -h $sqlbeta -e "'DELETE FROM seq WHERE extFile = '$val''" $db\n"
      endif
     end #foreach
    endif
   endif
@@ -426,23 +427,23 @@
 
  # do this for all instances: new data, update Case I, update Case II
  # load data into hgwbeta: $db.extFile based on: XXextFileCopyFromDevXX
  if ( 0 == $DEBUG ) then
-  hgsql -h hgwbeta -e 'LOAD DATA LOCAL INFILE "'XXextFileCopyFromDevXX'" \
+  hgsql -h $sqlbeta -e 'LOAD DATA LOCAL INFILE "'XXextFileCopyFromDevXX'" \
    INTO TABLE extFile' $db
  else
   # DEBUG mode
-  echo "hgsql -h hgwbeta -e "'LOAD DATA LOCAL INFILE 'XXextFileCopyFromDevXX' \
+  echo "hgsql -h $sqlbeta -e "'LOAD DATA LOCAL INFILE 'XXextFileCopyFromDevXX' \
    INTO TABLE extFile'" $db\n"
  endif
 
  # load data into hgwbeta: $db.seq based on: XXseqCopyFromDevXX
  if ( 0 == $DEBUG ) then
-  hgsql -h hgwbeta -e 'LOAD DATA LOCAL INFILE "'XXseqCopyFromDevXX'" \
+  hgsql -h $sqlbeta -e 'LOAD DATA LOCAL INFILE "'XXseqCopyFromDevXX'" \
    INTO TABLE seq' $db
  else
   # DEBUG mode
-  echo "hgsql -h hgwbeta -e "'LOAD DATA LOCAL INFILE 'XXseqCopyFromDevXX' \
+  echo "hgsql -h $sqlbeta -e "'LOAD DATA LOCAL INFILE 'XXseqCopyFromDevXX' \
    INTO TABLE seq'" $db\n"
  endif
 
  # display final information for user:
@@ -483,15 +484,15 @@
  echo "  extFile and seq tables on hgwbeta. If all is well, do NOT do this!\n"
  echo '#drop rows from $db.extFile:'
  echo '# set extFileId to this: cat XXextFileCopyFromDevXX | awk {print $1}'
  echo '# foreach id in $extFileId'
- echo '#  hgsql -h hgwbeta -e DELETE FROM extFile WHERE id = $id $db'
+ echo '#  hgsql -h $sqlbeta -e DELETE FROM extFile WHERE id = $id $db'
  echo '# end'
  echo
  echo '#drop rows from $db.seq:'
  echo '# set seqExtFile to this cat XXseqCopyFromDevXX | awk {print $5} | sort -u'
  echo '# foreach val in $seqExtFile'
- echo '#  hgsql -h hgwbeta -e DELETE FROM seq WHERE extFile = $val $db'
+ echo '#  hgsql -h $sqlbeta -e DELETE FROM seq WHERE extFile = $val $db'
  echo '# end\n'
 
  if ( "update" == $type && 1 == "$case" ) then
    echo "4. This script only *copied* rows from the tables on dev to those on beta;"

