aboutsummaryrefslogtreecommitdiff
path: root/paludis
diff options
context:
space:
mode:
Diffstat (limited to 'paludis')
-rw-r--r--paludis/dep_spec-fwd.hh3
-rw-r--r--paludis/dep_spec.cc14
-rw-r--r--paludis/dep_spec.hh12
-rw-r--r--paludis/dep_spec.se27
-rw-r--r--paludis/dep_spec_TEST.cc2
-rw-r--r--paludis/files.m42
-rw-r--r--paludis/repositories/e/dep_parser.cc2
-rw-r--r--paludis/repositories/fake/dep_parser.cc2
-rw-r--r--paludis/resolver/decider.cc2
-rw-r--r--paludis/resolver/get_constraints_for_dependent_helper.cc2
-rw-r--r--paludis/resolver/get_constraints_for_purge_helper.cc2
-rw-r--r--paludis/resolver/orderer.cc18
-rw-r--r--paludis/resolver/package_or_block_dep_spec.cc6
-rw-r--r--paludis/resolver/resolver_TEST_blockers.cc2
-rw-r--r--paludis/resolver/resolver_TEST_continue_on_failure.cc2
-rw-r--r--paludis/resolver/resolver_TEST_purges.cc2
-rw-r--r--paludis/resolver/resolver_TEST_uninstalls.cc2
-rw-r--r--paludis/resolver/spec_rewriter.cc2
-rw-r--r--paludis/stringify_formatter_TEST.cc3
19 files changed, 76 insertions, 31 deletions
diff --git a/paludis/dep_spec-fwd.hh b/paludis/dep_spec-fwd.hh
index 4bc9409d8..fb968411b 100644
--- a/paludis/dep_spec-fwd.hh
+++ b/paludis/dep_spec-fwd.hh
@@ -32,6 +32,9 @@
namespace paludis
{
+
+#include <paludis/dep_spec-se.hh>
+
class DepSpec;
class PackageDepSpec;
class PlainTextDepSpec;
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 4221d4662..419dd2a23 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -45,6 +45,8 @@
using namespace paludis;
+#include <paludis/dep_spec-se.cc>
+
namespace paludis
{
template <>
@@ -252,17 +254,17 @@ NamedSetDepSpec::need_keys_added() const
{
}
-BlockDepSpec::BlockDepSpec(const std::string & s, const PackageDepSpec & p, const bool t) :
+BlockDepSpec::BlockDepSpec(const std::string & s, const PackageDepSpec & p, const BlockKind k) :
StringDepSpec(s),
_spec(p),
- _strong(t)
+ _kind(k)
{
}
BlockDepSpec::BlockDepSpec(const BlockDepSpec & other) :
StringDepSpec(other.text()),
_spec(other._spec),
- _strong(other._strong)
+ _kind(other._kind)
{
}
@@ -450,10 +452,10 @@ BlockDepSpec::blocking() const
return _spec;
}
-bool
-BlockDepSpec::strong() const
+BlockKind
+BlockDepSpec::block_kind() const
{
- return _strong;
+ return _kind;
}
std::shared_ptr<DepSpec>
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index 98b485f22..8e710f933 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -595,7 +595,7 @@ namespace paludis
{
private:
PackageDepSpec _spec;
- bool _strong;
+ BlockKind _kind;
protected:
virtual void need_keys_added() const;
@@ -605,9 +605,9 @@ namespace paludis
///\{
/**
- * \since 0.41
+ * \since 0.55
*/
- BlockDepSpec(const std::string & text, const PackageDepSpec & spec, const bool strong);
+ BlockDepSpec(const std::string & text, const PackageDepSpec & spec, const BlockKind);
BlockDepSpec(const BlockDepSpec &);
@@ -621,11 +621,11 @@ namespace paludis
const PackageDepSpec blocking() const PALUDIS_ATTRIBUTE((warn_unused_result));
/**
- * Fetch whether we're a strong blocker.
+ * Fetch our blocker strength.
*
- * \since 0.41
+ * \since 0.55
*/
- bool strong() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ BlockKind block_kind() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::shared_ptr<DepSpec> clone() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
diff --git a/paludis/dep_spec.se b/paludis/dep_spec.se
new file mode 100644
index 000000000..3531f2bd9
--- /dev/null
+++ b/paludis/dep_spec.se
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et ft=sh :
+
+make_enum_BlockKind()
+{
+ prefix bk
+
+ key bk_weak "Generic weak block"
+ key bk_strong "Generic strong block"
+ key bk_manual "A block requiring manual resolution"
+ key bk_upgrade_blocked_before "Strong, nothing is not fine if met"
+ key bk_uninstall_blocked_before "Strong, nothing is fine too"
+ key bk_uninstall_blocked_after "Weak, nothing is fine too"
+
+ want_destringify
+
+ doxygen_comment << "END"
+ /**
+ * Kind of a BlockDepSpec.
+ *
+ * \ingroup g_dep_spec
+ * \since 0.55
+ */
+END
+}
+
+
diff --git a/paludis/dep_spec_TEST.cc b/paludis/dep_spec_TEST.cc
index 7925b53ec..bf7e5595a 100644
--- a/paludis/dep_spec_TEST.cc
+++ b/paludis/dep_spec_TEST.cc
@@ -71,7 +71,7 @@ namespace test_cases
std::shared_ptr<PackageDepSpec> c(std::static_pointer_cast<PackageDepSpec>(a.clone()));
TEST_CHECK_STRINGIFY_EQUAL(a, *c);
- BlockDepSpec d("!" + stringify(*c), *c, false);
+ BlockDepSpec d("!" + stringify(*c), *c, bk_weak);
std::shared_ptr<BlockDepSpec> e(std::static_pointer_cast<BlockDepSpec>(d.clone()));
TEST_CHECK_STRINGIFY_EQUAL(d.blocking(), e->blocking());
}
diff --git a/paludis/files.m4 b/paludis/files.m4
index 6657ec749..b987297de 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -25,7 +25,7 @@ add(`common_sets', `hh', `cc', `fwd')
add(`contents', `hh', `cc', `fwd')
add(`create_output_manager_info', `hh', `cc', `fwd', `se')
add(`dep_label', `hh', `cc', `fwd')
-add(`dep_spec', `hh', `cc', `test', `fwd')
+add(`dep_spec', `hh', `cc', `test', `fwd', `se')
add(`dep_spec_data', `hh', `cc', `fwd')
add(`dep_spec_flattener', `hh', `cc')
add(`dep_tag', `hh', `cc', `fwd')
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index 74192cebd..f5ae15424 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -123,7 +123,7 @@ namespace
eapi.supported()->package_dep_spec_parse_options(),
eapi.supported()->version_spec_options(),
id),
- strong));
+ strong ? bk_strong : bk_weak));
h.begin()->item()->append(spec);
annotations_go_here(spec);
}
diff --git a/paludis/repositories/fake/dep_parser.cc b/paludis/repositories/fake/dep_parser.cc
index 3941a5dae..b627b1c5c 100644
--- a/paludis/repositories/fake/dep_parser.cc
+++ b/paludis/repositories/fake/dep_parser.cc
@@ -73,7 +73,7 @@ namespace
+ epdso_allow_use_deps + epdso_allow_ranged_deps + epdso_allow_tilde_greater_deps
+ epdso_strict_parsing,
user_version_spec_options(),
- id), false));
+ id), bk_weak));
}
else
package_dep_spec_string_handler<T_>(h, s, id);
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index 7c083c38c..a4d24a46e 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -1033,7 +1033,7 @@ Decider::_make_constraint_for_preloading(
result->spec().if_block() = std::make_shared<BlockDepSpec>(
"!" + stringify(s),
s,
- result->spec().if_block()->strong());
+ result->spec().if_block()->block_kind());
}
return result;
diff --git a/paludis/resolver/get_constraints_for_dependent_helper.cc b/paludis/resolver/get_constraints_for_dependent_helper.cc
index 1309f6288..642699aea 100644
--- a/paludis/resolver/get_constraints_for_dependent_helper.cc
+++ b/paludis/resolver/get_constraints_for_dependent_helper.cc
@@ -95,7 +95,7 @@ GetConstraintsForDependentHelper::operator() (
n::destination_type() = dt_install_to_slash,
n::nothing_is_fine_too() = true,
n::reason() = reason,
- n::spec() = BlockDepSpec("!" + stringify(*spec), *spec, false),
+ n::spec() = BlockDepSpec("!" + stringify(*spec), *spec, bk_weak),
n::untaken() = false,
n::use_existing() = ue_if_possible
)));
diff --git a/paludis/resolver/get_constraints_for_purge_helper.cc b/paludis/resolver/get_constraints_for_purge_helper.cc
index 507290a25..625ae8887 100644
--- a/paludis/resolver/get_constraints_for_purge_helper.cc
+++ b/paludis/resolver/get_constraints_for_purge_helper.cc
@@ -86,7 +86,7 @@ GetConstraintsForPurgeHelper::operator() (
n::destination_type() = dt_install_to_slash,
n::nothing_is_fine_too() = true,
n::reason() = reason,
- n::spec() = BlockDepSpec("!" + stringify(spec), spec, false),
+ n::spec() = BlockDepSpec("!" + stringify(spec), spec, bk_weak),
n::untaken() = ! _imp->purge_specs.match_any(_imp->env, id, { }),
n::use_existing() = ue_if_possible
)));
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index 5982901d1..ce753449e 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -260,8 +260,22 @@ namespace
{
bool normal(true);
if (r.sanitised_dependency().spec().if_block())
- if (! r.sanitised_dependency().spec().if_block()->strong())
- normal = false;
+ switch (r.sanitised_dependency().spec().if_block()->block_kind())
+ {
+ case bk_weak:
+ case bk_uninstall_blocked_after:
+ normal = false;
+ break;
+
+ case bk_strong:
+ case bk_manual:
+ case bk_upgrade_blocked_before:
+ case bk_uninstall_blocked_before:
+ break;
+
+ case last_bk:
+ break;
+ }
NAGIndex from(make_named_values<NAGIndex>(
n::resolvent() = r.from_resolvent(),
diff --git a/paludis/resolver/package_or_block_dep_spec.cc b/paludis/resolver/package_or_block_dep_spec.cc
index cb96300f3..576ec5755 100644
--- a/paludis/resolver/package_or_block_dep_spec.cc
+++ b/paludis/resolver/package_or_block_dep_spec.cc
@@ -66,7 +66,7 @@ PackageOrBlockDepSpec::serialise(Serialiser & s) const
w
.member(SerialiserFlags<>(), "block", true)
.member(SerialiserFlags<>(), "spec", stringify(if_block()->blocking()))
- .member(SerialiserFlags<>(), "strong", if_block()->strong())
+ .member(SerialiserFlags<>(), "block_kind", stringify(if_block()->block_kind()))
.member(SerialiserFlags<>(), "text", if_block()->text())
;
}
@@ -140,9 +140,9 @@ PackageOrBlockDepSpec::deserialise(Deserialisation & d, const std::shared_ptr<co
if (block)
{
- bool strong(v.member<bool>("strong"));
+ BlockKind kind(destringify<BlockKind>(v.member<std::string>("block_kind")));
std::string text(v.member<std::string>("text"));
- BlockDepSpec b_spec(text, spec, strong);
+ BlockDepSpec b_spec(text, spec, kind);
if (annotations)
b_spec.set_annotations_key(annotations);
return PackageOrBlockDepSpec(b_spec);
diff --git a/paludis/resolver/resolver_TEST_blockers.cc b/paludis/resolver/resolver_TEST_blockers.cc
index d6ea45832..3df4f44cd 100644
--- a/paludis/resolver/resolver_TEST_blockers.cc
+++ b/paludis/resolver/resolver_TEST_blockers.cc
@@ -189,7 +189,7 @@ namespace test_cases
std::shared_ptr<const Resolved> resolved(get_resolved(BlockDepSpec(
"!target/target",
parse_user_package_dep_spec("target/target", &env, { }),
- false)));
+ bk_weak)));
check_resolved(resolved,
n::taken_change_or_remove_decisions() = exists ? make_shared_copy(DecisionChecks()
diff --git a/paludis/resolver/resolver_TEST_continue_on_failure.cc b/paludis/resolver/resolver_TEST_continue_on_failure.cc
index ab9e63f28..29da32865 100644
--- a/paludis/resolver/resolver_TEST_continue_on_failure.cc
+++ b/paludis/resolver/resolver_TEST_continue_on_failure.cc
@@ -169,7 +169,7 @@ namespace test_cases
std::shared_ptr<const Resolved> resolved(get_resolved(BlockDepSpec(
"!continue-on-failure-uninstall/target",
parse_user_package_dep_spec("continue-on-failure-uninstall/target", &env, { }),
- false)));
+ bk_weak)));
check_resolved(resolved,
n::taken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
diff --git a/paludis/resolver/resolver_TEST_purges.cc b/paludis/resolver/resolver_TEST_purges.cc
index be4a6fae0..7068f5b11 100644
--- a/paludis/resolver/resolver_TEST_purges.cc
+++ b/paludis/resolver/resolver_TEST_purges.cc
@@ -126,7 +126,7 @@ namespace test_cases
std::shared_ptr<const Resolved> resolved(get_resolved(BlockDepSpec(
"!star-slot-purges/target:1",
parse_user_package_dep_spec("star-slot-purges/target:1", &env, { }),
- false)));
+ bk_weak)));
check_resolved(resolved,
n::taken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
diff --git a/paludis/resolver/resolver_TEST_uninstalls.cc b/paludis/resolver/resolver_TEST_uninstalls.cc
index 46c9ff7b5..8369b4600 100644
--- a/paludis/resolver/resolver_TEST_uninstalls.cc
+++ b/paludis/resolver/resolver_TEST_uninstalls.cc
@@ -96,7 +96,7 @@ namespace test_cases
std::shared_ptr<const Resolved> resolved(get_resolved(BlockDepSpec(
"!breaking/target",
parse_user_package_dep_spec("breaking/target", &env, { }),
- false)));
+ bk_weak)));
if (allowed_to_remove)
check_resolved(resolved,
diff --git a/paludis/resolver/spec_rewriter.cc b/paludis/resolver/spec_rewriter.cc
index d9208423c..08f6aca9b 100644
--- a/paludis/resolver/spec_rewriter.cc
+++ b/paludis/resolver/spec_rewriter.cc
@@ -136,7 +136,7 @@ SpecRewriter::rewrite_if_special(const PackageOrBlockDepSpec & s, const std::sha
std::string::size_type p(prefix.find_first_not_of('!'));
if (std::string::npos != p)
prefix.erase(p);
- result->specs()->push_back(BlockDepSpec(prefix + stringify(spec), spec, s.if_block()->strong()));
+ result->specs()->push_back(BlockDepSpec(prefix + stringify(spec), spec, s.if_block()->block_kind()));
}
return result;
diff --git a/paludis/stringify_formatter_TEST.cc b/paludis/stringify_formatter_TEST.cc
index e2e159208..5245f8705 100644
--- a/paludis/stringify_formatter_TEST.cc
+++ b/paludis/stringify_formatter_TEST.cc
@@ -115,8 +115,7 @@ namespace test_cases
PartialFormatter f;
StringifyFormatter ff(f);
- BlockDepSpec b("!!!!!cat/pkg", parse_user_package_dep_spec("cat/pkg",
- &env, { }), false);
+ BlockDepSpec b("!!!!!cat/pkg", parse_user_package_dep_spec("cat/pkg", &env, { }), bk_weak);
NamedSetDepSpec u(SetName("foo"));
std::string s(format_three(
parse_user_package_dep_spec("cat/pkg", &env, { }),