You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by Massimo Manghi <ma...@unipr.it> on 2008/01/07 17:57:10 UTC

small fixes for DIO and init.tcl

small fixes for DIO (David Welton knows how
weird this sentence is for an italian speaker)

auto_path shouldn't be set or modified outsite
the init.tcl (like in dio.tcl) or by intervention 
of the user. 

This practice can lead to wrong packages being 
loaded when multiple versions are installed. 
Therefore I removed the 'lappend' command at the 
very beginning of dio.tcl and changed the position
within auto_path of the Tcl packages' directory.

 -- Massimo

Index: rivet/init.tcl
===================================================================
--- rivet/init.tcl	(revision 609658)
+++ rivet/init.tcl	(working copy)
@@ -75,9 +75,11 @@
 	## Add the packages directory to the auto_path.
 	## If we have a packages$tcl_version directory
 	## (IE: packages8.3, packages8.4) append that as well.
+
+	## The packages directory come right after the rivet-tcl directory.
 	set pkgpath [file join [file dirname [info script]] packages]
-	lappend auto_path $pkgpath
-	lappend auto_path ${pkgpath}-local
+	set auto_path [linsert $auto_path 1 $pkgpath]
+	set auto_path [linsert $auto_path 2 ${pkgpath}-local]
 
 	if { [file exists ${pkgpath}$::tcl_version] } {
 	    lappend auto_path ${pkgpath}$::tcl_version
@@ -85,6 +87,8 @@
 
 	## This will allow users to create proc libraries and tclIndex files
 	## in the local directory that can be autoloaded.
+	## Perhaps this must go to the front of the list to allow the user
+	## to override even Rivet's procs.
 	lappend auto_path .
     }
 
Index: rivet/packages/dio/dio_Mysql.tcl
===================================================================
--- rivet/packages/dio/dio_Mysql.tcl	(revision 609658)
+++ rivet/packages/dio/dio_Mysql.tcl	(working copy)
@@ -50,7 +50,6 @@
 	    if {![lempty $pass]} { lappend command -password $pass }
 	    if {![lempty $port]} { lappend command -port $port }
 	    if {![lempty $host]} { lappend command -host $host }
-
 	    if {[catch $command error]} { return -code error $error }
 
 	    set conn $error
Index: rivet/packages/dio/dio.tcl
===================================================================
--- rivet/packages/dio/dio.tcl	(revision 609658)
+++ rivet/packages/dio/dio.tcl	(working copy)
@@ -18,7 +18,7 @@
 
 catch {package require Tclx}
 package require Itcl
-set auto_path [linsert $auto_path 0 [file dirname [info script]]]
+##set auto_path [linsert $auto_path 0 [file dirname [info script]]]
 
 namespace eval ::DIO {
 


--
Universita' degli Studi di Parma (http://www.unipr.it)


---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org