Index: openacs-4/packages/acs-core-docs/www/files/deploy =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/files/deploy,v diff -u -r1.1 -r1.1.20.1 --- openacs-4/packages/acs-core-docs/www/files/deploy 3 Mar 2004 13:21:22 -0000 1.1 +++ openacs-4/packages/acs-core-docs/www/files/deploy 13 Oct 2013 10:33:54 -0000 1.1.20.1 @@ -61,13 +61,13 @@ help {set help_p true} version {set help_p true} switch {set switch_p true} - demote {if {[string length $arg1] >0 } { + demote {if {$arg1 ne "" } { set demote $arg1 } { set help_p true } } - promote {if {[string length $arg1] >0 } { + promote {if {$arg1 ne "" } { set promote $arg1 } { set help_p true @@ -91,7 +91,7 @@ while {[regexp {(.[^\n]+)} $channel_fodder match_fodder row] } { # remove each row as it's handled set remove_count [string length $row] - set channel_fodder [string range $channel_fodder [expr $remove_count + 1] end] + set channel_fodder [string range $channel_fodder [expr {$remove_count + 1}] end] set channel [string range $row 9 10] set port [string range $row 33 37] set status [string range $row 12 14] @@ -131,7 +131,7 @@ close $fileId } - if { ![string equal $file_contents ""]} { + if { $file_contents ne "" } { set channel_match [lsearch -regexp $channel_data $file_contents ] if { $channel_match >= 1 } { set channel_info [lindex $channel_data $channel_match] @@ -183,7 +183,7 @@ standby dis } $type] - if { [string equal $balance_status $should_be] } { + if {$balance_status eq $should_be} { set status OK } else { set status "PROBLEM: is $balance_status, should be $should_be" @@ -220,7 +220,7 @@ global balance_bin set demote_server [lindex $server_list [lsearch -regexp $server_list $server]] - if { ![string equal [lindex $demote_server 4] live] } { + if { [lindex $demote_server 4] ne "live" } { puts "$server is not a live server - cannot demote" exit } @@ -253,7 +253,7 @@ global balance_bin set promote_server [lindex $server_list [lsearch -regexp $server_list $server]] - if { ![string equal [lindex $promote_server 4] standby] } { + if { [lindex $promote_server 4] ne "standby" } { puts "$server is not a standby server - cannot promote" exit } @@ -287,12 +287,12 @@ exit } -if { [string length $demote] >0 } { +if { $demote ne "" } { demote $demote exit } -if { [string length $promote] >0 } { +if { $promote ne "" } { promote $promote exit } Index: openacs-4/packages/acs-core-docs/www/files/openacs.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/files/openacs.txt,v diff -u -r1.1 -r1.1.18.1 --- openacs-4/packages/acs-core-docs/www/files/openacs.txt 16 Apr 2004 12:59:35 -0000 1.1 +++ openacs-4/packages/acs-core-docs/www/files/openacs.txt 13 Oct 2013 10:33:54 -0000 1.1.18.1 @@ -58,10 +58,10 @@ while {[regexp {(.[^\n]+)} $file_contents match_fodder row] } { # remove each row as it's handled set remove_count [string length $row] - set file_contents [string range $file_contents [expr $remove_count + 1] end] + set file_contents [string range $file_contents $remove_count+1 end] # skip comment lines - if { [string equal [string index $row 0] \#] } { + if {[string index $row 0] eq "\#"} { continue } @@ -102,7 +102,7 @@ set time "" # remove each row as it's handled set remove_count [string length $row] - set svstat_txt [string range $svstat_txt [expr $remove_count + 1] end] + set svstat_txt [string range $svstat_txt $remove_count+1 end] regexp {/service/(.+):} $row match_fodder server regexp {:\s([a-z]+)\s} $row match_fodder svc_status regexp {\s([0-9]+)\sseconds} $row match_fodder time @@ -166,7 +166,7 @@ foreach server $server_list { set temp_status [lindex [array get servers ${server}_svc_status] 1] - if { [string equal [string trim $temp_status] up] } { + if {[string trim $temp_status] eq "up"} { set svc_status [lindex [array get servers ${server}_time] 1] } else { set svc_status $temp_status @@ -190,7 +190,7 @@ # if server is not running, start it set status [lindex [array get servers ${server}_svc_status] 1] - if { ![string equal $status "up"]} { + if { $status ne "up" } { puts "Server is not up; starting server" svc_cmd $server start } @@ -253,19 +253,19 @@ # start and restart are based on a key phrase in the log file - if { [string equal $action stop] } { + if {$action eq "stop"} { for { set x 1} { $x<120} {incr x} { # show the log set logline [read $fileId] - if { [string length $logline] > 0 } { + if { $logline ne "" } { puts $logline } # check daemontools svstat_getinfo set status [lindex [array get servers ${server}_svc_status] 1] - if { [string equal $status "down"]} { + if {$status eq "down"} { puts "${server} is down" close $fileId return @@ -277,11 +277,11 @@ puts "gave up waiting after 2 minutes" } } else { - if { [string equal $status "up"] && [string equal $flag "-u"]} { + if { $status eq "up" && $flag eq "-u"} { puts "$server is already up" return } - if { [string equal $status "down"] && [string equal $flag "-t"]} { + if { $status eq "down" && $flag eq "-t"} { puts "$server is down; attempting a start instead of a restart" set flag "-u" @@ -291,7 +291,7 @@ # check the server log every 100 ms for { set x 1} {$x<1200} {incr x} { set logline [read $fileId] - if { [string length $logline] > 0 } { + if { $logline ne "" } { puts $logline if { [regexp "accepting connections" $logline]} { close $fileId @@ -350,28 +350,28 @@ switch -glob -- $arg_1 { start { - if {[string length $arg_2] >0 } { + if {$arg_2 ne "" } { start $arg_2 exit } } stop - restart - reload { - if {[string length $arg_2] >0 } { + if {$arg_2 ne "" } { svc_cmd $arg_2 $arg_1 exit } } status { status - if { [string equal $arg_2 verbose] } { + if {$arg_2 eq "verbose"} { puts $verbose_status } exit } add { - if {[string length $arg_2] >0 } { + if {$arg_2 ne "" } { add $arg_2 exit } Index: openacs-4/packages/acs-core-docs/www/files/tutorial/myfirstpackage-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/files/tutorial/myfirstpackage-procs.tcl,v diff -u -r1.5 -r1.5.10.1 --- openacs-4/packages/acs-core-docs/www/files/tutorial/myfirstpackage-procs.tcl 10 Jan 2007 21:22:03 -0000 1.5 +++ openacs-4/packages/acs-core-docs/www/files/tutorial/myfirstpackage-procs.tcl 13 Oct 2013 10:33:54 -0000 1.5.10.1 @@ -14,7 +14,7 @@ -test_code { set name [ad_generate_random_string] set new_id [mfp::note::add -title $name] - aa_true "Note add succeeded" [exists_and_not_null new_id] + aa_true "Note add succeeded" ([info exists new_id] && $new_id ne "") mfp::note::get -item_id $new_id -array note_array aa_true "Note contains correct title" [string equal $note_array(title) $name] @@ -39,7 +39,7 @@ set name {-Bad [BAD] \077 { $Bad}} append name [ad_generate_random_string] set new_id [mfp::note::add -title $name] - aa_true "Note add succeeded" [exists_and_not_null new_id] + aa_true "Note add succeeded" ([info exists new_id] && $new_id ne "") mfp::note::get -item_id $new_id -array note_array aa_true "Note contains correct title" [string equal $note_array(title) $name] Index: openacs-4/packages/acs-core-docs/www/sql/display-sql.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/sql/display-sql.tcl,v diff -u -r1.5.10.1 -r1.5.10.2 --- openacs-4/packages/acs-core-docs/www/sql/display-sql.tcl 9 Sep 2013 16:44:18 -0000 1.5.10.1 +++ openacs-4/packages/acs-core-docs/www/sql/display-sql.tcl 13 Oct 2013 10:33:55 -0000 1.5.10.2 @@ -35,7 +35,7 @@ ad_script_abort } -if {[exists_and_not_null package_key]} { +if {$package_key ne ""} { set safe_p [regexp {/?(.*)} $url package_url] } Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/form-builder.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/form-builder.xml,v diff -u -r1.8 -r1.8.12.1 --- openacs-4/packages/acs-core-docs/www/xml/developers-guide/form-builder.xml 17 Jul 2006 05:38:37 -0000 1.8 +++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/form-builder.xml 13 Oct 2013 10:33:55 -0000 1.8.12.1 @@ -76,7 +76,7 @@ block that extends the form, you'll have the opportunity to add in subcategories: - if {[exists_and_not_null pm_task_id]} { + if {[info exists pm_task_id] && $pm_task_id ne ""} { db_1row get_task_values { } ad_form -extend -name form_name -form { ... } @@ -101,7 +101,7 @@ ns_log notice it's my page! set mypage [ns_getform] -if {[string equal "" $mypage]} { +if {$mypage eq ""} { ns_log notice no form was submitted on my page } else { ns_log notice the following form was submitted on my page Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/subsites.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/subsites.xml,v diff -u -r1.8 -r1.8.12.1 --- openacs-4/packages/acs-core-docs/www/xml/developers-guide/subsites.xml 17 Jul 2006 05:38:37 -0000 1.8 +++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/subsites.xml 13 Oct 2013 10:33:55 -0000 1.8.12.1 @@ -337,11 +337,11 @@ -if [template::form is_valid new_note] { +if {[template::form is_valid new_note]} { set user_id [ad_conn user_id] set peeraddr [ad_conn peeraddr] - if [info exists note_id] { + if {[info exists note_id]} { db_dml note_update { update notes set title = :title, Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml,v diff -u -r1.50.2.2 -r1.50.2.3 --- openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml 9 Sep 2013 16:50:34 -0000 1.50.2.2 +++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml 13 Oct 2013 10:33:55 -0000 1.50.2.3 @@ -712,7 +712,7 @@ set use_categories_p [parameter::get -parameter "EnableCategoriesP" -default 0] - if { $use_categories_p == 1 && [exists_and_not_null category_id] } { + if { $use_categories_p == 1 && $category_id ne "" } { set from_clause "category_object_map com, acs_named_objects nam" set_where_clause "com.object_id = qa.entry_id and @@ -1613,7 +1613,7 @@ ns_param verbose $debug ns_param extendedtableinfo true ns_param logsqlerrors $debug -if { $database == "oracle" } { +if { $database eq "oracle" } { ns_param driver ora8 ns_param datasource {} ns_param user $db_name Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-debug.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-debug.xml,v diff -u -r1.12 -r1.12.12.1 --- openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-debug.xml 17 Jul 2006 05:38:37 -0000 1.12 +++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-debug.xml 13 Oct 2013 10:33:55 -0000 1.12.12.1 @@ -146,7 +146,7 @@ set name [ad_generate_random_string] set new_id [mfp::note::add -title $name] - aa_true "Note add succeeded" [exists_and_not_null new_id] + aa_true "Note add succeeded" ([info exists new_id] && $new_id ne "") To test our simple case, we must load the test file into the system (just as with the /tcl file in the basic tutorial, since the file didn't exist when the system started, the system doesn't know about it.) To make this file take effect, go to the APM and choose "Reload changed" for "MyFirstPackage". Since we'll be changing it frequently, select "watch this file" on the next page. This will cause the system to check this file every time any page is requested, which is bad for production systems but convenient for developing. We can also add some aa_register_case flags to make it easier to run the test. The -procs flag, which indicates which procs are tested by this test case, makes it easier to find procs in your package that aren't tested at all. The -cats flag, setting categories, makes it easier to control which tests to run. The smoke test setting means that this is a basic test case that can and should be run any time you are doing any test. (a definition of "smoke test") Once the file is loaded, go to ACS Automated Testing and click on myfirstpackage. You should see your test case. Run it and examine the results. Index: openacs-4/packages/acs-core-docs/www/xml/install-guide/overview.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/install-guide/overview.xml,v diff -u -r1.28 -r1.28.12.1 --- openacs-4/packages/acs-core-docs/www/xml/install-guide/overview.xml 17 Jul 2006 05:38:38 -0000 1.28 +++ openacs-4/packages/acs-core-docs/www/xml/install-guide/overview.xml 13 Oct 2013 10:33:55 -0000 1.28.12.1 @@ -97,7 +97,7 @@ This is text from a program or file which you may need to examine or edit: - if {$database == "oracle"} { + if {$database eq "oracle"} { set db_password "mysitepassword" } Index: openacs-4/packages/acs-core-docs/www/xml/kernel/ext-auth-design.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/kernel/ext-auth-design.xml,v diff -u -r1.4.8.1 -r1.4.8.2 --- openacs-4/packages/acs-core-docs/www/xml/kernel/ext-auth-design.xml 27 Aug 2013 10:52:33 -0000 1.4.8.1 +++ openacs-4/packages/acs-core-docs/www/xml/kernel/ext-auth-design.xml 13 Oct 2013 10:33:55 -0000 1.4.8.2 @@ -434,7 +434,7 @@ User is redirected to /register/index.tcl if login is required (i.e. auth::require is specified) and the login is taken care of by user-login.tcl. If user not registered (i.e. - $auth_info(account_status) == "no_account" + $auth_info(account_status) eq "no_account" ), user is redirected to user-register.tcl. @@ -1654,7 +1654,7 @@ # Should make use of auth::password::RetrievePassword set body "[_ acs-subsite.lt_Please_follow_the_fol]" # Send email -if [catch {ns_sendmail $email $system_owner $subject $body} errmsg] { +if {[catch {ns_sendmail $email $system_owner $subject $body} errmsg]} { ad_return_error \ "[_ acs-subsite.Error_sending_mail]" \ "[_ acs-subsite.lt_Now_were_really_in_tr] @@ -1852,7 +1852,7 @@ set subject "some other i18n key msg" set body "some other i18n key msg" # Send email -if [catch {ns_sendmail $email $system_owner $subject $body} errmsg] { +if {[catch {ns_sendmail $email $system_owner $subject $body} errmsg]} { ad_return_error \ "[_ acs-subsite.Error_sending_mail]" \ "[_ acs-subsite.lt_Now_were_really_in_tr]