Sujet : Re: BUG: wrong usage for package loading with multiple versions available
De : nospam.nurdglaw (at) *nospam* gmail.com (Alan Grunwald)
Groupes : comp.lang.tclDate : 30. Apr 2025, 17:15:25
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vutid0$l1j2$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
On 30/04/2025 11:06, aotto1968 wrote:
hi,
The "-exact" option does NOT include the PARTIAL version number. To use the
tcltest-2.3.8 package the EXACT version have to be "known".
The CORE problem is that tcltest-2.3 and tcltest-2-5 have partly DIFFERENT
syntax. The command "package require tcltest 2.3" should load the LATEST
patch level from "tcltest-2.3.X"
package require Tcl 8.5
> 8.5.19
package versions tcltest
> 2.3.8 2.5.3
info library
> /path/to/lib/tcl8.5
catch {package require -exact tcltest 2.3} msg
> 1
set msg
> can't find package tcltest exactly 2.3
package require tcltest 2.3
> 2.5.3
package require Tcl 8.5
> 8.6.12
package versions tcltest
> 2.3.8 2.5.3
info library
> /path/to/lib/tcl8.6
catch {package require -exact tcltest 2.3} msg
> 1
set msg
> can't find package tcltest exactly 2.3
package require tcltest 2.3
> 2.5.3
OK. I'll bite.
From the manpage,
"package require -exact package version
" This form of the command is used when only the given version of package is acceptable to the caller."
Since 2.5.3 isn't exactly 2.5, [package require -exact tcltest 2.5] fails is only version 2.5.3 is available.
The second line of the manpage quote above goes on to state.
"This command is equivalent to package require package version-version."
I haven't checked, because I am, frankly, not interested, but
package require tcltest 2.3-2.3.9 might do what you want.