Index: openacs-4/packages/acs-lang/www/admin/message-usage-include.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/admin/message-usage-include.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-lang/www/admin/message-usage-include.tcl 7 Aug 2017 23:47:57 -0000 1.7 +++ openacs-4/packages/acs-lang/www/admin/message-usage-include.tcl 29 Dec 2017 11:26:06 -0000 1.8 @@ -7,8 +7,10 @@ set full_key "$package_key.$message_key" -# Since acs-lang.localization- messages use the lc_get proc (that leaves out the acs-lang.localization- part) -# for lookups we need a special regexp for them +# Since acs-lang.localization- messages use the lc_get proc (that +# leaves out the acs-lang.localization- part) for lookups we need a +# special regexp for them + if { [string match "acs-lang.localization-*" $full_key] } { set grepfor "${full_key}|lc_get \[\"\{\]?[string range $message_key [string length "localization-"] end]\[\"\}\]?" } else { @@ -17,15 +19,15 @@ multirow create message_usage file code -with_catch errmsg { - exec find $::acs::rootdir -type f -regex ".*\\.\\(info\\|adp\\|sql\\|tcl\\)" -follow | xargs egrep "$grepfor" 2>/dev/null -} { - #error "find $::acs::rootdir -type f -regex \".*\\.\\(info\\|adp\\|sql\\|tcl\\)\" -follow | xargs egrep \"${full_key_pattern}\"" +ad_try { + exec find $::acs::rootdir -type f -regex ".*\\.\\(info\\|adp\\|sql\\|tcl\\)" -follow \ + | xargs egrep "$grepfor" 2>/dev/null - foreach line [split $errmsg "\n"] { +} on error {errorMsg} { + foreach line [split $errorMsg "\n"] { if { [string first "child process exited abnormally" $line] == -1 } { set colon [string first ":" $line] - + multirow append message_usage \ [string range $line 0 $colon-1] \ [string trim [string range $line $colon+1 end]] Index: openacs-4/packages/file-storage/www/download-zip.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/download-zip.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/file-storage/www/download-zip.tcl 7 Aug 2017 23:48:11 -0000 1.8 +++ openacs-4/packages/file-storage/www/download-zip.tcl 29 Dec 2017 11:30:40 -0000 1.9 @@ -7,18 +7,19 @@ } -errors {object_id:,notnull,integer,multiple {Please select at least one item to download.} } -auth::require_login +auth::require_login set user_id [ad_conn user_id] # publish the object to the file system set in_path [ad_tmpnam] file mkdir $in_path if {[llength $object_id] == 1} { - set download_name [fs::get_file_system_safe_object_name -object_id $object_id] + set object_name_id $object_id } else { - set download_name [fs::get_file_system_safe_object_name -object_id [fs::get_parent -item_id [lindex $object_id 0]]] + set object_name_id [fs::get_parent -item_id [lindex $object_id 0]] } +set download_name [fs::get_file_system_safe_object_name -object_id $object_name_id] append download_name ".zip" @@ -27,9 +28,9 @@ # hard errors on following outdated links. We could test for # supported object_types. if {![acs_object::object_p -id $fs_object_id]} { - ns_returnnotfound - file delete -force -- $in_path - ad_script_abort + ns_returnnotfound + file delete -force -- $in_path + ad_script_abort } set file [fs::publish_object_to_file_system -object_id $fs_object_id -path $in_path -user_id $user_id] } @@ -41,13 +42,13 @@ set out_file [file join ${out_path} ${download_name}] # create the archive -with_catch errmsg { +ad_try { util::zip -source $in_path -destination $out_file -} { +} on error {errorMsg} { # some day we'll do something useful here file delete -force -- $in_path file delete -force -- $out_path - error $errmsg + error $errorMsg } # return the archive to the connection.