diff options
Diffstat (limited to 'mod/mod-package-version-details.cxx')
-rw-r--r-- | mod/mod-package-version-details.cxx | 97 |
1 files changed, 67 insertions, 30 deletions
diff --git a/mod/mod-package-version-details.cxx b/mod/mod-package-version-details.cxx index e47d9b4..91923e5 100644 --- a/mod/mod-package-version-details.cxx +++ b/mod/mod-package-version-details.cxx @@ -189,20 +189,20 @@ handle (request& rq, response& rs) s << H2 << pkg->summary << ~H2; - if (const optional<string>& d = pkg->description) + if (const optional<typed_text>& d = pkg->package_description + ? pkg->package_description + : pkg->description) { const string id ("description"); const string what (title + " description"); s << (full ? DIV_TEXT (*d, - *pkg->description_type, true /* strip_title */, id, what, error) : DIV_TEXT (*d, - *pkg->description_type, true /* strip_title */, options_->package_description (), url (!full, id), @@ -453,7 +453,10 @@ handle (request& rq, response& rs) // // Print test dependencies of the specific type. // - auto print_tests = [&pkg, &s, &print_dependency] (test_dependency_type dt) + auto print_tests = [&pkg, + &s, + &print_dependency, + full] (test_dependency_type dt) { string id; @@ -492,6 +495,20 @@ handle (request& rq, response& rs) print_dependency (td); + if (td.enable || td.reflect) + { + if (full) + { + if (td.enable) + s << " ? (" << *td.enable << ')'; + + if (td.reflect) + s << ' ' << *td.reflect; + } + else + s << " ..."; + } + s << ~SPAN << ~TD << ~TR; @@ -517,16 +534,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 package_build_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; + } } } @@ -565,8 +590,8 @@ handle (request& rq, response& rs) { dir_path distribution; // debian, fedora, archive dir_path os_release; // fedora37, windows10 - path symlink; // .../default, .../release - dir_path directory; // .../default-2023-05-11T10:13:43Z + path symlink; // .../x86_64, .../x86_64-release + dir_path directory; // .../x86_64-2023-05-11T10:13:43Z bool operator< (const bindist_config& v) @@ -616,7 +641,7 @@ handle (request& rq, response& rs) dir_path vd (fdd / rd / dir_path (pkg->project.string ()) / - dir_path (pn.string ()) / + dir_path (pn.string ()) / dir_path (sver)); try @@ -627,12 +652,12 @@ handle (request& rq, response& rs) if (ce.ltype () != entry_type::symlink) continue; - // Skip symlinks which have extensions. Note that upload - // handlers may add an extension to a newly created symlink to - // atomically replace an old symlink with the new one. + // Skip the "hidden" symlinks which may potentially be used by + // the upload handlers until they expose the finalized upload + // directory. // const path& cl (ce.path ()); - if (cl.extension_cstring () != nullptr) + if (cl.string () [0] == '.') continue; try @@ -701,7 +726,7 @@ handle (request& rq, response& rs) s << H3 << "Builds" << ~H3 << DIV(ID="builds"); - auto exclude = [&pkg, this] (const build_package_config& pc, + auto exclude = [&pkg, this] (const package_build_config& pc, const build_target_config& tc, string* rs = nullptr) { @@ -728,7 +753,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 @@ -740,13 +767,13 @@ handle (request& rq, response& rs) query sq (false); set<config_toolchain> unbuilt_configs; - for (const build_package_config& pc: pkg->build_configs) + for (const package_build_config& pc: pkg->build_configs) { for (const auto& bc: *target_conf_map_) { const build_target_config& tc (*bc.second); - if (belongs (tc, "all") && !exclude (pc, tc)) + if (!belongs (tc, "hidden") && !exclude (pc, tc)) { const build_target_config_id& id (bc.first); @@ -775,7 +802,7 @@ handle (request& rq, response& rs) // Print the package built configurations in the time-descending order. // for (auto& b: build_db_->query<build> ( - (query::id.package == pkg->id && sq) + + (query::id.package == pkg->id && query::state != "queued" && sq) + "ORDER BY" + query::timestamp + "DESC")) { string ts (butl::to_string (b.timestamp, @@ -789,6 +816,10 @@ handle (request& rq, response& rs) ts += ')'; + // @@ Note that here we also load result logs which we don't need. + // Probably we should invent some table view to only load operation + // names and statuses. + // if (b.state == build_state::built) build_db_->load (b, b.results_section); @@ -855,7 +886,7 @@ handle (request& rq, response& rs) // if (!tn->interactive) { - for (const build_package_config& pc: pkg->build_configs) + for (const package_build_config& pc: pkg->build_configs) { for (const auto& tc: *target_conf_) { @@ -886,19 +917,25 @@ handle (request& rq, response& rs) s << ~DIV; } - const string& ch (pkg->changes); - - if (!ch.empty ()) + if (const optional<typed_text>& c = pkg->changes) { const string id ("changes"); + const string what (title + " changes"); s << H3 << "Changes" << ~H3 << (full - ? PRE_TEXT (ch, id) - : PRE_TEXT (ch, + ? DIV_TEXT (*c, + false /* strip_title */, + id, + what, + error) + : DIV_TEXT (*c, + false /* strip_title */, options_->package_changes (), - url (!full, "changes"), - id)); + url (!full, id), + id, + what, + error)); } s << ~DIV |