Cecil Westerhof <
Ce...@decebal.nl> wrote:
> Christian Gollwitzer <
auri...@gmx.de> writes:
>
>> Am 08.12.17 um 01:35 schrieb Cecil Westerhof:
>>> I am not that far yet, but when I am going to write my own packages:
>>> what is the best place to install them? I was thinking:
>>> /usr/local/lib/tcltk
>>>
>>> Is that correct?
>>
>> In general, you can put them anywhere you like. But: are you asking,
>> how Tcl *finds* the packages? The answer is the variable auto_path,
>> which contains a list of directories which Tcl searches recursively
>> for packages. A package is made by a pkgIndex.tcl file. Try this:
>
> I should have been more clear. When using:
Yes, more clarity in one's origional posts often results in a *much*
lower latency between asking and receiving the answer you want.
> join $auto_path \n
>
> I get:
> /usr/share/tcltk/tcl8.6
> /usr/share/tcltk
> /usr/lib
> /usr/local/lib/tcltk
> /usr/local/share/tcltk
> /usr/lib/tcltk/x86_64-linux-gnu
> /usr/lib/tcltk
> /usr/lib/tcltk/tcl8.6
>
> And from those I thought
> /usr/local/lib/tcltk
> would be the most logical.
>
> By the way, I am using Debian 9.
Those are the default locations where Tcl, on your system, searches for
packages.
But you can place your own packages anywhere you like, and simply add
an entry to that list by either appending, or prepending, a new
directory to the global "auto_path" variable.
So if you wanted to keep your tcl modules in /home/cecil/tcl-modules/
you can, and your scripts just need:
lappend auto_path /home/cecil/tcl-modules
before they try to package require any of your personal modules (note,
prepending is left as an exercise for the reader).