Index: openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl,v diff -u -r1.41 -r1.42 --- openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl 4 Jun 2006 00:45:39 -0000 1.41 +++ openacs-4/packages/acs-lang/tcl/lang-catalog-procs.tcl 10 Jan 2007 21:22:04 -0000 1.42 @@ -66,7 +66,7 @@ } { set value [xml_node_get_attribute $element $attribute] - if { [empty_string_p $value] } { + if { $value eq "" } { error "Required attribute \"$attribute\" missing from <[xml_node_get_name $element]>" } @@ -172,7 +172,7 @@ } { set catalog_dir [package_catalog_dir $package_key] - if { ![empty_string_p $charset] } { + if { $charset ne "" } { set file_charset $charset } else { # We had problems storing digits in ISO-8859-6 so we decided @@ -185,7 +185,7 @@ } set message_backup_prefix "" - if { ![empty_string_p $backup_from_version] } { + if { $backup_from_version ne "" } { set message_backup_prefix "[message_backup_file_prefix]${backup_from_version}-${backup_to_version}_" } @@ -344,7 +344,7 @@ # Parse locale from filename array set old_filename_info [apm_parse_catalog_path $old_catalog_file] - if { [string equal $old_filename_info(locale) $filename_info(locale)] } { + if {$old_filename_info(locale) eq $filename_info(locale)} { file delete $old_catalog_file } } @@ -365,7 +365,7 @@ set message_count "0" foreach message_key $message_key_list { puts $catalog_file_id " [ad_quotehtml $messages_array($message_key)]" - if { [exists_and_not_null descriptions_array($message_key)] && $filename_info(locale) == "en_US" } { + if { [exists_and_not_null descriptions_array($message_key)] && $filename_info(locale) eq "en_US" } { puts $catalog_file_id " [ad_quotehtml $descriptions_array($message_key)]\n" } incr message_count @@ -391,15 +391,15 @@ @author Peter Marklund } { - if { ![empty_string_p $package_key] } { + if { $package_key ne "" } { set package_key_list $package_key } else { set package_key_list [apm_enabled_packages] } foreach package_key $package_key_list { # We do not want to export acs-translations. This usually is a very bad idea as the object_ids are different from site to site. - if {![string eq $package_key "acs-translations"]} { + if {$package_key ne "acs-translations" } { # Loop over all locales that the package has messages in # and write a catalog file for each such locale db_foreach get_locales_for_package {} { @@ -484,7 +484,7 @@ } { # Check arguments - if { [empty_string_p $catalog_file_contents] } { + if { $catalog_file_contents eq "" } { error "lang::catalog::parse the catalog_file_contents arguments is the empty string" } @@ -589,7 +589,7 @@ set charset $filename_info(charset) # Compare xml package_key with file path package_key - abort if there is a mismatch - if { ![string equal $package_key $catalog_array(package_key)] } { + if { $package_key ne $catalog_array(package_key) } { error "the package_key $catalog_array(package_key) in the file $file_path does not match the package_key $package_key in the filesystem" } @@ -770,7 +770,7 @@ if { [info exists db_messages($message_key)] } { # db message exists - if { ![string equal $db_messages($message_key) $base_messages($message_key)] } { + if { $db_messages($message_key) ne $base_messages($message_key) } { # db message and base message differ set db_change "update" } @@ -781,7 +781,7 @@ if { [info exists file_messages($message_key)] } { # file message exists - if { ![string equal $file_messages($message_key) $base_messages($message_key)] } { + if { $file_messages($message_key) ne $base_messages($message_key) } { # file message and base message differ set file_change "update" } @@ -843,7 +843,7 @@ switch $file_change { none {} add { - if { ![string equal $db_messages($message_key) $file_messages($message_key)] } { + if { $db_messages($message_key) ne $file_messages($message_key) } { # case 8 set import_case 8 # differing additions in db and file @@ -857,7 +857,7 @@ switch $file_change { none {} update { - if { ![string equal $db_messages($message_key) $file_messages($message_key)] } { + if { $db_messages($message_key) ne $file_messages($message_key) } { # case 14 set import_case 14 # differing updates in file and db @@ -902,7 +902,7 @@ ########################################### # For certain messages we need to move the sync point so that we have a current base for the next upgrade. - if { [string equal $db_change "none"] || ![string equal $file_change "none"] } { + if { $db_change eq "none" || $file_change ne "none" } { # If there is no db change then any change in the file will be reflected in # db (file takes precedence) and file and db are identical. # Also, regardless of what's happened in db, if @@ -915,7 +915,7 @@ # Store a new message in the database if we are adding or updating set error_p 0 - if { [string equal $upgrade_status "added"] || [string equal $upgrade_status "updated"] } { + if { $upgrade_status eq "added" || $upgrade_status eq "updated" } { ns_log Debug "lang::catalog::import_messages - invoking lang::message::register with import_case=\"$import_case\" -update_sync=$update_sync_p $message_key $upgrade_status $conflict_p" if { [catch {lang::message::register \ @@ -930,13 +930,13 @@ lappend message_count(errors) $errmsg set error_p 1 } - } elseif { $update_sync_p || [string equal $upgrade_status "deleted"] } { + } elseif { $update_sync_p || $upgrade_status eq "deleted" } { # Set the upgrade_status, deleted_p, conflict_p, and sync_time properties of the message # If we are doing nothing, the only property of the message we might want to update in the db # is the sync_time as we might have discovered that db and file are in sync array unset edit_array - if { ![string equal $upgrade_status "no_upgrade"] } { + if { $upgrade_status ne "no_upgrade" } { set edit_array(upgrade_status) $upgrade_status set edit_array(deleted_p) [string equal $upgrade_status "deleted"] set edit_array(conflict_p) $conflict_p @@ -999,7 +999,7 @@ set message_count(deleted) 0 set message_count(errors) [list] - if { ![empty_string_p $package_key] } { + if { $package_key ne "" } { set package_key_list $package_key } else { set package_key_list [apm_enabled_packages] @@ -1025,7 +1025,7 @@ -locales $locales] # Issue a warning and exit if there are no catalog files - if { [empty_string_p $catalog_files] } { + if { $catalog_files eq "" } { ns_log Warning "No catalog files found for package $package_key" continue } @@ -1039,8 +1039,8 @@ ns_log Error "The import of file $file_path failed, error message is:\n\n${errMsg}\n\nstack trace:\n\n$errorInfo\n\n" } else { foreach action [array names loop_message_count] { - if { ![string equal $action "errors"] } { - set message_count($action) [expr $message_count($action) + $loop_message_count($action)] + if { $action ne "errors" } { + set message_count($action) [expr {$message_count($action) + $loop_message_count($action)}] } } set message_count(errors) [concat $message_count(errors) $loop_message_count(errors)]