From dd194bd3ec25bd93ced813e1041fc056e0aac285 Mon Sep 17 00:00:00 2001 From: Joshua Root Date: Thu, 3 Oct 2024 16:35:37 +1000 Subject: [PATCH] portunarchive: delete any existing destroot first Copy semantics would create a subdir if the target already exists. --- src/package1.0/portunarchive.tcl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/package1.0/portunarchive.tcl b/src/package1.0/portunarchive.tcl index 682fd300a7..45f6d5e203 100644 --- a/src/package1.0/portunarchive.tcl +++ b/src/package1.0/portunarchive.tcl @@ -285,7 +285,10 @@ proc portunarchive::unarchive_main {args} { } } else { ui_info "$UI_PREFIX [format [msgcat::mc "Copying %s to destroot"] ${unarchive.file}]" - copy -force ${unarchive.path} ${unarchive.dir} + if {[file exists ${unarchive.dir}]} { + delete ${unarchive.dir} + } + copy ${unarchive.path} ${unarchive.dir} } return 0