aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-04-23 07:46:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-04-23 07:46:46 +0200
commit9a753934f5124437c91cafcefc92c35f2a8f0cbe (patch)
treeb46f25a0662740cf167007ec8c13c870ceef0aa5
parent0575b8704ef23f64f73ab0424a2dfc322937a053 (diff)
Revert revision ignoring in satisfy(constraint, constraint)
-rw-r--r--bpkg/package6
-rw-r--r--bpkg/pkg-configure.cxx11
-rw-r--r--bpkg/satisfaction.cxx10
3 files changed, 14 insertions, 13 deletions
diff --git a/bpkg/package b/bpkg/package
index d227929..779f0e2 100644
--- a/bpkg/package
+++ b/bpkg/package
@@ -443,8 +443,10 @@ namespace bpkg
//
optional<dir_path> out_root;
- // A map of "effective" prerequisites (i.e., pointers to other
- // selected packages) to optional dependency constraint.
+ // A map of "effective" prerequisites (i.e., pointers to other selected
+ // packages) to optional dependency constraint. Note that because it is a
+ // single constraint, we don't support multiple dependencies on the same
+ // package (e.g., two ranges of versions). See pkg_configure().
//
using prerequisites_type = std::map<lazy_shared_ptr<selected_package>,
optional<dependency_constraint>,
diff --git a/bpkg/pkg-configure.cxx b/bpkg/pkg-configure.cxx
index 1dbf94b..e17ac01 100644
--- a/bpkg/pkg-configure.cxx
+++ b/bpkg/pkg-configure.cxx
@@ -70,8 +70,9 @@ namespace bpkg
auto r (p->prerequisites.emplace (dp, d.constraint));
- // If we already have a dependency on this package, pick the
- // stricter of the two constraints.
+ // Currently we can only capture a single constraint, so if we
+ // already have a dependency on this package and one constraint is
+ // not a subset of the other, complain.
//
if (!r.second)
{
@@ -81,9 +82,9 @@ namespace bpkg
bool s2 (satisfies (d.constraint, c));
if (!s1 && !s2)
- fail << "incompatible constraints "
- << "(" << n << " " << *c << ") and "
- << "(" << n << " " << *d.constraint << ")";
+ fail << "multiple dependencies on package " << n <<
+ info << n << " " << *c <<
+ info << n << " " << *d.constraint;
if (s2 && !s1)
c = d.constraint;
diff --git a/bpkg/satisfaction.cxx b/bpkg/satisfaction.cxx
index c53e64b..a0ebbfb 100644
--- a/bpkg/satisfaction.cxx
+++ b/bpkg/satisfaction.cxx
@@ -42,8 +42,8 @@ namespace bpkg
{
assert (!l.empty () && !r.empty ());
- // See notes in pkg-build:find_available() on ignoring revision in
- // comparison.
+ // Note: the revision ignoring logic is still unclear/unimplemented. It
+ // seems it will be specific to each case below.
//
bool s (false);
@@ -51,8 +51,7 @@ namespace bpkg
{
if (r.min_version)
{
- int i (l.min_version->compare (*r.min_version,
- r.min_version->revision == 0));
+ int i (l.min_version->compare (*r.min_version, false));
if (l.min_open)
// Doesn't matter if r is min_open or not.
//
@@ -72,8 +71,7 @@ namespace bpkg
{
if (r.max_version)
{
- int i (l.max_version->compare (*r.max_version,
- r.max_version->revision == 0));
+ int i (l.max_version->compare (*r.max_version, false));
if (l.max_open)
// Doesn't matter if r is max_open or not.
//