Ignore:
Timestamp:
Aug 18, 2011 3:06:58 AM (12 years ago)
Author:
toby
Message:

revised update for sandbox

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/gsascmds.tcl

    r1122 r1167  
    38013801            forknewterm "manually update in subversion" \
    38023802                "$SVN update [file normalize $::expgui(gsasdir)]"
     3803            forknewterm "manually update in subversion" \
     3804                "$SVN update [file normalize $::expgui(scriptdir)]"
    38033805        }
    38043806        return
    38053807     } else {
     3808        if {[string first "*" $res] == -1} {
     3809            catch {set res [eval exec $SVN status [list $::expgui(scriptdir)] -u]} err
     3810        }
    38063811        if {[string first "*" $res] == -1} {
    38073812            MyMessageBox -parent . -title "No updates" \
     
    38243829    # special upgrade for windows, where the wish exec blocks upgrade of the exe directory
    38253830    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
     3831        set fp [open [file join $::expgui(gsasdir) selfupdate.bat] w]
     3832        puts $fp {@REM this script must be run from the GSAS installation directory
    38313833@REM This is run to update the installation, the name of the EXP file is
    38323834@REM expected as an argument
     
    38373839.\svn\bin\svn cleanup .
    38383840.\svn\bin\svn update .
    3839 @if (%1)==() goto Install2
     3841}
     3842        puts $fp ".\svn\bin\svn cleanup $expgui(scriptdir)"
     3843        puts $fp ".\svn\bin\svn update $expgui(scriptdir)"
     3844        puts $fp {@if (%1)==() goto Install2
    38403845@echo ****************************************************
    38413846@echo Update has completed. Press return to restart EXPGUI
     
    38513856%COMSPEC% /c "start exe\ncnrpack.exe expgui\expgui"
    38523857exit
    3853             }
    3854             close $fp
    3855         }
     3858        }
     3859        close $fp
    38563860        # split the directory and EXP file and get rid os spaces in the directory name
    38573861        set exp [file normalize $::expgui(expfile)]
     
    38593863        cd $::expgui(gsasdir)
    38603864        #run the batch file
    3861         exec $::env(COMSPEC) /c {start .\update.bat [file join $dir [file tail $exp]]} &
     3865        exec $::env(COMSPEC) /c {start .\selfupdate.bat [file join $dir [file tail $exp]]} &
    38623866        exit
    38633867    }
     
    38693873            -icon error
    38703874    }
     3875    # do a quiet cleanup. Sometimes needed after install, and never hurts
     3876    if [catch {set res [eval exec $SVN cleanup [list $::expgui(scriptdir)]]} err] {
     3877        MyMessageBox -parent . -title "Error in cleanup" \
     3878            -message "Error performing cleanup. Will try to continue anyway. Error:\n$err" \
     3879            -icon error
     3880    }
    38713881    if [catch {set res [exec $SVN up $::expgui(gsasdir)]} err] {
    38723882        MyMessageBox -parent . -title "Error updating" \
    38733883            -message "Error performing update:\n$err" \
     3884            -icon error
     3885        return
     3886    } elseif [catch {set res [exec $SVN up $::expgui(scriptdir)]} err] {
     3887        MyMessageBox -parent . -title "Error updating" \
     3888            -message "Error performing scriptdir update:\n$err" \
    38743889            -icon error
    38753890        return
Note: See TracChangeset for help on using the changeset viewer.