aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-05-30 13:42:29 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-05-30 13:42:29 +0200
commit614144c0e54302c93965957a68b150d713d95ed5 (patch)
treea7269457ed1a849f8c91d0a0b7a84aa5df5b3aaa
parent9f4ef03ed488acd2af2ec5155a37677444edc605 (diff)
Default to libarchive's bsdtar for zip archives on Windows
-rw-r--r--build2/dist/operation.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/build2/dist/operation.cxx b/build2/dist/operation.cxx
index 7b07c0f..d59112c 100644
--- a/build2/dist/operation.cxx
+++ b/build2/dist/operation.cxx
@@ -568,14 +568,25 @@ namespace build2
if (e == "zip")
{
+ // On Windows we use libarchive's bsdtar (zip is an MSYS executabales).
+ //
+#ifdef _WIN32
+ args = {"bsdtar",
+ "-a", // -a with the .zip extension seems to be the only way.
+ "-cf", ap.string ().c_str (),
+ pkg.c_str (),
+ nullptr};
+#else
args = {"zip",
"-rq", ap.string ().c_str (),
pkg.c_str (),
nullptr};
+#endif
}
else
{
- // On Windows we default to libarchive's bsdtar with auto-compression.
+ // On Windows we use libarchive's bsdtar with auto-compression (tar
+ // itself and quite a few compressors are MSYS executables).
//
#ifdef _WIN32
const char* tar = "bsdtar";