Re: upgrade problem tcl/tk-8.4 -> 8.5 [SOLVED]



Donald Arseneau wrote:
On Jul 31, 1:24 am, Donald Arseneau <a...@xxxxxxxxx> wrote:
On Jul 31, 12:30 am, Helmut Jarausch <jarau...@xxxxxxxxx> wrote:
When upgrading from Tcl/Tk-8.4.* to 8.5.3 an error occurs in
an old script (tkdiff+)
unmatched open brace in list
while executing
"foreach {pattern dummy1 dummy2} $content {

Maybe $content contains many lines and is removed, but it probably
also contains brace characters, and is not really a list.

OK, I grabbed tkdiff+.3.07g, and that line is part of status:save,
and $content is the contents of the rc file, likely .tkdiffrc or
_tkdiff.rc. Check that the file has not been clobbered.

Ummmm... does your rc file contain comments? Comments are allowed
for processing the file, but I don't see any method for handling
them when saving the status.


Meanwhile I've managed to patch tkdiff+ since
clock format / clock scan
seems inconsistent to me in Tcl 8.5.3 (see my other reply)

Here is the patch

--- tkdiff+-SAVE 2006-09-14 14:20:47.000000000 +0000
+++ tkdiff+ 2008-07-31 11:14:12.000000000 +0000
@@ -3677,7 +3677,7 @@

# put the tkdiff version in the file. It might be handy later
puts $fid "# This file was generated by $g(name) $g(version)"
- puts $fid "# [clock format [clock seconds]]\n"
+ puts $fid "# [clock format [clock seconds] -format "%Y/%m/%d %H:%M"]\n"
puts $fid "set prefsFileVersion {$g(version)}\n"

# now, put all of the preferences in the file
@@ -8940,7 +8940,7 @@
set mtime "? "
catch { set size [file size $file] }
catch { set mtime [clock format [file mtime $file] \
- -format {%Y/%m/%d %H:%M}]}
+ -format "%Y/%m/%d %H:%M"]}
return "\t[file tail $file]\t$size\t$mtime"
}

@@ -9403,7 +9403,7 @@
set i 1
foreach {pattern dummy1 dummy2} $content {
if {$pattern == $data(v:status:pattern)} {
- set content [lreplace $content $i $i [clock format [clock seconds]]]
+ set content [lreplace $content $i $i [clock format [clock seconds] -format "%Y/%m/%d %H:%M"]]
incr i
set content [lreplace $content $i $i $files]
set done 1
@@ -9412,14 +9412,14 @@
incr i 3
}
if {!$done} {
- lappend content $data(v:status:pattern) [clock format [clock seconds]] $files
+ lappend content $data(v:status:pattern) [clock format [clock seconds] -format "%Y/%m/%d %H:%M"] $files
}

# write file
set out [open $data(v:rcfile) "w"]
foreach {p d f} $content {
# remove entries older than 6 months
- if {[clock scan "6 months" -base [clock scan $d]] > [clock seconds]} {
+ if {[clock add [clock scan $d -format "%Y/%m/%d %H:%M"] 6 "months"] > [clock seconds]} {
puts $out "[list $p] [list $d] [list $f]\n"
}
}


--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
.


Quantcast