diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-03-21 06:32:56 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-03-21 06:32:56 +0200 |
commit | df91839a0f53b1bf266eb6b9ebabf2b587211731 (patch) | |
tree | 54be65ac5da79d560d5186491e806f8fc9d44323 /bpkg/system-package-manager-archive.cxx | |
parent | d76e64d064c859e8a9cb69640bdb099427aca7b7 (diff) |
Add support for --recursive=separate pkg-bindist option mode
Diffstat (limited to 'bpkg/system-package-manager-archive.cxx')
-rw-r--r-- | bpkg/system-package-manager-archive.cxx | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/bpkg/system-package-manager-archive.cxx b/bpkg/system-package-manager-archive.cxx index 4b4fd7f..384a0d5 100644 --- a/bpkg/system-package-manager-archive.cxx +++ b/bpkg/system-package-manager-archive.cxx @@ -43,7 +43,7 @@ namespace bpkg else target = host; - arch = target.cpu; // Set in case queried by someone else. + arch = target.string (); // Set in case queried by someone else. } // env --chdir=<root> tar|zip ... <base>.<ext> <base> @@ -294,7 +294,8 @@ namespace bpkg const package_manifest& pm, const string& pt, const small_vector<language, 1>& langs, - optional<recursive_mode> recur) + optional<bool> recursive_full, + bool first) { tracer trace ("system_package_manager_archive::generate"); @@ -457,9 +458,7 @@ namespace bpkg // since we know dependencies cannot be spread over multiple linked // configurations. // - string scope (!recur || *recur == recursive_mode::full - ? "project" - : "weak"); + string scope (!recursive_full || *recursive_full ? "project" : "weak"); // The plan is to create the archive directory (with the same name as the // archive base; we call it "destination directory") inside the output @@ -471,16 +470,13 @@ namespace bpkg // Also, by default, we are going to keep all the intermediate files on // failure for troubleshooting. // - if (exists (out)) + if (first && exists (out) && !empty (out)) { - if (!empty (out)) - { - if (!ops->wipe_output ()) - fail << "output root directory " << out << " is not empty" << - info << "use --wipe-output to clean it up but be careful"; + if (!ops->wipe_output ()) + fail << "output root directory " << out << " is not empty" << + info << "use --wipe-output to clean it up but be careful"; - rm_r (out, false); - } + rm_r (out, false); } // NOTE: THE BELOW DESCRIPTION IS ALSO REWORDED IN BPKG-PKG-BINDIST(1). |