Update of /cvsroot/aolserver/aolserver/nsd
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8044/nsd
Modified Files:
init.tcl
Log Message:
enable use of ensemble commands in init scripts
Index: init.tcl
===================================================================
RCS file: /cvsroot/aolserver/aolserver/nsd/init.tcl,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** init.tcl 13 Apr 2006 19:06:28 -0000 1.33
--- init.tcl 24 Dec 2009 19:50:34 -0000 1.34
***************
*** 433,436 ****
--- 433,458 ----
}
+ #
+ # _ns_genensemble -
+ #
+ # if the passed command is an ensemble, returns a command
+ # to recreate it
+ # otherwise, returns an empty string
+ #
+
+ if {[catch {package require Tcl 8.5}]} {
+ proc _ns_getensemble {cmd} {}
+ } else {
+ proc _ns_getensemble {cmd} {
+ ::if {[::namespace ensemble exists $cmd]} {
+ ::array set _cfg [::namespace ensemble configure $cmd]
+ ::set _enns $_cfg(-namespace)
+ ::unset _cfg(-namespace)
+ ::set _encmd [::list namespace ensemble create -command $cmd {*}[::array get _cfg]]
+ return [::list namespace eval $_enns $_encmd]\n
+ }
+ }
+ }
+
#
***************
*** 547,550 ****
--- 569,573 ----
::append _import [::list namespace import -force $_orig] \n
}
+ ::append _import [_ns_getensemble $_cmnd]
}
|