diff options
author | 2013-09-08 09:04:15 +0100 | |
---|---|---|
committer | 2013-09-08 09:20:00 +0100 | |
commit | 9c877a1ab941ff8dfc42ced7fb688f00123c86e1 (patch) | |
tree | 2b0af304fe65056524cf5de746b08ea32bf9bf41 | |
parent | b40b455286e20ff004882b41b036da8119e061d0 (diff) | |
download | paludis-9c877a1ab941ff8dfc42ced7fb688f00123c86e1.tar.gz paludis-9c877a1ab941ff8dfc42ced7fb688f00123c86e1.tar.xz |
Add UninstallConfirmation
-rw-r--r-- | paludis/resolver/confirm_helper.cc | 4 | ||||
-rw-r--r-- | paludis/resolver/required_confirmations-fwd.hh | 3 | ||||
-rw-r--r-- | paludis/resolver/required_confirmations.cc | 20 | ||||
-rw-r--r-- | paludis/resolver/required_confirmations.hh | 15 | ||||
-rw-r--r-- | src/clients/cave/cmd_display_resolution.cc | 1 | ||||
-rw-r--r-- | src/clients/cave/resolve_common.cc | 5 |
6 files changed, 44 insertions, 4 deletions
diff --git a/paludis/resolver/confirm_helper.cc b/paludis/resolver/confirm_helper.cc index 3908cff96..dcc0120ae 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 7f0faf57b..3aaac2e86 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 18d1e742e..235b853d5 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 9f62e446f..c76ab7b2e 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 20fa2a91a..66cf06cc7 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 d25c83f3c..1be2ea65d 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; + } }; } |