From 750bb4f38bdd986f76d570cb1197921d34ac29f8 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 31 Oct 2019 20:14:23 +0300 Subject: Omit builds section on package version details page if builds manifest value is none --- mod/mod-package-version-details.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mod/mod-package-version-details.cxx b/mod/mod-package-version-details.cxx index cc89048..8787860 100644 --- a/mod/mod-package-version-details.cxx +++ b/mod/mod-package-version-details.cxx @@ -433,8 +433,22 @@ handle (request& rq, response& rs) bool builds (build_db_ != nullptr && pkg->buildable); if (builds) + { 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 (pkg->builds.size () == 1) + { + const build_class_expr& be (pkg->builds[0]); + + builds = be.underlying_classes.size () != 1 || + be.underlying_classes[0] != "none"; + } + } + bool archived (package_db_->load (tenant)->archived); t.commit (); -- cgit v1.1