Changeset 1216 for branches/sandbox


Ignore:
Timestamp:
Aug 19, 2012 9:10:44 AM (8 years ago)
Author:
toby
Message:

bring proxy support back to sandbox

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/gsascmds.tcl

    r1215 r1216  
    37903790
    37913791proc CheckAndDoUpdate { } {
     3792    if [file exists [file join $::expgui(gsasdir) proxyinfo.txt]] {
     3793        set fp [open [file join $::expgui(gsasdir) proxyinfo.txt]]
     3794        gets $fp proxaddr
     3795        gets $fp proxport
     3796        set proxy "--config-option servers:global:http-proxy-host=$proxaddr"
     3797        set proxp "--config-option servers:global:http-proxy-port=$proxport"
     3798        close $fp
     3799    } else {
     3800        set proxy {}
     3801        set proxp {}
     3802    }
    37923803    pleasewait "... Checking with software repository..."
    37933804    if {! [CheckSVNinstalled]} {
     
    38083819    # check for updates
    38093820    set SVN [auto_execok svn]
    3810     if [catch {set res [eval exec $SVN status [list $::expgui(gsasdir)] -u]} err] {
     3821    if [catch {set res \
     3822                   [eval exec $SVN status [list $::expgui(gsasdir)] -u $proxy $proxp] \
     3823               } err] {
    38113824        donewait
    38123825        set ans [MyMessageBox -parent . -title "Error checking status" \
     
    38153828        if {$ans != "no"} {
    38163829            forknewterm "manually update in subversion" \
    3817                 "$SVN update [file normalize $::expgui(gsasdir)]"
     3830                " \"$SVN update [file normalize $::expgui(gsasdir)] $proxy $proxp\""
    38183831            forknewterm "manually update in subversion" \
    3819                 "$SVN update [file normalize $::expgui(scriptdir)]"
     3832                " \"$SVN update [file normalize $::expgui(scriptdir)] $proxy $proxp\""
    38203833        }
    38213834        return
    38223835     } else {
    38233836        if {[string first "*" $res] == -1} {
    3824             catch {set res [eval exec $SVN status [list $::expgui(scriptdir)] -u]} err
     3837            catch {set res \
     3838                       [eval exec $SVN status [list $::expgui(scriptdir)] -u $proxy $proxp]\
     3839                   } err
    38253840        }
    38263841        if {[string first "*" $res] == -1} {
     
    38323847        }
    38333848    }
    3834 
     3849    set msg {
     3850Updates to GSAS/EXPGUI found on server.
     3851                 
     3852Press the "Update & Restart" button to begin the update process. After the update completes, EXPGUI will be restarted.}
     3853    if {$proxy != "" || $proxp != ""} {
     3854        append msg "\nUsing proxy settings \"$proxy\" and \"$proxp\""
     3855    }
    38353856    donewait
    38363857    if {[MyMessageBox -parent . -title "Ready to Update" \
    3837              -message {
    3838 Updates to GSAS/EXPGUI found on server.
    3839                  
    3840 Press the "Update & Restart" button to begin the update process. After the update completes, EXPGUI will be restarted.} \
     3858             -message $msg \
    38413859             -type {Cancel "Update & Restart"} -default cancel -icon warning
    38423860        ] == "cancel"} {return}
     
    38553873@pause
    38563874.\svn\bin\svn cleanup .
    3857 .\svn\bin\svn update .
    3858 }
     3875}
     3876        puts $fp ".\\svn\\bin\\svn update . $proxy $proxp"
    38593877        puts $fp ".\\svn\\bin\\svn cleanup $::expgui(scriptdir)"
    3860         puts $fp ".\\svn\\bin\\svn update $::expgui(scriptdir)"
     3878        puts $fp ".\\svn\\bin\\svn update $::expgui(scriptdir) $proxy $proxp"
    38613879        puts $fp {@if (%1)==() goto Install2
    38623880@echo ****************************************************
     
    38963914            -icon error
    38973915    }
    3898     if [catch {set res [exec $SVN up $::expgui(gsasdir)]} err] {
     3916    if [catch {set res [exec $SVN up $::expgui(gsasdir) $proxy $proxp]} err] {
    38993917        MyMessageBox -parent . -title "Error updating" \
    39003918            -message "Error performing update:\n$err" \
    39013919            -icon error
    39023920        return
    3903     } elseif [catch {set res [exec $SVN up $::expgui(scriptdir)]} err] {
     3921    } elseif [catch {set res [exec $SVN up $::expgui(scriptdir) $proxy $proxp]} err] {
    39043922        MyMessageBox -parent . -title "Error updating" \
    39053923            -message "Error performing scriptdir update:\n$err" \
Note: See TracChangeset for help on using the changeset viewer.