aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-09-08 09:04:15 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-09-08 09:20:00 +0100
commit9c877a1ab941ff8dfc42ced7fb688f00123c86e1 (patch)
tree2b0af304fe65056524cf5de746b08ea32bf9bf41
parentb40b455286e20ff004882b41b036da8119e061d0 (diff)
downloadpaludis-9c877a1ab941ff8dfc42ced7fb688f00123c86e1.tar.gz
paludis-9c877a1ab941ff8dfc42ced7fb688f00123c86e1.tar.xz
Add UninstallConfirmation
-rw-r--r--paludis/resolver/confirm_helper.cc4
-rw-r--r--paludis/resolver/required_confirmations-fwd.hh3
-rw-r--r--paludis/resolver/required_confirmations.cc20
-rw-r--r--paludis/resolver/required_confirmations.hh15
-rw-r--r--src/clients/cave/cmd_display_resolution.cc1
-rw-r--r--src/clients/cave/resolve_common.cc5
6 files changed, 44 insertions, 4 deletions
diff --git a/paludis/resolver/confirm_helper.cc b/paludis/resolver/confirm_helper.cc
index 3908cff..dcc0120 100644
--- a/paludis/resolver/confirm_helper.cc
+++ b/paludis/resolver/confirm_helper.cc
@@ -127,6 +127,10 @@ ConfirmHelper::operator() (
[&] (const ChangedChoicesConfirmation &) {
return false;
+ },
+
+ [&] (const UninstallConfirmation &) {
+ return false;
}
);
}
diff --git a/paludis/resolver/required_confirmations-fwd.hh b/paludis/resolver/required_confirmations-fwd.hh
index 7f0faf5..3aaac2e 100644
--- a/paludis/resolver/required_confirmations-fwd.hh
+++ b/paludis/resolver/required_confirmations-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -34,6 +34,7 @@ namespace paludis
class RemoveSystemPackageConfirmation;
class MaskedConfirmation;
class ChangedChoicesConfirmation;
+ class UninstallConfirmation;
typedef Sequence<std::shared_ptr<const RequiredConfirmation> > RequiredConfirmations;
}
diff --git a/paludis/resolver/required_confirmations.cc b/paludis/resolver/required_confirmations.cc
index 18d1e74..235b853 100644
--- a/paludis/resolver/required_confirmations.cc
+++ b/paludis/resolver/required_confirmations.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -40,6 +40,8 @@ RequiredConfirmation::deserialise(Deserialisation & d)
return MaskedConfirmation::deserialise(d);
else if (d.class_name() == "ChangedChoicesConfirmation")
return ChangedChoicesConfirmation::deserialise(d);
+ else if (d.class_name() == "UninstallConfirmation")
+ return UninstallConfirmation::deserialise(d);
throw InternalError(PALUDIS_HERE,
"unknown class '" + stringify(d.class_name()) + "'");
@@ -135,8 +137,24 @@ ChangedChoicesConfirmation::serialise(Serialiser & s) const
;
}
+const std::shared_ptr<UninstallConfirmation>
+UninstallConfirmation::deserialise(Deserialisation & d)
+{
+ Deserialisator v(d, "UninstallConfirmation");
+ return std::make_shared<UninstallConfirmation>();
+}
+
+void
+UninstallConfirmation::serialise(Serialiser & s) const
+{
+ SerialiserObjectWriter writer =
+ s.object("UninstallConfirmation")
+ ;
+}
+
namespace paludis
{
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 9f62e44..c76ab7b 100644
--- a/paludis/resolver/required_confirmations.hh
+++ b/paludis/resolver/required_confirmations.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -33,7 +33,7 @@ namespace paludis
class PALUDIS_VISIBLE RequiredConfirmation :
public virtual DeclareAbstractAcceptMethods<RequiredConfirmation, MakeTypeList<
DowngradeConfirmation, NotBestConfirmation, BreakConfirmation, RemoveSystemPackageConfirmation,
- MaskedConfirmation, ChangedChoicesConfirmation>::Type>
+ MaskedConfirmation, ChangedChoicesConfirmation, UninstallConfirmation>::Type>
{
public:
virtual void serialise(Serialiser &) const = 0;
@@ -107,6 +107,17 @@ namespace paludis
virtual void serialise(Serialiser &) const;
};
+
+ class PALUDIS_VISIBLE UninstallConfirmation :
+ public RequiredConfirmation,
+ public ImplementAcceptMethods<RequiredConfirmation, UninstallConfirmation>
+ {
+ public:
+ static const std::shared_ptr<UninstallConfirmation> 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 20fa2a9..66cf06c 100644
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -795,6 +795,7 @@ namespace
[&] (const NotBestConfirmation &) { return "--permit-old-version"; },
[&] (const BreakConfirmation &) { return "--uninstalls-may-break or --remove-if-dependent"; },
[&] (const RemoveSystemPackageConfirmation &) { return "--uninstalls-may-break system"; },
+ [&] (const UninstallConfirmation &) { return "--permit-uninstall (check this very carefully!)"; },
[&] (const MaskedConfirmation &) { return "being unmasked"; },
[&] (const ChangedChoicesConfirmation &) { return "user configuration changes"; }
);
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index d25c83f..1be2ea6 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -740,6 +740,11 @@ namespace
{
return true;
}
+
+ bool visit(const UninstallConfirmation &) const
+ {
+ return true;
+ }
};
}