62c9a2b425dd3b7f0ce1c37044a085ef31702375
max
  Wed Nov 3 00:23:57 2021 -0700
fix blat directory rename problem, refs #28432

diff --git src/product/installer/browserSetup.sh src/product/installer/browserSetup.sh
index bba907d..d546dc4 100755
--- src/product/installer/browserSetup.sh
+++ src/product/installer/browserSetup.sh
@@ -1772,31 +1772,34 @@
 
    # update the mysql DBs
    stopMysql
    DBS=`ls /var/lib/mysql/ | egrep -v '(Trash$)|(hgTemp)|(^ib_)|(^ibdata)|(^aria)|(^mysql)|(performance)|(.flag$)|(hgcentral)'`
    for db in $DBS; do 
        echo2 syncing full mysql database: $db
        $RSYNC --update --progress -avp $RSYNCOPTS $HGDOWNLOAD::mysql/$db/ $MYSQLDIR/$db/
    done
    startMysql
 
    echo2 update finished
 }
 
 function addTools {
    rsync -avP hgdownload.soe.ucsc.edu::genome/admin/exe/linux.x86_64/ /usr/local/bin/
-   mv /usr/local/bin/blat/* /usr/local/bin/ # tools under the BLAT license are separated into their own directory
+   rm -rf /usr/local/bin/blat.tmp # in case an old one is still there
+   mv /usr/local/bin/blat /usr/local/bin/blat.tmp # tools under the BLAT license are separated into their own directory
+   mv /usr/local/bin/blat.tmp/* /usr/local/bin/
+   rmdir /usr/local/bin/blat.tmp
    echo2 The UCSC User Tools were copied to /usr/local/bin
    echo2 Please note that most of the tools require an .hg.conf file in the users
    echo2 home directory. A very minimal .hg.conf file can be found here:
    echo2 "http://genome-source.soe.ucsc.edu/gitlist/kent.git/blob/master/src/product/minimal.hg.conf"
 }
 
 # ------------ end of utility functions ----------------
 
 # -- START OF SCRIPT  --- MAIN ---
 
 # On Debian and OSX, sudo by default does not update the HOME variable (hence the -H option above)
 if [[ "${SUDO_USER:-}" != "" ]]; then
    export HOME=~root
 fi