aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-02-05 16:17:02 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-02-05 16:17:02 +0000
commit188e4e6d2f8c861e1b307e21f60ba0b784518031 (patch)
tree7f683bebdfc31b5960026b8cc035d0afa795ee08
parent4b06fa752f1b4ae8b21590d7c8ba92077f43dd68 (diff)
downloadpaludis-188e4e6d2f8c861e1b307e21f60ba0b784518031.tar.gz
paludis-188e4e6d2f8c861e1b307e21f60ba0b784518031.tar.xz
RemoveDecision::ids
-rw-r--r--paludis/resolver/decider.cc1
-rw-r--r--paludis/resolver/decision.cc21
-rw-r--r--paludis/resolver/decision.hh7
3 files changed, 25 insertions, 4 deletions
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index 8fc3ab2..a6bf7f0 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -1125,6 +1125,7 @@ Decider::_try_to_find_decision_for(
* able to remove things. */
if (_installed_but_allowed_to_remove(resolvent))
return make_shared_ptr(new RemoveDecision(
+ _installed_ids(resolvent),
! resolution->constraints()->all_untaken()
));
else
diff --git a/paludis/resolver/decision.cc b/paludis/resolver/decision.cc
index 5c9a7c4..0188ce2 100644
--- a/paludis/resolver/decision.cc
+++ b/paludis/resolver/decision.cc
@@ -109,7 +109,13 @@ RemoveDecision::deserialise(Deserialisation & d)
{
Deserialisator v(d, "RemoveDecision");
+ std::tr1::shared_ptr<PackageIDSequence> ids(new PackageIDSequence);
+ Deserialisator vv(*v.find_remove_member("ids"), "c");
+ for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
+ ids->push_back(vv.member<std::tr1::shared_ptr<const PackageID> >(stringify(n)));
+
return make_shared_ptr(new RemoveDecision(
+ ids,
v.member<bool>("taken")
));
}
@@ -374,17 +380,19 @@ namespace paludis
template <>
struct Implementation<RemoveDecision>
{
+ const std::tr1::shared_ptr<const PackageIDSequence> ids;
const bool taken;
- Implementation(const bool t) :
+ Implementation(const std::tr1::shared_ptr<const PackageIDSequence> & i, const bool t) :
+ ids(i),
taken(t)
{
}
};
}
-RemoveDecision::RemoveDecision(const bool t) :
- PrivateImplementationPattern<RemoveDecision>(new Implementation<RemoveDecision>(t))
+RemoveDecision::RemoveDecision(const std::tr1::shared_ptr<const PackageIDSequence> & i, const bool t) :
+ PrivateImplementationPattern<RemoveDecision>(new Implementation<RemoveDecision>(i, t))
{
}
@@ -402,11 +410,18 @@ RemoveDecision::taken() const
return _imp->taken;
}
+const std::tr1::shared_ptr<const PackageIDSequence>
+RemoveDecision::ids() const
+{
+ return _imp->ids;
+}
+
void
RemoveDecision::serialise(Serialiser & s) const
{
s.object("RemoveDecision")
.member(SerialiserFlags<>(), "taken", taken())
+ .member(SerialiserFlags<serialise::might_be_null, serialise::container>(), "ids", ids())
;
}
diff --git a/paludis/resolver/decision.hh b/paludis/resolver/decision.hh
index b2225f8..cf6e4c2 100644
--- a/paludis/resolver/decision.hh
+++ b/paludis/resolver/decision.hh
@@ -131,11 +131,16 @@ namespace paludis
public std::tr1::enable_shared_from_this<RemoveDecision>
{
public:
- RemoveDecision(const bool taken);
+ RemoveDecision(
+ const std::tr1::shared_ptr<const PackageIDSequence> &,
+ const bool taken);
~RemoveDecision();
virtual bool taken() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const std::tr1::shared_ptr<const PackageIDSequence> ids() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
virtual void serialise(Serialiser &) const;
static const std::tr1::shared_ptr<RemoveDecision> deserialise(