Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Alan Grunwald Newsgroups: comp.lang.tcl Subject: Re: BUG: wrong usage for package loading with multiple versions available Date: Wed, 30 Apr 2025 17:15:25 +0100 Organization: A noiseless patient Spider Lines: 55 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 30 Apr 2025 18:16:33 +0200 (CEST) Injection-Info: dont-email.me; posting-host="5a0396b510c2fefceb77ff407462b0ce"; logging-data="689762"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19FabQnmoZGhNPTURBIVLdX4eQ+LksVJS8=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:wM1VbnV+kg3B4QBud8by7WfQxXc= Content-Language: en-US In-Reply-To: Bytes: 2595 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.