aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-06-22 22:18:03 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-06-22 22:18:03 +0300
commita0036370b2a7aaf4da229c27f9c9d66c0737fb79 (patch)
treee690b02bba704ebf08546a48d447c6a3767d7ceb /mod
parentdeaeb8c74858aabf86e068dbbf8c5062c41e16f4 (diff)
Fix package version details page to properly detect if it needs to drop Builds section
Diffstat (limited to 'mod')
-rw-r--r--mod/mod-package-version-details.cxx24
1 files changed, 17 insertions, 7 deletions
diff --git a/mod/mod-package-version-details.cxx b/mod/mod-package-version-details.cxx
index 3a8d8f4..bf592e9 100644
--- a/mod/mod-package-version-details.cxx
+++ b/mod/mod-package-version-details.cxx
@@ -517,16 +517,24 @@ handle (request& rq, response& rs)
{
package_db_->load (*pkg, pkg->build_section);
- // If the package has a singe build configuration class expression with
- // exactly one underlying class and the class is none, then we just drop
- // the page builds section altogether.
+ // If all package build configurations has a singe effective build
+ // configuration class expression with exactly one underlying class and
+ // the class is none, then we just drop the page builds section
+ // altogether.
//
- if (pkg->builds.size () == 1)
+ builds = false;
+
+ for (const build_package_config& pc: pkg->build_configs)
{
- const build_class_expr& be (pkg->builds[0]);
+ const build_class_exprs& exprs (pc.effective_builds (pkg->builds));
- builds = be.underlying_classes.size () != 1 ||
- be.underlying_classes[0] != "none";
+ if (exprs.size () != 1 ||
+ exprs[0].underlying_classes.size () != 1 ||
+ exprs[0].underlying_classes[0] != "none")
+ {
+ builds = true;
+ break;
+ }
}
}
@@ -728,7 +736,9 @@ handle (request& rq, response& rs)
"ORDER BY" + query::build::id.toolchain_name +
order_by_version_desc (query::build::id.toolchain_version,
false /* first */)))
+ {
toolchains.emplace_back (move (t.name), move (t.version));
+ }
}
// Compose the configuration filtering sub-query and collect unbuilt