Index: openacs-4/packages/acs-bootstrap-installer/installer.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/installer.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-bootstrap-installer/installer.tcl 12 Apr 2001 16:58:18 -0000 1.1 +++ openacs-4/packages/acs-bootstrap-installer/installer.tcl 16 Apr 2001 04:46:21 -0000 1.2 @@ -121,7 +121,7 @@ ]} { set system_file "$system_file.tcl" } - source "[acs_root_dir]/www/SYSTEM/$system_file" + acs_source "[acs_root_dir]/www/SYSTEM/$system_file" return "filter_return" } @@ -145,7 +145,7 @@ ns_mutex lock [nsv_get acs_installer mutex] if { [catch { # Source the page and then unlock the mutex. - source $path + acs_source $path ns_mutex unlock [nsv_get acs_installer mutex] } error] } { # In case of an error, don't forget to unlock the mutex. Index: openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl 12 Apr 2001 16:58:18 -0000 1.1 +++ openacs-4/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl 16 Apr 2001 04:46:21 -0000 1.2 @@ -30,6 +30,14 @@ error "$path is not under the path root ([acs_root_dir])" } +# A "safe" way to source a Tcl file. This is mainly so we can trace sourcing in the call stack, +# which is fairly important in the QD, and generally a better idea for figuring out what the +# heck is going on. (ben) +proc acs_source { path } { + # That's right, that's all we're doing. Wrapping source so we can do call stack traces. + source $path +} + proc ad_parse_documentation_string { doc_string elements_var } { upvar $elements_var elements if { [info exists elements] } { Index: openacs-4/packages/acs-tcl/tcl/apm-file-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-file-procs-postgresql.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-tcl/tcl/apm-file-procs-postgresql.xql 12 Apr 2001 17:15:38 -0000 1.2 +++ openacs-4/packages/acs-tcl/tcl/apm-file-procs-postgresql.xql 16 Apr 2001 04:46:21 -0000 1.3 @@ -1,5 +1,6 @@ +postgresql7.1 @@ -11,7 +12,6 @@ :db_type ) -postgresql7.1 @@ -21,7 +21,6 @@ :version_id ) -postgresql7.1 Index: openacs-4/packages/acs-tcl/tcl/apm-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-tcl/tcl/apm-procs-postgresql.xql 5 Apr 2001 18:23:38 -0000 1.1 +++ openacs-4/packages/acs-tcl/tcl/apm-procs-postgresql.xql 16 Apr 2001 04:46:21 -0000 1.2 @@ -1,5 +1,6 @@ +postgresql7.1 @@ -14,7 +15,6 @@ :min_n_values, :max_n_values); -postgresql7.1 @@ -23,7 +23,6 @@ from apm_parameters p LEFT JOIN apm_parameter_values v using (parameter_id) where p.package_key = :package_key -postgresql7.1 @@ -35,7 +34,6 @@ :interface_version ) -postgresql7.1 @@ -44,7 +42,6 @@ :interface_id ); -postgresql7.1 @@ -56,7 +53,6 @@ :dependency_version ) -postgresql7.1 Index: openacs-4/packages/acs-tcl/tcl/db-query-dispatcher-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/db-query-dispatcher-procs.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/acs-tcl/tcl/db-query-dispatcher-procs.tcl 15 Apr 2001 23:09:55 -0000 1.4 +++ openacs-4/packages/acs-tcl/tcl/db-query-dispatcher-procs.tcl 16 Apr 2001 04:46:21 -0000 1.5 @@ -152,27 +152,52 @@ return $local_name } + # Test stuff (ben) + for {set i 0} {$i < 5} {incr i} { + if {[catch {ns_log Notice "QD = LEVEL $i = [info level [expr "0 - $i"]]"} errmsg]} { + break + } + } + # Get the proc name being executed. set proc_name [info level [expr "-1 - $added_stack_num"]] # We check if we're running the special ns_ proc that tells us # whether this is an URL or a Tcl proc. - if {[regexp {^ns_sourceproc} $proc_name all]} { + if {[regexp {^ns_sourceproc} $proc_name all] || \ + [regexp {^acs_source} $proc_name all]} { # Means we are running inside an URL + # Now we do a check to see if this is a directly accessed URL or a sourced URL + if {[regexp {^ns_sourceproc} $proc_name all]} { + set real_url_p 1 + set url [ns_conn url] + } else { + set real_url_p 0 + set url [lindex $proc_name 1] + set url [ad_make_relative_path $url] + regsub {^/?packages} $url {} url + } + # Get the URL and remove the .tcl - set url [ns_conn url] + regsub {^/} $url {} url regsub {\.tcl$} $url {} url # Change all dots to colons, and slashes to dots regsub -all {\.} $url {:} url regsub -all {/} $url {.} url # We insert the "www" after the package key - regexp {^([^\.]*)(.*)} url all package_key rest + regexp {^([^\.]*)(.*)} $url all package_key rest - set full_name "acs.${package_key}.www.${rest}.${local_name}" + ns_log Notice "QD = package key is $package_key and rest is $rest" + + if {$real_url_p} { + set full_name "acs.${package_key}.www${rest}.${local_name}" + } else { + set full_name "acs.${package_key}${rest}.${local_name}" + } } else { # Let's find out where this Tcl proc is defined!! # Get the first word, which is the Tcl proc Index: openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql 8 Apr 2001 16:12:26 -0000 1.1 +++ openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql 16 Apr 2001 04:46:21 -0000 1.2 @@ -1,13 +1,16 @@ + + + + postgresql + 7.1 + + insert into secret_tokens(token_id, token, timestamp) values (sec_security_token_id_seq.nextval, :random_token, now()) - - postgresql - 7.1 -