Index: openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl,v diff -u -r1.106 -r1.107 --- openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 17 Oct 2010 21:06:09 -0000 1.106 +++ openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 8 Dec 2012 17:42:31 -0000 1.107 @@ -656,7 +656,7 @@ @author Peter Marklund } { # If acs-lang hasn't been installed yet we simply return - if { [llength [info proc lang::catalog::import]] == 0 || ![apm_package_installed_p acs-lang] } { + if { [info commands lang::catalog::import] eq "" || ![apm_package_installed_p acs-lang] } { return } Index: openacs-4/packages/acs-tcl/tcl/apm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs.tcl,v diff -u -r1.89 -r1.90 --- openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 30 Nov 2010 14:44:31 -0000 1.89 +++ openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 8 Dec 2012 17:42:32 -0000 1.90 @@ -1202,7 +1202,10 @@ @return The package id of the instance of the package. 0 if no instance exists, error if several instances exist. } { - return [util_memoize "apm_package_id_from_key_mem $package_key"] + set var ::apm::package_id_from_key($package_key) + if {[info exists $var]} {return [set $var]} + set $var [util_memoize "apm_package_id_from_key_mem $package_key"] + #set $var [ns_cache_eval ns:memoize apm_package_id_from_key_$package_key [list apm_package_id_from_key_mem $package_key]] } ad_proc -private apm_package_id_from_key_mem {package_key} { @@ -1364,7 +1367,7 @@ set procedure_name [string tolower "[string trim $package_key]_post_instantiation"] # Change all "-" to "_" to mimic our tcl standards regsub -all {\-} $procedure_name "_" procedure_name - if { [empty_string_p [info procs ::$procedure_name]] } { + if { [info commands ::$procedure_name] eq "" } { # No such procedure exists... return "" } @@ -1674,7 +1677,7 @@ @author Peter Marklund } { - if { [empty_string_p [info procs ::${proc_name}]] } { + if { [info commands ::$proc_name] eq "" } { return 0 } Index: openacs-4/packages/acs-tcl/tcl/defs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/defs-procs.tcl,v diff -u -r1.60 -r1.61 --- openacs-4/packages/acs-tcl/tcl/defs-procs.tcl 25 Mar 2010 01:02:16 -0000 1.60 +++ openacs-4/packages/acs-tcl/tcl/defs-procs.tcl 8 Dec 2012 17:42:32 -0000 1.61 @@ -299,7 +299,7 @@ } else { set curriculum_bar "" } - if { [llength [info procs ds_link]] == 1 } { + if { [info commands ds_link] ne "" } { set ds_link [ds_link] } else { set ds_link "" @@ -352,7 +352,7 @@ @see Documentation on the site master template for the proper way to standardize page footers } { - if { [llength [info procs ds_link]] == 1 } { + if { [info commands ds_link] ne "" } { set ds_link [ds_link] } else { set ds_link "" Index: openacs-4/packages/acs-tcl/tcl/ds-stub-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/ds-stub-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-tcl/tcl/ds-stub-procs.tcl 10 Jan 2007 21:22:12 -0000 1.2 +++ openacs-4/packages/acs-tcl/tcl/ds-stub-procs.tcl 8 Dec 2012 17:42:32 -0000 1.3 @@ -12,12 +12,12 @@ @cvs-id $Id$ } -if {{} eq [info procs ds_add]} { +if {[info commands ds_add] eq ""} { proc ds_add {args} {} } -if {{} eq [info procs ds_collect_db_call]} { +if {[info commands ds_collect_db_call] eq ""} { proc ds_collect_db_call {args} {} } -if {{} eq [info procs ds_collect_connection_info]} { +if {[info commands ds_collect_connection_info] eq ""} { proc ds_collect_connection_info {} {} } Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v diff -u -r1.128 -r1.129 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 18 Sep 2012 09:15:11 -0000 1.128 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 8 Dec 2012 17:42:32 -0000 1.129 @@ -834,7 +834,7 @@ # Prepend with the base URL if { [exists_and_not_null base] } { if { $export_string ne "" } { - if { [regexp {\?} $base] } { + if { [string match {*[?]*} $base] } { # The base already has query vars set export_string "${base}&${export_string}" } else { @@ -1866,7 +1866,7 @@ that may be used to execute unsafe code. } { foreach arg $args { - if { [regexp {[\[;]} $arg] } { + if { [string match {*[\[;]*} $arg] } { return -code error "Unsafe argument to safe_eval: $arg" } } @@ -2009,8 +2009,8 @@ if { $replace } { # Try to find an already-set cookie named $name. for { set i 0 } { $i < [ns_set size $headers] } { incr i } { - if { ![string compare [string tolower [ns_set key $headers $i]] "set-cookie"] && \ - [regexp "^$name=" [ns_set value $headers $i]] } { + if { [string tolower [ns_set key $headers $i]] eq "set-cookie" && + [string match "$name=*" [ns_set value $headers $i]] } { ns_set delete $headers $i } } @@ -2325,7 +2325,7 @@ set type [ns_set iget [ad_conn headers] content-type] if { [string match *multipart/form-data* [string tolower $type]] } { set user_agent [ns_set get [ad_conn headers] User-Agent] - set use_metarefresh_p [regexp -nocase "msie 5.0" $user_agent match] + set use_metarefresh_p [string match -nocase "*msie 5.0*" $user_agent match] } if {[string match "https://*" [ad_conn location]] && [string match "http://*" $url]} { # workaround the You are about to be redirected to a connection that @@ -2549,7 +2549,7 @@ ad_proc -public ad_call_proc_if_exists { proc args } { Calls a procedure with particular arguments, only if the procedure is defined. } { - if { [llength [info procs $proc]] == 1 } { + if { [llength [info commands $proc]] == 1 } { eval $proc $args } } Index: openacs-4/packages/acs-tcl/tcl/test/ad-proc-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/ad-proc-test-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-tcl/tcl/test/ad-proc-test-procs.tcl 10 Jan 2007 21:22:12 -0000 1.8 +++ openacs-4/packages/acs-tcl/tcl/test/ad-proc-test-procs.tcl 8 Dec 2012 17:42:32 -0000 1.9 @@ -23,14 +23,14 @@ } error] ad_proc -callback a_callback { -arg1 arg2 } { this is a test callback } - - set callback_procs [info procs ::callback::a_callback::*] + set callback_procs [info command ::callback::a_callback::*] aa_true "creation of a valid callback contract with '-' body" \ [expr {[lsearch -exact \ $callback_procs \ ::callback::a_callback::contract] >= 0}] ad_proc -callback a_callback_2 { arg1 arg2 } { this is a test callback } {} - set callback_procs [info procs ::callback::a_callback_2::*] + set callback_procs [info commands ::callback::a_callback_2::*] aa_true "creation of a valid callback contract with no body" \ [expr {[lsearch -exact \ $callback_procs \ @@ -50,7 +50,7 @@ this is a test callback implementation } { } - set impl_procs [info procs ::callback::a_callback::impl::*] + set impl_procs [info commands ::callback::a_callback::impl::*] aa_true "creation of a valid callback implementation" \ [expr {[lsearch -exact \ $impl_procs \