Changeset 1175 for trunk/gsascmds.tcl


Ignore:
Timestamp:
Oct 24, 2011 11:17:42 PM (9 years ago)
Author:
toby
Message:

update stable release to fix bugs & match sandbox: many RB updates; show RB atoms in phase

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsascmds.tcl

    r1166 r1175  
    28652865            close $fp
    28662866            update
    2867             regexp {GNLS  RUN on (.*) +Total.*run *([0-9]+) } \
     2867            regexp -linestop {GNLS  RUN on (.*) +Total.*run *([0-9]+) } \
    28682868                    $testline a last cycles
    28692869            pack [label $expgui(FileInfoBox).2 -justify left \
     
    37793779
    37803780proc CheckAndDoUpdate { } {
     3781    pleasewait "... Checking with software repository..."
    37813782    if {! [CheckSVNinstalled]} {
     3783        donewait
    37823784        MyMessageBox -parent . -title "SVN not found" \
    37833785            -message "Unable to upgrade: Could not locate a copy of the subversion program. It does not appear that one of self-updating GSAS/EXPGUI releases was installed" \
     
    37873789    #is there a svn directory in the source?
    37883790    if {! [file exists [file join $::expgui(gsasdir)  .svn]]} {
     3791        donewait
    37893792        MyMessageBox -parent . -title "No .svn directory" \
    37903793            -message "Unable to upgrade: It does not appear that one of self-updating GSAS/EXPGUI releases was installed" \
     
    37953798    set SVN [auto_execok svn]
    37963799    if [catch {set res [eval exec $SVN status [list $::expgui(gsasdir)] -u]} err] {
     3800        donewait
    37973801        set ans [MyMessageBox -parent . -title "Error checking status" \
    37983802                     -message "Error checking for updates: $err\n\nTry to update manually?" \
     
    38013805            forknewterm "manually update in subversion" \
    38023806                "$SVN update [file normalize $::expgui(gsasdir)]"
     3807            forknewterm "manually update in subversion" \
     3808                "$SVN update [file normalize $::expgui(scriptdir)]"
    38033809        }
    38043810        return
    38053811     } else {
    38063812        if {[string first "*" $res] == -1} {
     3813            catch {set res [eval exec $SVN status [list $::expgui(scriptdir)] -u]} err
     3814        }
     3815        if {[string first "*" $res] == -1} {
     3816            donewait
    38073817            MyMessageBox -parent . -title "No updates" \
    38083818                -message "GSAS & EXPGUI appear up-to-date" \
     
    38123822    }
    38133823
     3824    donewait
    38143825    if {[MyMessageBox -parent . -title "Ready to Update" \
    38153826             -message {
     
    38243835    # special upgrade for windows, where the wish exec blocks upgrade of the exe directory
    38253836    if {$::tcl_platform(platform) == "windows" && $::tcl_platform(os) != "Windows 95"} {
    3826         if {![file exists [file join $::expgui(gsasdir) update.bat]]} {
    3827             MyMessageBox -parent . -title "No update.bat" \
    3828                 -message "File update.bat was not found. This should not happen. Will try to create it now."
    3829             set fp [open [file join $::expgui(gsasdir) update.bat] w]
    3830             puts $fp {@REM this script must be run from the GSAS installation directory
     3837        set fp [open [file join $::expgui(gsasdir) selfupdate.bat] w]
     3838        puts $fp {@REM this script must be run from the GSAS installation directory
    38313839@REM This is run to update the installation, the name of the EXP file is
    38323840@REM expected as an argument
     
    38373845.\svn\bin\svn cleanup .
    38383846.\svn\bin\svn update .
    3839 @if (%1)==() goto Install2
     3847}
     3848        puts $fp ".\\svn\\bin\\svn cleanup $::expgui(scriptdir)"
     3849        puts $fp ".\\svn\\bin\\svn update $::expgui(scriptdir)"
     3850        puts $fp {@if (%1)==() goto Install2
    38403851@echo ****************************************************
    38413852@echo Update has completed. Press return to restart EXPGUI
     
    38513862%COMSPEC% /c "start exe\ncnrpack.exe expgui\expgui"
    38523863exit
    3853             }
    3854             close $fp
    3855         }
     3864        }
     3865        close $fp
    38563866        # split the directory and EXP file and get rid os spaces in the directory name
    38573867        set exp [file normalize $::expgui(expfile)]
     
    38593869        cd $::expgui(gsasdir)
    38603870        #run the batch file
    3861         exec $::env(COMSPEC) /c {start .\update.bat [file join $dir [file tail $exp]]} &
     3871        exec $::env(COMSPEC) /c "start .\\selfupdate.bat [file join $dir [file tail $exp]]" &
    38623872        exit
    38633873    }
     
    38693879            -icon error
    38703880    }
     3881    # do a quiet cleanup. Sometimes needed after install, and never hurts
     3882    if [catch {set res [eval exec $SVN cleanup [list $::expgui(scriptdir)]]} err] {
     3883        MyMessageBox -parent . -title "Error in cleanup" \
     3884            -message "Error performing cleanup. Will try to continue anyway. Error:\n$err" \
     3885            -icon error
     3886    }
    38713887    if [catch {set res [exec $SVN up $::expgui(gsasdir)]} err] {
    38723888        MyMessageBox -parent . -title "Error updating" \
    38733889            -message "Error performing update:\n$err" \
     3890            -icon error
     3891        return
     3892    } elseif [catch {set res [exec $SVN up $::expgui(scriptdir)]} err] {
     3893        MyMessageBox -parent . -title "Error updating" \
     3894            -message "Error performing scriptdir update:\n$err" \
    38743895            -icon error
    38753896        return
Note: See TracChangeset for help on using the changeset viewer.