aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-10-31 20:14:23 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-10-31 20:14:23 +0300
commit750bb4f38bdd986f76d570cb1197921d34ac29f8 (patch)
treea978809a6730aaec0f93bdb137c2c0c545191fa1 /mod
parent7a782b0494b3566f8fb441a64e16efa3965b7b2b (diff)
Omit builds section on package version details page if builds manifest value is none
Diffstat (limited to 'mod')
-rw-r--r--mod/mod-package-version-details.cxx14
1 files changed, 14 insertions, 0 deletions
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<brep::tenant> (tenant)->archived);
t.commit ();