Am 07.04.24 um 16:52 schrieb
[email protected]:
Installing tkpath from chiselapp.com into a Slackware Linux system with
the usual ./configure --with-tcl... make, make install seemed to work. However executing
package require tkpath
in tkcon (version 2.7) gives proc not found errors. The package require worked fine in tclsh or wish.
The original pkgIndex.tcl is:
#pkgIndex.tcl. Generated from pkgIndex.tcl.in by configure.
#
namespace eval ::tkpath {
proc load_package {dir} {
load [file join $dir libtkpath0.3.3.so]
# Allow optional redirect of library components.
# Only necessary for testing, but could be used elsewhere.
if {[info exists ::env(TKPATH_LIBRARY)]} {
set dir $::env(TKPATH_LIBRARY)
}
source $dir/tkpath.tcl
};# load_package
}
package ifneeded tkpath 0.3.3 [list ::tkpath::load_package $dir]
#*EOF*
When the load_package proc was implemented as an annonymous procedure in the package ifneeded command tkcon, tclsh and wish can all load the package.
package ifneeded tkpath 0.3.3 [list apply {{dir} {
load [file join $dir libtkpath0.3.3.so]
# Allow optional redirect of library components.
# Only necessary for testing, but could be used elsewhere.
if {[info exists ::env(TKPATH_LIBRARY)]} {
set dir $::env(TKPATH_LIBRARY)
}
source $dir/tkpath.tcl
}} $dir]
Is this a known problem in tkcon, something unique to the tkpath package, or just something wrong in my system configuration?
Dave B
#The original pkgIndex.tcl see the same. Works with tclsh and tkcon
#Is it perhaps not included in the auto_path of tkcon?
#Compare the output in tclsh and tkcon.
#! /usr/bin/env tclsh
#
https://wiki.tcl-lang.org/page/The+RC+File
proc lspackages {{pattern *}} {
# Force the package loader to do its thing:
# NOTE: this depends on a side effect of the
# built-in [package unknown]. Other [package unknown]
# handlers might not meet our expectations.
eval [package unknown] Tcl [package provide Tcl]
set rlist [list ]
foreach package [lsort [package names]] {
if {![string match $pattern $package]} { continue }
foreach version [package versions $package] {
set present [expr {[string compare $version [package
provide $package]] ? " " : "+" }]
set ifneeded [string replace [string trim [string map
{"\n" " " "\t" " "} [package ifneeded $package $version]]] 50 end "..."]
#puts [format "%1s%-35s %6s %-75s" $present $package
$version $ifneeded]
lappend rlist [list $present $package $version $ifneeded]
}
}
return $rlist
}
puts [lspackages tkpath]
puts [join $auto_path "\n"]
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)