From: Jeff Hobbs Date: Mon, 31 Mar 2003 20:44:42 +0000 (+0000) Subject: * tkcon.tcl (tkcon::Retrieve): correct the check for tkcon version X-Git-Tag: tkcon-2-4~20 X-Git-Url: http://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=a037e9d267ff8da746bbf0498060113bd0e44b15;p=tkcon * tkcon.tcl (tkcon::Retrieve): correct the check for tkcon version when retrieving from http. --- diff --git a/ChangeLog b/ChangeLog index 659a96e..43c8efd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-03-31 Jeff Hobbs + + * tkcon.tcl (tkcon::Retrieve): correct the check for tkcon version + when retrieving from http. + 2003-02-20 Jeff Hobbs * tkcon.tcl (EvalCmd): set $:: (aka ${}) var to last command result. diff --git a/tkcon.tcl b/tkcon.tcl index f72e6fb..21450fd 100755 --- a/tkcon.tcl +++ b/tkcon.tcl @@ -74,6 +74,8 @@ foreach cmd {SetCursor UpDownLine Transpose ScrollPages} { # Initialize the ::tkcon namespace # namespace eval ::tkcon { + # when modifying this line, make sure that the auto-upgrade check + # for version still works. variable VERSION "2.4" # The OPT variable is an array containing most of the optional # info to configure. COLOR has the color data. @@ -5275,20 +5277,24 @@ proc ::tkcon::Retrieve {} { puts -nonewline $fid $data close $fid regexp {Id: tkcon.tcl,v (\d+\.\d+)} $data -> rcsVersion - regexp {version\s+(\d+\.\d[^\n]*)} $data -> tkconVersion + regexp {VERSION\s+"(\d+\.\d+[^\"]*)"} $data -> tkconVersion } } err] ::http::cleanup $token if {$code} { return -code error $err - } elseif {[tk_messageBox -type yesno -icon info -parent $PRIV(root) \ - -title "Retrieved tkcon v$tkconVersion, RCS $rcsVersion" \ - -message "Successfully retrieved tkcon v$tkconVersion,\ - RCS $rcsVersion. Shall I resource (not restart) this\ - version now?"] == "yes"} { - set PRIV(SCRIPT) $file - set PRIV(version) $tkconVersion.$rcsVersion - ::tkcon::Resource + } else { + if {![info exists rcsVersion]} { set rcsVersion "UNKNOWN" } + if {![info exists tkconVersion]} { set tkconVersion "UNKNOWN" } + if {[tk_messageBox -type yesno -icon info -parent $PRIV(root) \ + -title "Retrieved tkcon v$tkconVersion, RCS $rcsVersion" \ + -message "Successfully retrieved tkcon v$tkconVersion,\ + RCS $rcsVersion. Shall I resource (not restart) this\ + version now?"] == "yes"} { + set PRIV(SCRIPT) $file + set PRIV(version) $tkconVersion.$rcsVersion + ::tkcon::Resource + } } } }