Index: openacs-4/packages/xotcl-core/tcl/04-library-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/04-library-procs.tcl,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/xotcl-core/tcl/04-library-procs.tcl 21 Oct 2017 11:42:23 -0000 1.6 +++ openacs-4/packages/xotcl-core/tcl/04-library-procs.tcl 3 Sep 2024 15:37:54 -0000 1.7 @@ -42,7 +42,7 @@ library proc doc {comment} { ad_library $comment nsv_set [self]-loaded [info script] 1 - #my log "--loaded nsv_set [self]-loaded [info script] 1" + #:log "--loaded nsv_set [self]-loaded [info script] 1" } library ad_proc require {{-package ""} filename} { @@ -58,29 +58,29 @@ @param filename filename without path and .tcl suffix } { - #my log "--loaded nsv_set [self]-loaded [info script] 1" + #:log "--loaded nsv_set [self]-loaded [info script] 1" nsv_set [self]-loaded [info script] 1 set myfile [file tail [info script]] set dirname [file dirname [info script]] if {$package eq ""} { set otherfile $dirname/$filename.tcl } else { - set otherfile [acs_root_dir]/packages/$package/tcl/$filename.tcl + set otherfile $::acs::rootdir/packages/$package/tcl/$filename.tcl } set vn [self] - #my log "--exists otherfile $otherfile => [nsv_exists $vn $otherfile]" + #:log "--exists otherfile $otherfile => [nsv_exists $vn $otherfile]" if {[nsv_exists $vn $otherfile]} { nsv_set $vn $otherfile [lsort -unique [concat [nsv_get $vn $otherfile] [info script]]] - #my log "--setting nsv_set $vn $otherfile [lsort -unique [concat [nsv_get $vn $otherfile] $myfile]]" + #:log "--setting nsv_set $vn $otherfile [lsort -unique [concat [nsv_get $vn $otherfile] $myfile]]" } else { nsv_set $vn $otherfile [info script] - #my log "--setting nsv_set $vn $otherfile $myfile" + #:log "--setting nsv_set $vn $otherfile $myfile" } - #my log "--source when not loaded [self]-loaded $otherfile: [nsv_exists [self]-loaded $otherfile]" - #my log "--loaded = [lsort [nsv_array names [self]-loaded]]" + #:log "--source when not loaded [self]-loaded $otherfile: [nsv_exists [self]-loaded $otherfile]" + #:log "--loaded = [lsort [nsv_array names [self]-loaded]]" if {![nsv_exists [self]-loaded $otherfile]} { - :log "--sourcing $otherfile" + :log "--sourcing first $otherfile" apm_source $otherfile nsv_set [self]-loaded $otherfile 1 } @@ -101,11 +101,13 @@ set myfile [file tail [info script]] set dirname [file dirname [info script]] set vn [self] - #my log "--check nsv_exists $vn $dirname/$myfile [nsv_exists $vn $dirname/$myfile]" + #:log "--check nsv_exists $vn $dirname/$myfile [nsv_exists $vn $dirname/$myfile]" if {[nsv_exists $vn $dirname/$myfile]} { foreach file [nsv_get $vn $dirname/$myfile] { - :log "--sourcing dependent $file" + incr ::__source_dependent_level + ns_log notice "--sourcing dependent ($::__source_dependent_level) $myfile -> $file" apm_source $file + incr ::__source_dependent_level -1 } } }