aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-09-05 09:22:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-09-05 09:22:06 +0200
commitb6746495ce6ee4ba5e3b414a7e401a8135ee1508 (patch)
tree9d18724c0144b9d4113f8ca2af30173aa210cc57
parent207e5156c5664822e0aee8bcc3057adc61027f5b (diff)
Add support for build-time dependencies
-rw-r--r--brep/package7
-rw-r--r--brep/package.xml1
-rw-r--r--load/load.cxx2
-rw-r--r--mod/mod-package-version-details.cxx12
-rw-r--r--mod/page.cxx6
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<dependency_alternatives>;
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 @@
<column name="version_revision" type="INTEGER" null="false"/>
<column name="index" type="BIGINT" null="false"/>
<column name="conditional" type="BOOLEAN" null="false"/>
+ <column name="buildtime" type="BOOLEAN" null="false"/>
<column name="comment" type="TEXT" null="false"/>
<foreign-key name="object_id_fk" on-delete="CASCADE">
<column name="name"/>
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<repository>& 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<string> 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