This is an automated email from the ASF dual-hosted git repository.

big-r81 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/main by this push:
     new 3a7bacce4 configure.ps1: extract clouseau.zip flat
3a7bacce4 is described below

commit 3a7bacce48011b23a55965277d78257a52f70f6e
Author: Gabor Pali <[email protected]>
AuthorDate: Sat Oct 3 15:06:43 2026 +0200

    configure.ps1: extract clouseau.zip flat
    
    On Windows, unzipping the archive for Clouseau does not implement
    the `-j` flag so it will not drop directory names if there are
    some, like the Unix-like systems do.
    
    Starting from Clouseau 3.4.0, the `-dist.zip` contains a top-level
    directory to become consistent the `.tar.gz` format it now also
    provides -- not ignoring this can break the Windows port, that is
    why I may make sense to bring the two implementations in sync.
---
 configure.ps1 | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/configure.ps1 b/configure.ps1
index 9a012923f..8fa053136 100644
--- a/configure.ps1
+++ b/configure.ps1
@@ -347,11 +347,23 @@ if ($WithClouseau) {
             exit 1
         }
 
-        Expand-Archive clouseau.zip -DestinationPath $ClouseauDir -Force
-        If ($LASTEXITCODE -ne 0) {
+        Add-Type -AssemblyName 'System.IO.Compression.FileSystem'
+
+        try {
+            $Archive = 
[System.IO.Compression.ZipFile]::OpenRead("clouseau.zip")
+            Foreach ($entry in $Archive.Entries.Where({ $_.Name.length -gt 0 
})) {
+                
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($entry, 
"$ClouseauDir\$($entry.Name)")
+            }
+        }
+        catch {
             Write-Output "ERROR: Clouseau distribution package (clouseau.zip) 
could not be extracted."
             exit 1
         }
+        finally {
+            if ($null -ne $Archive) {
+                $Archive.Dispose()
+            }
+        }
 
         Remove-Item clouseau.zip
 

Reply via email to