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.189.2.166 -r1.189.2.167 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 21 Apr 2023 16:28:00 -0000 1.189.2.166 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 24 Apr 2023 13:53:29 -0000 1.189.2.167 @@ -71,76 +71,8 @@ set in_path $source } - # - # Check if zipfile::mkzip, introduced in tcllib 1.18, is available. - # Otherwise, use the legacy method calling an external zip command via exec. - # - if {![catch {package require zipfile::mkzip} version]} { - ::zipfile::mkzip::mkzip $destination -directory $in_path $filename - } else { - set zip [util::which zip] - if {$zip eq ""} { - error "zip command not found on the system." - } - # - # To avoid having the full path of the file included in the archive, - # we must first cd to the source directory. zip doesn't have an option - # to do this without building a little script... - # - set cmd [list exec] - switch -- $::tcl_platform(platform) { - windows { - lappend cmd cmd.exe /c - set zip_cmd [list] - lappend zip_cmd "cd $in_path" - lappend zip_cmd "${zip} -r \"${destination}\" \"${filename}\"" - set zip_cmd [join $zip_cmd " && "] - lappend cmd $zip_cmd - } - default { - # - # Previous versions of this, for unix-like systems, used bash in - # order to change directories before executing zip (see above). - # - # This method was problematic when using certain characters for - # the filenames, such as backticks, for example. - # - # In order to avoid this and properly quote everything, we use - # tclsh instead, in a convoluted and funny way. - # - # (Thanks to Nathan Coulter for the hack.) - # - # TODO: test this also on windows. It may work as well, and - # potentially unify the two legacy implementations. - # - set tcl_shell [util::which tclsh] - if {$tcl_shell eq ""} { - error "tclsh command not found on the system." - } - lappend cmd $tcl_shell - - - set script [ - string map [ - list @in_path@ [list $in_path] @zip@ [list $zip] @destination@ [list $destination] @filename@ [list $filename] - ] { - if { - [catch { - cd @in_path@ - exec @zip@ -r @destination@ @filename@ - } errorMsg eopts] - } { - puts "Error: [dict get $eopts -errorinfo]" - exit 1 - } - } - ] - lappend cmd << $script - } - } - - # Create the archive - {*}$cmd - } + package require zipfile::mkzip + ::zipfile::mkzip::mkzip $destination -directory $in_path $filename } #