diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2023-02-09 21:37:17 +0300 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-02-21 04:46:55 +0200 |
commit | b453087907850073244e5ce1f1ea52728402734d (patch) | |
tree | 5784215b3eccf62717fa419a19dcf35b8cf11889 /bpkg/system-package-manager.hxx | |
parent | 5e004f94984476ddda74f90e8adaacd3c0871062 (diff) |
Add system_package_manager::system_package_version()
Diffstat (limited to 'bpkg/system-package-manager.hxx')
-rw-r--r-- | bpkg/system-package-manager.hxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bpkg/system-package-manager.hxx b/bpkg/system-package-manager.hxx index 81adeee..7e4f89c 100644 --- a/bpkg/system-package-manager.hxx +++ b/bpkg/system-package-manager.hxx @@ -271,6 +271,29 @@ namespace bpkg const string& version_id, const vector<string>& like_ids); + // Given the available package and the repository fragment it belongs to, + // return the system package version as mapped by one of the + // <distribution>-version values. + // + // The rest of the arguments as well as the overalls semantics is the same + // as in system_package_names() above. That is, first consider + // <distribution>-version values corresponding to name_id. If none match, + // then repeat the above process for every like_ids entry with version_id + // equal 0. If still no match, then return nullopt (in which case the + // caller may choose to fallback to the upstream package version or do + // something more elaborate). + // + // Note that lazy_shared_ptr<repository_fragment> is used only for + // diagnostics and conveys the database the available package object + // belongs to. + // + static optional<string> + system_package_version (const available_package&, + const lazy_shared_ptr<repository_fragment>&, + const string& name_id, + const string& version_id, + const vector<string>& like_ids); + // Given the system package version and available packages (as returned by // find_available_all()) return the downstream package version as mapped // by one of the <distribution>-to-downstream-version values. |