aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-build-log.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-05-03 15:24:53 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-05-03 15:40:41 +0300
commit9891dbfdc88b94d01144151a8e30116e2ed28a59 (patch)
treea37bdbf8330eef130ed778fc1ed34af50dadfd3e /mod/mod-build-log.cxx
parent3f270d5ce4534e92ebfaa032d373e6c35a6f8d46 (diff)
Add support for task request manifest toolchain name/version
Diffstat (limited to 'mod/mod-build-log.cxx')
-rw-r--r--mod/mod-build-log.cxx57
1 files changed, 35 insertions, 22 deletions
diff --git a/mod/mod-build-log.cxx b/mod/mod-build-log.cxx
index 09591b9..bf64ddb 100644
--- a/mod/mod-build-log.cxx
+++ b/mod/mod-build-log.cxx
@@ -71,7 +71,7 @@ handle (request& rq, response& rs)
//
// Note that the URL path must be in the following form:
//
- // <package-name>/<package-version>/log/<config-name>[/<operation>]
+ // <pkg-name>/<pkg-version>/log/<cfg-name>/<toolchain-version>[/<operation>]
//
// Also note that the presence of the first 3 components is guaranteed by
// the repository_root module.
@@ -93,30 +93,41 @@ handle (request& rq, response& rs)
assert (i != lpath.end ());
- version version;
-
- // Intercept exception handling to add the parsing error attribution.
- //
- try
- {
- version = brep::version (*i++);
- }
- catch (const invalid_argument& e)
+ auto parse_version = [] (const string& v, const char* what) -> version
{
- throw invalid_argument (
- string ("invalid package version: ") + e.what ());
- }
+ // Intercept exception handling to add the parsing error attribution.
+ //
+ try
+ {
+ return brep::version (v);
+ }
+ catch (const invalid_argument& e)
+ {
+ throw invalid_argument (string ("invalid ") + what + ": " + e.what ());
+ }
+ };
+
+ version package_version (parse_version (*i++, "package version"));
assert (i != lpath.end () && *i == "log");
if (++i == lpath.end ())
throw invalid_argument ("no configuration name");
- id = build_id (package_id (move (name), version), *i++);
+ string config (*i++);
- if (id.configuration.empty ())
+ if (config.empty ())
throw invalid_argument ("empty configuration name");
+ if (i == lpath.end ())
+ throw invalid_argument ("no toolchain version");
+
+ version toolchain_version (parse_version (*i++, "toolchain version"));
+
+ id = build_id (package_id (move (name), package_version),
+ move (config),
+ toolchain_version);
+
if (i != lpath.end ())
op = *i++;
@@ -199,13 +210,15 @@ handle (request& rq, response& rs)
assert (b->machine && b->machine_summary);
- os << "package: " << b->package_name << endl
- << "version: " << b->package_version << endl
- << "config: " << b->configuration << endl
- << "machine: " << *b->machine << " (" << *b->machine_summary << ")"
- << endl
- << "target: " << (i->target ? i->target->string () : "default") << endl
- << endl;
+ os << "package: " << b->package_name << endl
+ << "version: " << b->package_version << endl
+ << "config: " << b->configuration << endl
+ << "toolchain: " << b->toolchain_name << '-' << b->toolchain_version
+ << endl
+ << "machine: " << *b->machine << " (" << *b->machine_summary << ")"
+ << endl
+ << "target: " << (i->target ? i->target->string () : "default") << endl
+ << endl;
if (op.empty ())
{