diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-03-28 10:12:17 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-03-28 10:12:17 +0200 |
commit | 699d0dfe6769ca949808bf78606a689aeff117df (patch) | |
tree | 3a42e946252996f496bb36e43a5a2e13918a5929 /bpkg/system-package-manager.hxx | |
parent | d38f564abaf6fcbc6c7cf2922f3e8f4c8327362f (diff) |
Add support for JSON structured result output in pkg-bindist
Diffstat (limited to 'bpkg/system-package-manager.hxx')
-rw-r--r-- | bpkg/system-package-manager.hxx | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/bpkg/system-package-manager.hxx b/bpkg/system-package-manager.hxx index 736a53a..372730d 100644 --- a/bpkg/system-package-manager.hxx +++ b/bpkg/system-package-manager.hxx @@ -181,6 +181,7 @@ namespace bpkg // // Return the list of paths to binary packages and any other associated // files (build metadata, etc) that could be useful for their consumption. + // Each returned file has a distribution-specific type that classifies it. // If the result is empty, assume the prepare-only mode (or similar) with // appropriate result diagnostics having been already issued. // @@ -198,7 +199,21 @@ namespace bpkg using packages = vector<package>; - virtual paths + struct binary_file + { + bpkg::path path; + string type; + }; + + struct binary_files: public vector<binary_file> + { + // Empty if not applicable. + // + string system_name; + string system_version; + }; + + virtual binary_files generate (const packages& pkgs, const packages& deps, const strings& vars, @@ -432,12 +447,15 @@ namespace bpkg bool yes, const string& sudo); + // Create for production. The second half of the result is the effective + // distribution name. + // // Note that the reference to options is expected to outlive the returned // instance. // class pkg_bindist_options; - unique_ptr<system_package_manager> + pair<unique_ptr<system_package_manager>, string> make_production_system_package_manager (const pkg_bindist_options&, const target_triplet&, const string& name, |