Artifacts Associated With Ticket 00bc6a8fb5
Ticket change [dc1581b36e] (rid 463) by anonymous on 2015-04-13 02:54:10:
- foundin initialized to: "trunk"
- icomment:
teapot-client uses [lsort -dictionary] to determine the newest package version, which is incorrect (case in point: tdbc). The following patch fixes this AND inclides a workaround for vectcl http://teapot.rkeene.org/entity/name/vectcl/index.html which doesn't conform to [package vcompare]. The latter should surely be fixed: ActiveState's teapot knows it only as "0.1". Index: client/lib/teapotclient0.1/teapotclient.tcl ================================================================== --- client/lib/teapotclient0.1/teapotclient.tcl +++ client/lib/teapotclient0.1/teapotclient.tcl @@ -340,17 +340,29 @@ lappend pkginfo($pkg) [list $ver $arch] } foreach pkg [array names pkginfo] { - set pkginfo($pkg) [lsort -decreasing -dictionary $pkginfo($pkg)] + set pkginfo($pkg) [lsort -decreasing -command ::teapotclient::vcompare $pkginfo($pkg)] } return [array get pkginfo] } proc setcachedir {dir} { set ::teapotclient::pkgcachedir $dir } + + proc vcompare {a b} { + try { + package vcompare $a $b + } on error {} { + try { + package vcompare [lindex $a 0] [lindex $b 0] + } on error {} { + string compare -nocase $a $b + } + } + } } package provide teapotclient 0.1 Index: client/teapot-client.tcl ================================================================== --- client/teapot-client.tcl +++ client/teapot-client.tcl @@ -88,15 +88,15 @@ set extinfoitemvers [lindex $extinfoitem 0] if {[lsearch -exact $extvers $extinfoitemvers] == -1} { lappend extvers $extinfoitemvers } } - set extvers [lsort -decreasing -dictionary $extvers] + set extvers [lsort -decreasing -command ::teapotclient::vcompare $extvers] puts " $ext [lindex $extvers 0]" } } default { print_help exit 1 } }
- login: "anonymous"
- mimetype: "text/x-fossil-plain"
- private_contact initialized to: "cb02a4a25e8da92f2790bc307bf01ef24ce6053e"
- severity initialized to: "Severe"
- status initialized to: "Open"
- title initialized to:
use [package vcompare] instead of dictionary sort for package versions
- type initialized to: "Code_Defect"