From 110b8541dca943a5513ce2ad4e1e8863806aa56f Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 17 Jan 2023 17:35:27 +0300 Subject: Add support for multiple system package versions --- bpkg/system-repository.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'bpkg/system-repository.cxx') diff --git a/bpkg/system-repository.cxx b/bpkg/system-repository.cxx index d7a47b7..229ebd3 100644 --- a/bpkg/system-repository.cxx +++ b/bpkg/system-repository.cxx @@ -5,10 +5,14 @@ namespace bpkg { - const version& system_repository:: - insert (const package_name& name, const version& v, bool authoritative) + const system_package_versions& system_repository:: + insert (const package_name& name, + const system_package_versions& vs, + bool authoritative) { - auto p (map_.emplace (name, system_package {v, authoritative})); + assert (!vs.empty ()); + + auto p (map_.emplace (name, system_package {vs, authoritative})); if (!p.second) { @@ -21,10 +25,10 @@ namespace bpkg if (authoritative >= sp.authoritative) { sp.authoritative = authoritative; - sp.version = v; + sp.versions = vs; } } - return p.first->second.version; + return p.first->second.versions; } } -- cgit v1.1