I'm afraid we misunderstand what information "package versions <pkg>"
provides
I have in /usr/lib/tcltk/rivet3 the packages that come with rivet 3.2.4.
(dio_Tdbc 1.0 is one of them). But for a project of mine I needed
dio_Tdbc 1.2 so I installed the whole bunch of up to date DIO stuff in a
directory within the project directory tree
tclsh8.6 [~] package versions dio_Tdbc
0.1
tclsh8.6 [~] set auto_path [concat public_html/erice $auto_path]
....
tclsh8.6 [~] package require dio_Tdbc 1.2
1.2
tclsh8.6 [~] package versions dio_Tdbc
0.1 1.2
I guess the reason is that for the system installed packages the
pkgIndex.tcl files are pre-fetched at Tcl shell startup.
# tclsh
tclsh8.6 [~] package ifneeded dio_Tdbc 1.2 [list source [file join
public_html erice dio_Tdbc]]
tclsh8.6 [~] package versions dio_Tdbc
0.1 1.2
-- M
On 3/17/25 10:39, Scott Pitcher wrote:
I tried ...
set website(basedir) [file dir [info script]]
set website(libdir) [file join $website(basedir) lib]
set website(3rdpartydir) [file join $website(basedir) .. 3rdparty]
set ::auto_path [concat [file normalize $website(libdir)]
$::auto_path]
if {[file isdirectory $website(3rdpartydir)]} {
set ::auto_path [concat [file normalize $website(3rdpartydir)]
$::auto_path]
}
# Test package loading.
::rivet::apache_log_error notice "Apackage versions=[package
versions Apackage]"
::rivet::apache_log_error notice "Apackage loaded=[package require
-exact Apackage 1.0]"
........................................................................
} on ok {} {
::rivet::apache_log_error notice "childboot completed"
}
Restart apache, but /package versions..../ still show 1.1 and not the 1.0:
[Mon Mar 17 20:26:28.235295 2025] [:notice] [pid 753] Apackage
versions=1.1
[Mon Mar 17 20:26:28.264136 2025] [:notice] [pid 753] Apackage loaded=1.0
[Mon Mar 17 20:26:28.264178 2025] [:notice] [pid 753] childboot completed
Note here in this test site I can /package require -exact/ and it will
load 1.0. That doesn't happen on the website - only 1.1 is available.
The strange behaviour there is that If I remove the 1.1 from the system
(sudo rm -rv /usr/local/lib/tcltk/A-package) and reload apache, the
local 1.0 package in 3rdparty directory is available again. It loads,
but does not show up /package versions/.
Kind regards,
Scott
On 17/3/25 19:34, Massimo Manghi wrote:
I've spotted these lines
set website(basedir) [file dir [info script]]
set website(libdir) [file join $website(basedir) lib]
set website(3rdpartydir) [file join $website(basedir) .. 3rdparty]*
lappend ::auto_path [file normalize $website(libdir)]
is this the hierarchy of directories adjacent to the website code?
What if build the auto_path the way around?
set ::auto_path [concat [file normalize $website(libdir)] $::auto_path]
and have the packages take precedence?
-- Massimo
On 3/17/25 09:01, Scott Pitcher wrote:
Hi,
I'm trying to load only a 1.0 version of the package from a
"3rdparty" directory adjacent to the website code. I discovered that
the 1.1 wasn't 100% compatible and that caused the Maintenance
threads to cycle like crazy without their customary waiting time.
There were many many months between using 1.0 on the website and
installing the 1.1 package independently so it caught me by surprise.
But the trouble came when I tried to load the /-exact ... 1.0/
version and that failed because only 1.1 is available, now (with 1.1
installed under /usr/local/....). It could not see the 1.0 anymore.
But, if I remove 1.1 from the system and restart apache then it loads
the 1.0 once again and uses it quite happily.
In the cut down test code I posted I couldn't replicate a step. With
both packages available I can successfully/package require -exact ...
1.0/, even with 1.1 installed under /usr/local/...
HOWEVER there is a little strangeness as the 1.0 package does not
show up in /package versions/, but I can still load it anyway.
Kind regards,
Scott
set website(basedir) [file dir [info script]]
set website(logdir) [file join $website(basedir) .. log]
set website(libdir) [file join $website(basedir) lib]
* set website(3rdpartydir) [file join $website(basedir) .. 3rdparty]*
set website(tmpdir) [file join $website(basedir) .. tmp]
..............................................................................................
#
# Set the path for loading tclIndex files. This is all we need
and the rest of the library
# will load. Any source directories in the website
configuration should be in
# website(SourceDirs) after content is loaded, and we'll set
those after.
#
lappend ::auto_path [file normalize $website(libdir)]
if {[file isdirectory $website(3rdpartydir)]} {
*lappend ::auto_path [file normalize $website(3rdpartydir)]*
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
--
+-----------------------------------------------------------------------------+
|...will make the wilderness a pool of water, the dry land springs of water...|
+-----------------------------------------------------------------------------+
| Scott [email protected] |
| +61-3-9008-5695 (B) SVP Technical Services |
|PGP:https://gnupg.org/ ABN 79 220 496 603 |
|KEY:https://pgp.mit.edu/pks/lookup?op=vindex&search=0xEDBE43639EFD884D |
+-----------------------------------------------------------------------------+
DISCLAIMER:
The content of this email is confidential and strictly intended only for the
recipient(s) specified in the message. If you have received this message by
mistake it is strictly forbidden to keep this email in any form, electronic
or hard copy, or to share any part of it with any one else, without the prior,
written consent of the author. If you have received this message by mistake,
please let me know by replying to this email, and then destroy it and any
copies.
SECURITY:
I prefer to send and receive confidential messages protected by PGP public
key encryption. If you are willing to or are interested in protecting our
email communication with PGP encryption, please refer tohttps://gnupg.org/.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]