Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Add local initialization script for Tcl.

Open219375ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 25 years ago
Descriptionplain2000-10-26 05:11:49
OriginalBugID: 5998 RFE
Version: 8.1.1
SubmitDate: '2000-07-10'
LastModified: '2000-10-25'
Severity: LOW
Status: UnAssn
Submitter: techsupp
OS: BSD
OSVersion: BSD/OS 4.0.1
Machine: x86 pc architecture
FixedDate: '2000-10-25'
ClosedDate: '2000-10-25'


Name:

Robert Hare


Extensions:

BerkeleyDB.3.0,  mpexpr1.0


DesiredBehavior:

It would be nice to have the following code added to the init.tcl script:

     # Perform any local initialization.

     if {[file exists [file join [info library] init-local.tcl]]} {

          source [file join [info library] init-local.tcl]

     }


This allows customized local initializations to be performed.  In our case we want to add entries

to the default auto_path so that packages we have installed can be found without having to

tweak on the auto_path in every program.


Patch:

--- init.tcl.orig       Tue Jun 15 08:28:19 1999

+++ init.tcl    Fri Jul  7 11:10:00 2000

@@ -570,3 +570,9 @@

 }


 }

+

+

+# Perform any local initialization.

+if {[file exists [file join [info library] init-local.tcl]]} {

+    source [file join [info library] init-local.tcl]

+}


PatchFiles:

init.tcl
dkfplain2001-01-25 17:10:38
I like this idea, though I'm not too sure what the best location for such an initialization script is (apart from probably being platform-dependent.)  What do other systems that have to deal with this problem do?
dgpplain2001-01-26 03:58:20
Back when this was first proposed, it spawned a thread
on comp.lang.tcl.  See

http://deja.com/=dnc/viewthread.xp?AN=646185059
dkfplain2001-01-26 16:54:51
Might I recommend particularly the following message from that thread:
http://www.deja.com/getdoc.xp?AN=645101031
dkf Ticket [219375ffff]: 1 change [History diff]2001-01-31 17:32:45
dgpplain2001-02-01 01:19:26
Registered patch as #103526
dgp Ticket [219375ffff]: 1 change [History diff]2001-02-08 08:23:35
dgp Ticket [219375ffff]: 1 change [History diff]2001-04-04 04:57:11
dgpplain2001-07-22 01:58:36
Logged In: YES 
user_id=80530

The referenced c.l.t thread is now available at:

http://groups.google.com/groups?hl=en&safe=off&th=e11c0f97f99942,7&seekm=8kckfn%247jg%241%40bob.news.rcn.net

I'm not sure which message Donal wanted to point to in
particular.
dgpplain2002-04-12 22:24:06
Logged In: YES 
user_id=80530

Kevin Kenny notes in the Tcl'ers chat that a
site-initialization script like this one would
be the place for sysadmins to set the default
locale for the Tcl library for their systems.

More important as most localization stuff gets
put into Tcl.
hobbsplain2002-04-13 02:40:27
Logged In: YES 
user_id=72656

For Kevin's case, 8.4 (which uses nl_langinfo) should be 
much better already at guessing locales, but I still think 
there is value in have such a facility available to 
sysadmins.
Log in (anonymous is fine) to add a comment.