aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-15 16:22:59 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-15 16:22:59 +0100
commitde3cd9f9217b344a92a677ac26749fa4c6dfb686 (patch)
treef937ece4bae5d3c731e1eb15cadc1fec2bb65474
parent004b5620a3f60ccf1b6e97521d6b3004b27ab147 (diff)
downloadpaludis-de3cd9f9217b344a92a677ac26749fa4c6dfb686.tar.gz
paludis-de3cd9f9217b344a92a677ac26749fa4c6dfb686.tar.xz
Remove old orderer
-rw-r--r--paludis/resolver/Makefile.am45
-rw-r--r--paludis/resolver/arrow-fwd.hh37
-rw-r--r--paludis/resolver/arrow.cc53
-rw-r--r--paludis/resolver/arrow.hh55
-rw-r--r--paludis/resolver/decider.cc1
-rw-r--r--paludis/resolver/failure_kinds-fwd.hh39
-rw-r--r--paludis/resolver/failure_kinds.cc30
-rw-r--r--paludis/resolver/failure_kinds.hh33
-rw-r--r--paludis/resolver/failure_kinds.se14
-rw-r--r--paludis/resolver/job-fwd.hh38
-rw-r--r--paludis/resolver/job.cc743
-rw-r--r--paludis/resolver/job.hh301
-rw-r--r--paludis/resolver/job_id-fwd.hh38
-rw-r--r--paludis/resolver/job_id.cc67
-rw-r--r--paludis/resolver/job_id.hh50
-rw-r--r--paludis/resolver/job_state-fwd.hh35
-rw-r--r--paludis/resolver/job_state.cc202
-rw-r--r--paludis/resolver/job_state.hh116
-rw-r--r--paludis/resolver/jobs-fwd.hh31
-rw-r--r--paludis/resolver/jobs.cc299
-rw-r--r--paludis/resolver/jobs.hh75
-rw-r--r--paludis/resolver/orderer-fwd.hh31
-rw-r--r--paludis/resolver/orderer.cc787
-rw-r--r--paludis/resolver/orderer.hh78
-rw-r--r--paludis/resolver/resolution.cc1
-rw-r--r--paludis/resolver/resolver.cc25
-rw-r--r--paludis/resolver/resolver.hh2
-rw-r--r--paludis/resolver/resolver_TEST_any.cc1
-rw-r--r--paludis/resolver/resolver_TEST_blockers.cc1
-rw-r--r--paludis/resolver/resolver_TEST_cycles.cc1
-rw-r--r--paludis/resolver/resolver_TEST_errors.cc1
-rw-r--r--paludis/resolver/resolver_TEST_serialisation.cc1
-rw-r--r--paludis/resolver/resolver_TEST_simple.cc1
-rw-r--r--paludis/resolver/resolver_TEST_suggestions.cc1
-rw-r--r--paludis/resolver/resolver_TEST_virtuals.cc1
-rw-r--r--paludis/resolver/resolver_lists-fwd.hh31
-rw-r--r--paludis/resolver/resolver_lists.cc96
-rw-r--r--paludis/resolver/resolver_lists.hh62
-rw-r--r--paludis/resolver/resolver_test.cc4
-rw-r--r--paludis/resolver/resolver_test.hh1
-rw-r--r--src/clients/cave/cmd_display_resolution.cc1
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc6
-rw-r--r--src/clients/cave/cmd_resolve_dump.cc21
-rw-r--r--src/clients/cave/resolve_common.cc6
44 files changed, 16 insertions, 3446 deletions
diff --git a/paludis/resolver/Makefile.am b/paludis/resolver/Makefile.am
index f543baa..db5b447 100644
--- a/paludis/resolver/Makefile.am
+++ b/paludis/resolver/Makefile.am
@@ -4,7 +4,6 @@ DISTCLEANFILES = \
any_child_score-se.hh any_child_score-se.cc \
change_type-se.hh change_type-se.cc \
destination_types-se.hh destination_types-se.cc \
- failure_kinds-se.hh failure_kinds-se.cc \
resolver_functions-se.hh resolver_functions-se.cc \
use_existing-se.hh use_existing-se.cc
AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
@@ -12,7 +11,6 @@ EXTRA_DIST = \
any_child_score-se.hh any_child_score-se.cc any_child_score.se \
change_type-se.hh change_type-se.cc change_type.se \
destination_types-se.hh destination_types-se.cc destination_types.se \
- failure_kinds-se.hh failure_kinds-se.cc failure_kinds.se \
resolver_functions-se.hh resolver_functions-se.cc resolver_functions.se \
use_existing-se.hh use_existing-se.cc use_existing.se \
$(check_SCRIPTS)
@@ -20,84 +18,67 @@ BUILT_SOURCES = \
any_child_score-se.hh any_child_score-se.cc \
change_type-se.hh change_type-se.cc \
destination_types-se.hh destination_types-se.cc \
- failure_kinds-se.hh failure_kinds-se.cc \
resolver_functions-se.hh resolver_functions-se.cc \
use_existing-se.hh use_existing-se.cc
noinst_HEADERS = \
any_child_score.hh any_child_score-fwd.hh any_child_score-se.hh \
- arrow.hh arrow-fwd.hh \
change_type.hh change_type-fwd.hh change_type-se.hh \
constraint.hh constraint-fwd.hh \
decider.hh decider-fwd.hh \
decision.hh decision-fwd.hh \
+ decisions.hh decisions-fwd.hh \
destination.hh destination-fwd.hh \
destination_types.hh destination_types-fwd.hh destination_types-se.hh \
- failure_kinds.hh failure_kinds-fwd.hh failure_kinds-se.hh \
- job.hh job-fwd.hh \
- job_id.hh job_id-fwd.hh \
- job_state.hh job_state-fwd.hh \
- jobs.hh jobs-fwd.hh \
- orderer.hh orderer-fwd.hh \
+ lineariser.hh lineariser-fwd.hh \
+ nag.hh nag-fwd.hh \
package_or_block_dep_spec.hh package_or_block_dep_spec-fwd.hh \
reason.hh reason-fwd.hh \
required_confirmations.hh required_confirmations-fwd.hh \
resolution.hh resolution-fwd.hh \
resolutions_by_resolvent.hh resolutions_by_resolvent-fwd.hh \
+ resolved.hh resolved-fwd.hh \
resolvent.hh resolvent-fwd.hh \
resolver.hh resolver-fwd.hh \
resolver_functions.hh resolver_functions-fwd.hh \
- resolver_lists.hh resolver_lists-fwd.hh \
sanitised_dependencies.hh sanitised_dependencies-fwd.hh \
slot_name_or_null.hh slot_name_or_null-fwd.hh \
spec_rewriter.hh spec_rewriter-fwd.hh \
+ strongly_connected_component.hh strongly_connected_component-fwd.hh \
suggest_restart.hh suggest_restart-fwd.hh \
unsuitable_candidates.hh unsuitable_candidates-fwd.hh \
use_existing.hh use_existing-fwd.hh use_existing-se.hh \
- resolved.hh resolved-fwd.hh \
- decisions.hh decisions-fwd.hh \
- lineariser.hh lineariser-fwd.hh \
- nag.hh nag-fwd.hh \
- strongly_connected_component.hh strongly_connected_component-fwd.hh \
work_item.hh work_item-fwd.hh \
work_list.hh work_list-fwd.hh \
work_lists.hh work_lists-fwd.hh
libpaludisresolver_a_SOURCES = \
any_child_score.cc \
- arrow.cc \
change_type.cc \
constraint.cc \
decider.cc \
decision.cc \
+ decisions.cc \
destination.cc \
destination_types.cc \
- failure_kinds.cc \
- job.cc \
- job_id.cc \
- job_state.cc \
- jobs.cc \
- orderer.cc \
+ lineariser.cc \
+ nag.cc \
package_or_block_dep_spec.cc \
reason.cc \
required_confirmations.cc \
resolution.cc \
resolutions_by_resolvent.cc \
+ resolved.cc \
resolvent.cc \
resolver.cc \
resolver_functions.cc \
- resolver_lists.cc \
sanitised_dependencies.cc \
slot_name_or_null.cc \
spec_rewriter.cc \
+ strongly_connected_component.cc \
suggest_restart.cc \
unsuitable_candidates.cc \
use_existing.cc \
- resolved.cc \
- decisions.cc \
- lineariser.cc \
- nag.cc \
- strongly_connected_component.cc \
work_item.cc \
work_list.cc \
work_lists.cc
@@ -247,12 +228,6 @@ use_existing-se.hh : use_existing.se $(top_srcdir)/misc/make_se.bash
use_existing-se.cc : use_existing.se $(top_srcdir)/misc/make_se.bash
if ! $(top_srcdir)/misc/make_se.bash --source $(srcdir)/use_existing.se > $@ ; then rm -f $@ ; exit 1 ; fi
-failure_kinds-se.hh : failure_kinds.se $(top_srcdir)/misc/make_se.bash
- if ! $(top_srcdir)/misc/make_se.bash --header $(srcdir)/failure_kinds.se > $@ ; then rm -f $@ ; exit 1 ; fi
-
-failure_kinds-se.cc : failure_kinds.se $(top_srcdir)/misc/make_se.bash
- if ! $(top_srcdir)/misc/make_se.bash --source $(srcdir)/failure_kinds.se > $@ ; then rm -f $@ ; exit 1 ; fi
-
destination_types-se.hh : destination_types.se $(top_srcdir)/misc/make_se.bash
if ! $(top_srcdir)/misc/make_se.bash --header $(srcdir)/destination_types.se > $@ ; then rm -f $@ ; exit 1 ; fi
diff --git a/paludis/resolver/arrow-fwd.hh b/paludis/resolver/arrow-fwd.hh
deleted file mode 100644
index 0355e05..0000000
--- a/paludis/resolver/arrow-fwd.hh
+++ /dev/null
@@ -1,37 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_ARROW_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_ARROW_FWD_HH 1
-
-#include <paludis/util/attributes.hh>
-#include <paludis/util/sequence-fwd.hh>
-#include <tr1/memory>
-
-namespace paludis
-{
- namespace resolver
- {
- struct Arrow;
-
- typedef Sequence<Arrow> ArrowSequence;
- }
-}
-
-#endif
diff --git a/paludis/resolver/arrow.cc b/paludis/resolver/arrow.cc
deleted file mode 100644
index 1390c25..0000000
--- a/paludis/resolver/arrow.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009, 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <paludis/resolver/arrow.hh>
-#include <paludis/resolver/reason.hh>
-#include <paludis/util/sequence-impl.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_named_values.hh>
-#include <paludis/serialise-impl.hh>
-
-using namespace paludis;
-using namespace paludis::resolver;
-
-void
-Arrow::serialise(Serialiser & s) const
-{
- s.object("Arrow")
- .member(SerialiserFlags<>(), "comes_after", comes_after())
- .member(SerialiserFlags<>(), "failure_kinds", failure_kinds())
- .member(SerialiserFlags<serialise::might_be_null>(), "maybe_reason", maybe_reason())
- ;
-}
-
-const Arrow
-Arrow::deserialise(Deserialisation & d)
-{
- Deserialisator v(d, "Arrow");
- return make_named_values<Arrow>(
- n::comes_after() = v.member<JobID>("comes_after"),
- n::failure_kinds() = v.member<FailureKinds>("failure_kinds"),
- n::maybe_reason() = v.member<std::tr1::shared_ptr<const Reason> >("maybe_reason")
- );
-}
-
-template class Sequence<Arrow>;
-template class WrappedForwardIterator<ArrowSequence::ConstIteratorTag, const Arrow>;
-
diff --git a/paludis/resolver/arrow.hh b/paludis/resolver/arrow.hh
deleted file mode 100644
index 256ccb1..0000000
--- a/paludis/resolver/arrow.hh
+++ /dev/null
@@ -1,55 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009, 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_ARROW_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_ARROW_HH 1
-
-#include <paludis/resolver/arrow-fwd.hh>
-#include <paludis/resolver/resolvent.hh>
-#include <paludis/resolver/reason-fwd.hh>
-#include <paludis/resolver/job_id.hh>
-#include <paludis/resolver/failure_kinds-fwd.hh>
-#include <paludis/serialise-fwd.hh>
-#include <paludis/util/named_value.hh>
-
-namespace paludis
-{
- namespace n
- {
- typedef Name<struct comes_after_name> comes_after;
- typedef Name<struct failure_kinds_name> failure_kinds;
- typedef Name<struct maybe_reason_name> maybe_reason;
- }
-
- namespace resolver
- {
- struct Arrow
- {
- NamedValue<n::comes_after, JobID> comes_after;
- NamedValue<n::failure_kinds, FailureKinds> failure_kinds;
- NamedValue<n::maybe_reason, std::tr1::shared_ptr<const Reason> > maybe_reason;
-
- void serialise(Serialiser &) const;
-
- static const Arrow deserialise(Deserialisation & d) PALUDIS_ATTRIBUTE((warn_unused_result));
- };
- }
-}
-
-#endif
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index faf0a5f..8d00177 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -30,7 +30,6 @@
#include <paludis/resolver/reason.hh>
#include <paludis/resolver/unsuitable_candidates.hh>
#include <paludis/resolver/resolver.hh>
-#include <paludis/resolver/resolver_lists.hh>
#include <paludis/resolver/required_confirmations.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
diff --git a/paludis/resolver/failure_kinds-fwd.hh b/paludis/resolver/failure_kinds-fwd.hh
deleted file mode 100644
index 86384a1..0000000
--- a/paludis/resolver/failure_kinds-fwd.hh
+++ /dev/null
@@ -1,39 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_FAILURE_KINDS_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_FAILURE_KINDS_FWD_HH 1
-
-#include <paludis/util/attributes.hh>
-#include <paludis/util/options.hh>
-#include <iosfwd>
-
-namespace paludis
-{
- namespace resolver
- {
-
-#include <paludis/resolver/failure_kinds-se.hh>
-
- typedef Options<FailureKind> FailureKinds;
-
- }
-}
-
-#endif
diff --git a/paludis/resolver/failure_kinds.cc b/paludis/resolver/failure_kinds.cc
deleted file mode 100644
index 522960d..0000000
--- a/paludis/resolver/failure_kinds.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <paludis/resolver/failure_kinds.hh>
-#include <paludis/util/stringify.hh>
-#include <paludis/util/exception.hh>
-#include <istream>
-#include <ostream>
-
-using namespace paludis;
-using namespace paludis::resolver;
-
-#include <paludis/resolver/failure_kinds-se.cc>
-
diff --git a/paludis/resolver/failure_kinds.hh b/paludis/resolver/failure_kinds.hh
deleted file mode 100644
index 76a93cd..0000000
--- a/paludis/resolver/failure_kinds.hh
+++ /dev/null
@@ -1,33 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_FAILURE_KINDS_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_FAILURE_KINDS_HH 1
-
-#include <paludis/resolver/failure_kinds-fwd.hh>
-
-namespace paludis
-{
- namespace resolver
- {
-
- }
-}
-
-#endif
diff --git a/paludis/resolver/failure_kinds.se b/paludis/resolver/failure_kinds.se
deleted file mode 100644
index 236812a..0000000
--- a/paludis/resolver/failure_kinds.se
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-# vim: set sw=4 sts=4 et ft=sh :
-
-make_enum_FailureKind()
-{
- prefix fk
- namespace paludis::resolver
-
- key fk_ignorable_always "We can always ignore this failure"
- key fk_ignorable_if_satisfied "We can ignore this failure if we're if-satisfied"
-
- want_destringify
-}
-
diff --git a/paludis/resolver/job-fwd.hh b/paludis/resolver/job-fwd.hh
deleted file mode 100644
index 5322bd5..0000000
--- a/paludis/resolver/job-fwd.hh
+++ /dev/null
@@ -1,38 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009, 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_FWD_HH 1
-
-namespace paludis
-{
- namespace resolver
- {
- struct Job;
-
- struct SimpleInstallJob;
- struct UninstallJob;
- struct FetchJob;
- struct UsableJob;
- struct UsableGroupJob;
- struct ErrorJob;
- }
-}
-
-#endif
diff --git a/paludis/resolver/job.cc b/paludis/resolver/job.cc
deleted file mode 100644
index e5facec..0000000
--- a/paludis/resolver/job.cc
+++ /dev/null
@@ -1,743 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009, 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <paludis/resolver/job.hh>
-#include <paludis/resolver/arrow.hh>
-#include <paludis/resolver/resolution.hh>
-#include <paludis/resolver/decision.hh>
-#include <paludis/resolver/required_confirmations.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/sequence.hh>
-#include <paludis/util/make_named_values.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/stringify.hh>
-#include <paludis/util/join.hh>
-#include <paludis/serialise-impl.hh>
-
-using namespace paludis;
-using namespace paludis::resolver;
-
-namespace paludis
-{
- template <>
- struct Implementation<UsableJob>
- {
- const std::tr1::shared_ptr<const Resolution> resolution;
- const std::tr1::shared_ptr<ArrowSequence> arrows;
- const std::tr1::shared_ptr<JobIDSequence> used_existing_packages_when_ordering;
- const std::tr1::shared_ptr<RequiredConfirmations> required_confirmations;
-
- Implementation(const std::tr1::shared_ptr<const Resolution> & r) :
- resolution(r),
- arrows(new ArrowSequence),
- used_existing_packages_when_ordering(new JobIDSequence),
- required_confirmations(new RequiredConfirmations)
- {
- }
- };
-
- template <>
- struct Implementation<UsableGroupJob>
- {
- const std::tr1::shared_ptr<const JobIDSequence> ids;
- const std::tr1::shared_ptr<ArrowSequence> arrows;
- const std::tr1::shared_ptr<JobIDSequence> used_existing_packages_when_ordering;
- const std::tr1::shared_ptr<RequiredConfirmations> required_confirmations;
-
- Implementation(const std::tr1::shared_ptr<const JobIDSequence> & i) :
- ids(i),
- arrows(new ArrowSequence),
- used_existing_packages_when_ordering(new JobIDSequence),
- required_confirmations(new RequiredConfirmations)
- {
- }
- };
-
- template <>
- struct Implementation<FetchJob>
- {
- const std::tr1::shared_ptr<const Resolution> resolution;
- const std::tr1::shared_ptr<const ChangesToMakeDecision> decision;
- const std::tr1::shared_ptr<ArrowSequence> arrows;
- const std::tr1::shared_ptr<JobIDSequence> used_existing_packages_when_ordering;
- const std::tr1::shared_ptr<RequiredConfirmations> required_confirmations;
-
- Implementation(const std::tr1::shared_ptr<const Resolution> & r,
- const std::tr1::shared_ptr<const ChangesToMakeDecision> & d) :
- resolution(r),
- decision(d),
- arrows(new ArrowSequence),
- used_existing_packages_when_ordering(new JobIDSequence),
- required_confirmations(new RequiredConfirmations)
- {
- }
- };
-
- template <>
- struct Implementation<SimpleInstallJob>
- {
- const std::tr1::shared_ptr<const Resolution> resolution;
- const std::tr1::shared_ptr<const ChangesToMakeDecision> decision;
- const std::tr1::shared_ptr<ArrowSequence> arrows;
- const std::tr1::shared_ptr<JobIDSequence> used_existing_packages_when_ordering;
- const std::tr1::shared_ptr<RequiredConfirmations> required_confirmations;
-
- Implementation(const std::tr1::shared_ptr<const Resolution> & r,
- const std::tr1::shared_ptr<const ChangesToMakeDecision> & d) :
- resolution(r),
- decision(d),
- arrows(new ArrowSequence),
- used_existing_packages_when_ordering(new JobIDSequence),
- required_confirmations(new RequiredConfirmations)
- {
- }
- };
-
- template <>
- struct Implementation<UninstallJob>
- {
- const std::tr1::shared_ptr<const Resolution> resolution;
- const std::tr1::shared_ptr<const RemoveDecision> decision;
- const std::tr1::shared_ptr<ArrowSequence> arrows;
- const std::tr1::shared_ptr<JobIDSequence> used_existing_packages_when_ordering;
- const std::tr1::shared_ptr<RequiredConfirmations> required_confirmations;
-
- Implementation(const std::tr1::shared_ptr<const Resolution> & r,
- const std::tr1::shared_ptr<const RemoveDecision> & d) :
- resolution(r),
- decision(d),
- arrows(new ArrowSequence),
- used_existing_packages_when_ordering(new JobIDSequence),
- required_confirmations(new RequiredConfirmations)
- {
- }
- };
-
- template <>
- struct Implementation<ErrorJob>
- {
- const std::tr1::shared_ptr<const Resolution> resolution;
- const std::tr1::shared_ptr<const UnableToMakeDecision> decision;
- const std::tr1::shared_ptr<ArrowSequence> arrows;
- const std::tr1::shared_ptr<JobIDSequence> used_existing_packages_when_ordering;
- const std::tr1::shared_ptr<RequiredConfirmations> required_confirmations;
-
- Implementation(const std::tr1::shared_ptr<const Resolution> & r,
- const std::tr1::shared_ptr<const UnableToMakeDecision> & d) :
- resolution(r),
- decision(d),
- arrows(new ArrowSequence),
- used_existing_packages_when_ordering(new JobIDSequence),
- required_confirmations(new RequiredConfirmations)
- {
- }
- };
-}
-
-Job::~Job()
-{
-}
-
-namespace
-{
- void do_arrows(
- const std::tr1::shared_ptr<Job> & result,
- Deserialisator & v)
- {
- Deserialisator vv(*v.find_remove_member("arrows"), "c");
- for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
- result->arrows()->push_back(vv.member<Arrow>(stringify(n)));
- }
-
- void do_existing(
- const std::tr1::shared_ptr<Job> & result,
- Deserialisator & v)
- {
- Deserialisator vv(*v.find_remove_member("used_existing_packages_when_ordering"), "c");
- for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
- result->used_existing_packages_when_ordering()->push_back(vv.member<JobID>(stringify(n)));
- }
-
- void do_required(
- const std::tr1::shared_ptr<Job> & result,
- Deserialisator & v)
- {
- Deserialisator vv(*v.find_remove_member("required_confirmations"), "c");
- for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
- result->required_confirmations()->push_back(vv.member<std::tr1::shared_ptr<RequiredConfirmation> >(stringify(n)));
- }
-}
-
-const std::tr1::shared_ptr<Job>
-Job::deserialise(Deserialisation & d)
-{
- std::tr1::shared_ptr<Job> result;
-
- if (d.class_name() == "UsableJob")
- {
- Deserialisator v(d, "UsableJob");
- result.reset(new UsableJob(
- v.member<std::tr1::shared_ptr<Resolution> >("resolution")
- ));
- do_arrows(result, v);
- do_existing(result, v);
- do_required(result, v);
- }
- else if (d.class_name() == "UsableGroupJob")
- {
- Deserialisator v(d, "UsableGroupJob");
-
- Deserialisator vv(*v.find_remove_member("job_ids"), "c");
- const std::tr1::shared_ptr<JobIDSequence> ids(new JobIDSequence);
- for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
- ids->push_back(vv.member<JobID>(stringify(n)));
-
- result.reset(new UsableGroupJob(ids));
- do_arrows(result, v);
- do_existing(result, v);
- do_required(result, v);
- }
- else if (d.class_name() == "SimpleInstallJob")
- {
- Deserialisator v(d, "SimpleInstallJob");
- result.reset(new SimpleInstallJob(
- v.member<std::tr1::shared_ptr<Resolution> >("resolution"),
- v.member<std::tr1::shared_ptr<ChangesToMakeDecision> >("changes_to_make_decision")
- ));
- do_arrows(result, v);
- do_existing(result, v);
- do_required(result, v);
- }
- else if (d.class_name() == "UninstallJob")
- {
- Deserialisator v(d, "UninstallJob");
- result.reset(new UninstallJob(
- v.member<std::tr1::shared_ptr<Resolution> >("resolution"),
- v.member<std::tr1::shared_ptr<RemoveDecision> >("remove_decision")
- ));
- do_arrows(result, v);
- do_existing(result, v);
- do_required(result, v);
- }
- else if (d.class_name() == "FetchJob")
- {
- Deserialisator v(d, "FetchJob");
- result.reset(new FetchJob(
- v.member<std::tr1::shared_ptr<Resolution> >("resolution"),
- v.member<std::tr1::shared_ptr<ChangesToMakeDecision> >("changes_to_make_decision")
- ));
- do_arrows(result, v);
- do_existing(result, v);
- do_required(result, v);
- }
- else if (d.class_name() == "ErrorJob")
- {
- Deserialisator v(d, "ErrorJob");
- result.reset(new ErrorJob(
- v.member<std::tr1::shared_ptr<Resolution> >("resolution"),
- v.member<std::tr1::shared_ptr<UnableToMakeDecision> >("unable_to_make_decision")
- ));
- do_arrows(result, v);
- do_existing(result, v);
- do_required(result, v);
- }
- else
- throw InternalError(PALUDIS_HERE, "unknown class '" + stringify(d.class_name()) + "'");
-
- return result;
-}
-
-UsableJob::UsableJob(const std::tr1::shared_ptr<const Resolution> & r) :
- PrivateImplementationPattern<UsableJob>(new Implementation<UsableJob>(r))
-{
-}
-
-UsableJob::~UsableJob()
-{
-}
-
-const std::tr1::shared_ptr<const Resolution>
-UsableJob::resolution() const
-{
- return _imp->resolution;
-}
-
-const std::tr1::shared_ptr<const ArrowSequence>
-UsableJob::arrows() const
-{
- return _imp->arrows;
-}
-
-const std::tr1::shared_ptr<ArrowSequence>
-UsableJob::arrows()
-{
- return _imp->arrows;
-}
-
-const std::tr1::shared_ptr<const JobIDSequence>
-UsableJob::used_existing_packages_when_ordering() const
-{
- return _imp->used_existing_packages_when_ordering;
-}
-
-const std::tr1::shared_ptr<JobIDSequence>
-UsableJob::used_existing_packages_when_ordering()
-{
- return _imp->used_existing_packages_when_ordering;
-}
-
-const std::tr1::shared_ptr<const RequiredConfirmations>
-UsableJob::required_confirmations() const
-{
- return _imp->required_confirmations;
-}
-
-const std::tr1::shared_ptr<RequiredConfirmations>
-UsableJob::required_confirmations()
-{
- return _imp->required_confirmations;
-}
-
-const JobID
-UsableJob::id() const
-{
- return make_named_values<JobID>(
- n::string_id() = "usable:" + stringify(resolution()->resolvent())
- );
-}
-
-void
-UsableJob::serialise(Serialiser & s) const
-{
- s.object("UsableJob")
- .member(SerialiserFlags<serialise::might_be_null, serialise::container>(), "arrows", arrows())
- .member(SerialiserFlags<serialise::might_be_null>(), "resolution", resolution())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(),
- "required_confirmations", required_confirmations())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(),
- "used_existing_packages_when_ordering", used_existing_packages_when_ordering())
- ;
-}
-
-UsableGroupJob::UsableGroupJob(const std::tr1::shared_ptr<const JobIDSequence> & r) :
- PrivateImplementationPattern<UsableGroupJob>(new Implementation<UsableGroupJob>(r))
-{
-}
-
-UsableGroupJob::~UsableGroupJob()
-{
-}
-
-const std::tr1::shared_ptr<const JobIDSequence>
-UsableGroupJob::job_ids() const
-{
- return _imp->ids;
-}
-
-const std::tr1::shared_ptr<const ArrowSequence>
-UsableGroupJob::arrows() const
-{
- return _imp->arrows;
-}
-
-const std::tr1::shared_ptr<ArrowSequence>
-UsableGroupJob::arrows()
-{
- return _imp->arrows;
-}
-
-const std::tr1::shared_ptr<const JobIDSequence>
-UsableGroupJob::used_existing_packages_when_ordering() const
-{
- return _imp->used_existing_packages_when_ordering;
-}
-
-const std::tr1::shared_ptr<JobIDSequence>
-UsableGroupJob::used_existing_packages_when_ordering()
-{
- return _imp->used_existing_packages_when_ordering;
-}
-
-const std::tr1::shared_ptr<const RequiredConfirmations>
-UsableGroupJob::required_confirmations() const
-{
- return _imp->required_confirmations;
-}
-
-const std::tr1::shared_ptr<RequiredConfirmations>
-UsableGroupJob::required_confirmations()
-{
- return _imp->required_confirmations;
-}
-
-namespace
-{
- std::string stringify_job_id(const JobID & i)
- {
- return i.string_id();
- }
-}
-
-const JobID
-UsableGroupJob::id() const
-{
- return make_named_values<JobID>(
- n::string_id() = "usable_group:" + join(_imp->ids->begin(), _imp->ids->end(), "+", &stringify_job_id)
- );
-}
-
-void
-UsableGroupJob::serialise(Serialiser & s) const
-{
- s.object("UsableGroupJob")
- .member(SerialiserFlags<serialise::might_be_null, serialise::container>(), "arrows", arrows())
- .member(SerialiserFlags<serialise::might_be_null, serialise::container>(), "job_ids", job_ids())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(),
- "required_confirmations", required_confirmations())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(),
- "used_existing_packages_when_ordering", used_existing_packages_when_ordering())
- ;
-}
-
-FetchJob::FetchJob(const std::tr1::shared_ptr<const Resolution> & r,
- const std::tr1::shared_ptr<const ChangesToMakeDecision> & d) :
- PrivateImplementationPattern<FetchJob>(new Implementation<FetchJob>(r, d))
-{
-}
-
-FetchJob::~FetchJob()
-{
-}
-
-const std::tr1::shared_ptr<const Resolution>
-FetchJob::resolution() const
-{
- return _imp->resolution;
-}
-
-const std::tr1::shared_ptr<const ChangesToMakeDecision>
-FetchJob::changes_to_make_decision() const
-{
- return _imp->decision;
-}
-
-const std::tr1::shared_ptr<const ArrowSequence>
-FetchJob::arrows() const
-{
- return _imp->arrows;
-}
-
-const std::tr1::shared_ptr<ArrowSequence>
-FetchJob::arrows()
-{
- return _imp->arrows;
-}
-
-const std::tr1::shared_ptr<const JobIDSequence>
-FetchJob::used_existing_packages_when_ordering() const
-{
- return _imp->used_existing_packages_when_ordering;
-}
-
-const std::tr1::shared_ptr<JobIDSequence>
-FetchJob::used_existing_packages_when_ordering()
-{
- return _imp->used_existing_packages_when_ordering;
-}
-
-const std::tr1::shared_ptr<const RequiredConfirmations>
-FetchJob::required_confirmations() const
-{
- return _imp->required_confirmations;
-}
-
-const std::tr1::shared_ptr<RequiredConfirmations>
-FetchJob::required_confirmations()
-{
- return _imp->required_confirmations;
-}
-
-const JobID
-FetchJob::id() const
-{
- return make_named_values<JobID>(
- n::string_id() = "fetch:" + stringify(resolution()->resolvent())
- );
-}
-
-void
-FetchJob::serialise(Serialiser & s) const
-{
- s.object("FetchJob")
- .member(SerialiserFlags<serialise::might_be_null, serialise::container>(), "arrows", arrows())
- .member(SerialiserFlags<serialise::might_be_null>(), "changes_to_make_decision", changes_to_make_decision())
- .member(SerialiserFlags<serialise::might_be_null>(), "resolution", resolution())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(),
- "required_confirmations", required_confirmations())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(),
- "used_existing_packages_when_ordering", used_existing_packages_when_ordering())
- ;
-}
-
-SimpleInstallJob::SimpleInstallJob(const std::tr1::shared_ptr<const Resolution> & r,
- const std::tr1::shared_ptr<const ChangesToMakeDecision> & d) :
- PrivateImplementationPattern<SimpleInstallJob>(new Implementation<SimpleInstallJob>(r, d))
-{
-}
-
-SimpleInstallJob::~SimpleInstallJob()
-{
-}
-
-const std::tr1::shared_ptr<const Resolution>
-SimpleInstallJob::resolution() const
-{
- return _imp->resolution;
-}
-
-const std::tr1::shared_ptr<const ChangesToMakeDecision>
-SimpleInstallJob::changes_to_make_decision() const
-{
- return _imp->decision;
-}
-
-const std::tr1::shared_ptr<const ArrowSequence>
-SimpleInstallJob::arrows() const
-{
- return _imp->arrows;
-}
-
-const std::tr1::shared_ptr<ArrowSequence>
-SimpleInstallJob::arrows()
-{
- return _imp->arrows;
-}
-
-const std::tr1::shared_ptr<const JobIDSequence>
-SimpleInstallJob::used_existing_packages_when_ordering() const
-{
- return _imp->used_existing_packages_when_ordering;
-}
-
-const std::tr1::shared_ptr<JobIDSequence>
-SimpleInstallJob::used_existing_packages_when_ordering()
-{
- return _imp->used_existing_packages_when_ordering;
-}
-
-const std::tr1::shared_ptr<const RequiredConfirmations>
-SimpleInstallJob::required_confirmations() const
-{
- return _imp->required_confirmations;
-}
-
-const std::tr1::shared_ptr<RequiredConfirmations>
-SimpleInstallJob::required_confirmations()
-{
- return _imp->required_confirmations;
-}
-
-const JobID
-SimpleInstallJob::id() const
-{
- return make_named_values<JobID>(
- n::string_id() = "install:" + stringify(resolution()->resolvent())
- );
-}
-
-void
-SimpleInstallJob::serialise(Serialiser & s) const
-{
- s.object("SimpleInstallJob")
- .member(SerialiserFlags<serialise::might_be_null, serialise::container>(), "arrows", arrows())
- .member(SerialiserFlags<serialise::might_be_null>(), "changes_to_make_decision", changes_to_make_decision())
- .member(SerialiserFlags<serialise::might_be_null>(), "resolution", resolution())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(),
- "required_confirmations", required_confirmations())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(),
- "used_existing_packages_when_ordering", used_existing_packages_when_ordering())
- ;
-}
-
-UninstallJob::UninstallJob(const std::tr1::shared_ptr<const Resolution> & r,
- const std::tr1::shared_ptr<const RemoveDecision> & d) :
- PrivateImplementationPattern<UninstallJob>(new Implementation<UninstallJob>(r, d))
-{
-}
-
-UninstallJob::~UninstallJob()
-{
-}
-
-const std::tr1::shared_ptr<const Resolution>
-UninstallJob::resolution() const
-{
- return _imp->resolution;
-}
-
-const std::tr1::shared_ptr<const RemoveDecision>
-UninstallJob::remove_decision() const
-{
- return _imp->decision;
-}
-
-const std::tr1::shared_ptr<const ArrowSequence>
-UninstallJob::arrows() const
-{
- return _imp->arrows;
-}
-
-const std::tr1::shared_ptr<ArrowSequence>
-UninstallJob::arrows()
-{
- return _imp->arrows;
-}
-
-const std::tr1::shared_ptr<const JobIDSequence>
-UninstallJob::used_existing_packages_when_ordering() const
-{
- return _imp->used_existing_packages_when_ordering;
-}
-
-const std::tr1::shared_ptr<JobIDSequence>
-UninstallJob::used_existing_packages_when_ordering()
-{
- return _imp->used_existing_packages_when_ordering;
-}
-
-const std::tr1::shared_ptr<const RequiredConfirmations>
-UninstallJob::required_confirmations() const
-{
- return _imp->required_confirmations;
-}
-
-const std::tr1::shared_ptr<RequiredConfirmations>
-UninstallJob::required_confirmations()
-{
- return _imp->required_confirmations;
-}
-
-const JobID
-UninstallJob::id() const
-{
- return make_named_values<JobID>(
- n::string_id() = "install:" + stringify(resolution()->resolvent())
- );
-}
-
-void
-UninstallJob::serialise(Serialiser & s) const
-{
- s.object("UninstallJob")
- .member(SerialiserFlags<serialise::might_be_null, serialise::container>(), "arrows", arrows())
- .member(SerialiserFlags<serialise::might_be_null>(), "remove_decision", remove_decision())
- .member(SerialiserFlags<serialise::might_be_null>(), "resolution", resolution())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(),
- "required_confirmations", required_confirmations())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(),
- "used_existing_packages_when_ordering", used_existing_packages_when_ordering())
- ;
-}
-
-ErrorJob::ErrorJob(const std::tr1::shared_ptr<const Resolution> & r, const std::tr1::shared_ptr<const UnableToMakeDecision> & d) :
- PrivateImplementationPattern<ErrorJob>(new Implementation<ErrorJob>(r, d))
-{
-}
-
-ErrorJob::~ErrorJob()
-{
-}
-
-const std::tr1::shared_ptr<const Resolution>
-ErrorJob::resolution() const
-{
- return _imp->resolution;
-}
-
-const std::tr1::shared_ptr<const ArrowSequence>
-ErrorJob::arrows() const
-{
- return _imp->arrows;
-}
-
-const std::tr1::shared_ptr<ArrowSequence>
-ErrorJob::arrows()
-{
- return _imp->arrows;
-}
-
-const std::tr1::shared_ptr<const JobIDSequence>
-ErrorJob::used_existing_packages_when_ordering() const
-{
- return _imp->used_existing_packages_when_ordering;
-}
-
-const std::tr1::shared_ptr<JobIDSequence>
-ErrorJob::used_existing_packages_when_ordering()
-{
- return _imp->used_existing_packages_when_ordering;
-}
-
-const std::tr1::shared_ptr<const RequiredConfirmations>
-ErrorJob::required_confirmations() const
-{
- return _imp->required_confirmations;
-}
-
-const std::tr1::shared_ptr<RequiredConfirmations>
-ErrorJob::required_confirmations()
-{
- return _imp->required_confirmations;
-}
-
-const JobID
-ErrorJob::id() const
-{
- return make_named_values<JobID>(
- n::string_id() = "error:" + stringify(resolution()->resolvent())
- );
-}
-
-void
-ErrorJob::serialise(Serialiser & s) const
-{
- s.object("ErrorJob")
- .member(SerialiserFlags<serialise::might_be_null, serialise::container>(), "arrows", arrows())
- .member(SerialiserFlags<serialise::might_be_null>(), "unable_to_make_decision", unable_to_make_decision())
- .member(SerialiserFlags<serialise::might_be_null>(), "resolution", resolution())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(),
- "required_confirmations", required_confirmations())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(),
- "used_existing_packages_when_ordering", used_existing_packages_when_ordering())
- ;
-}
-
-const std::tr1::shared_ptr<const UnableToMakeDecision>
-ErrorJob::unable_to_make_decision() const
-{
- return _imp->decision;
-}
-
-template class PrivateImplementationPattern<resolver::UsableJob>;
-template class PrivateImplementationPattern<resolver::UsableGroupJob>;
-template class PrivateImplementationPattern<resolver::FetchJob>;
-template class PrivateImplementationPattern<resolver::SimpleInstallJob>;
-template class PrivateImplementationPattern<resolver::ErrorJob>;
-template class PrivateImplementationPattern<resolver::UninstallJob>;
-
diff --git a/paludis/resolver/job.hh b/paludis/resolver/job.hh
deleted file mode 100644
index bb3d2f0..0000000
--- a/paludis/resolver/job.hh
+++ /dev/null
@@ -1,301 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009, 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_HH 1
-
-#include <paludis/resolver/job-fwd.hh>
-#include <paludis/resolver/job_id-fwd.hh>
-#include <paludis/resolver/arrow-fwd.hh>
-#include <paludis/resolver/resolution-fwd.hh>
-#include <paludis/resolver/decision-fwd.hh>
-#include <paludis/resolver/required_confirmations-fwd.hh>
-#include <paludis/util/attributes.hh>
-#include <paludis/util/simple_visitor.hh>
-#include <paludis/util/type_list.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/serialise-fwd.hh>
-#include <tr1/memory>
-
-namespace paludis
-{
- namespace resolver
- {
- class PALUDIS_VISIBLE Job :
- public virtual DeclareAbstractAcceptMethods<Job, MakeTypeList<
- UsableJob, UsableGroupJob, SimpleInstallJob, UninstallJob, FetchJob, ErrorJob>::Type>
- {
- public:
- virtual ~Job() = 0;
-
- virtual const JobID id()
- const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- virtual const std::tr1::shared_ptr<const ArrowSequence> arrows()
- const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- virtual const std::tr1::shared_ptr<ArrowSequence> arrows()
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- virtual const std::tr1::shared_ptr<const JobIDSequence> used_existing_packages_when_ordering()
- const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- virtual const std::tr1::shared_ptr<JobIDSequence> used_existing_packages_when_ordering()
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- virtual const std::tr1::shared_ptr<const RequiredConfirmations> required_confirmations()
- const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- virtual const std::tr1::shared_ptr<RequiredConfirmations> required_confirmations()
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- virtual void serialise(Serialiser &) const = 0;
-
- static const std::tr1::shared_ptr<Job> deserialise(
- Deserialisation & d) PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE UsableJob :
- public Job,
- public ImplementAcceptMethods<Job, UsableJob>,
- private PrivateImplementationPattern<UsableJob>
- {
- public:
- UsableJob(const std::tr1::shared_ptr<const Resolution> &);
- ~UsableJob();
-
- virtual const JobID id() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const ArrowSequence> arrows()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<ArrowSequence> arrows()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const JobIDSequence> used_existing_packages_when_ordering()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<JobIDSequence> used_existing_packages_when_ordering()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const RequiredConfirmations> required_confirmations()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<RequiredConfirmations> required_confirmations()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- const std::tr1::shared_ptr<const Resolution> resolution() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual void serialise(Serialiser &) const;
- };
-
- class PALUDIS_VISIBLE UsableGroupJob :
- public Job,
- public ImplementAcceptMethods<Job, UsableGroupJob>,
- private PrivateImplementationPattern<UsableGroupJob>
- {
- public:
- UsableGroupJob(const std::tr1::shared_ptr<const JobIDSequence> &);
- ~UsableGroupJob();
-
- virtual const JobID id() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const ArrowSequence> arrows()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<ArrowSequence> arrows()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const JobIDSequence> used_existing_packages_when_ordering()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<JobIDSequence> used_existing_packages_when_ordering()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const RequiredConfirmations> required_confirmations()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<RequiredConfirmations> required_confirmations()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- const std::tr1::shared_ptr<const JobIDSequence> job_ids() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual void serialise(Serialiser &) const;
- };
-
- class PALUDIS_VISIBLE FetchJob :
- public Job,
- public ImplementAcceptMethods<Job, FetchJob>,
- private PrivateImplementationPattern<FetchJob>
- {
- public:
- FetchJob(
- const std::tr1::shared_ptr<const Resolution> &,
- const std::tr1::shared_ptr<const ChangesToMakeDecision> &);
- ~FetchJob();
-
- virtual const JobID id() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const ArrowSequence> arrows()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<ArrowSequence> arrows()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const JobIDSequence> used_existing_packages_when_ordering()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<JobIDSequence> used_existing_packages_when_ordering()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const RequiredConfirmations> required_confirmations()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<RequiredConfirmations> required_confirmations()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- const std::tr1::shared_ptr<const Resolution> resolution() const PALUDIS_ATTRIBUTE((warn_unused_result));
- const std::tr1::shared_ptr<const ChangesToMakeDecision> changes_to_make_decision() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual void serialise(Serialiser &) const;
- };
-
- class PALUDIS_VISIBLE SimpleInstallJob :
- public Job,
- public ImplementAcceptMethods<Job, SimpleInstallJob>,
- private PrivateImplementationPattern<SimpleInstallJob>
- {
- public:
- SimpleInstallJob(
- const std::tr1::shared_ptr<const Resolution> &,
- const std::tr1::shared_ptr<const ChangesToMakeDecision> &);
- ~SimpleInstallJob();
-
- virtual const JobID id() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const ArrowSequence> arrows()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<ArrowSequence> arrows()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const JobIDSequence> used_existing_packages_when_ordering()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<JobIDSequence> used_existing_packages_when_ordering()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const RequiredConfirmations> required_confirmations()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<RequiredConfirmations> required_confirmations()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- const std::tr1::shared_ptr<const Resolution> resolution() const PALUDIS_ATTRIBUTE((warn_unused_result));
- const std::tr1::shared_ptr<const ChangesToMakeDecision> changes_to_make_decision() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual void serialise(Serialiser &) const;
- };
-
- class PALUDIS_VISIBLE UninstallJob :
- public Job,
- public ImplementAcceptMethods<Job, UninstallJob>,
- private PrivateImplementationPattern<UninstallJob>
- {
- public:
- UninstallJob(
- const std::tr1::shared_ptr<const Resolution> &,
- const std::tr1::shared_ptr<const RemoveDecision> &);
- ~UninstallJob();
-
- virtual const JobID id() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const ArrowSequence> arrows()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<ArrowSequence> arrows()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const JobIDSequence> used_existing_packages_when_ordering()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<JobIDSequence> used_existing_packages_when_ordering()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const RequiredConfirmations> required_confirmations()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<RequiredConfirmations> required_confirmations()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- const std::tr1::shared_ptr<const Resolution> resolution() const PALUDIS_ATTRIBUTE((warn_unused_result));
- const std::tr1::shared_ptr<const RemoveDecision> remove_decision() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual void serialise(Serialiser &) const;
- };
-
- class PALUDIS_VISIBLE ErrorJob :
- public Job,
- public ImplementAcceptMethods<Job, ErrorJob>,
- private PrivateImplementationPattern<ErrorJob>
- {
- public:
- ErrorJob(
- const std::tr1::shared_ptr<const Resolution> &,
- const std::tr1::shared_ptr<const UnableToMakeDecision> &);
- ~ErrorJob();
-
- virtual const JobID id() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const ArrowSequence> arrows()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<ArrowSequence> arrows()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const JobIDSequence> used_existing_packages_when_ordering()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<JobIDSequence> used_existing_packages_when_ordering()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<const RequiredConfirmations> required_confirmations()
- const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const std::tr1::shared_ptr<RequiredConfirmations> required_confirmations()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- const std::tr1::shared_ptr<const Resolution> resolution() const PALUDIS_ATTRIBUTE((warn_unused_result));
- const std::tr1::shared_ptr<const UnableToMakeDecision> unable_to_make_decision() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual void serialise(Serialiser &) const;
- };
- }
-
-#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
- extern template class PrivateImplementationPattern<resolver::UsableJob>;
- extern template class PrivateImplementationPattern<resolver::UsableGroupJob>;
- extern template class PrivateImplementationPattern<resolver::FetchJob>;
- extern template class PrivateImplementationPattern<resolver::SimpleInstallJob>;
- extern template class PrivateImplementationPattern<resolver::UninstallJob>;
- extern template class PrivateImplementationPattern<resolver::ErrorJob>;
-#endif
-}
-
-#endif
diff --git a/paludis/resolver/job_id-fwd.hh b/paludis/resolver/job_id-fwd.hh
deleted file mode 100644
index a027329..0000000
--- a/paludis/resolver/job_id-fwd.hh
+++ /dev/null
@@ -1,38 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_ID_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_ID_FWD_HH 1
-
-#include <paludis/util/sequence-fwd.hh>
-#include <paludis/util/attributes.hh>
-
-namespace paludis
-{
- namespace resolver
- {
- struct JobID;
-
- bool operator== (const JobID &, const JobID &) PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((warn_unused_result));
-
- typedef Sequence<JobID> JobIDSequence;
- }
-}
-
-#endif
diff --git a/paludis/resolver/job_id.cc b/paludis/resolver/job_id.cc
deleted file mode 100644
index 718854c..0000000
--- a/paludis/resolver/job_id.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009, 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <paludis/resolver/job_id.hh>
-#include <paludis/util/hashes.hh>
-#include <paludis/util/make_named_values.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/sequence-impl.hh>
-#include <paludis/serialise-impl.hh>
-
-using namespace paludis;
-using namespace paludis::resolver;
-
-bool
-paludis::resolver::operator== (const JobID & a, const JobID & b)
-{
- return a.string_id() == b.string_id();
-}
-
-std::size_t
-JobID::hash() const
-{
- return Hash<std::string>()(string_id());
-}
-
-bool
-JobID::operator< (const JobID & other) const
-{
- return string_id() < other.string_id();
-}
-
-void
-JobID::serialise(Serialiser & s) const
-{
- s.object("JobID")
- .member(SerialiserFlags<>(), "string_id", string_id())
- ;
-}
-
-const JobID
-JobID::deserialise(Deserialisation & d)
-{
- Deserialisator v(d, "JobID");
- return make_named_values<JobID>(
- n::string_id() = v.member<std::string>("string_id")
- );
-}
-
-template class Sequence<JobID>;
-template class WrappedForwardIterator<JobIDSequence::ConstIteratorTag, const JobID>;
-
diff --git a/paludis/resolver/job_id.hh b/paludis/resolver/job_id.hh
deleted file mode 100644
index 919d479..0000000
--- a/paludis/resolver/job_id.hh
+++ /dev/null
@@ -1,50 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009, 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_ID_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_ID_HH 1
-
-#include <paludis/resolver/job_id-fwd.hh>
-#include <paludis/util/named_value.hh>
-#include <paludis/serialise-fwd.hh>
-#include <string>
-
-namespace paludis
-{
- namespace n
- {
- typedef Name<struct string_id_name> string_id;
- }
-
- namespace resolver
- {
- struct JobID
- {
- NamedValue<n::string_id, std::string> string_id;
-
- std::size_t hash() const PALUDIS_ATTRIBUTE((warn_unused_result));
- bool operator< (const JobID &) const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- void serialise(Serialiser &) const;
- static const JobID deserialise(Deserialisation & d) PALUDIS_ATTRIBUTE((warn_unused_result));
- };
- }
-}
-
-#endif
diff --git a/paludis/resolver/job_state-fwd.hh b/paludis/resolver/job_state-fwd.hh
deleted file mode 100644
index fab624e..0000000
--- a/paludis/resolver/job_state-fwd.hh
+++ /dev/null
@@ -1,35 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_STATE_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_STATE_FWD_HH 1
-
-namespace paludis
-{
- namespace resolver
- {
- struct JobState;
- struct JobPendingState;
- struct JobSucceededState;
- struct JobFailedState;
- struct JobSkippedState;
- }
-}
-
-#endif
diff --git a/paludis/resolver/job_state.cc b/paludis/resolver/job_state.cc
deleted file mode 100644
index c3e63f1..0000000
--- a/paludis/resolver/job_state.cc
+++ /dev/null
@@ -1,202 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <paludis/resolver/job_state.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/output_manager.hh>
-#include <list>
-#include <algorithm>
-#include <tr1/functional>
-
-using namespace paludis;
-using namespace paludis::resolver;
-
-JobState::~JobState()
-{
-}
-
-namespace paludis
-{
- template <>
- struct Implementation<JobPendingState>
- {
- const std::tr1::shared_ptr<const Job> job;
-
- Implementation(const std::tr1::shared_ptr<const Job> & j) :
- job(j)
- {
- }
- };
-
- template <>
- struct Implementation<JobSucceededState>
- {
- const std::tr1::shared_ptr<const Job> job;
- std::list<std::tr1::shared_ptr<OutputManager> > output_managers;
-
- Implementation(const std::tr1::shared_ptr<const Job> & j) :
- job(j)
- {
- }
- };
-
- template <>
- struct Implementation<JobFailedState>
- {
- const std::tr1::shared_ptr<const Job> job;
- std::list<std::tr1::shared_ptr<OutputManager> > output_managers;
-
- Implementation(const std::tr1::shared_ptr<const Job> & j) :
- job(j)
- {
- }
- };
-
- template <>
- struct Implementation<JobSkippedState>
- {
- const std::tr1::shared_ptr<const Job> job;
-
- Implementation(const std::tr1::shared_ptr<const Job> & j) :
- job(j)
- {
- }
- };
-}
-
-JobPendingState::JobPendingState(const std::tr1::shared_ptr<const Job> & j) :
- PrivateImplementationPattern<JobPendingState>(new Implementation<JobPendingState>(j))
-{
-}
-
-JobPendingState::~JobPendingState()
-{
-}
-
-const std::tr1::shared_ptr<const Job>
-JobPendingState::job() const
-{
- return _imp->job;
-}
-
-const std::string
-JobPendingState::state_name() const
-{
- return "pending";
-}
-
-JobSucceededState::JobSucceededState(const std::tr1::shared_ptr<const Job> & j) :
- PrivateImplementationPattern<JobSucceededState>(new Implementation<JobSucceededState>(j))
-{
-}
-
-JobSucceededState::~JobSucceededState()
-{
-}
-
-const std::tr1::shared_ptr<const Job>
-JobSucceededState::job() const
-{
- return _imp->job;
-}
-
-const std::string
-JobSucceededState::state_name() const
-{
- return "succeeded";
-}
-
-void
-JobSucceededState::add_output_manager(const std::tr1::shared_ptr<OutputManager> & o)
-{
- _imp->output_managers.push_back(o);
-}
-
-bool
-JobSucceededState::any_output_manager_wants_to_flush() const
-{
- return indirect_iterator(_imp->output_managers.end()) != std::find_if(
- indirect_iterator(_imp->output_managers.begin()),
- indirect_iterator(_imp->output_managers.end()),
- std::tr1::bind(&OutputManager::want_to_flush, std::tr1::placeholders::_1));
-}
-
-JobFailedState::JobFailedState(const std::tr1::shared_ptr<const Job> & j) :
- PrivateImplementationPattern<JobFailedState>(new Implementation<JobFailedState>(j))
-{
-}
-
-JobFailedState::~JobFailedState()
-{
-}
-
-const std::tr1::shared_ptr<const Job>
-JobFailedState::job() const
-{
- return _imp->job;
-}
-
-void
-JobFailedState::add_output_manager(const std::tr1::shared_ptr<OutputManager> & o)
-{
- _imp->output_managers.push_back(o);
-}
-
-bool
-JobFailedState::any_output_manager_wants_to_flush() const
-{
- return indirect_iterator(_imp->output_managers.end()) != std::find_if(
- indirect_iterator(_imp->output_managers.begin()),
- indirect_iterator(_imp->output_managers.end()),
- std::tr1::bind(&OutputManager::want_to_flush, std::tr1::placeholders::_1));
-}
-
-const std::string
-JobFailedState::state_name() const
-{
- return "failed";
-}
-
-JobSkippedState::JobSkippedState(const std::tr1::shared_ptr<const Job> & j) :
- PrivateImplementationPattern<JobSkippedState>(new Implementation<JobSkippedState>(j))
-{
-}
-
-JobSkippedState::~JobSkippedState()
-{
-}
-
-const std::tr1::shared_ptr<const Job>
-JobSkippedState::job() const
-{
- return _imp->job;
-}
-
-const std::string
-JobSkippedState::state_name() const
-{
- return "skipped";
-}
-
-template class PrivateImplementationPattern<JobPendingState>;
-template class PrivateImplementationPattern<JobSucceededState>;
-template class PrivateImplementationPattern<JobFailedState>;
-template class PrivateImplementationPattern<JobSkippedState>;
-
diff --git a/paludis/resolver/job_state.hh b/paludis/resolver/job_state.hh
deleted file mode 100644
index c3c946d..0000000
--- a/paludis/resolver/job_state.hh
+++ /dev/null
@@ -1,116 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_STATE_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_STATE_HH 1
-
-#include <paludis/resolver/job_state-fwd.hh>
-#include <paludis/resolver/job-fwd.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/simple_visitor.hh>
-#include <paludis/util/type_list.hh>
-#include <paludis/output_manager-fwd.hh>
-#include <tr1/memory>
-#include <string>
-
-namespace paludis
-{
- namespace resolver
- {
- class PALUDIS_VISIBLE JobState :
- public virtual DeclareAbstractAcceptMethods<JobState, MakeTypeList<
- JobPendingState, JobSucceededState, JobFailedState, JobSkippedState>::Type>
- {
- public:
- virtual ~JobState() = 0;
-
- virtual const std::tr1::shared_ptr<const Job> job() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- virtual const std::string state_name() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- };
-
- class PALUDIS_VISIBLE JobPendingState :
- public JobState,
- public ImplementAcceptMethods<JobState, JobPendingState>,
- private PrivateImplementationPattern<JobPendingState>
- {
- public:
- JobPendingState(const std::tr1::shared_ptr<const Job> &);
- ~JobPendingState();
-
- virtual const std::tr1::shared_ptr<const Job> job() const PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const std::string state_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE JobSucceededState :
- public JobState,
- public ImplementAcceptMethods<JobState, JobSucceededState>,
- private PrivateImplementationPattern<JobSucceededState>
- {
- public:
- JobSucceededState(const std::tr1::shared_ptr<const Job> &);
- ~JobSucceededState();
-
- virtual const std::tr1::shared_ptr<const Job> job() const PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const std::string state_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- void add_output_manager(const std::tr1::shared_ptr<OutputManager> &);
- bool any_output_manager_wants_to_flush() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE JobFailedState :
- public JobState,
- public ImplementAcceptMethods<JobState, JobFailedState>,
- private PrivateImplementationPattern<JobFailedState>
- {
- public:
- JobFailedState(const std::tr1::shared_ptr<const Job> &);
- ~JobFailedState();
-
- virtual const std::tr1::shared_ptr<const Job> job() const PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const std::string state_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- void add_output_manager(const std::tr1::shared_ptr<OutputManager> &);
- bool any_output_manager_wants_to_flush() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-
- class PALUDIS_VISIBLE JobSkippedState :
- public JobState,
- public ImplementAcceptMethods<JobState, JobSkippedState>,
- private PrivateImplementationPattern<JobSkippedState>
- {
- public:
- JobSkippedState(const std::tr1::shared_ptr<const Job> &);
- ~JobSkippedState();
-
- virtual const std::tr1::shared_ptr<const Job> job() const PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const std::string state_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
- };
- }
-
-#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
- extern template class PrivateImplementationPattern<resolver::JobPendingState>;
- extern template class PrivateImplementationPattern<resolver::JobSucceededState>;
- extern template class PrivateImplementationPattern<resolver::JobFailedState>;
- extern template class PrivateImplementationPattern<resolver::JobSkippedState>;
-#endif
-}
-
-#endif
diff --git a/paludis/resolver/jobs-fwd.hh b/paludis/resolver/jobs-fwd.hh
deleted file mode 100644
index bde750c..0000000
--- a/paludis/resolver/jobs-fwd.hh
+++ /dev/null
@@ -1,31 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_JOBS_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_JOBS_FWD_HH 1
-
-namespace paludis
-{
- namespace resolver
- {
- struct Jobs;
- }
-}
-
-#endif
diff --git a/paludis/resolver/jobs.cc b/paludis/resolver/jobs.cc
deleted file mode 100644
index 3ada174..0000000
--- a/paludis/resolver/jobs.cc
+++ /dev/null
@@ -1,299 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009, 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <paludis/resolver/jobs.hh>
-#include <paludis/resolver/job.hh>
-#include <paludis/resolver/job_id.hh>
-#include <paludis/resolver/resolution.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/hashes.hh>
-#include <paludis/util/stringify.hh>
-#include <paludis/util/exception.hh>
-#include <paludis/util/simple_visitor_cast.hh>
-#include <paludis/serialise-impl.hh>
-#include <tr1/unordered_map>
-#include <list>
-#include <map>
-
-using namespace paludis;
-using namespace paludis::resolver;
-
-typedef std::list<std::tr1::shared_ptr<Job> > JobsList;
-typedef std::multimap<Resolvent, JobsList::const_iterator> JobsListByResolventIndex;
-typedef std::tr1::unordered_map<JobID, JobsList::const_iterator, Hash<JobID> > JobsListByJobIDIndex;
-
-namespace paludis
-{
- template <>
- struct Implementation<Jobs>
- {
- JobsList jobs;
- JobsListByResolventIndex jobs_list_by_resolvent_index;
- JobsListByJobIDIndex jobs_list_by_job_id_index;
- };
-}
-
-Jobs::Jobs() :
- PrivateImplementationPattern<Jobs>(new Implementation<Jobs>)
-{
-}
-
-Jobs::~Jobs()
-{
-}
-
-namespace
-{
- struct Indexer
- {
- JobsListByResolventIndex & jobs_list_by_resolvent_index;
- JobsList::const_iterator i;
-
- Indexer(JobsListByResolventIndex & j, const JobsList::const_iterator & c) :
- jobs_list_by_resolvent_index(j),
- i(c)
- {
- }
-
- void visit(const UsableJob & j)
- {
- jobs_list_by_resolvent_index.insert(std::make_pair(j.resolution()->resolvent(), i));
- }
-
- void visit(const UninstallJob & j)
- {
- jobs_list_by_resolvent_index.insert(std::make_pair(j.resolution()->resolvent(), i));
- }
-
- void visit(const UsableGroupJob &)
- {
- }
-
- void visit(const SimpleInstallJob & j)
- {
- jobs_list_by_resolvent_index.insert(std::make_pair(j.resolution()->resolvent(), i));
- }
-
- void visit(const ErrorJob & j)
- {
- jobs_list_by_resolvent_index.insert(std::make_pair(j.resolution()->resolvent(), i));
- }
-
- void visit(const FetchJob & j)
- {
- jobs_list_by_resolvent_index.insert(std::make_pair(j.resolution()->resolvent(), i));
- }
- };
-}
-
-void
-Jobs::add(const std::tr1::shared_ptr<Job> & j)
-{
- JobsList::const_iterator i(_imp->jobs.insert(_imp->jobs.end(), j));
- Indexer x(_imp->jobs_list_by_resolvent_index, i);
- j->accept(x);
- _imp->jobs_list_by_job_id_index.insert(std::make_pair(j->id(), i));
-}
-
-namespace
-{
- struct InstalledJobChecker
- {
- bool visit(const FetchJob &) const
- {
- return false;
- }
-
- bool visit(const ErrorJob &) const
- {
- return true;
- }
-
- bool visit(const UninstallJob &) const
- {
- return true;
- }
-
- bool visit(const UsableJob &) const
- {
- return false;
- }
-
- bool visit(const UsableGroupJob &) const
- {
- return false;
- }
-
- bool visit(const SimpleInstallJob &) const
- {
- return true;
- }
- };
-
- struct UsableJobChecker
- {
- bool visit(const FetchJob &) const
- {
- return false;
- }
-
- bool visit(const UninstallJob &) const
- {
- return true;
- }
-
- bool visit(const ErrorJob &) const
- {
- return true;
- }
-
- bool visit(const UsableGroupJob &) const
- {
- return false;
- }
-
- bool visit(const UsableJob &) const
- {
- return true;
- }
-
- bool visit(const SimpleInstallJob &) const
- {
- return false;
- }
- };
-}
-
-const JobID
-Jobs::find_id_for_installed(const Resolvent & r) const
-{
- std::pair<JobsListByResolventIndex::const_iterator, JobsListByResolventIndex::const_iterator> candidates(
- _imp->jobs_list_by_resolvent_index.equal_range(r));
-
- for ( ; candidates.first != candidates.second ; ++candidates.first)
- {
- if ((*candidates.first->second)->accept_returning<bool>(InstalledJobChecker()))
- return (*candidates.first->second)->id();
- }
-
- return find_id_for_usable(r);
-}
-
-const JobID
-Jobs::find_id_for_usable(const Resolvent & r) const
-{
- std::pair<JobsListByResolventIndex::const_iterator, JobsListByResolventIndex::const_iterator> candidates(
- _imp->jobs_list_by_resolvent_index.equal_range(r));
-
- for ( ; candidates.first != candidates.second ; ++candidates.first)
- {
- if ((*candidates.first->second)->accept_returning<bool>(UsableJobChecker()))
- return (*candidates.first->second)->id();
- }
-
- throw InternalError(PALUDIS_HERE, "no build job for " + stringify(r));
-}
-
-bool
-Jobs::have_job_for_installed(const Resolvent & r) const
-{
- std::pair<JobsListByResolventIndex::const_iterator, JobsListByResolventIndex::const_iterator> candidates(
- _imp->jobs_list_by_resolvent_index.equal_range(r));
-
- for ( ; candidates.first != candidates.second ; ++candidates.first)
- {
- if ((*candidates.first->second)->accept_returning<bool>(InstalledJobChecker()))
- return true;
- }
-
- return have_job_for_usable(r);
-}
-
-bool
-Jobs::have_job_for_usable(const Resolvent & r) const
-{
- std::pair<JobsListByResolventIndex::const_iterator, JobsListByResolventIndex::const_iterator> candidates(
- _imp->jobs_list_by_resolvent_index.equal_range(r));
-
- for ( ; candidates.first != candidates.second ; ++candidates.first)
- {
- if ((*candidates.first->second)->accept_returning<bool>(UsableJobChecker()))
- return true;
- }
-
- return false;
-}
-
-const std::tr1::shared_ptr<Job>
-Jobs::fetch(const JobID & id)
-{
- JobsListByJobIDIndex::const_iterator i(_imp->jobs_list_by_job_id_index.find(id));
- if (i == _imp->jobs_list_by_job_id_index.end())
- throw InternalError(PALUDIS_HERE, "no job for id");
- return *i->second;
-}
-
-const std::tr1::shared_ptr<const Job>
-Jobs::fetch(const JobID & id) const
-{
- JobsListByJobIDIndex::const_iterator i(_imp->jobs_list_by_job_id_index.find(id));
- if (i == _imp->jobs_list_by_job_id_index.end())
- throw InternalError(PALUDIS_HERE, "no job for id");
- return *i->second;
-}
-
-template <typename J_>
-const std::tr1::shared_ptr<const J_>
-Jobs::fetch_as(const JobID & id) const
-{
- JobsListByJobIDIndex::const_iterator i(_imp->jobs_list_by_job_id_index.find(id));
- if (i == _imp->jobs_list_by_job_id_index.end())
- throw InternalError(PALUDIS_HERE, "no job for id");
- if (simple_visitor_cast<const J_>(**i->second))
- return std::tr1::static_pointer_cast<const J_>(*i->second);
- else
- throw InternalError(PALUDIS_HERE, "wrong job type id");
-}
-
-void
-Jobs::serialise(Serialiser & s) const
-{
- s.object("Jobs")
- .member(SerialiserFlags<serialise::container>(), "items", _imp->jobs)
- ;
-}
-
-const std::tr1::shared_ptr<Jobs>
-Jobs::deserialise(Deserialisation & d)
-{
- Deserialisator v(d, "Jobs");
- Deserialisator vv(*v.find_remove_member("items"), "c");
- std::tr1::shared_ptr<Jobs> result(new Jobs);
- for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
- result->add(vv.member<std::tr1::shared_ptr<Job> >(stringify(n)));
- return result;
-}
-
-template class PrivateImplementationPattern<resolver::Jobs>;
-
-template const std::tr1::shared_ptr<const SimpleInstallJob> Jobs::fetch_as<SimpleInstallJob>(const JobID &) const;
-template const std::tr1::shared_ptr<const ErrorJob> Jobs::fetch_as<ErrorJob>(const JobID &) const;
-template const std::tr1::shared_ptr<const FetchJob> Jobs::fetch_as<FetchJob>(const JobID &) const;
-template const std::tr1::shared_ptr<const UsableJob> Jobs::fetch_as<UsableJob>(const JobID &) const;
-
diff --git a/paludis/resolver/jobs.hh b/paludis/resolver/jobs.hh
deleted file mode 100644
index bdd9dfa..0000000
--- a/paludis/resolver/jobs.hh
+++ /dev/null
@@ -1,75 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009, 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_JOBS_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_JOBS_HH 1
-
-#include <paludis/resolver/jobs-fwd.hh>
-#include <paludis/resolver/job-fwd.hh>
-#include <paludis/resolver/job_id-fwd.hh>
-#include <paludis/resolver/resolvent-fwd.hh>
-#include <paludis/util/attributes.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/serialise-fwd.hh>
-#include <tr1/memory>
-
-namespace paludis
-{
- namespace resolver
- {
- class PALUDIS_VISIBLE Jobs :
- private PrivateImplementationPattern<Jobs>
- {
- public:
- Jobs();
- ~Jobs();
-
- void add(const std::tr1::shared_ptr<Job> &);
-
- bool have_job_for_installed(const Resolvent &) const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- const JobID find_id_for_installed(const Resolvent &) const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- bool have_job_for_usable(const Resolvent &) const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- const JobID find_id_for_usable(const Resolvent &) const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- const std::tr1::shared_ptr<Job> fetch(
- const JobID &) PALUDIS_ATTRIBUTE((warn_unused_result));
-
- const std::tr1::shared_ptr<const Job> fetch(
- const JobID &) const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- template <typename J_>
- const std::tr1::shared_ptr<const J_> fetch_as(
- const JobID &) const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- void serialise(Serialiser &) const;
-
- static const std::tr1::shared_ptr<Jobs> deserialise(
- Deserialisation & d) PALUDIS_ATTRIBUTE((warn_unused_result));
- };
- }
-
-#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
- extern template class PrivateImplementationPattern<resolver::Jobs>;
-#endif
-
-}
-#endif
diff --git a/paludis/resolver/orderer-fwd.hh b/paludis/resolver/orderer-fwd.hh
deleted file mode 100644
index 77cfbc5..0000000
--- a/paludis/resolver/orderer-fwd.hh
+++ /dev/null
@@ -1,31 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_ORDERER_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_ORDERER_FWD_HH 1
-
-namespace paludis
-{
- namespace resolver
- {
- struct Orderer;
- }
-}
-
-#endif
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
deleted file mode 100644
index f79f7f6..0000000
--- a/paludis/resolver/orderer.cc
+++ /dev/null
@@ -1,787 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009, 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <paludis/resolver/orderer.hh>
-#include <paludis/resolver/reason.hh>
-#include <paludis/resolver/constraint.hh>
-#include <paludis/resolver/resolvent.hh>
-#include <paludis/resolver/decider.hh>
-#include <paludis/resolver/resolution.hh>
-#include <paludis/resolver/arrow.hh>
-#include <paludis/resolver/decision.hh>
-#include <paludis/resolver/resolutions_by_resolvent.hh>
-#include <paludis/resolver/resolver.hh>
-#include <paludis/resolver/resolver_lists.hh>
-#include <paludis/resolver/job.hh>
-#include <paludis/resolver/jobs.hh>
-#include <paludis/resolver/required_confirmations.hh>
-#include <paludis/resolver/resolver_functions.hh>
-#include <paludis/util/exception.hh>
-#include <paludis/util/sequence-impl.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/accept_visitor.hh>
-#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
-#include <paludis/util/stringify.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/log.hh>
-#include <paludis/util/simple_visitor_cast.hh>
-#include <paludis/match_package.hh>
-#include <paludis/generator.hh>
-#include <paludis/filter.hh>
-#include <paludis/filtered_generator.hh>
-#include <paludis/selection.hh>
-#include <paludis/notifier_callback.hh>
-#include <algorithm>
-#include <set>
-
-using namespace paludis;
-using namespace paludis::resolver;
-
-typedef std::set<JobID> ToOrder;
-
-namespace paludis
-{
- template <>
- struct Implementation<Orderer>
- {
- const Environment * const env;
- const ResolverFunctions fns;
- const std::tr1::shared_ptr<const Decider> decider;
-
- const std::tr1::shared_ptr<ResolverLists> lists;
-
- ToOrder to_order;
-
- Implementation(const Environment * const e,
- const ResolverFunctions & f,
- const std::tr1::shared_ptr<const Decider> & d,
- const std::tr1::shared_ptr<ResolverLists> & l) :
- env(e),
- fns(f),
- decider(d),
- lists(l)
- {
- }
- };
-}
-
-Orderer::Orderer(const Environment * const e,
- const ResolverFunctions & f,
- const std::tr1::shared_ptr<const Decider> & d,
- const std::tr1::shared_ptr<ResolverLists> & l) :
- PrivateImplementationPattern<Orderer>(new Implementation<Orderer>(e, f, d, l))
-{
-}
-
-Orderer::~Orderer()
-{
-}
-
-void
-Orderer::resolve()
-{
- _imp->env->trigger_notifier_callback(NotifierCallbackResolverStageEvent("Building Jobs"));
- _resolve_jobs();
- _imp->env->trigger_notifier_callback(NotifierCallbackResolverStageEvent("Building Arrows"));
- _resolve_jobs_dep_arrows();
- _imp->env->trigger_notifier_callback(NotifierCallbackResolverStageEvent("Ordering"));
- _resolve_order();
-}
-
-namespace paludis
-{
- namespace n
- {
- struct done_installs;
- struct done_pretends;
- }
-}
-
-namespace
-{
- struct DecisionHandler
- {
- typedef std::tr1::function<void (
- const std::tr1::shared_ptr<const Resolution> &,
- const ChangesToMakeDecision &,
- const std::tr1::shared_ptr<SimpleInstallJob> &)> MightNeedConfirmationFunction;
-
- const std::tr1::shared_ptr<Resolution> resolution;
- const std::tr1::shared_ptr<ResolverLists> lists;
- ToOrder & to_order;
- MightNeedConfirmationFunction might_need_confirmation;
-
- DecisionHandler(
- const std::tr1::shared_ptr<Resolution> & r,
- const std::tr1::shared_ptr<ResolverLists> & l,
- ToOrder & o,
- const MightNeedConfirmationFunction & m) :
- resolution(r),
- lists(l),
- to_order(o),
- might_need_confirmation(m)
- {
- }
-
- void visit(const NothingNoChangeDecision & d)
- {
- if (d.taken())
- {
- Log::get_instance()->message("resolver.orderer.job.nothing_no_change", ll_debug, lc_no_context)
- << "taken " << resolution->resolvent() << " nothing no change";
-
- const std::tr1::shared_ptr<UsableJob> usable_job(new UsableJob(resolution));
- lists->jobs()->add(usable_job);
- to_order.insert(usable_job->id());
- }
- else
- {
- Log::get_instance()->message("resolver.orderer.job.nothing_no_change", ll_debug, lc_no_context)
- << "untaken " << resolution->resolvent() << " nothing no change";
- }
- }
-
- void visit(const ExistingNoChangeDecision & d)
- {
- if (d.taken())
- {
- Log::get_instance()->message("resolver.orderer.job.existing_no_change", ll_debug, lc_no_context)
- << "taken " << resolution->resolvent() << " existing no change";
-
- const std::tr1::shared_ptr<UsableJob> usable_job(new UsableJob(resolution));
- lists->jobs()->add(usable_job);
- to_order.insert(usable_job->id());
- }
- else
- {
- Log::get_instance()->message("resolver.orderer.job.existing_no_change", ll_debug, lc_no_context)
- << "untaken " << resolution->resolvent() << " existing no change";
- }
- }
-
- void visit(const ChangesToMakeDecision & d)
- {
- if (d.taken())
- {
- Log::get_instance()->message("resolver.orderer.job.changes_to_make", ll_debug, lc_no_context)
- << "taken " << resolution->resolvent() << " changes to make";
-
- const std::tr1::shared_ptr<FetchJob> fetch_job(new FetchJob(resolution,
- d.shared_from_this()));
- lists->jobs()->add(fetch_job);
- to_order.insert(fetch_job->id());
-
- const std::tr1::shared_ptr<SimpleInstallJob> install_job(new SimpleInstallJob(resolution,
- d.shared_from_this()));
- lists->jobs()->add(install_job);
- to_order.insert(install_job->id());
-
- const std::tr1::shared_ptr<UsableJob> usable_job(new UsableJob(resolution));
- lists->jobs()->add(usable_job);
- to_order.insert(usable_job->id());
-
- /* we can't install until we've fetched */
- install_job->arrows()->push_back(make_named_values<Arrow>(
- n::comes_after() = fetch_job->id(),
- n::failure_kinds() = FailureKinds(),
- n::maybe_reason() = make_null_shared_ptr()
- ));
-
- /* we aren't usable until we've been installed */
- usable_job->arrows()->push_back(make_named_values<Arrow>(
- n::comes_after() = install_job->id(),
- n::failure_kinds() = FailureKinds(),
- n::maybe_reason() = make_null_shared_ptr()
- ));
-
- /* do we need confirmation of this? */
- might_need_confirmation(resolution, d, install_job);
- }
- else
- {
- Log::get_instance()->message("resolver.orderer.job.changes_to_make", ll_debug, lc_no_context)
- << "untaken " << resolution->resolvent() << " changes to make";
-
- const std::tr1::shared_ptr<SimpleInstallJob> install_job(new SimpleInstallJob(resolution, d.shared_from_this()));
- lists->jobs()->add(install_job);
- lists->untaken_job_ids()->push_back(install_job->id());
- }
- }
-
- void visit(const UnableToMakeDecision & d)
- {
- if (d.taken())
- {
- Log::get_instance()->message("resolver.orderer.job.unable_to_make", ll_debug, lc_no_context)
- << "taken " << resolution->resolvent() << " unable to make";
-
- const std::tr1::shared_ptr<ErrorJob> error_job(new ErrorJob(resolution, d.shared_from_this()));
- lists->jobs()->add(error_job);
- lists->taken_error_job_ids()->push_back(error_job->id());
- }
- else
- {
- Log::get_instance()->message("resolver.orderer.job.unable_to_make", ll_debug, lc_no_context)
- << "untaken " << resolution->resolvent() << " unable to make";
-
- const std::tr1::shared_ptr<ErrorJob> error_job(new ErrorJob(resolution, d.shared_from_this()));
- lists->jobs()->add(error_job);
- lists->untaken_error_job_ids()->push_back(error_job->id());
- }
- }
-
- void visit(const RemoveDecision & d)
- {
- if (d.taken())
- {
- Log::get_instance()->message("resolver.orderer.job.remove_decision", ll_debug, lc_no_context)
- << "taken " << resolution->resolvent() << " remove decision";
-
- const std::tr1::shared_ptr<UninstallJob> uninstall_job(new UninstallJob(resolution,
- d.shared_from_this()));
- lists->jobs()->add(uninstall_job);
- to_order.insert(uninstall_job->id());
- }
- else
- {
- Log::get_instance()->message("resolver.orderer.job.remove_decision", ll_debug, lc_no_context)
- << "untaken " << resolution->resolvent() << " remove decision";
-
- const std::tr1::shared_ptr<UninstallJob> uninstall_job(new UninstallJob(resolution, d.shared_from_this()));
- lists->jobs()->add(uninstall_job);
- lists->untaken_job_ids()->push_back(uninstall_job->id());
- }
- }
- };
-}
-
-void
-Orderer::_resolve_jobs()
-{
- for (ResolutionsByResolvent::ConstIterator i(_imp->lists->resolutions_by_resolvent()->begin()),
- i_end(_imp->lists->resolutions_by_resolvent()->end()) ;
- i != i_end ; ++i)
- {
- DecisionHandler d(*i, _imp->lists, _imp->to_order, std::tr1::bind(
- &Orderer::_confirm, this, std::tr1::placeholders::_1,
- std::tr1::placeholders::_2, std::tr1::placeholders::_3));
- (*i)->decision()->accept(d);
- }
-}
-
-void
-Orderer::_confirm(
- const std::tr1::shared_ptr<const Resolution> & resolution,
- const ChangesToMakeDecision & decision,
- const std::tr1::shared_ptr<SimpleInstallJob> & job)
-{
- if (! decision.best())
- {
- const std::tr1::shared_ptr<RequiredConfirmation> c(new NotBestConfirmation);
- if (! _imp->fns.confirm_fn()(resolution, c))
- job->required_confirmations()->push_back(c);
- }
-
- if (ct_downgrade == decision.change_type())
- {
- const std::tr1::shared_ptr<DowngradeConfirmation> c(new DowngradeConfirmation);
- if (! _imp->fns.confirm_fn()(resolution, c))
- job->required_confirmations()->push_back(c);
- }
-
- if (! job->required_confirmations()->empty())
- _imp->lists->job_ids_needing_confirmation()->push_back(job->id());
-}
-
-namespace
-{
- struct LabelArrowsInfo
- {
- bool build;
- bool run;
-
- LabelArrowsInfo() :
- build(false),
- run(false)
- {
- }
-
- void visit(const DependenciesBuildLabel &)
- {
- build = true;
- }
-
- void visit(const DependenciesInstallLabel &)
- {
- build = true;
- }
-
- void visit(const DependenciesFetchLabel &)
- {
- build = true;
- }
-
- void visit(const DependenciesRunLabel &)
- {
- run = true;
- }
-
- void visit(const DependenciesTestLabel &)
- {
- build = true;
- }
-
- void visit(const DependenciesPostLabel &)
- {
- }
-
- void visit(const DependenciesSuggestionLabel &)
- {
- }
-
- void visit(const DependenciesRecommendationLabel &)
- {
- }
-
- void visit(const DependenciesCompileAgainstLabel &)
- {
- build = true;
- }
- };
-
- struct DepArrowsAdder
- {
- const std::tr1::shared_ptr<Jobs> jobs;
- const JobID our_identifier;
- const bool is_usable;
- const std::tr1::shared_ptr<const Reason> reason;
-
- DepArrowsAdder(
- const std::tr1::shared_ptr<Jobs> & j,
- const JobID & i,
- const bool u,
- const std::tr1::shared_ptr<const Reason> & r) :
- jobs(j),
- our_identifier(i),
- is_usable(u),
- reason(r)
- {
- }
-
- void visit(const TargetReason &) const
- {
- }
-
- void visit(const PresetReason &) const
- {
- }
-
- void visit(const SetReason & r) const
- {
- r.reason_for_set()->accept(*this);
- }
-
- void visit(const DependencyReason & r) const
- {
- Context context("When adding arrows for job '" + stringify(our_identifier.string_id())
- + "' with reason '" + stringify(r.sanitised_dependency().spec())
- + "' from '" + stringify(r.from_resolvent()) + "':");
-
- FailureKinds failure_kinds;
- if (r.already_met())
- failure_kinds += fk_ignorable_if_satisfied;
-
- if (r.sanitised_dependency().spec().if_block())
- {
- /* only strong blockers impose arrows. todo: maybe weak
- * blockers should impose some kind of weak arrow? or would
- * that make matters worse with silly Gentoo KDE blockers? */
- if (r.sanitised_dependency().spec().if_block()->strong())
- {
- /* we might not be changing anything (e.g. for a blocker), or we
- * might be a dependency that got cancelled out later when
- * something was changed from a decision to an error. */
- if (! jobs->have_job_for_installed(r.from_resolvent()))
- {
- Log::get_instance()->message("resolver.orderer.job.no_job_for_installed", ll_warning, lc_context)
- << "No job for building '" << r.from_resolvent() << "'. Verify manually that this is sane for now.";
- return;
- }
-
- /* todo: this should probably only cause an arrow if the
- * blocker is currently met */
- jobs->fetch(jobs->find_id_for_installed(r.from_resolvent()))->arrows()->push_back(
- make_named_values<Arrow>(
- n::comes_after() = our_identifier,
- n::failure_kinds() = failure_kinds,
- n::maybe_reason() = reason
- ));
- }
- }
- else
- {
- LabelArrowsInfo v;
- for (DependenciesLabelSequence::ConstIterator l(r.sanitised_dependency().active_dependency_labels()->begin()),
- l_end(r.sanitised_dependency().active_dependency_labels()->end()) ;
- l != l_end ; ++l)
- (*l)->accept(v);
-
- if (v.build || v.run)
- {
- /* we might not be changing anything (e.g. for a blocker), or we
- * might be a dependency that got cancelled out later when
- * something was changed from a decision to an error. */
- if (! jobs->have_job_for_usable(r.from_resolvent()))
- {
- Log::get_instance()->message("resolver.orderer.job.no_job_for_usable", ll_warning, lc_context)
- << "No job for building '" << r.from_resolvent() << "'. Verify manually that this is sane for now.";
- return;
- }
-
- if (v.build)
- {
- /* build: we must be usable before the other package is built */
- if (is_usable)
- jobs->fetch(jobs->find_id_for_installed(r.from_resolvent()))->arrows()->push_back(
- make_named_values<Arrow>(
- n::comes_after() = our_identifier,
- n::failure_kinds() = failure_kinds,
- n::maybe_reason() = reason
- ));
- }
-
- if (v.run)
- {
- /* run: we must be usable before the other package is usable */
- if (is_usable)
- jobs->fetch(jobs->find_id_for_usable(r.from_resolvent()))->arrows()->push_back(
- make_named_values<Arrow>(
- n::comes_after() = our_identifier,
- n::failure_kinds() = failure_kinds,
- n::maybe_reason() = reason
- ));
- }
- }
- }
- }
-
- void visit(const DependentReason &) const
- {
- }
- };
-
- struct DepArrowHandler
- {
- const std::tr1::shared_ptr<Jobs> jobs;
- const JobID our_identifier;
-
- DepArrowHandler(
- const std::tr1::shared_ptr<Jobs> & j,
- const JobID & i) :
- jobs(j),
- our_identifier(i)
- {
- }
-
- void add_dep_arrows(const bool u, const std::tr1::shared_ptr<const Resolution> & r)
- {
- for (Constraints::ConstIterator c(r->constraints()->begin()), c_end(r->constraints()->end()) ;
- c != c_end ; ++c)
- if ((*c)->reason())
- (*c)->reason()->accept(DepArrowsAdder(jobs, our_identifier, u, (*c)->reason()));
- }
-
- void visit(const SimpleInstallJob & c)
- {
- add_dep_arrows(false, c.resolution());
- }
-
- void visit(const UsableJob & c)
- {
- add_dep_arrows(true, c.resolution());
- }
-
- void visit(const UninstallJob &)
- {
- }
-
- void visit(const UsableGroupJob &)
- {
- }
-
- void visit(const FetchJob &)
- {
- }
-
- void visit(const ErrorJob &)
- {
- }
- };
-}
-
-void
-Orderer::_resolve_jobs_dep_arrows()
-{
- Context context("When resolving dep arrows:");
-
- for (ToOrder::const_iterator i(_imp->to_order.begin()),
- i_end(_imp->to_order.end()) ;
- i != i_end ; ++i)
- {
- DepArrowHandler d(_imp->lists->jobs(), *i);
- _imp->lists->jobs()->fetch(*i)->accept(d);
- }
-}
-
-void
-Orderer::_resolve_order()
-{
- while (true)
- {
- _imp->env->trigger_notifier_callback(NotifierCallbackResolverStageEvent("Ordering"));
-
- /* anything left? */
- if (_imp->to_order.empty())
- break;
-
- /* first attempt: nothing fancy */
- if (_order_some(false, false))
- continue;
-
- _imp->env->trigger_notifier_callback(NotifierCallbackResolverStageEvent("Ordering Usable Cycles"));
-
- /* second attempt: remove cycles containing only usable jobs */
- if (_remove_usable_cycles())
- continue;
-
- _imp->env->trigger_notifier_callback(NotifierCallbackResolverStageEvent("Ordering Using Existing"));
-
- /* third attempt: remove an install job whose deps are already met */
- if (_order_some(true, true))
- continue;
-
- _imp->env->trigger_notifier_callback(NotifierCallbackResolverStageEvent("Ordering Using Any Existing"));
-
- if (_order_some(true, false))
- continue;
-
- _cycle_error();
- }
-}
-
-bool
-Orderer::_order_some(const bool desperate, const bool installs_only)
-{
- bool result(false);
-
- for (ToOrder::iterator i(_imp->to_order.begin()), i_next(i), i_end(_imp->to_order.end()) ;
- i != i_end ; i = i_next)
- {
- /* i might end up invalidated by the time we're done */
- JobID id(*i);
- ++i_next;
-
- if (installs_only)
- {
- const std::tr1::shared_ptr<const Job> job(_imp->lists->jobs()->fetch(*i));
- if (! simple_visitor_cast<const SimpleInstallJob>(*job))
- continue;
- }
-
- if (! _can_order(id, desperate))
- continue;
-
- if (desperate)
- {
- const std::tr1::shared_ptr<Job> job(_imp->lists->jobs()->fetch(id));
- for (ArrowSequence::ConstIterator a(job->arrows()->begin()), a_end(job->arrows()->end()) ;
- a != a_end ; ++a)
- if (_imp->to_order.end() != _imp->to_order.find(a->comes_after()))
- job->used_existing_packages_when_ordering()->push_back(a->comes_after());
- }
-
- _order_this(id, false);
- result = true;
- }
-
- return result;
-}
-
-void
-Orderer::_order_this(const JobID & i, const bool inside_something_else)
-{
- if (! inside_something_else)
- _imp->lists->taken_job_ids()->push_back(i);
- _mark_already_ordered(i);
-}
-
-bool
-Orderer::_remove_usable_cycles()
-{
- /* we only want to remove usable jobs... */
- std::set<JobID> removable;
- for (ToOrder::const_iterator i(_imp->to_order.begin()),
- i_end(_imp->to_order.end()) ;
- i != i_end ; ++i)
- {
- const std::tr1::shared_ptr<const Job> job(_imp->lists->jobs()->fetch(*i));
- if (simple_visitor_cast<const UsableJob>(*job))
- removable.insert(job->id());
- }
-
- /* but we don't want to remove any job unless it only requires other jobs that
- * we're going to remove. */
- while (true)
- {
- bool need_another_pass(false);
- /* hashes have annoying invalidation rules */
- std::list<JobID> removable_copy(removable.begin(), removable.end());
- for (std::list<JobID>::iterator i(removable_copy.begin()), i_end(removable_copy.end()) ;
- i != i_end ; ++i)
- {
- bool ok(true);
- const std::tr1::shared_ptr<const Job> job(_imp->lists->jobs()->fetch(*i));
- for (ArrowSequence::ConstIterator a(job->arrows()->begin()), a_end(job->arrows()->end()) ;
- a != a_end ; ++a)
- if (_imp->to_order.end() != _imp->to_order.find(a->comes_after()))
- if (removable.end() == removable.find(a->comes_after()))
- {
- need_another_pass = true;
- ok = false;
- break;
- }
-
- if (! ok)
- removable.erase(*i);
- }
-
- if (! need_another_pass)
- break;
- }
-
- if (! removable.empty())
- {
- const std::tr1::shared_ptr<JobIDSequence> ids(new JobIDSequence);
- std::copy(removable.begin(), removable.end(), ids->back_inserter());
-
- const std::tr1::shared_ptr<UsableGroupJob> usable_group_job(new UsableGroupJob(ids));
- _imp->lists->jobs()->add(usable_group_job);
- _order_this(usable_group_job->id(), false);
-
- for (std::set<JobID>::iterator i(removable.begin()), i_next(i),
- i_end(removable.end()) ;
- i != i_end ; i = i_next)
- {
- ++i_next;
- _order_this(*i, true);
- }
- }
-
- return ! removable.empty();
-}
-
-void
-Orderer::_cycle_error()
-{
- std::stringstream s;
- for (ToOrder::const_iterator i(_imp->to_order.begin()),
- i_end(_imp->to_order.end()) ;
- i != i_end ; ++i)
- {
- s << " {{{" << i->string_id() << " missing";
- const std::tr1::shared_ptr<const Job> job(_imp->lists->jobs()->fetch(*i));
- for (ArrowSequence::ConstIterator a(job->arrows()->begin()), a_end(job->arrows()->end()) ;
- a != a_end ; ++a)
- if (_imp->to_order.end() != _imp->to_order.find(a->comes_after()))
- s << " [" << a->comes_after().string_id() << "]";
- s << " }}}";
- }
-
- throw InternalError(PALUDIS_HERE, "can't order any of " + s.str());
-}
-
-namespace
-{
- typedef std::tr1::function<bool (const PackageOrBlockDepSpec &)> AlreadyMetFn;
-
- struct AlreadyMetDep
- {
- bool visit(const DependentReason &) const
- {
- return false;
- }
-
- bool visit(const PresetReason &) const
- {
- return false;
- }
-
- bool visit(const TargetReason &) const
- {
- return false;
- }
-
- bool visit(const SetReason & r) const
- {
- return r.reason_for_set()->accept_returning<bool>(*this);
- }
-
- bool visit(const DependencyReason & r) const
- {
- return r.already_met();
- }
- };
-}
-
-bool
-Orderer::_can_order(const JobID & i, const bool desperate) const
-{
- const std::tr1::shared_ptr<const Job> job(_imp->lists->jobs()->fetch(i));
- for (ArrowSequence::ConstIterator a(job->arrows()->begin()), a_end(job->arrows()->end()) ;
- a != a_end ; ++a)
- {
- if (_imp->to_order.end() != _imp->to_order.find(a->comes_after()))
- {
- bool skippable(false);
-
- if ((! skippable) && desperate)
- {
- /* we can also ignore any arrows that are already met (e.g a
- * dep b, b dep a, a is already installed */
- if (a->maybe_reason() && a->maybe_reason()->accept_returning<bool>(AlreadyMetDep()))
- skippable = true;
- }
-
- if (! skippable)
- return false;
- }
- }
-
- return true;
-}
-
-void
-Orderer::_mark_already_ordered(const JobID & i)
-{
- _imp->to_order.erase(i);
- _imp->env->trigger_notifier_callback(NotifierCallbackResolverStepEvent());
-}
-
diff --git a/paludis/resolver/orderer.hh b/paludis/resolver/orderer.hh
deleted file mode 100644
index 77dc0f7..0000000
--- a/paludis/resolver/orderer.hh
+++ /dev/null
@@ -1,78 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009, 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_ORDERER_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_ORDERER_HH 1
-
-#include <paludis/resolver/orderer-fwd.hh>
-#include <paludis/resolver/resolvent-fwd.hh>
-#include <paludis/resolver/resolution-fwd.hh>
-#include <paludis/resolver/constraint-fwd.hh>
-#include <paludis/resolver/reason-fwd.hh>
-#include <paludis/resolver/resolver_functions-fwd.hh>
-#include <paludis/resolver/sanitised_dependencies-fwd.hh>
-#include <paludis/resolver/decider-fwd.hh>
-#include <paludis/resolver/resolver-fwd.hh>
-#include <paludis/resolver/job_id-fwd.hh>
-#include <paludis/resolver/job-fwd.hh>
-#include <paludis/resolver/decision-fwd.hh>
-#include <paludis/util/attributes.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/environment.hh>
-#include <tr1/memory>
-
-namespace paludis
-{
- namespace resolver
- {
- class PALUDIS_VISIBLE Orderer :
- private PrivateImplementationPattern<Orderer>
- {
- private:
- void _resolve_jobs();
- void _resolve_jobs_dep_arrows();
- void _resolve_order();
-
- bool _can_order(const JobID &, const bool desperate) const PALUDIS_ATTRIBUTE((warn_unused_result));
- void _mark_already_ordered(const JobID &);
- void _order_this(const JobID &, const bool inside_something_else);
-
- bool _order_some(const bool desperate, const bool installs_only) PALUDIS_ATTRIBUTE((warn_unused_result));
- bool _remove_usable_cycles() PALUDIS_ATTRIBUTE((warn_unused_result));
- void _cycle_error() PALUDIS_ATTRIBUTE((noreturn));
-
- void _confirm(
- const std::tr1::shared_ptr<const Resolution> &,
- const ChangesToMakeDecision &,
- const std::tr1::shared_ptr<SimpleInstallJob> &);
-
- public:
- Orderer(
- const Environment * const,
- const ResolverFunctions &,
- const std::tr1::shared_ptr<const Decider> &,
- const std::tr1::shared_ptr<ResolverLists> &);
- ~Orderer();
-
- void resolve();
- };
- }
-}
-
-#endif
diff --git a/paludis/resolver/resolution.cc b/paludis/resolver/resolution.cc
index 6287c6b..ec398a3 100644
--- a/paludis/resolver/resolution.cc
+++ b/paludis/resolver/resolution.cc
@@ -19,7 +19,6 @@
#include <paludis/resolver/resolution.hh>
#include <paludis/resolver/constraint.hh>
-#include <paludis/resolver/arrow.hh>
#include <paludis/resolver/decision.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/join.hh>
diff --git a/paludis/resolver/resolver.cc b/paludis/resolver/resolver.cc
index fd3b3e2..7ead5de 100644
--- a/paludis/resolver/resolver.cc
+++ b/paludis/resolver/resolver.cc
@@ -19,15 +19,11 @@
#include <paludis/resolver/resolver.hh>
#include <paludis/resolver/resolver_functions.hh>
-#include <paludis/resolver/resolver_lists.hh>
#include <paludis/resolver/spec_rewriter.hh>
#include <paludis/resolver/decider.hh>
#include <paludis/resolver/sanitised_dependencies.hh>
#include <paludis/resolver/reason.hh>
#include <paludis/resolver/resolutions_by_resolvent.hh>
-#include <paludis/resolver/jobs.hh>
-#include <paludis/resolver/job_id.hh>
-#include <paludis/resolver/orderer.hh>
#include <paludis/resolver/lineariser.hh>
#include <paludis/resolver/decisions.hh>
#include <paludis/resolver/work_list.hh>
@@ -58,27 +54,16 @@ namespace paludis
const Environment * const env;
const ResolverFunctions fns;
- const std::tr1::shared_ptr<ResolverLists> lists;
const std::tr1::shared_ptr<Resolved> resolved;
const std::tr1::shared_ptr<Decider> decider;
- const std::tr1::shared_ptr<Orderer> orderer;
const std::tr1::shared_ptr<Lineariser> lineariser;
Implementation(const Environment * const e, const ResolverFunctions & f) :
env(e),
fns(f),
- lists(new ResolverLists(make_named_values<ResolverLists>(
- n::job_ids_needing_confirmation() = make_shared_ptr(new JobIDSequence),
- n::jobs() = make_shared_ptr(new Jobs),
- n::resolutions_by_resolvent() = make_shared_ptr(new ResolutionsByResolvent),
- n::taken_error_job_ids() = make_shared_ptr(new JobIDSequence),
- n::taken_job_ids() = make_shared_ptr(new JobIDSequence),
- n::untaken_error_job_ids() = make_shared_ptr(new JobIDSequence),
- n::untaken_job_ids() = make_shared_ptr(new JobIDSequence)
- ))),
resolved(new Resolved(make_named_values<Resolved>(
- n::resolutions_by_resolvent() = lists->resolutions_by_resolvent(),
+ n::resolutions_by_resolvent() = make_shared_ptr(new ResolutionsByResolvent),
n::taken_change_or_remove_decisions() = make_shared_ptr(new Decisions<ChangeOrRemoveDecision>),
n::taken_unable_to_make_decisions() = make_shared_ptr(new Decisions<UnableToMakeDecision>),
n::taken_unconfirmed_change_or_remove_decisions() = make_shared_ptr(new Decisions<ChangeOrRemoveDecision>),
@@ -90,7 +75,6 @@ namespace paludis
))
))),
decider(new Decider(e, f, resolved->resolutions_by_resolvent())),
- orderer(new Orderer(e, f, decider, lists)),
lineariser(new Lineariser(e, resolved))
{
}
@@ -179,16 +163,9 @@ void
Resolver::resolve()
{
_imp->decider->resolve();
- _imp->orderer->resolve();
_imp->lineariser->resolve();
}
-const std::tr1::shared_ptr<const ResolverLists>
-Resolver::lists() const
-{
- return _imp->lists;
-}
-
const std::tr1::shared_ptr<const Resolved>
Resolver::resolved() const
{
diff --git a/paludis/resolver/resolver.hh b/paludis/resolver/resolver.hh
index 3818111..7473f68 100644
--- a/paludis/resolver/resolver.hh
+++ b/paludis/resolver/resolver.hh
@@ -24,7 +24,6 @@
#include <paludis/resolver/reason-fwd.hh>
#include <paludis/resolver/resolver_functions-fwd.hh>
#include <paludis/resolver/decider-fwd.hh>
-#include <paludis/resolver/resolver_lists-fwd.hh>
#include <paludis/resolver/resolved-fwd.hh>
#include <paludis/resolver/sanitised_dependencies-fwd.hh>
#include <paludis/resolver/package_or_block_dep_spec-fwd.hh>
@@ -57,7 +56,6 @@ namespace paludis
void resolve();
- const std::tr1::shared_ptr<const ResolverLists> lists() const PALUDIS_ATTRIBUTE((warn_unused_result));
const std::tr1::shared_ptr<const Resolved> resolved() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/resolver/resolver_TEST_any.cc b/paludis/resolver/resolver_TEST_any.cc
index 92a6c20..fa37066 100644
--- a/paludis/resolver/resolver_TEST_any.cc
+++ b/paludis/resolver/resolver_TEST_any.cc
@@ -25,7 +25,6 @@
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/suggest_restart.hh>
-#include <paludis/resolver/resolver_lists.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
diff --git a/paludis/resolver/resolver_TEST_blockers.cc b/paludis/resolver/resolver_TEST_blockers.cc
index fdf3aa5..3ea617f 100644
--- a/paludis/resolver/resolver_TEST_blockers.cc
+++ b/paludis/resolver/resolver_TEST_blockers.cc
@@ -24,7 +24,6 @@
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/suggest_restart.hh>
-#include <paludis/resolver/resolver_lists.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
diff --git a/paludis/resolver/resolver_TEST_cycles.cc b/paludis/resolver/resolver_TEST_cycles.cc
index 3f673fe..1597be5 100644
--- a/paludis/resolver/resolver_TEST_cycles.cc
+++ b/paludis/resolver/resolver_TEST_cycles.cc
@@ -24,7 +24,6 @@
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/suggest_restart.hh>
-#include <paludis/resolver/resolver_lists.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
diff --git a/paludis/resolver/resolver_TEST_errors.cc b/paludis/resolver/resolver_TEST_errors.cc
index ee744ae..7c0ce0b 100644
--- a/paludis/resolver/resolver_TEST_errors.cc
+++ b/paludis/resolver/resolver_TEST_errors.cc
@@ -24,7 +24,6 @@
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/suggest_restart.hh>
-#include <paludis/resolver/resolver_lists.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
diff --git a/paludis/resolver/resolver_TEST_serialisation.cc b/paludis/resolver/resolver_TEST_serialisation.cc
index faf9d31..2b0c7e8 100644
--- a/paludis/resolver/resolver_TEST_serialisation.cc
+++ b/paludis/resolver/resolver_TEST_serialisation.cc
@@ -24,7 +24,6 @@
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/suggest_restart.hh>
-#include <paludis/resolver/resolver_lists.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
diff --git a/paludis/resolver/resolver_TEST_simple.cc b/paludis/resolver/resolver_TEST_simple.cc
index 7b0985b..b96865d 100644
--- a/paludis/resolver/resolver_TEST_simple.cc
+++ b/paludis/resolver/resolver_TEST_simple.cc
@@ -24,7 +24,6 @@
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/suggest_restart.hh>
-#include <paludis/resolver/resolver_lists.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
diff --git a/paludis/resolver/resolver_TEST_suggestions.cc b/paludis/resolver/resolver_TEST_suggestions.cc
index 56044da..1fa93ee 100644
--- a/paludis/resolver/resolver_TEST_suggestions.cc
+++ b/paludis/resolver/resolver_TEST_suggestions.cc
@@ -24,7 +24,6 @@
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/suggest_restart.hh>
-#include <paludis/resolver/resolver_lists.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
diff --git a/paludis/resolver/resolver_TEST_virtuals.cc b/paludis/resolver/resolver_TEST_virtuals.cc
index 51247bb..dfb20cb 100644
--- a/paludis/resolver/resolver_TEST_virtuals.cc
+++ b/paludis/resolver/resolver_TEST_virtuals.cc
@@ -24,7 +24,6 @@
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/suggest_restart.hh>
-#include <paludis/resolver/resolver_lists.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
diff --git a/paludis/resolver/resolver_lists-fwd.hh b/paludis/resolver/resolver_lists-fwd.hh
deleted file mode 100644
index 6ae3457..0000000
--- a/paludis/resolver/resolver_lists-fwd.hh
+++ /dev/null
@@ -1,31 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_RESOLVER_LISTS_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_RESOLVER_LISTS_FWD_HH 1
-
-namespace paludis
-{
- namespace resolver
- {
- struct ResolverLists;
- }
-}
-
-#endif
diff --git a/paludis/resolver/resolver_lists.cc b/paludis/resolver/resolver_lists.cc
deleted file mode 100644
index 3878ee1..0000000
--- a/paludis/resolver/resolver_lists.cc
+++ /dev/null
@@ -1,96 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009, 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <paludis/resolver/resolver_lists.hh>
-#include <paludis/resolver/resolutions_by_resolvent.hh>
-#include <paludis/resolver/jobs.hh>
-#include <paludis/resolver/job_id.hh>
-#include <paludis/util/sequence.hh>
-#include <paludis/util/make_named_values.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/serialise-impl.hh>
-
-using namespace paludis;
-using namespace paludis::resolver;
-
-void
-ResolverLists::serialise(Serialiser & s) const
-{
- s.object("ResolverLists")
- .member(SerialiserFlags<serialise::might_be_null>(), "jobs", jobs())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(), "job_ids_needing_confirmation", job_ids_needing_confirmation())
- .member(SerialiserFlags<serialise::might_be_null>(), "resolutions_by_resolvent", resolutions_by_resolvent())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(), "taken_error_job_ids", taken_error_job_ids())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(), "taken_job_ids", taken_job_ids())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(), "untaken_error_job_ids", untaken_error_job_ids())
- .member(SerialiserFlags<serialise::container, serialise::might_be_null>(), "untaken_job_ids", untaken_job_ids())
- ;
-}
-
-const ResolverLists
-ResolverLists::deserialise(Deserialisation & d)
-{
- Deserialisator v(d, "ResolverLists");
-
- std::tr1::shared_ptr<JobIDSequence> job_ids_needing_confirmation(new JobIDSequence);
- {
- Deserialisator vv(*v.find_remove_member("job_ids_needing_confirmation"), "c");
- for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
- job_ids_needing_confirmation->push_back(vv.member<JobID>(stringify(n)));
- }
-
- std::tr1::shared_ptr<JobIDSequence> taken_error_job_ids(new JobIDSequence);
- {
- Deserialisator vv(*v.find_remove_member("taken_error_job_ids"), "c");
- for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
- taken_error_job_ids->push_back(vv.member<JobID>(stringify(n)));
- }
-
- std::tr1::shared_ptr<JobIDSequence> taken_job_ids(new JobIDSequence);
- {
- Deserialisator vv(*v.find_remove_member("taken_job_ids"), "c");
- for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
- taken_job_ids->push_back(vv.member<JobID>(stringify(n)));
- }
-
- std::tr1::shared_ptr<JobIDSequence> untaken_error_job_ids(new JobIDSequence);
- {
- Deserialisator vv(*v.find_remove_member("untaken_error_job_ids"), "c");
- for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
- untaken_error_job_ids->push_back(vv.member<JobID>(stringify(n)));
- }
-
- std::tr1::shared_ptr<JobIDSequence> untaken_job_ids(new JobIDSequence);
- {
- Deserialisator vv(*v.find_remove_member("untaken_job_ids"), "c");
- for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
- untaken_job_ids->push_back(vv.member<JobID>(stringify(n)));
- }
-
- return make_named_values<ResolverLists>(
- n::job_ids_needing_confirmation() = job_ids_needing_confirmation,
- n::jobs() = v.member<std::tr1::shared_ptr<Jobs> >("jobs"),
- n::resolutions_by_resolvent() = v.member<std::tr1::shared_ptr<ResolutionsByResolvent> >("resolutions_by_resolvent"),
- n::taken_error_job_ids() = taken_error_job_ids,
- n::taken_job_ids() = taken_job_ids,
- n::untaken_error_job_ids() = untaken_error_job_ids,
- n::untaken_job_ids() = untaken_job_ids
- );
-}
-
diff --git a/paludis/resolver/resolver_lists.hh b/paludis/resolver/resolver_lists.hh
deleted file mode 100644
index bfa0740..0000000
--- a/paludis/resolver/resolver_lists.hh
+++ /dev/null
@@ -1,62 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2009, 2010 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_RESOLVER_LISTS_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_RESOLVER_LISTS_HH 1
-
-#include <paludis/resolver/resolver_lists-fwd.hh>
-#include <paludis/resolver/job_id-fwd.hh>
-#include <paludis/resolver/jobs-fwd.hh>
-#include <paludis/resolver/resolutions_by_resolvent-fwd.hh>
-#include <paludis/util/named_value.hh>
-#include <paludis/serialise.hh>
-#include <tr1/memory>
-
-namespace paludis
-{
- namespace n
- {
- typedef Name<struct job_ids_needing_confirmation_name> job_ids_needing_confirmation;
- typedef Name<struct jobs_name> jobs;
- typedef Name<struct resolutions_by_resolvent_name> resolutions_by_resolvent;
- typedef Name<struct taken_error_job_ids_name> taken_error_job_ids;
- typedef Name<struct taken_job_ids_name> taken_job_ids;
- typedef Name<struct untaken_error_job_ids_name> untaken_error_job_ids;
- typedef Name<struct untaken_job_ids_name> untaken_job_ids;
- }
-
- namespace resolver
- {
- struct ResolverLists
- {
- NamedValue<n::job_ids_needing_confirmation, std::tr1::shared_ptr<JobIDSequence> > job_ids_needing_confirmation;
- NamedValue<n::jobs, std::tr1::shared_ptr<Jobs> > jobs;
- NamedValue<n::resolutions_by_resolvent, std::tr1::shared_ptr<ResolutionsByResolvent> > resolutions_by_resolvent;
- NamedValue<n::taken_error_job_ids, std::tr1::shared_ptr<JobIDSequence> > taken_error_job_ids;
- NamedValue<n::taken_job_ids, std::tr1::shared_ptr<JobIDSequence> > taken_job_ids;
- NamedValue<n::untaken_error_job_ids, std::tr1::shared_ptr<JobIDSequence> > untaken_error_job_ids;
- NamedValue<n::untaken_job_ids, std::tr1::shared_ptr<JobIDSequence> > untaken_job_ids;
-
- static const ResolverLists deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
- void serialise(Serialiser &) const;
- };
- }
-}
-
-#endif
diff --git a/paludis/resolver/resolver_test.cc b/paludis/resolver/resolver_test.cc
index ff3abcb..b67f32d 100644
--- a/paludis/resolver/resolver_test.cc
+++ b/paludis/resolver/resolver_test.cc
@@ -27,10 +27,6 @@
#include <paludis/resolver/decision.hh>
#include <paludis/resolver/decisions.hh>
#include <paludis/resolver/decider.hh>
-#include <paludis/resolver/orderer.hh>
-#include <paludis/resolver/job.hh>
-#include <paludis/resolver/jobs.hh>
-#include <paludis/resolver/job_id.hh>
#include <paludis/resolver/reason.hh>
#include <paludis/util/map.hh>
#include <paludis/util/make_shared_ptr.hh>
diff --git a/paludis/resolver/resolver_test.hh b/paludis/resolver/resolver_test.hh
index 4f2ea97..4693ea7 100644
--- a/paludis/resolver/resolver_test.hh
+++ b/paludis/resolver/resolver_test.hh
@@ -29,7 +29,6 @@
#include <paludis/resolver/decision-fwd.hh>
#include <paludis/resolver/destination_types-fwd.hh>
#include <paludis/resolver/resolver-fwd.hh>
-#include <paludis/resolver/jobs-fwd.hh>
#include <paludis/resolver/resolver_functions-fwd.hh>
#include <paludis/resolver/required_confirmations-fwd.hh>
#include <paludis/resolver/package_or_block_dep_spec-fwd.hh>
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 134e378..a962e3b 100644
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -50,7 +50,6 @@
#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/destination.hh>
#include <paludis/resolver/unsuitable_candidates.hh>
-#include <paludis/resolver/resolver_lists.hh>
#include <paludis/resolver/decisions.hh>
#include <paludis/resolver/required_confirmations.hh>
#include <paludis/package_id.hh>
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index 1235ad2..d5f8d56 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -49,12 +49,6 @@
#include <paludis/resolver/resolver.hh>
#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/destination.hh>
-#include <paludis/resolver/resolver_lists.hh>
-#include <paludis/resolver/jobs.hh>
-#include <paludis/resolver/job.hh>
-#include <paludis/resolver/job_id.hh>
-#include <paludis/resolver/job_state.hh>
-#include <paludis/resolver/arrow.hh>
#include <paludis/resolver/work_lists.hh>
#include <paludis/resolver/work_list.hh>
#include <paludis/resolver/work_item.hh>
diff --git a/src/clients/cave/cmd_resolve_dump.cc b/src/clients/cave/cmd_resolve_dump.cc
index df8b9fe..0dd42a1 100644
--- a/src/clients/cave/cmd_resolve_dump.cc
+++ b/src/clients/cave/cmd_resolve_dump.cc
@@ -25,10 +25,8 @@
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/decision.hh>
#include <paludis/resolver/reason.hh>
-#include <paludis/resolver/arrow.hh>
#include <paludis/resolver/destination.hh>
#include <paludis/resolver/resolutions_by_resolvent.hh>
-#include <paludis/resolver/resolver_lists.hh>
#include <paludis/util/enum_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/join.hh>
@@ -191,14 +189,6 @@ namespace
return s;
}
- std::ostream &
- operator<< (std::ostream & s, const Arrow & a)
- {
- s << "Arrow(-> " << a.comes_after().string_id();
- s << ")";
- return s;
- }
-
std::string stringify_constraint(const Constraint & c)
{
std::stringstream s;
@@ -206,13 +196,6 @@ namespace
return s.str();
}
- std::string stringify_arrow(const Arrow & a)
- {
- std::stringstream s;
- s << a;
- return s.str();
- }
-
std::ostream &
operator<< (std::ostream & s, const Resolution & r)
{
@@ -237,8 +220,8 @@ namespace
{
std::cout << "Dumping resolutions by QPN:S:" << std::endl << std::endl;
- for (ResolutionsByResolvent::ConstIterator c(resolver->lists()->resolutions_by_resolvent()->begin()),
- c_end(resolver->lists()->resolutions_by_resolvent()->end()) ;
+ for (ResolutionsByResolvent::ConstIterator c(resolver->resolved()->resolutions_by_resolvent()->begin()),
+ c_end(resolver->resolved()->resolutions_by_resolvent()->end()) ;
c != c_end ; ++c)
{
std::cout << (*c)->resolvent() << std::endl;
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index a2c599a..adb20eb 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -51,9 +51,9 @@
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/sanitised_dependencies.hh>
#include <paludis/resolver/resolutions_by_resolvent.hh>
-#include <paludis/resolver/resolver_lists.hh>
#include <paludis/resolver/required_confirmations.hh>
#include <paludis/resolver/work_lists.hh>
+#include <paludis/resolver/decisions.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/notifier_callback.hh>
#include <paludis/generator.hh>
@@ -1681,10 +1681,10 @@ paludis::cave::resolve_common(
retcode |= display_resolution(env, resolver->resolved(), resolution_options,
display_options, program_options, keys_if_import, targets);
- if (! resolver->lists()->taken_error_job_ids()->empty())
+ if (! resolver->resolved()->taken_unable_to_make_decisions()->empty())
retcode |= 1;
- if (! resolver->lists()->job_ids_needing_confirmation()->empty())
+ if (! resolver->resolved()->taken_unconfirmed_change_or_remove_decisions()->empty())
retcode |= 3;
if (0 == retcode)