Index: generic/aol-xotcl.tcl =================================================================== diff -u -r563057617439268857362e03beffe5711ca2d5ed -rdb25b05a86452db1b157dd556f061dec85d8de3f --- generic/aol-xotcl.tcl (.../aol-xotcl.tcl) (revision 563057617439268857362e03beffe5711ca2d5ed) +++ generic/aol-xotcl.tcl (.../aol-xotcl.tcl) (revision db25b05a86452db1b157dd556f061dec85d8de3f) @@ -1,9 +1,14 @@ # # Load Next Scripting Framework, XOTcl and some related packages for -# AOLserver 4.*. The file is not needed for e.g. naviserver, where -# the logic resides in ns/tcl/nstrace.tcl +# AOLserver 4.* and naviserver. # -# We expect to find the packages in standard Tcl package search path +# - aolserver: rewrite essentially _ns_savenamespaces to include the +# serialized objects +# +# - naviserver: just needed for the package require +# the serialization logic resides in ns/tcl/nstrace.tcl +# +# We expect to find the package in standard Tcl package search path # (the auto_path var) The simplest location is to put them under the # "lib" directory within the AOLserver tree. # @@ -12,13 +17,16 @@ package require nx::serializer ns_log notice "XOTcl version $::xotcl::version$::xotcl::patchlevel loaded" -# -# Overload procedure defined in bin/init.tcl. -# It is now XOTcl-savvy in how it treats some -# special namespaces. -# - -proc _ns_savenamespaces {} { +if {[ns_info name] ne "NaviServer"} { + # + # We are loading into aolserver. + # + # Overload procedure defined in bin/init.tcl. + # It is now XOTcl-savvy in how it treats some + # special namespaces. + # + + proc _ns_savenamespaces {} { set script [_ns_getpackages] set import "" set nslist "" @@ -52,14 +60,14 @@ puts $f $script close $f } -} + } -# -# Source XOTcl files from shared/private library -# the way AOLserver does for plain Tcl files. -# - -proc _my_sourcefiles {shared private} { + # + # Source XOTcl files from shared/private library + # the way AOLserver does for plain Tcl files. + # + + proc _my_sourcefiles {shared private} { set files "" foreach file [lsort [glob -nocomplain -directory $shared *.xotcl]] { if {[file exists [file join $private [file tail $file]]] == 0} { @@ -72,11 +80,11 @@ foreach file $files { _ns_sourcefile $file } -} + } -ns_eval { - _my_sourcefiles [ns_library shared] [ns_library private] + ns_eval { + _my_sourcefiles [ns_library shared] [ns_library private] + } } -# EOF $RCSfile: aol-xotcl.tcl,v $