Re: Package Require getting "wrong version"
- From: Donald G Porter <dgp@xxxxxxxx>
- Date: Wed, 30 Apr 2008 16:29:03 -0400
Donald G Porter wrote:
Ok, once you get into that state, [package require] is behaving according
to spec. You've asked for any version of http. It knows about version 1.0,
so it will deliver version 1.0 without bothering to go look for any others.
The mystery is how you get into that state, having discovered the availability
of version 1.0 while somehow missing the availability of version 2.5.3.
This isn't really a mystery after all. Tcl 8.5 installs http 2.5.3 as
a Tcl Module. Unlike pkgIndex.tcl packages, the search for Tcl Modules
is not an exhaustive one.
For a long time, some folks have believed that
% package require no-such-package
would coax Tcl into finding all packages on the system, so then a
[package names] would return all installed packages. That's never
been strictly true. That property is not a feature of [package require].
It is only a feature of the pkgIndex.tcl system for installing packages.
But for years and years, the pkgIndex.tcl system has been the only game
in town. With Tcl 8.5, the new Tcl Module players took the field. A
search for a Tcl Module install of a package (like WS::Utils) is *not*
guaranteed to find all Tcl Module installs of all other packages, like
http-2.5.3.tm. If the search then continues to the pkgIndex.tcl packages,
though, you are guaranteed to find all the other pkgIndex.tcl packages,
like http 1.0 in http1.0/http.tcl.
None of these details really matter, so long as your program asks for
the requirements it needs. But if you tell [package require] that any
version of http is acceptable, then your program better really be
prepared to take any version.
--
| Don Porter Mathematical and Computational Sciences Division |
| donald.porter@xxxxxxxx Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
.
- References:
- Package Require getting "wrong version"
- From: Gerald W. Lester
- Re: Package Require getting "wrong version"
- From: Donald G Porter
- Re: Package Require getting "wrong version"
- From: Gerald W. Lester
- Re: Package Require getting "wrong version"
- From: Donald G Porter
- Package Require getting "wrong version"
- Prev by Date: Re: Package Require getting "wrong version"
- Next by Date: Re: Package Require getting "wrong version"
- Previous by thread: Re: Package Require getting "wrong version"
- Next by thread: Re: Package Require getting "wrong version"
- Index(es):
Relevant Pages
|