From 53c2aa8e382dd50d09b385285bc3fa0b645ace0a Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 19 Aug 2016 17:37:29 +0300 Subject: Support system packages --- bpkg/database.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'bpkg/database.cxx') diff --git a/bpkg/database.cxx b/bpkg/database.cxx index 6eec6f8..418265c 100644 --- a/bpkg/database.cxx +++ b/bpkg/database.cxx @@ -7,7 +7,10 @@ #include #include +#include +#include #include +#include using namespace std; @@ -76,6 +79,20 @@ namespace bpkg fail << "configuration " << d << " is already used by another process"; } + // Query for all the packages with the system substate and enter their + // versions into system_repository as non-authoritative. This way an + // available_package (e.g., a stub) will automatically "see" system + // version, if one is known. + // + transaction t (db.begin ()); + + for (const auto& p: + db.query ( + query::substate == "system")) + system_repository.insert (p.name, p.version, false); + + t.commit (); + db.tracer (tr); // Switch to the caller's tracer. return db; } -- cgit v1.1