aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-07-18 14:55:38 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-07-18 14:55:38 +0300
commit732dd69e4d9e1b70edffad9829e34d84155cd91b (patch)
tree4bc1e8b26b1947b982ceb593257c5ab3f1cb268a /mod
parent67d190d15e5a8ad865dbbf21fdf7dcb7b1168cdd (diff)
Adapt to non-optional buildtab target
Diffstat (limited to 'mod')
-rw-r--r--mod/build-config.cxx3
-rw-r--r--mod/mod-build-log.cxx3
-rw-r--r--mod/mod-builds.cxx26
-rw-r--r--mod/mod-package-version-details.cxx7
-rw-r--r--mod/options.cli6
5 files changed, 16 insertions, 29 deletions
diff --git a/mod/build-config.cxx b/mod/build-config.cxx
index fed2ee9..ecbcf6f 100644
--- a/mod/build-config.cxx
+++ b/mod/build-config.cxx
@@ -152,8 +152,7 @@ namespace brep
const build_config& c)
{
return path_match (config_pattern, c.name) &&
- (!target_pattern ||
- (c.target && path_match (*target_pattern, c.target->string ())));
+ (!target_pattern || path_match (*target_pattern, c.target.string ()));
}
bool
diff --git a/mod/mod-build-log.cxx b/mod/mod-build-log.cxx
index f9fb0e5..b667c08 100644
--- a/mod/mod-build-log.cxx
+++ b/mod/mod-build-log.cxx
@@ -200,8 +200,7 @@ handle (request& rq, response& rs)
<< "config: " << b->configuration << endl
<< "machine: " << b->machine << " (" << b->machine_summary << ")"
<< endl
- << "target: " << (b->target ? b->target->string () : "<default>")
- << endl
+ << "target: " << b->target.string () << endl
<< "timestamp: ";
butl::to_stream (os, b->timestamp, "%Y-%m-%d %H:%M:%S%[.N] %Z", true, true);
diff --git a/mod/mod-builds.cxx b/mod/mod-builds.cxx
index 2f436c7..7b806bf 100644
--- a/mod/mod-builds.cxx
+++ b/mod/mod-builds.cxx
@@ -149,12 +149,8 @@ build_query (const brep::cstrings& configs, const brep::params::builds& params)
// Build target.
//
- const string& tg (params.target ());
-
- if (tg != "*")
- q = q && (tg.empty ()
- ? qb::target.is_null ()
- : qb::target.like (transform (tg)));
+ if (!params.target ().empty ())
+ q = q && qb::target.like (transform (params.target ()));
// Build result.
//
@@ -386,7 +382,7 @@ handle (request& rq, response& rs)
<< ~TR
<< TR_INPUT ("machine", "mn", params.machine (), "*")
- << TR_INPUT ("target", "tg", params.target (), "<default>")
+ << TR_INPUT ("target", "tg", params.target (), "*")
<< TR_SELECT ("result", "rs", params.result (), build_results)
<< ~TBODY
<< ~TABLE
@@ -456,8 +452,7 @@ handle (request& rq, response& rs)
b.toolchain_version.string ())
<< TR_VALUE ("config", b.configuration)
<< TR_VALUE ("machine", b.machine)
- << TR_VALUE ("target",
- b.target ? b.target->string () : "<default>")
+ << TR_VALUE ("target", b.target.string ())
<< TR_VALUE ("timestamp", ts)
<< TR_BUILD_RESULT (b, host, root)
<< ~TBODY
@@ -546,10 +541,9 @@ handle (request& rq, response& rs)
{
if ((pc.empty () || path_match (pc, c.name)) && // Filter by name.
- (tg.empty () // Filter by target.
- ? !c.target
- : tg == "*" ||
- (c.target && path_match (tg, c.target->string ()))))
+ // Filter by target.
+ //
+ (tg.empty () || path_match (tg, c.target.string ())))
{
configs.push_back (&c);
@@ -803,8 +797,6 @@ handle (request& rq, response& rs)
auto i (build_conf_map_->find (ct.configuration.c_str ()));
assert (i != build_conf_map_->end ());
- const optional<target_triplet>& tg (i->second->target);
-
s << TABLE(CLASS="proplist build")
<< TBODY
<< TR_NAME (id.name, string (), root)
@@ -813,7 +805,7 @@ handle (request& rq, response& rs)
string (ct.toolchain_name) + '-' +
ct.toolchain_version.string ())
<< TR_VALUE ("config", ct.configuration)
- << TR_VALUE ("target", tg ? tg->string () : "<default>")
+ << TR_VALUE ("target", i->second->target.string ())
<< ~TBODY
<< ~TABLE;
@@ -851,7 +843,7 @@ handle (request& rq, response& rs)
add_filter ("tc", params.toolchain (), "*");
add_filter ("cf", params.configuration ());
add_filter ("mn", params.machine ());
- add_filter ("tg", params.target (), "*");
+ add_filter ("tg", params.target ());
add_filter ("rs", params.result (), "*");
s << DIV_PAGER (page, count, page_configs, options_->build_pages (), u)
diff --git a/mod/mod-package-version-details.cxx b/mod/mod-package-version-details.cxx
index 4da13ab..0138154 100644
--- a/mod/mod-package-version-details.cxx
+++ b/mod/mod-package-version-details.cxx
@@ -371,8 +371,7 @@ handle (request& rq, response& rs)
b.toolchain_name + '-' +
b.toolchain_version.string ())
<< TR_VALUE ("config",
- b.configuration + " / " +
- (b.target ? b.target->string () : "<default>"))
+ b.configuration + " / " + b.target.string ())
<< TR_VALUE ("timestamp", ts)
<< TR_BUILD_RESULT (b, host, root)
<< ~TBODY
@@ -421,9 +420,7 @@ handle (request& rq, response& rs)
{
s << TABLE(CLASS="proplist build")
<< TBODY
- << TR_VALUE ("config",
- c.name + " / " +
- (c.target ? c.target->string () : "<default>"))
+ << TR_VALUE ("config", c.name + " / " + c.target.string ())
<< TR_VALUE ("result",
!reason.empty ()
? "excluded (" + reason + ')'
diff --git a/mod/options.cli b/mod/options.cli
index 857c2f3..3f7ec01 100644
--- a/mod/options.cli
+++ b/mod/options.cli
@@ -523,10 +523,10 @@ namespace brep
//
string machine | mn;
- // Package build target wildcard. If empty, then the default machine
- // target is matched.
+ // Package build target wildcard. An empty value is treated the same way
+ // as *.
//
- string target | tg = "*";
+ string target | tg;
// Package build result. If *, then no build result constraint is
// applied. Otherwise the value is supposed to be the one of the