From b6746495ce6ee4ba5e3b414a7e401a8135ee1508 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Sep 2016 09:22:06 +0200 Subject: Add support for build-time dependencies --- brep/package | 7 +++---- brep/package.xml | 1 + load/load.cxx | 2 +- mod/mod-package-version-details.cxx | 12 ++++++++++++ mod/page.cxx | 6 ++++++ 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/brep/package b/brep/package index a193c16..423002b 100644 --- a/brep/package +++ b/brep/package @@ -335,13 +335,12 @@ namespace brep { public: bool conditional; + bool buildtime; string comment; dependency_alternatives () = default; - - explicit - dependency_alternatives (bool d, string c) - : conditional (d), comment (move (c)) {} + dependency_alternatives (bool d, bool b, string c) + : conditional (d), buildtime (b), comment (move (c)) {} }; using dependencies = vector; diff --git a/brep/package.xml b/brep/package.xml index 98c0f02..cfd2a6f 100644 --- a/brep/package.xml +++ b/brep/package.xml @@ -313,6 +313,7 @@ + diff --git a/load/load.cxx b/load/load.cxx index 3b19ae3..79b0ace 100644 --- a/load/load.cxx +++ b/load/load.cxx @@ -383,7 +383,7 @@ load_packages (const shared_ptr& rp, database& db) for (auto& pda: pm.dependencies) { - ds.emplace_back (pda.conditional, move (pda.comment)); + ds.emplace_back (pda.conditional, pda.buildtime, move (pda.comment)); for (auto& pd: pda) // Proper version will be assigned during dependency resolution diff --git a/mod/mod-package-version-details.cxx b/mod/mod-package-version-details.cxx index b2172ce..30933fb 100644 --- a/mod/mod-package-version-details.cxx +++ b/mod/mod-package-version-details.cxx @@ -212,6 +212,12 @@ handle (request& rq, response& rs) if (da.conditional) s << "?"; + if (da.buildtime) + s << "*"; + + if (da.conditional || da.buildtime) + s << " "; + s << ~TH << TD << SPAN(CLASS="value"); @@ -283,6 +289,12 @@ handle (request& rq, response& rs) if (ra.conditional) s << "?"; + if (ra.buildtime) + s << "*"; + + if (ra.conditional || ra.buildtime) + s << " "; + s << ~TH << TD << SPAN(CLASS="value"); diff --git a/mod/page.cxx b/mod/page.cxx index aba7581..2c1b4d1 100644 --- a/mod/page.cxx +++ b/mod/page.cxx @@ -293,6 +293,9 @@ namespace brep if (d.conditional) s << "?"; + if (d.buildtime) + s << "*"; + // Suppress package name duplicates. // set names; @@ -373,6 +376,9 @@ namespace brep if (r.conditional) s << "?"; + if (r.buildtime) + s << "*"; + if (r.empty ()) { // If there is no requirement alternatives specified, then -- cgit v1.1