From 4dcc80df759c7ba1ada65b52a8dc6c793d56e4e5 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 8 Jul 2019 11:44:44 +0300 Subject: Display unbuilt configurations on package version details page --- mod/build-config-module.hxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'mod/build-config-module.hxx') diff --git a/mod/build-config-module.hxx b/mod/build-config-module.hxx index 0b5b4d0..3ad1a83 100644 --- a/mod/build-config-module.hxx +++ b/mod/build-config-module.hxx @@ -77,6 +77,31 @@ namespace brep static path dash_components_to_path (const string&); + // Configuration/toolchain combination that, in particular, can be used as + // a set value. + // + // Note: contains shallow references to the configuration, toolchain name, + // and version. + // + struct config_toolchain + { + const string& configuration; + const string& toolchain_name; + const bpkg::version& toolchain_version; + + bool + operator< (const config_toolchain& ct) const + { + if (int r = toolchain_name.compare (ct.toolchain_name)) + return r < 0; + + if (toolchain_version != ct.toolchain_version) + return toolchain_version > ct.toolchain_version; + + return configuration.compare (ct.configuration) < 0; + } + }; + protected: // Build configurations. // -- cgit v1.1