From fdaa71c503c04aa35230b7f932f9ad43cc994a08 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 21 Mar 2022 21:32:42 +0300 Subject: Add configuration variable sources to selected packages --- bpkg/package.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'bpkg/package.cxx') diff --git a/bpkg/package.cxx b/bpkg/package.cxx index 4b9cdc3..3a356f8 100644 --- a/bpkg/package.cxx +++ b/bpkg/package.cxx @@ -529,6 +529,28 @@ namespace bpkg return lazy_shared_ptr (ddb, move (prerequisite)); } + string + to_string (config_source s) + { + switch (s) + { + case config_source::user: return "user"; + case config_source::dependent: return "dependent"; + case config_source::reflect: return "reflect"; + } + + return string (); // Should never reach. + } + + config_source + to_config_source (const string& s) + { + if (s == "user") return config_source::user; + else if (s == "dependent") return config_source::dependent; + else if (s == "reflect") return config_source::reflect; + else throw invalid_argument ("invalid config source '" + s + "'"); + } + shared_ptr make_available (const common_options& options, database& db, -- cgit v1.1