aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-24 13:38:35 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-24 13:38:35 +0100
commitd9961fca4dad9e65c32045ad179d4a01a3b37ae5 (patch)
treeb7f46e73199ebce81b5f3682a713981265e39eed
parentef31d7d0c52d8e149830aeae915d6a6129282fcd (diff)
downloadpaludis-d9961fca4dad9e65c32045ad179d4a01a3b37ae5.tar.gz
paludis-d9961fca4dad9e65c32045ad179d4a01a3b37ae5.tar.xz
MaskedConfirmation
-rw-r--r--paludis/resolver/decider.cc7
-rw-r--r--paludis/resolver/required_confirmations-fwd.hh1
-rw-r--r--paludis/resolver/required_confirmations.cc16
-rw-r--r--paludis/resolver/required_confirmations.hh13
-rw-r--r--src/clients/cave/cmd_display_resolution.cc5
-rw-r--r--src/clients/cave/resolve_common.cc5
6 files changed, 46 insertions, 1 deletions
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index 9f93642..d036517 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -2065,6 +2065,13 @@ namespace
if (! fns.confirm_fn()(resolution, c))
changes_to_make_decision.add_required_confirmation(c);
}
+
+ if (changes_to_make_decision.origin_id()->masked())
+ {
+ auto c(std::make_shared<MaskedConfirmation>());
+ if (! fns.confirm_fn()(resolution, c))
+ changes_to_make_decision.add_required_confirmation(c);
+ }
}
void visit(BreakDecision & break_decision) const
diff --git a/paludis/resolver/required_confirmations-fwd.hh b/paludis/resolver/required_confirmations-fwd.hh
index ddd9398..80ccd41 100644
--- a/paludis/resolver/required_confirmations-fwd.hh
+++ b/paludis/resolver/required_confirmations-fwd.hh
@@ -32,6 +32,7 @@ namespace paludis
struct NotBestConfirmation;
struct BreakConfirmation;
struct RemoveSystemPackageConfirmation;
+ struct MaskedConfirmation;
typedef Sequence<std::shared_ptr<const RequiredConfirmation> > RequiredConfirmations;
}
diff --git a/paludis/resolver/required_confirmations.cc b/paludis/resolver/required_confirmations.cc
index dc9e1f6..95585c8 100644
--- a/paludis/resolver/required_confirmations.cc
+++ b/paludis/resolver/required_confirmations.cc
@@ -38,6 +38,8 @@ RequiredConfirmation::deserialise(Deserialisation & d)
return BreakConfirmation::deserialise(d);
else if (d.class_name() == "RemoveSystemPackageConfirmation")
return RemoveSystemPackageConfirmation::deserialise(d);
+ else if (d.class_name() == "MaskedConfirmation")
+ return MaskedConfirmation::deserialise(d);
else
throw InternalError(PALUDIS_HERE, "unknown class '" + stringify(d.class_name()) + "'");
@@ -100,6 +102,20 @@ RemoveSystemPackageConfirmation::serialise(Serialiser & s) const
;
}
+const std::shared_ptr<MaskedConfirmation>
+MaskedConfirmation::deserialise(Deserialisation & d)
+{
+ Deserialisator v(d, "MaskedConfirmation");
+ return std::make_shared<MaskedConfirmation>();
+}
+
+void
+MaskedConfirmation::serialise(Serialiser & s) const
+{
+ s.object("MaskedConfirmation")
+ ;
+}
+
template class Sequence<std::shared_ptr<const RequiredConfirmation> >;
template class WrappedForwardIterator<RequiredConfirmations::ConstIteratorTag, const std::shared_ptr<const RequiredConfirmation> >;
diff --git a/paludis/resolver/required_confirmations.hh b/paludis/resolver/required_confirmations.hh
index 2c7e1c8..4520561 100644
--- a/paludis/resolver/required_confirmations.hh
+++ b/paludis/resolver/required_confirmations.hh
@@ -32,7 +32,7 @@ namespace paludis
{
class PALUDIS_VISIBLE RequiredConfirmation :
public virtual DeclareAbstractAcceptMethods<RequiredConfirmation, MakeTypeList<
- DowngradeConfirmation, NotBestConfirmation, BreakConfirmation, RemoveSystemPackageConfirmation>::Type>
+ DowngradeConfirmation, NotBestConfirmation, BreakConfirmation, RemoveSystemPackageConfirmation, MaskedConfirmation>::Type>
{
public:
virtual void serialise(Serialiser &) const = 0;
@@ -84,6 +84,17 @@ namespace paludis
virtual void serialise(Serialiser &) const;
};
+
+ class PALUDIS_VISIBLE MaskedConfirmation :
+ public RequiredConfirmation,
+ public ImplementAcceptMethods<RequiredConfirmation, MaskedConfirmation>
+ {
+ public:
+ static const std::shared_ptr<MaskedConfirmation> deserialise(
+ Deserialisation & d) PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual void serialise(Serialiser &) const;
+ };
}
}
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 879e489..6820f93 100644
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -698,6 +698,11 @@ namespace
{
return "--uninstalls-may-break system";
}
+
+ std::string visit(const MaskedConfirmation &) const
+ {
+ return "being unmasked";
+ }
};
std::string stringify_confirmation(const RequiredConfirmation & c)
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index f9432a8..2ec8bbc 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -1210,6 +1210,11 @@ namespace
{
return allowed_to_break_system;
}
+
+ bool visit(const MaskedConfirmation &) const
+ {
+ return false;
+ }
};
bool confirm_fn(