From 614144c0e54302c93965957a68b150d713d95ed5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 30 May 2019 13:42:29 +0200 Subject: Default to libarchive's bsdtar for zip archives on Windows --- build2/dist/operation.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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"; -- cgit v1.1