From: <no...@tc...> - 2025-10-06 07:33:45
|
Automated mail by fx, on behalf of no...@tc... Ticket Change [f2840ebb0fbf26f88dcf54d58d5d5438ab5939f33a4c1962aef7e6410a023dd1] [pluginmgr potential collisions with files/folders in cwd] By juliannoble2 For Tcllib On 2025-10-06T07:27:58.421 Details https://core.tcl-lang.org/tcllib/tinfo?name=f2840ebb0fbf26f88dcf54d58d5d5438ab5939f33a4c1962aef7e6410a023dd1 Ticket https://core.tcl-lang.org/tcllib/tktview/1a7976b873c9828c29c5abc0ac90739f196ab783 Changed Fields assignee: icomment: I guess I'm suggesting adding something like the following to the LoadPlugin method, along with documentation to indicate that the home, env and registry based paths don't automatically support .tm based modules, only supporting pkgIndex.tcl based libs or dropin 'directplugin.tcl' files. Other arbitrary paths could still be supported by an application specifically for .tm or pkgIndex.tcl packages - as long as they were ordinarily (or explicitly) configured in auto_path or tcl::tm::list. If this approach were taken, a similar code block would be needed in the list method to append appropriate entries to the results. foreach p $paths { set fp [file join $p $name] #This won't load .tm files if {[file exists $fp.tcl] && [file type $fp.tcl] eq "file"} { # Plugin files can be loaded directly without pkgIndex.tcl # This allows dropping of a single plugin.tcl file into a home, env or registry based plugin path # Such a file may override libs here or on auto_path, and may override modules already in tm path. $sip invokehidden source $fp.tcl return 1 } if {[file exists [file join $p pkgIndex.tcl]} { $sip invokehidden source [file join $p pkgIndex.tcl] #and pkgIndex.tcl one level deep - review set subdirs [glob -nocomplain -directory $p -types d -tails *] foreach s $subdirs { if {[file exists [file join $p $s pkgIndex.tcl]]} { $sip invokehidden source [file join $p $s pkgIndex.tcl] } } #continue below to load packages } } login: juliannoble2 ------------------------------------------------------------ See Tcl/Tk development @ http://core.tcl-lang.org/ ------------------------------------------------------------ |