aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-05 11:02:21 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-05 11:02:21 +0100
commit5e53f01cc8b8b570f8eba57a19f15f392f4dcfcc (patch)
treeeb90b421ed8131d0ba03d3e280c14c256d93202e
parente491822c8f84330b1ba114b84226988753c88ec9 (diff)
downloadpaludis-5e53f01cc8b8b570f8eba57a19f15f392f4dcfcc.tar.gz
paludis-5e53f01cc8b8b570f8eba57a19f15f392f4dcfcc.tar.xz
Move PartiallyMadePackageDepSpec into own header
-rw-r--r--doc/api/cplusplus/examples/example_contents.cc1
-rw-r--r--paludis/changed_choices.cc1
-rw-r--r--paludis/changed_choices.hh1
-rw-r--r--paludis/comma_separated_dep_printer.cc2
-rw-r--r--paludis/common_sets.cc1
-rw-r--r--paludis/dep_list.cc1
-rw-r--r--paludis/dep_spec-fwd.hh32
-rw-r--r--paludis/dep_spec.cc475
-rw-r--r--paludis/dep_spec.hh114
-rw-r--r--paludis/dep_spec_flattener.cc1
-rw-r--r--paludis/elike_package_dep_spec-fwd.hh3
-rw-r--r--paludis/elike_package_dep_spec.cc1
-rw-r--r--paludis/environments/paludis/world.cc1
-rw-r--r--paludis/environments/paludis/world_TEST.cc1
-rw-r--r--paludis/environments/portage/portage_environment.cc1
-rw-r--r--paludis/environments/portage/portage_environment_TEST.cc1
-rw-r--r--paludis/files.m43
-rw-r--r--paludis/install_task.cc1
-rw-r--r--paludis/ndbam.cc1
-rw-r--r--paludis/package_database.cc1
-rw-r--r--paludis/partially_made_package_dep_spec-fwd.hh53
-rw-r--r--paludis/partially_made_package_dep_spec.cc511
-rw-r--r--paludis/partially_made_package_dep_spec.hh146
-rw-r--r--paludis/partially_made_package_dep_spec.se (renamed from paludis/dep_spec.se)0
-rw-r--r--paludis/range_rewriter_TEST.cc1
-rw-r--r--paludis/report_task.cc1
-rw-r--r--paludis/repositories/accounts/accounts_dep_key.cc1
-rw-r--r--paludis/repositories/cran/dep_spec_pretty_printer.cc2
-rw-r--r--paludis/repositories/e/can_skip_phase.cc3
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer.cc1
-rw-r--r--paludis/repositories/e/dependencies_rewriter.cc2
-rw-r--r--paludis/repositories/e/e_choices_key.cc1
-rw-r--r--paludis/repositories/e/e_key.cc1
-rw-r--r--paludis/repositories/e/e_repository.cc1
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc1
-rw-r--r--paludis/repositories/e/e_repository_sets.cc39
-rw-r--r--paludis/repositories/e/ebuild_id.cc2
-rw-r--r--paludis/repositories/e/fetch_visitor.cc2
-rw-r--r--paludis/repositories/e/fix_locked_dependencies.cc2
-rw-r--r--paludis/repositories/e/myoptions_requirements_verifier.cc1
-rw-r--r--paludis/repositories/e/pretend_fetch_visitor.cc2
-rw-r--r--paludis/repositories/e/vdb_repository.cc4
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc3
-rw-r--r--paludis/repositories/fake/dep_parser_TEST.cc3
-rw-r--r--paludis/repositories/fake/fake_package_id.cc2
-rw-r--r--paludis/repositories/unpackaged/installed_repository_TEST.cc3
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_file.cc2
-rw-r--r--paludis/repositories/virtuals/package_id.cc1
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc1
-rw-r--r--paludis/resolver/decider.cc2
-rw-r--r--paludis/resolver/orderer.cc1
-rw-r--r--paludis/resolver/resolver.cc4
-rw-r--r--paludis/resolver/resolver_test.cc1
-rw-r--r--paludis/resolver/sanitised_dependencies.cc2
-rw-r--r--paludis/resolver/spec_rewriter.cc1
-rw-r--r--paludis/set_file.cc1
-rw-r--r--paludis/set_file_TEST.cc15
-rw-r--r--paludis/show_suggest_visitor.cc2
-rw-r--r--paludis/spec_tree.cc2
-rw-r--r--paludis/spec_tree.hh5
-rw-r--r--paludis/uninstall_task.cc2
-rw-r--r--paludis/user_dep_spec.cc2
-rw-r--r--python/dep_spec.cc4
-rw-r--r--ruby/dep_spec.cc2
-rw-r--r--src/clients/adjutrix/downgrade_check.cc1
-rw-r--r--src/clients/adjutrix/find_insecure_packages.cc1
-rw-r--r--src/clients/adjutrix/find_reverse_deps.cc1
-rw-r--r--src/clients/adjutrix/keywords_graph.cc2
-rw-r--r--src/clients/appareo/appareo.cc1
-rw-r--r--src/clients/cave/cmd_fix_linkage.cc1
-rw-r--r--src/clients/cave/cmd_match.cc1
-rw-r--r--src/clients/cave/cmd_print_set.cc1
-rw-r--r--src/clients/cave/cmd_show.cc2
-rw-r--r--src/clients/cave/cmd_uninstall.cc1
-rw-r--r--src/clients/cave/executables_common.cc1
-rw-r--r--src/clients/cave/resolve_common.cc1
-rw-r--r--src/clients/inquisitio/do_search.cc1
-rw-r--r--src/clients/inquisitio/key_extractor.cc1
-rw-r--r--src/clients/instruo/instruo.cc2
-rw-r--r--src/clients/paludis/info.cc1
-rw-r--r--src/clients/paludis/query.cc7
-rw-r--r--src/clients/reconcilio/fix_linkage.cc1
-rw-r--r--src/output/console_install_task.cc1
-rw-r--r--src/output/console_query_task.cc2
84 files changed, 853 insertions, 658 deletions
diff --git a/doc/api/cplusplus/examples/example_contents.cc b/doc/api/cplusplus/examples/example_contents.cc
index 58e910c..7c52266 100644
--- a/doc/api/cplusplus/examples/example_contents.cc
+++ b/doc/api/cplusplus/examples/example_contents.cc
@@ -17,6 +17,7 @@
#include "example_command_line.hh"
#include <iostream>
#include <iomanip>
+#include <algorithm>
using namespace paludis;
using namespace examples;
diff --git a/paludis/changed_choices.cc b/paludis/changed_choices.cc
index f4a11d6..cd8fb8e 100644
--- a/paludis/changed_choices.cc
+++ b/paludis/changed_choices.cc
@@ -24,6 +24,7 @@
#include <paludis/serialise-impl.hh>
#include <paludis/elike_use_requirement-fwd.hh>
#include <paludis/dep_spec.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <map>
using namespace paludis;
diff --git a/paludis/changed_choices.hh b/paludis/changed_choices.hh
index 1efb83f..2f5fe4e 100644
--- a/paludis/changed_choices.hh
+++ b/paludis/changed_choices.hh
@@ -27,6 +27,7 @@
#include <paludis/choice-fwd.hh>
#include <paludis/serialise-fwd.hh>
#include <paludis/dep_spec-fwd.hh>
+#include <paludis/partially_made_package_dep_spec-fwd.hh>
#include <memory>
namespace paludis
diff --git a/paludis/comma_separated_dep_printer.cc b/paludis/comma_separated_dep_printer.cc
index a75d938..b8a483b 100644
--- a/paludis/comma_separated_dep_printer.cc
+++ b/paludis/comma_separated_dep_printer.cc
@@ -22,12 +22,14 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/options.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/environment.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/action.hh>
+#include <algorithm>
#include <sstream>
using namespace paludis;
diff --git a/paludis/common_sets.cc b/paludis/common_sets.cc
index 1fb5fe1..f5871fa 100644
--- a/paludis/common_sets.cc
+++ b/paludis/common_sets.cc
@@ -28,6 +28,7 @@
#include <paludis/metadata_key.hh>
#include <paludis/package_id.hh>
#include <paludis/elike_slot_requirement.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/stringify.hh>
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index 253475c..c6a0552 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -40,6 +40,7 @@
#include <paludis/choice.hh>
#include <paludis/package_dep_spec_properties.hh>
#include <paludis/notifier_callback.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
diff --git a/paludis/dep_spec-fwd.hh b/paludis/dep_spec-fwd.hh
index 9f96b3d..20bfd43 100644
--- a/paludis/dep_spec-fwd.hh
+++ b/paludis/dep_spec-fwd.hh
@@ -20,15 +20,9 @@
#ifndef PALUDIS_GUARD_PALUDIS_DEP_SPEC_FWD_HH
#define PALUDIS_GUARD_PALUDIS_DEP_SPEC_FWD_HH 1
-#include <iosfwd>
-#include <string>
-#include <paludis/dep_label-fwd.hh>
-#include <paludis/dep_spec-fwd.hh>
-#include <paludis/formatter-fwd.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/sequence-fwd.hh>
-#include <paludis/util/options-fwd.hh>
-#include <memory>
+#include <paludis/dep_label-fwd.hh>
+#include <iosfwd>
/** \file
* Forward declarations for paludis/dep_spec.hh .
@@ -53,16 +47,6 @@ namespace paludis
class PlainTextLabelDepSpec;
template <typename T_> class LabelsDepSpec;
-#include <paludis/dep_spec-se.hh>
-
- /**
- * Options for PartiallyMadePackageDepSpec.
- *
- * \ingroup g_dep_spec
- * \since 0.38
- */
- typedef Options<PartiallyMadePackageDepSpecOption> PartiallyMadePackageDepSpecOptions;
-
/**
* A URILabelsDepSpec represents labels in a FetchableURISpecTree.
*
@@ -80,24 +64,12 @@ namespace paludis
typedef LabelsDepSpec<DependenciesLabel> DependenciesLabelsDepSpec;
class PackageDepSpecData;
- class PartiallyMadePackageDepSpec;
class ConditionalDepSpecData;
struct InstallableToRepository;
struct InstallableToPath;
/**
- * Create a PackageDepSpec from various rules.
- *
- * Note the return type is a PartiallyMadePackageDepSpec, which is implicitly convertible to
- * a PackageDepSpec.
- *
- * \ingroup g_dep_spec
- * \since 0.26
- */
- PartiallyMadePackageDepSpec make_package_dep_spec(const PartiallyMadePackageDepSpecOptions &) PALUDIS_VISIBLE;
-
- /**
* A PlainTextDepSpec can be written to an ostream.
*
* \ingroup g_dep_spec
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 06d2348..6cb775b 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -44,8 +44,6 @@
using namespace paludis;
-#include <paludis/dep_spec-se.cc>
-
namespace paludis
{
template <>
@@ -743,485 +741,12 @@ PackageDepSpec::need_keys_added() const
{
}
-PartiallyMadePackageDepSpec
-paludis::make_package_dep_spec(const PartiallyMadePackageDepSpecOptions & o)
-{
- return PartiallyMadePackageDepSpec(o);
-}
-
-namespace
-{
- struct PartiallyMadePackageDepSpecData :
- PackageDepSpecData
- {
- std::shared_ptr<const QualifiedPackageName> package;
- std::shared_ptr<const PackageNamePart> package_name_part;
- std::shared_ptr<const CategoryNamePart> category_name_part;
- std::shared_ptr<VersionRequirements> version_requirements;
- VersionRequirementsMode version_requirements_mode_v;
- std::shared_ptr<const SlotRequirement> slot;
- std::shared_ptr<const RepositoryName> in_repository;
- std::shared_ptr<const RepositoryName> from_repository;
- std::shared_ptr<const InstallableToRepository> installable_to_repository;
- std::shared_ptr<const FSEntry> installed_at_path;
- std::shared_ptr<const InstallableToPath> installable_to_path;
- std::shared_ptr<AdditionalPackageDepSpecRequirements> additional_requirements;
- std::shared_ptr<const MetadataSectionKey> annotations;
- PartiallyMadePackageDepSpecOptions options_for_partially_made_package_dep_spec_v;
-
- PartiallyMadePackageDepSpecData(const PartiallyMadePackageDepSpecOptions & o) :
- PackageDepSpecData(),
- version_requirements_mode_v(vr_and),
- options_for_partially_made_package_dep_spec_v(o)
- {
- }
-
- PartiallyMadePackageDepSpecData(const PackageDepSpecData & other) :
- PackageDepSpecData(other),
- package(other.package_ptr()),
- package_name_part(other.package_name_part_ptr()),
- category_name_part(other.category_name_part_ptr()),
- version_requirements(other.version_requirements_ptr() ? new VersionRequirements : 0),
- version_requirements_mode_v(other.version_requirements_mode()),
- slot(other.slot_requirement_ptr()),
- in_repository(other.in_repository_ptr()),
- from_repository(other.from_repository_ptr()),
- installable_to_repository(other.installable_to_repository_ptr()),
- installed_at_path(other.installed_at_path_ptr()),
- installable_to_path(other.installable_to_path_ptr()),
- additional_requirements(other.additional_requirements_ptr() ? new AdditionalPackageDepSpecRequirements : 0),
- annotations(other.annotations_key()),
- options_for_partially_made_package_dep_spec_v(other.options_for_partially_made_package_dep_spec())
- {
- if (version_requirements)
- std::copy(other.version_requirements_ptr()->begin(), other.version_requirements_ptr()->end(),
- version_requirements->back_inserter());
-
- if (additional_requirements)
- std::copy(other.additional_requirements_ptr()->begin(), other.additional_requirements_ptr()->end(),
- additional_requirements->back_inserter());
- }
-
- PartiallyMadePackageDepSpecData(const PartiallyMadePackageDepSpecData & other) :
- PackageDepSpecData(other),
- package(other.package),
- package_name_part(other.package_name_part),
- category_name_part(other.category_name_part),
- version_requirements(other.version_requirements),
- version_requirements_mode_v(other.version_requirements_mode_v),
- slot(other.slot),
- in_repository(other.in_repository),
- from_repository(other.from_repository),
- installable_to_repository(other.installable_to_repository),
- installed_at_path(other.installed_at_path),
- installable_to_path(other.installable_to_path),
- additional_requirements(other.additional_requirements),
- annotations(other.annotations),
- options_for_partially_made_package_dep_spec_v(other.options_for_partially_made_package_dep_spec_v)
- {
- }
-
- virtual std::string as_string() const
- {
- std::ostringstream s;
-
- if (version_requirements_ptr())
- {
- if (version_requirements_ptr()->begin() == version_requirements_ptr()->end())
- {
- }
- else if (next(version_requirements_ptr()->begin()) == version_requirements_ptr()->end() &&
- ! options_for_partially_made_package_dep_spec_v[pmpdso_always_use_ranged_deps])
- {
- if (version_requirements_ptr()->begin()->version_operator() == vo_stupid_equal_star || version_requirements_ptr()->begin()->version_operator() == vo_nice_equal_star)
- s << "=";
- else
- s << version_requirements_ptr()->begin()->version_operator();
- }
- }
-
- if (package_ptr())
- s << *package_ptr();
- else
- {
- if (category_name_part_ptr())
- s << *category_name_part_ptr();
- else
- s << "*";
-
- s << "/";
-
- if (package_name_part_ptr())
- s << *package_name_part_ptr();
- else
- s << "*";
- }
-
- if (version_requirements_ptr())
- {
- if (version_requirements_ptr()->begin() == version_requirements_ptr()->end())
- {
- }
- else if (next(version_requirements_ptr()->begin()) == version_requirements_ptr()->end() &&
- ! options_for_partially_made_package_dep_spec_v[pmpdso_always_use_ranged_deps])
- {
- s << "-" << version_requirements_ptr()->begin()->version_spec();
- if (version_requirements_ptr()->begin()->version_operator() == vo_stupid_equal_star || version_requirements_ptr()->begin()->version_operator() == vo_nice_equal_star)
- s << "*";
- }
- }
-
- if (slot_requirement_ptr())
- s << stringify(*slot_requirement_ptr());
-
- std::string left, right;
- bool need_arrow(false);
-
- if (from_repository_ptr())
- left = stringify(*from_repository_ptr());
-
- if (in_repository_ptr())
- right = stringify(*in_repository_ptr());
-
- if (installed_at_path_ptr())
- {
- if (! right.empty())
- {
- need_arrow = true;
- right.append("->");
- }
- right.append(stringify(*installed_at_path_ptr()));
- }
-
- if (installable_to_repository_ptr())
- {
- if (! right.empty())
- {
- need_arrow = true;
- right.append("->");
- }
- if (installable_to_repository_ptr()->include_masked())
- right.append(stringify(installable_to_repository_ptr()->repository()) + "??");
- else
- right.append(stringify(installable_to_repository_ptr()->repository()) + "?");
- }
-
- if (installable_to_path_ptr())
- {
- if (! right.empty())
- {
- need_arrow = true;
- right.append("->");
- }
- if (installable_to_path_ptr()->include_masked())
- right.append(stringify(installable_to_path_ptr()->path()) + "??");
- else
- right.append(stringify(installable_to_path_ptr()->path()) + "?");
- }
-
- if (need_arrow || ((! left.empty()) && (! right.empty())))
- s << "::" << left << "->" << right;
- else if (! right.empty())
- s << "::" << right;
- else if (! left.empty())
- s << "::" << left << "->";
-
- if (version_requirements_ptr())
- {
- if (version_requirements_ptr()->begin() == version_requirements_ptr()->end())
- {
- }
- else if (next(version_requirements_ptr()->begin()) == version_requirements_ptr()->end() &&
- ! options_for_partially_made_package_dep_spec_v[pmpdso_always_use_ranged_deps])
- {
- }
- else
- {
- bool need_op(false);
- s << "[";
- for (VersionRequirements::ConstIterator r(version_requirements_ptr()->begin()),
- r_end(version_requirements_ptr()->end()) ; r != r_end ; ++r)
- {
- if (need_op)
- {
- do
- {
- switch (version_requirements_mode())
- {
- case vr_and:
- s << "&";
- continue;
-
- case vr_or:
- s << "|";
- continue;
-
- case last_vr:
- ;
- }
- throw InternalError(PALUDIS_HERE, "Bad version_requirements_mode");
- } while (false);
- }
-
- if (r->version_operator() == vo_stupid_equal_star || r->version_operator() == vo_nice_equal_star)
- s << "=";
- else
- s << r->version_operator();
-
- s << r->version_spec();
-
- if (r->version_operator() == vo_stupid_equal_star || r->version_operator() == vo_nice_equal_star)
- s << "*";
-
- need_op = true;
- }
- s << "]";
- }
- }
-
- if (additional_requirements_ptr())
- for (AdditionalPackageDepSpecRequirements::ConstIterator u(additional_requirements_ptr()->begin()),
- u_end(additional_requirements_ptr()->end()) ; u != u_end ; ++u)
- s << (*u)->as_raw_string();
-
- return s.str();
- }
-
- virtual std::shared_ptr<const QualifiedPackageName> package_ptr() const
- {
- return package;
- }
-
- virtual std::shared_ptr<const PackageNamePart> package_name_part_ptr() const
- {
- return package_name_part;
- }
-
- virtual std::shared_ptr<const CategoryNamePart> category_name_part_ptr() const
- {
- return category_name_part;
- }
-
- virtual std::shared_ptr<const VersionRequirements> version_requirements_ptr() const
- {
- return version_requirements;
- }
-
- virtual VersionRequirementsMode version_requirements_mode() const
- {
- return version_requirements_mode_v;
- }
-
- virtual std::shared_ptr<const SlotRequirement> slot_requirement_ptr() const
- {
- return slot;
- }
-
- virtual std::shared_ptr<const RepositoryName> in_repository_ptr() const
- {
- return in_repository;
- }
-
- virtual std::shared_ptr<const InstallableToRepository> installable_to_repository_ptr() const
- {
- return installable_to_repository;
- }
-
- virtual std::shared_ptr<const RepositoryName> from_repository_ptr() const
- {
- return from_repository;
- }
-
- virtual std::shared_ptr<const FSEntry> installed_at_path_ptr() const
- {
- return installed_at_path;
- }
-
- virtual std::shared_ptr<const InstallableToPath> installable_to_path_ptr() const
- {
- return installable_to_path;
- }
-
- virtual std::shared_ptr<const AdditionalPackageDepSpecRequirements> additional_requirements_ptr() const
- {
- return additional_requirements;
- }
-
- virtual std::shared_ptr<const MetadataSectionKey> annotations_key() const
- {
- return annotations;
- }
-
- virtual const PartiallyMadePackageDepSpecOptions options_for_partially_made_package_dep_spec() const
- {
- return options_for_partially_made_package_dep_spec_v;
- }
- };
-}
-
-namespace paludis
-{
- template <>
- struct Imp<PartiallyMadePackageDepSpec>
- {
- std::shared_ptr<PartiallyMadePackageDepSpecData> data;
-
- Imp(const PartiallyMadePackageDepSpecOptions & o) :
- data(std::make_shared<PartiallyMadePackageDepSpecData>(o))
- {
- }
-
- Imp(const Imp & other) :
- data(std::make_shared<PartiallyMadePackageDepSpecData>(*other.data))
- {
- }
-
- Imp(const PackageDepSpec & other) :
- data(std::make_shared<PartiallyMadePackageDepSpecData>(*other.data()))
- {
- }
- };
-}
-
-PartiallyMadePackageDepSpec::PartiallyMadePackageDepSpec(const PartiallyMadePackageDepSpecOptions & o) :
- Pimp<PartiallyMadePackageDepSpec>(o)
-{
-}
-
-PartiallyMadePackageDepSpec::PartiallyMadePackageDepSpec(const PartiallyMadePackageDepSpec & other) :
- Pimp<PartiallyMadePackageDepSpec>(*other._imp.get())
-{
-}
-
-PartiallyMadePackageDepSpec::PartiallyMadePackageDepSpec(const PackageDepSpec & other) :
- Pimp<PartiallyMadePackageDepSpec>(other)
-{
-}
-
-PartiallyMadePackageDepSpec::~PartiallyMadePackageDepSpec()
-{
-}
-
-PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::package(const QualifiedPackageName & name)
-{
- _imp->data->package = std::make_shared<QualifiedPackageName>(name);
- return *this;
-}
-
-PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::slot_requirement(const std::shared_ptr<const SlotRequirement> & s)
-{
- _imp->data->slot = s;
- return *this;
-}
-
-PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::in_repository(const RepositoryName & s)
-{
- _imp->data->in_repository = std::make_shared<RepositoryName>(s);
- return *this;
-}
-
-PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::from_repository(const RepositoryName & s)
-{
- _imp->data->from_repository = std::make_shared<RepositoryName>(s);
- return *this;
-}
-
-PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::installable_to_repository(const InstallableToRepository & s)
-{
- _imp->data->installable_to_repository = std::make_shared<InstallableToRepository>(s);
- return *this;
-}
-
-PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::installed_at_path(const FSEntry & s)
-{
- _imp->data->installed_at_path = std::make_shared<FSEntry>(s);
- return *this;
-}
-
-PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::installable_to_path(const InstallableToPath & s)
-{
- _imp->data->installable_to_path = std::make_shared<InstallableToPath>(s);
- return *this;
-}
-
-PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::package_name_part(const PackageNamePart & part)
-{
- _imp->data->package_name_part = std::make_shared<PackageNamePart>(part);
- return *this;
-}
-
-PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::category_name_part(const CategoryNamePart & part)
-{
- _imp->data->category_name_part = std::make_shared<CategoryNamePart>(part);
- return *this;
-}
-
-PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::version_requirement(const VersionRequirement & req)
-{
- if (! _imp->data->version_requirements)
- _imp->data->version_requirements = std::make_shared<VersionRequirements>();
- _imp->data->version_requirements->push_back(req);
- return *this;
-}
-
-PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::version_requirements_mode(const VersionRequirementsMode & mode)
-{
- _imp->data->version_requirements_mode_v = mode;
- return *this;
-}
-
-PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::additional_requirement(const std::shared_ptr<const AdditionalPackageDepSpecRequirement> & req)
-{
- if (! _imp->data->additional_requirements)
- _imp->data->additional_requirements = std::make_shared<AdditionalPackageDepSpecRequirements>();
- _imp->data->additional_requirements->push_back(req);
- return *this;
-}
-
-PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::clear_additional_requirements()
-{
- _imp->data->additional_requirements.reset();
- return *this;
-}
-
-PartiallyMadePackageDepSpec &
-PartiallyMadePackageDepSpec::annotations(const std::shared_ptr<const MetadataSectionKey> & a)
-{
- _imp->data->annotations = a;
- return *this;
-}
-
-PartiallyMadePackageDepSpec::operator const PackageDepSpec() const
-{
- return PackageDepSpec(_imp->data);
-}
-
-const PackageDepSpec
-PartiallyMadePackageDepSpec::to_package_dep_spec() const
-{
- return operator const PackageDepSpec();
-}
-
template class LabelsDepSpec<URILabel>;
template class LabelsDepSpec<DependenciesLabel>;
template class Cloneable<DepSpec>;
template class Pimp<ConditionalDepSpec>;
template class CloneUsingThis<DepSpec, ConditionalDepSpec>;
-template class Pimp<PartiallyMadePackageDepSpec>;
template class Pimp<PackageDepSpec>;
template class CloneUsingThis<DepSpec, PackageDepSpec>;
template class Pimp<URILabelsDepSpec>;
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index 610b6cc..ece18cb 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -40,6 +40,7 @@
#include <paludis/package_id-fwd.hh>
#include <paludis/environment-fwd.hh>
#include <paludis/additional_package_dep_spec_requirement-fwd.hh>
+#include <paludis/partially_made_package_dep_spec-fwd.hh>
#include <memory>
#include <functional>
@@ -316,118 +317,6 @@ namespace paludis
};
/**
- * A PartiallyMadePackageDepSpec is returned by make_package_dep_spec()
- * and is used to incrementally build a PackageDepSpec.
- *
- * \ingroup g_dep_spec
- * \since 0.26
- */
- class PALUDIS_VISIBLE PartiallyMadePackageDepSpec :
- private Pimp<PartiallyMadePackageDepSpec>
- {
- public:
- ///\name Basic operations
- ///\{
-
- PartiallyMadePackageDepSpec(const PartiallyMadePackageDepSpecOptions &);
- ~PartiallyMadePackageDepSpec();
- PartiallyMadePackageDepSpec(const PackageDepSpec &);
- PartiallyMadePackageDepSpec(const PartiallyMadePackageDepSpec &);
-
- ///\}
-
- /**
- * Set our package requirements, return ourself.
- */
- PartiallyMadePackageDepSpec & package(const QualifiedPackageName &);
-
- /**
- * Set our slot requirements, return ourself.
- */
- PartiallyMadePackageDepSpec & slot_requirement(const std::shared_ptr<const SlotRequirement> &);
-
- /**
- * Set our in-repository requirement, return ourself.
- */
- PartiallyMadePackageDepSpec & in_repository(const RepositoryName &);
-
- /**
- * Set our from-repository requirement, return ourself.
- */
- PartiallyMadePackageDepSpec & from_repository(const RepositoryName &);
-
- /**
- * Set our installable-to-repository requirement, return ourself.
- *
- * \since 0.32
- */
- PartiallyMadePackageDepSpec & installable_to_repository(const InstallableToRepository &);
-
- /**
- * Set our installed-at-path requirement, return ourself.
- *
- * \since 0.32
- */
- PartiallyMadePackageDepSpec & installed_at_path(const FSEntry &);
-
- /**
- * Set our installable-to-path requirement, return ourself.
- *
- * \since 0.32
- */
- PartiallyMadePackageDepSpec & installable_to_path(const InstallableToPath &);
-
- /**
- * Set our package name part requirements, return ourself.
- */
- PartiallyMadePackageDepSpec & package_name_part(const PackageNamePart &);
-
- /**
- * Set our category name part requirements, return ourself.
- */
- PartiallyMadePackageDepSpec & category_name_part(const CategoryNamePart &);
-
- /**
- * Add a version requirement, return ourself.
- */
- PartiallyMadePackageDepSpec & version_requirement(const VersionRequirement &);
-
- /**
- * Set our version requirements mode, return ourself.
- */
- PartiallyMadePackageDepSpec & version_requirements_mode(const VersionRequirementsMode &);
-
- /**
- * Add an additional requirement, return ourself.
- */
- PartiallyMadePackageDepSpec & additional_requirement(
- const std::shared_ptr<const AdditionalPackageDepSpecRequirement> &);
-
- /**
- * Clear additional requirements, return ourself.
- *
- * \since 0.41
- */
- PartiallyMadePackageDepSpec & clear_additional_requirements();
-
- /**
- * Add annotations
- */
- PartiallyMadePackageDepSpec & annotations(
- const std::shared_ptr<const MetadataSectionKey> &);
-
- /**
- * Turn ourselves into a PackageDepSpec.
- */
- operator const PackageDepSpec() const;
-
- /**
- * Explicitly turn ourselves into a PackageDepSpec.
- */
- const PackageDepSpec to_package_dep_spec() const;
- };
-
- /**
* A PackageDepSpec represents a package name (for example,
* 'app-editors/vim'), possibly with associated version and SLOT
* restrictions.
@@ -949,7 +838,6 @@ namespace paludis
extern template class Cloneable<DepSpec>;
extern template class Pimp<ConditionalDepSpec>;
extern template class CloneUsingThis<DepSpec, ConditionalDepSpec>;
- extern template class Pimp<PartiallyMadePackageDepSpec>;
extern template class Pimp<PackageDepSpec>;
extern template class CloneUsingThis<DepSpec, PackageDepSpec>;
extern template class Pimp<DependenciesLabelsDepSpec>;
diff --git a/paludis/dep_spec_flattener.cc b/paludis/dep_spec_flattener.cc
index 603b014..bf9835b 100644
--- a/paludis/dep_spec_flattener.cc
+++ b/paludis/dep_spec_flattener.cc
@@ -25,6 +25,7 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/repository.hh>
#include <list>
#include <algorithm>
diff --git a/paludis/elike_package_dep_spec-fwd.hh b/paludis/elike_package_dep_spec-fwd.hh
index bdbb09f..345c257 100644
--- a/paludis/elike_package_dep_spec-fwd.hh
+++ b/paludis/elike_package_dep_spec-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 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
@@ -26,6 +26,7 @@
#include <paludis/package_id-fwd.hh>
#include <paludis/version_operator-fwd.hh>
#include <paludis/version_spec-fwd.hh>
+#include <paludis/partially_made_package_dep_spec-fwd.hh>
#include <functional>
#include <iosfwd>
diff --git a/paludis/elike_package_dep_spec.cc b/paludis/elike_package_dep_spec.cc
index af9a802..8d2c841 100644
--- a/paludis/elike_package_dep_spec.cc
+++ b/paludis/elike_package_dep_spec.cc
@@ -28,6 +28,7 @@
#include <paludis/version_spec.hh>
#include <paludis/version_requirements.hh>
#include <paludis/user_dep_spec.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <strings.h>
using namespace paludis;
diff --git a/paludis/environments/paludis/world.cc b/paludis/environments/paludis/world.cc
index 3304a33..714f185 100644
--- a/paludis/environments/paludis/world.cc
+++ b/paludis/environments/paludis/world.cc
@@ -28,6 +28,7 @@
#include <paludis/set_file.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/dep_tag.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <functional>
using namespace paludis;
diff --git a/paludis/environments/paludis/world_TEST.cc b/paludis/environments/paludis/world_TEST.cc
index 64ea589..181f3bb 100644
--- a/paludis/environments/paludis/world_TEST.cc
+++ b/paludis/environments/paludis/world_TEST.cc
@@ -22,6 +22,7 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/options.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <iterator>
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index c376dc5..1221bc2 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -51,6 +51,7 @@
#include <paludis/literal_metadata_key.hh>
#include <paludis/repository_factory.hh>
#include <paludis/choice.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <functional>
#include <algorithm>
#include <set>
diff --git a/paludis/environments/portage/portage_environment_TEST.cc b/paludis/environments/portage/portage_environment_TEST.cc
index c18ca1f..b8e8067 100644
--- a/paludis/environments/portage/portage_environment_TEST.cc
+++ b/paludis/environments/portage/portage_environment_TEST.cc
@@ -35,6 +35,7 @@
#include <paludis/selection.hh>
#include <paludis/metadata_key.hh>
#include <paludis/choice.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
diff --git a/paludis/files.m4 b/paludis/files.m4
index b6a9f1b..b803fea 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -27,7 +27,7 @@ add(`dep_label', `hh', `cc', `fwd')
add(`dep_list', `hh', `cc', `fwd', `test')
add(`dep_list_exceptions', `hh', `cc')
add(`dep_list_options', `hh', `cc', `se')
-add(`dep_spec', `hh', `cc', `test', `fwd', `se')
+add(`dep_spec', `hh', `cc', `test', `fwd')
add(`dep_spec_flattener', `hh', `cc')
add(`dep_tag', `hh', `cc', `fwd')
add(`distribution', `hh', `cc', `impl', `fwd')
@@ -82,6 +82,7 @@ add(`package_dep_spec_properties', `hh', `cc', `fwd')
add(`package_id', `hh', `cc', `fwd', `se')
add(`paludis', `hh')
add(`paludislike_options_conf', `hh', `cc', `fwd')
+add(`partially_made_package_dep_spec', `hh', `cc', `fwd', `se')
add(`query_visitor', `hh', `cc')
add(`range_rewriter', `hh', `cc', `test')
add(`report_task', `hh', `cc')
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index 5957fa9..35d40ef 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -36,6 +36,7 @@
#include <paludis/generator.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/package_dep_spec_properties.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/set-impl.hh>
#include <paludis/util/log.hh>
diff --git a/paludis/ndbam.cc b/paludis/ndbam.cc
index 687f392..2dc6da0 100644
--- a/paludis/ndbam.cc
+++ b/paludis/ndbam.cc
@@ -36,6 +36,7 @@
#include <paludis/name.hh>
#include <paludis/contents.hh>
#include <paludis/literal_metadata_key.hh>
+#include <algorithm>
#include <unordered_map>
#include <functional>
#include <vector>
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index 1ed1316..262e369 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -26,6 +26,7 @@
#include <paludis/generator.hh>
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/util/log.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/stringify.hh>
diff --git a/paludis/partially_made_package_dep_spec-fwd.hh b/paludis/partially_made_package_dep_spec-fwd.hh
new file mode 100644
index 0000000..7a2a465
--- /dev/null
+++ b/paludis/partially_made_package_dep_spec-fwd.hh
@@ -0,0 +1,53 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006, 2007, 2008, 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_PARTIALLY_MADE_PACKAGE_DEP_SPEC_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_PARTIALLY_MADE_PACKAGE_DEP_SPEC_FWD_HH 1
+
+#include <paludis/util/attributes.hh>
+#include <paludis/util/options-fwd.hh>
+#include <iosfwd>
+
+namespace paludis
+{
+
+#include <paludis/partially_made_package_dep_spec-se.hh>
+
+ /**
+ * Options for PartiallyMadePackageDepSpec.
+ *
+ * \ingroup g_dep_spec
+ * \since 0.38
+ */
+ typedef Options<PartiallyMadePackageDepSpecOption> PartiallyMadePackageDepSpecOptions;
+
+ class PartiallyMadePackageDepSpec;
+
+ /**
+ * Create a PackageDepSpec from various rules.
+ *
+ * Note the return type is a PartiallyMadePackageDepSpec, which is implicitly convertible to
+ * a PackageDepSpec.
+ *
+ * \ingroup g_dep_spec
+ * \since 0.26
+ */
+ PartiallyMadePackageDepSpec make_package_dep_spec(const PartiallyMadePackageDepSpecOptions &) PALUDIS_VISIBLE;
+}
+
+#endif
diff --git a/paludis/partially_made_package_dep_spec.cc b/paludis/partially_made_package_dep_spec.cc
new file mode 100644
index 0000000..4d32c18
--- /dev/null
+++ b/paludis/partially_made_package_dep_spec.cc
@@ -0,0 +1,511 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006, 2007, 2008, 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/partially_made_package_dep_spec.hh>
+#include <paludis/util/stringify.hh>
+#include <paludis/util/exception.hh>
+#include <paludis/util/options.hh>
+#include <paludis/util/wrapped_output_iterator-impl.hh>
+#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/pimp-impl.hh>
+#include <paludis/util/sequence-impl.hh>
+#include <paludis/version_requirements.hh>
+#include <paludis/additional_package_dep_spec_requirement.hh>
+#include <iterator>
+#include <algorithm>
+#include <ostream>
+
+using namespace paludis;
+
+#include <paludis/partially_made_package_dep_spec-se.cc>
+
+PartiallyMadePackageDepSpec
+paludis::make_package_dep_spec(const PartiallyMadePackageDepSpecOptions & o)
+{
+ return PartiallyMadePackageDepSpec(o);
+}
+
+namespace
+{
+ struct PartiallyMadePackageDepSpecData :
+ PackageDepSpecData
+ {
+ std::shared_ptr<const QualifiedPackageName> package;
+ std::shared_ptr<const PackageNamePart> package_name_part;
+ std::shared_ptr<const CategoryNamePart> category_name_part;
+ std::shared_ptr<VersionRequirements> version_requirements;
+ VersionRequirementsMode version_requirements_mode_v;
+ std::shared_ptr<const SlotRequirement> slot;
+ std::shared_ptr<const RepositoryName> in_repository;
+ std::shared_ptr<const RepositoryName> from_repository;
+ std::shared_ptr<const InstallableToRepository> installable_to_repository;
+ std::shared_ptr<const FSEntry> installed_at_path;
+ std::shared_ptr<const InstallableToPath> installable_to_path;
+ std::shared_ptr<AdditionalPackageDepSpecRequirements> additional_requirements;
+ std::shared_ptr<const MetadataSectionKey> annotations;
+ PartiallyMadePackageDepSpecOptions options_for_partially_made_package_dep_spec_v;
+
+ PartiallyMadePackageDepSpecData(const PartiallyMadePackageDepSpecOptions & o) :
+ PackageDepSpecData(),
+ version_requirements_mode_v(vr_and),
+ options_for_partially_made_package_dep_spec_v(o)
+ {
+ }
+
+ PartiallyMadePackageDepSpecData(const PackageDepSpecData & other) :
+ PackageDepSpecData(other),
+ package(other.package_ptr()),
+ package_name_part(other.package_name_part_ptr()),
+ category_name_part(other.category_name_part_ptr()),
+ version_requirements(other.version_requirements_ptr() ? new VersionRequirements : 0),
+ version_requirements_mode_v(other.version_requirements_mode()),
+ slot(other.slot_requirement_ptr()),
+ in_repository(other.in_repository_ptr()),
+ from_repository(other.from_repository_ptr()),
+ installable_to_repository(other.installable_to_repository_ptr()),
+ installed_at_path(other.installed_at_path_ptr()),
+ installable_to_path(other.installable_to_path_ptr()),
+ additional_requirements(other.additional_requirements_ptr() ? new AdditionalPackageDepSpecRequirements : 0),
+ annotations(other.annotations_key()),
+ options_for_partially_made_package_dep_spec_v(other.options_for_partially_made_package_dep_spec())
+ {
+ if (version_requirements)
+ std::copy(other.version_requirements_ptr()->begin(), other.version_requirements_ptr()->end(),
+ version_requirements->back_inserter());
+
+ if (additional_requirements)
+ std::copy(other.additional_requirements_ptr()->begin(), other.additional_requirements_ptr()->end(),
+ additional_requirements->back_inserter());
+ }
+
+ PartiallyMadePackageDepSpecData(const PartiallyMadePackageDepSpecData & other) :
+ PackageDepSpecData(other),
+ package(other.package),
+ package_name_part(other.package_name_part),
+ category_name_part(other.category_name_part),
+ version_requirements(other.version_requirements),
+ version_requirements_mode_v(other.version_requirements_mode_v),
+ slot(other.slot),
+ in_repository(other.in_repository),
+ from_repository(other.from_repository),
+ installable_to_repository(other.installable_to_repository),
+ installed_at_path(other.installed_at_path),
+ installable_to_path(other.installable_to_path),
+ additional_requirements(other.additional_requirements),
+ annotations(other.annotations),
+ options_for_partially_made_package_dep_spec_v(other.options_for_partially_made_package_dep_spec_v)
+ {
+ }
+
+ virtual std::string as_string() const
+ {
+ std::ostringstream s;
+
+ if (version_requirements_ptr())
+ {
+ if (version_requirements_ptr()->begin() == version_requirements_ptr()->end())
+ {
+ }
+ else if (next(version_requirements_ptr()->begin()) == version_requirements_ptr()->end() &&
+ ! options_for_partially_made_package_dep_spec_v[pmpdso_always_use_ranged_deps])
+ {
+ if (version_requirements_ptr()->begin()->version_operator() == vo_stupid_equal_star || version_requirements_ptr()->begin()->version_operator() == vo_nice_equal_star)
+ s << "=";
+ else
+ s << version_requirements_ptr()->begin()->version_operator();
+ }
+ }
+
+ if (package_ptr())
+ s << *package_ptr();
+ else
+ {
+ if (category_name_part_ptr())
+ s << *category_name_part_ptr();
+ else
+ s << "*";
+
+ s << "/";
+
+ if (package_name_part_ptr())
+ s << *package_name_part_ptr();
+ else
+ s << "*";
+ }
+
+ if (version_requirements_ptr())
+ {
+ if (version_requirements_ptr()->begin() == version_requirements_ptr()->end())
+ {
+ }
+ else if (next(version_requirements_ptr()->begin()) == version_requirements_ptr()->end() &&
+ ! options_for_partially_made_package_dep_spec_v[pmpdso_always_use_ranged_deps])
+ {
+ s << "-" << version_requirements_ptr()->begin()->version_spec();
+ if (version_requirements_ptr()->begin()->version_operator() == vo_stupid_equal_star || version_requirements_ptr()->begin()->version_operator() == vo_nice_equal_star)
+ s << "*";
+ }
+ }
+
+ if (slot_requirement_ptr())
+ s << stringify(*slot_requirement_ptr());
+
+ std::string left, right;
+ bool need_arrow(false);
+
+ if (from_repository_ptr())
+ left = stringify(*from_repository_ptr());
+
+ if (in_repository_ptr())
+ right = stringify(*in_repository_ptr());
+
+ if (installed_at_path_ptr())
+ {
+ if (! right.empty())
+ {
+ need_arrow = true;
+ right.append("->");
+ }
+ right.append(stringify(*installed_at_path_ptr()));
+ }
+
+ if (installable_to_repository_ptr())
+ {
+ if (! right.empty())
+ {
+ need_arrow = true;
+ right.append("->");
+ }
+ if (installable_to_repository_ptr()->include_masked())
+ right.append(stringify(installable_to_repository_ptr()->repository()) + "??");
+ else
+ right.append(stringify(installable_to_repository_ptr()->repository()) + "?");
+ }
+
+ if (installable_to_path_ptr())
+ {
+ if (! right.empty())
+ {
+ need_arrow = true;
+ right.append("->");
+ }
+ if (installable_to_path_ptr()->include_masked())
+ right.append(stringify(installable_to_path_ptr()->path()) + "??");
+ else
+ right.append(stringify(installable_to_path_ptr()->path()) + "?");
+ }
+
+ if (need_arrow || ((! left.empty()) && (! right.empty())))
+ s << "::" << left << "->" << right;
+ else if (! right.empty())
+ s << "::" << right;
+ else if (! left.empty())
+ s << "::" << left << "->";
+
+ if (version_requirements_ptr())
+ {
+ if (version_requirements_ptr()->begin() == version_requirements_ptr()->end())
+ {
+ }
+ else if (next(version_requirements_ptr()->begin()) == version_requirements_ptr()->end() &&
+ ! options_for_partially_made_package_dep_spec_v[pmpdso_always_use_ranged_deps])
+ {
+ }
+ else
+ {
+ bool need_op(false);
+ s << "[";
+ for (VersionRequirements::ConstIterator r(version_requirements_ptr()->begin()),
+ r_end(version_requirements_ptr()->end()) ; r != r_end ; ++r)
+ {
+ if (need_op)
+ {
+ do
+ {
+ switch (version_requirements_mode())
+ {
+ case vr_and:
+ s << "&";
+ continue;
+
+ case vr_or:
+ s << "|";
+ continue;
+
+ case last_vr:
+ ;
+ }
+ throw InternalError(PALUDIS_HERE, "Bad version_requirements_mode");
+ } while (false);
+ }
+
+ if (r->version_operator() == vo_stupid_equal_star || r->version_operator() == vo_nice_equal_star)
+ s << "=";
+ else
+ s << r->version_operator();
+
+ s << r->version_spec();
+
+ if (r->version_operator() == vo_stupid_equal_star || r->version_operator() == vo_nice_equal_star)
+ s << "*";
+
+ need_op = true;
+ }
+ s << "]";
+ }
+ }
+
+ if (additional_requirements_ptr())
+ for (AdditionalPackageDepSpecRequirements::ConstIterator u(additional_requirements_ptr()->begin()),
+ u_end(additional_requirements_ptr()->end()) ; u != u_end ; ++u)
+ s << (*u)->as_raw_string();
+
+ return s.str();
+ }
+
+ virtual std::shared_ptr<const QualifiedPackageName> package_ptr() const
+ {
+ return package;
+ }
+
+ virtual std::shared_ptr<const PackageNamePart> package_name_part_ptr() const
+ {
+ return package_name_part;
+ }
+
+ virtual std::shared_ptr<const CategoryNamePart> category_name_part_ptr() const
+ {
+ return category_name_part;
+ }
+
+ virtual std::shared_ptr<const VersionRequirements> version_requirements_ptr() const
+ {
+ return version_requirements;
+ }
+
+ virtual VersionRequirementsMode version_requirements_mode() const
+ {
+ return version_requirements_mode_v;
+ }
+
+ virtual std::shared_ptr<const SlotRequirement> slot_requirement_ptr() const
+ {
+ return slot;
+ }
+
+ virtual std::shared_ptr<const RepositoryName> in_repository_ptr() const
+ {
+ return in_repository;
+ }
+
+ virtual std::shared_ptr<const InstallableToRepository> installable_to_repository_ptr() const
+ {
+ return installable_to_repository;
+ }
+
+ virtual std::shared_ptr<const RepositoryName> from_repository_ptr() const
+ {
+ return from_repository;
+ }
+
+ virtual std::shared_ptr<const FSEntry> installed_at_path_ptr() const
+ {
+ return installed_at_path;
+ }
+
+ virtual std::shared_ptr<const InstallableToPath> installable_to_path_ptr() const
+ {
+ return installable_to_path;
+ }
+
+ virtual std::shared_ptr<const AdditionalPackageDepSpecRequirements> additional_requirements_ptr() const
+ {
+ return additional_requirements;
+ }
+
+ virtual std::shared_ptr<const MetadataSectionKey> annotations_key() const
+ {
+ return annotations;
+ }
+
+ virtual const PartiallyMadePackageDepSpecOptions options_for_partially_made_package_dep_spec() const
+ {
+ return options_for_partially_made_package_dep_spec_v;
+ }
+ };
+}
+
+namespace paludis
+{
+ template <>
+ struct Imp<PartiallyMadePackageDepSpec>
+ {
+ std::shared_ptr<PartiallyMadePackageDepSpecData> data;
+
+ Imp(const PartiallyMadePackageDepSpecOptions & o) :
+ data(std::make_shared<PartiallyMadePackageDepSpecData>(o))
+ {
+ }
+
+ Imp(const Imp & other) :
+ data(std::make_shared<PartiallyMadePackageDepSpecData>(*other.data))
+ {
+ }
+
+ Imp(const PackageDepSpec & other) :
+ data(std::make_shared<PartiallyMadePackageDepSpecData>(*other.data()))
+ {
+ }
+ };
+}
+
+PartiallyMadePackageDepSpec::PartiallyMadePackageDepSpec(const PartiallyMadePackageDepSpecOptions & o) :
+ Pimp<PartiallyMadePackageDepSpec>(o)
+{
+}
+
+PartiallyMadePackageDepSpec::PartiallyMadePackageDepSpec(const PartiallyMadePackageDepSpec & other) :
+ Pimp<PartiallyMadePackageDepSpec>(*other._imp.get())
+{
+}
+
+PartiallyMadePackageDepSpec::PartiallyMadePackageDepSpec(const PackageDepSpec & other) :
+ Pimp<PartiallyMadePackageDepSpec>(other)
+{
+}
+
+PartiallyMadePackageDepSpec::~PartiallyMadePackageDepSpec()
+{
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::package(const QualifiedPackageName & name)
+{
+ _imp->data->package = std::make_shared<QualifiedPackageName>(name);
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::slot_requirement(const std::shared_ptr<const SlotRequirement> & s)
+{
+ _imp->data->slot = s;
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::in_repository(const RepositoryName & s)
+{
+ _imp->data->in_repository = std::make_shared<RepositoryName>(s);
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::from_repository(const RepositoryName & s)
+{
+ _imp->data->from_repository = std::make_shared<RepositoryName>(s);
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::installable_to_repository(const InstallableToRepository & s)
+{
+ _imp->data->installable_to_repository = std::make_shared<InstallableToRepository>(s);
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::installed_at_path(const FSEntry & s)
+{
+ _imp->data->installed_at_path = std::make_shared<FSEntry>(s);
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::installable_to_path(const InstallableToPath & s)
+{
+ _imp->data->installable_to_path = std::make_shared<InstallableToPath>(s);
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::package_name_part(const PackageNamePart & part)
+{
+ _imp->data->package_name_part = std::make_shared<PackageNamePart>(part);
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::category_name_part(const CategoryNamePart & part)
+{
+ _imp->data->category_name_part = std::make_shared<CategoryNamePart>(part);
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::version_requirement(const VersionRequirement & req)
+{
+ if (! _imp->data->version_requirements)
+ _imp->data->version_requirements = std::make_shared<VersionRequirements>();
+ _imp->data->version_requirements->push_back(req);
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::version_requirements_mode(const VersionRequirementsMode & mode)
+{
+ _imp->data->version_requirements_mode_v = mode;
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::additional_requirement(const std::shared_ptr<const AdditionalPackageDepSpecRequirement> & req)
+{
+ if (! _imp->data->additional_requirements)
+ _imp->data->additional_requirements = std::make_shared<AdditionalPackageDepSpecRequirements>();
+ _imp->data->additional_requirements->push_back(req);
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::clear_additional_requirements()
+{
+ _imp->data->additional_requirements.reset();
+ return *this;
+}
+
+PartiallyMadePackageDepSpec &
+PartiallyMadePackageDepSpec::annotations(const std::shared_ptr<const MetadataSectionKey> & a)
+{
+ _imp->data->annotations = a;
+ return *this;
+}
+
+PartiallyMadePackageDepSpec::operator const PackageDepSpec() const
+{
+ return PackageDepSpec(_imp->data);
+}
+
+const PackageDepSpec
+PartiallyMadePackageDepSpec::to_package_dep_spec() const
+{
+ return operator const PackageDepSpec();
+}
+
+template class Pimp<PartiallyMadePackageDepSpec>;
+
diff --git a/paludis/partially_made_package_dep_spec.hh b/paludis/partially_made_package_dep_spec.hh
new file mode 100644
index 0000000..e3376e3
--- /dev/null
+++ b/paludis/partially_made_package_dep_spec.hh
@@ -0,0 +1,146 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006, 2007, 2008, 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_PARTIALLY_MADE_PACKAGE_DEP_SPEC_HH
+#define PALUDIS_GUARD_PALUDIS_PARTIALLY_MADE_PACKAGE_DEP_SPEC_HH 1
+
+#include <paludis/partially_made_package_dep_spec-fwd.hh>
+#include <paludis/util/pimp.hh>
+#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/name-fwd.hh>
+#include <paludis/dep_spec.hh>
+
+namespace paludis
+{
+ /**
+ * A PartiallyMadePackageDepSpec is returned by make_package_dep_spec()
+ * and is used to incrementally build a PackageDepSpec.
+ *
+ * \ingroup g_dep_spec
+ * \since 0.26
+ */
+ class PALUDIS_VISIBLE PartiallyMadePackageDepSpec :
+ private Pimp<PartiallyMadePackageDepSpec>
+ {
+ public:
+ ///\name Basic operations
+ ///\{
+
+ PartiallyMadePackageDepSpec(const PartiallyMadePackageDepSpecOptions &);
+ ~PartiallyMadePackageDepSpec();
+ PartiallyMadePackageDepSpec(const PackageDepSpec &);
+ PartiallyMadePackageDepSpec(const PartiallyMadePackageDepSpec &);
+
+ ///\}
+
+ /**
+ * Set our package requirements, return ourself.
+ */
+ PartiallyMadePackageDepSpec & package(const QualifiedPackageName &);
+
+ /**
+ * Set our slot requirements, return ourself.
+ */
+ PartiallyMadePackageDepSpec & slot_requirement(const std::shared_ptr<const SlotRequirement> &);
+
+ /**
+ * Set our in-repository requirement, return ourself.
+ */
+ PartiallyMadePackageDepSpec & in_repository(const RepositoryName &);
+
+ /**
+ * Set our from-repository requirement, return ourself.
+ */
+ PartiallyMadePackageDepSpec & from_repository(const RepositoryName &);
+
+ /**
+ * Set our installable-to-repository requirement, return ourself.
+ *
+ * \since 0.32
+ */
+ PartiallyMadePackageDepSpec & installable_to_repository(const InstallableToRepository &);
+
+ /**
+ * Set our installed-at-path requirement, return ourself.
+ *
+ * \since 0.32
+ */
+ PartiallyMadePackageDepSpec & installed_at_path(const FSEntry &);
+
+ /**
+ * Set our installable-to-path requirement, return ourself.
+ *
+ * \since 0.32
+ */
+ PartiallyMadePackageDepSpec & installable_to_path(const InstallableToPath &);
+
+ /**
+ * Set our package name part requirements, return ourself.
+ */
+ PartiallyMadePackageDepSpec & package_name_part(const PackageNamePart &);
+
+ /**
+ * Set our category name part requirements, return ourself.
+ */
+ PartiallyMadePackageDepSpec & category_name_part(const CategoryNamePart &);
+
+ /**
+ * Add a version requirement, return ourself.
+ */
+ PartiallyMadePackageDepSpec & version_requirement(const VersionRequirement &);
+
+ /**
+ * Set our version requirements mode, return ourself.
+ */
+ PartiallyMadePackageDepSpec & version_requirements_mode(const VersionRequirementsMode &);
+
+ /**
+ * Add an additional requirement, return ourself.
+ */
+ PartiallyMadePackageDepSpec & additional_requirement(
+ const std::shared_ptr<const AdditionalPackageDepSpecRequirement> &);
+
+ /**
+ * Clear additional requirements, return ourself.
+ *
+ * \since 0.41
+ */
+ PartiallyMadePackageDepSpec & clear_additional_requirements();
+
+ /**
+ * Add annotations
+ */
+ PartiallyMadePackageDepSpec & annotations(
+ const std::shared_ptr<const MetadataSectionKey> &);
+
+ /**
+ * Turn ourselves into a PackageDepSpec.
+ */
+ operator const PackageDepSpec() const;
+
+ /**
+ * Explicitly turn ourselves into a PackageDepSpec.
+ */
+ const PackageDepSpec to_package_dep_spec() const;
+ };
+
+ extern template class Pimp<PartiallyMadePackageDepSpec>;
+}
+
+#endif
diff --git a/paludis/dep_spec.se b/paludis/partially_made_package_dep_spec.se
index ed3550a..ed3550a 100644
--- a/paludis/dep_spec.se
+++ b/paludis/partially_made_package_dep_spec.se
diff --git a/paludis/range_rewriter_TEST.cc b/paludis/range_rewriter_TEST.cc
index 9feb7ad..b2f6181 100644
--- a/paludis/range_rewriter_TEST.cc
+++ b/paludis/range_rewriter_TEST.cc
@@ -22,6 +22,7 @@
#include <paludis/user_dep_spec.hh>
#include <paludis/util/options.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/environments/test/test_environment.hh>
#include <test/test_runner.hh>
diff --git a/paludis/report_task.cc b/paludis/report_task.cc
index 941f6ec..2515e94 100644
--- a/paludis/report_task.cc
+++ b/paludis/report_task.cc
@@ -38,6 +38,7 @@
#include <paludis/util/sequence.hh>
#include <paludis/package_database.hh>
#include <paludis/version_requirements.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <algorithm>
#include <set>
#include <map>
diff --git a/paludis/repositories/accounts/accounts_dep_key.cc b/paludis/repositories/accounts/accounts_dep_key.cc
index 5074531..3b3d15a 100644
--- a/paludis/repositories/accounts/accounts_dep_key.cc
+++ b/paludis/repositories/accounts/accounts_dep_key.cc
@@ -29,6 +29,7 @@
#include <paludis/formatter.hh>
#include <paludis/environment.hh>
#include <paludis/util/pimp-impl.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <sstream>
#include <list>
diff --git a/paludis/repositories/cran/dep_spec_pretty_printer.cc b/paludis/repositories/cran/dep_spec_pretty_printer.cc
index 1520937..de4b349 100644
--- a/paludis/repositories/cran/dep_spec_pretty_printer.cc
+++ b/paludis/repositories/cran/dep_spec_pretty_printer.cc
@@ -23,12 +23,14 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/environment.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/action-fwd.hh>
+#include <algorithm>
#include <ostream>
#include <sstream>
diff --git a/paludis/repositories/e/can_skip_phase.cc b/paludis/repositories/e/can_skip_phase.cc
index b0d8daf..d526312 100644
--- a/paludis/repositories/e/can_skip_phase.cc
+++ b/paludis/repositories/e/can_skip_phase.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 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
@@ -22,6 +22,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/metadata_key.hh>
#include <paludis/dep_spec.hh>
#include <paludis/spec_tree.hh>
diff --git a/paludis/repositories/e/dep_spec_pretty_printer.cc b/paludis/repositories/e/dep_spec_pretty_printer.cc
index fb1feab..f4fe2cf 100644
--- a/paludis/repositories/e/dep_spec_pretty_printer.cc
+++ b/paludis/repositories/e/dep_spec_pretty_printer.cc
@@ -29,6 +29,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/options.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/environment.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
diff --git a/paludis/repositories/e/dependencies_rewriter.cc b/paludis/repositories/e/dependencies_rewriter.cc
index 95543ca..8bd7c4b 100644
--- a/paludis/repositories/e/dependencies_rewriter.cc
+++ b/paludis/repositories/e/dependencies_rewriter.cc
@@ -28,8 +28,10 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/metadata_key.hh>
#include <list>
+#include <algorithm>
using namespace paludis;
using namespace paludis::erepository;
diff --git a/paludis/repositories/e/e_choices_key.cc b/paludis/repositories/e/e_choices_key.cc
index 395249d..90054b6 100644
--- a/paludis/repositories/e/e_choices_key.cc
+++ b/paludis/repositories/e/e_choices_key.cc
@@ -39,6 +39,7 @@
#include <paludis/util/set-impl.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/environment.hh>
#include <paludis/stringify_formatter-impl.hh>
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 0e46838..389b024 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -51,6 +51,7 @@
#include <paludis/dep_spec_flattener.hh>
#include <paludis/literal_metadata_key.hh>
+#include <algorithm>
#include <functional>
#include <list>
#include <vector>
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 8c5c04e..8af0369 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -63,6 +63,7 @@
#include <paludis/repository_name_cache.hh>
#include <paludis/syncer.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/util/cookie.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/create_iterator-impl.hh>
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 836b18a..919b2da 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -50,6 +50,7 @@
#include <test/test_framework.hh>
#include <test/test_runner.hh>
+#include <algorithm>
#include <functional>
#include <set>
#include <string>
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index f32abff..dd4cede 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -24,34 +24,37 @@
#include <paludis/repositories/e/dep_parser.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <paludis/environment.hh>
-#include <paludis/util/config_file.hh>
-#include <paludis/set_file.hh>
+#include <paludis/action-fwd.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/dep_tag.hh>
+#include <paludis/elike_slot_requirement.hh>
+#include <paludis/environment.hh>
+#include <paludis/filter.hh>
+#include <paludis/filtered_generator.hh>
+#include <paludis/generator.hh>
+#include <paludis/metadata_key.hh>
#include <paludis/package_id.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
+#include <paludis/selection.hh>
+#include <paludis/set_file.hh>
+#include <paludis/user_dep_spec.hh>
#include <paludis/version_operator.hh>
#include <paludis/version_requirements.hh>
-#include <paludis/user_dep_spec.hh>
+
+#include <paludis/util/config_file.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/strip.hh>
-#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/tokeniser.hh>
-#include <paludis/util/set.hh>
-#include <paludis/util/sequence.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_null_shared_ptr.hh>
-#include <paludis/dep_spec.hh>
-#include <paludis/elike_slot_requirement.hh>
-#include <paludis/selection.hh>
-#include <paludis/generator.hh>
-#include <paludis/filter.hh>
-#include <paludis/filtered_generator.hh>
-#include <paludis/action-fwd.hh>
-#include <paludis/metadata_key.hh>
+#include <paludis/util/pimp-impl.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/strip.hh>
+#include <paludis/util/tokeniser.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+
#include <functional>
#include <algorithm>
#include <list>
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 6b6b75c..692be43 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -56,9 +56,11 @@
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/singleton-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <set>
#include <iterator>
+#include <algorithm>
using namespace paludis;
using namespace paludis::erepository;
diff --git a/paludis/repositories/e/fetch_visitor.cc b/paludis/repositories/e/fetch_visitor.cc
index e85d4b7..b39c1bc 100644
--- a/paludis/repositories/e/fetch_visitor.cc
+++ b/paludis/repositories/e/fetch_visitor.cc
@@ -35,7 +35,9 @@
#include <paludis/util/join.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/output_manager.hh>
+#include <algorithm>
#include <list>
using namespace paludis;
diff --git a/paludis/repositories/e/fix_locked_dependencies.cc b/paludis/repositories/e/fix_locked_dependencies.cc
index e4a517f..4cfa73f 100644
--- a/paludis/repositories/e/fix_locked_dependencies.cc
+++ b/paludis/repositories/e/fix_locked_dependencies.cc
@@ -25,6 +25,7 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/options.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/dep_spec.hh>
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
@@ -35,6 +36,7 @@
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <functional>
#include <algorithm>
#include <list>
diff --git a/paludis/repositories/e/myoptions_requirements_verifier.cc b/paludis/repositories/e/myoptions_requirements_verifier.cc
index b40473c..5925b48 100644
--- a/paludis/repositories/e/myoptions_requirements_verifier.cc
+++ b/paludis/repositories/e/myoptions_requirements_verifier.cc
@@ -29,6 +29,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/choice.hh>
#include <paludis/metadata_key.hh>
#include <algorithm>
diff --git a/paludis/repositories/e/pretend_fetch_visitor.cc b/paludis/repositories/e/pretend_fetch_visitor.cc
index 48e46f1..9b1f319 100644
--- a/paludis/repositories/e/pretend_fetch_visitor.cc
+++ b/paludis/repositories/e/pretend_fetch_visitor.cc
@@ -30,6 +30,8 @@
#include <paludis/util/log.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
+#include <algorithm>
#include <list>
#include <set>
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 77cef49..51138c9 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -54,7 +54,10 @@
#include <paludis/generator.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/filter.hh>
+#include <paludis/output_manager.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/fast_unique_copy.hh>
#include <paludis/util/mutex.hh>
@@ -73,7 +76,6 @@
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/wrapped_output_iterator.hh>
-#include <paludis/output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/safe_ofstream.hh>
#include <paludis/util/timestamp.hh>
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index 9b9e4c2..9975974 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -27,8 +27,9 @@
#include <paludis/util/options.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/standard_output_manager.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/util/safe_ifstream.hh>
+#include <paludis/standard_output_manager.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
diff --git a/paludis/repositories/fake/dep_parser_TEST.cc b/paludis/repositories/fake/dep_parser_TEST.cc
index 2bbc646..ff738d0 100644
--- a/paludis/repositories/fake/dep_parser_TEST.cc
+++ b/paludis/repositories/fake/dep_parser_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 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
@@ -20,6 +20,7 @@
#include <paludis/repositories/fake/dep_parser.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <sstream>
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 81f6071..03ce38c 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -43,9 +43,11 @@
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <map>
#include <list>
#include <sstream>
+#include <algorithm>
using namespace paludis;
using namespace paludis::fakerepository;
diff --git a/paludis/repositories/unpackaged/installed_repository_TEST.cc b/paludis/repositories/unpackaged/installed_repository_TEST.cc
index 21219a6..5372c63 100644
--- a/paludis/repositories/unpackaged/installed_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/installed_repository_TEST.cc
@@ -29,11 +29,12 @@
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/selection.hh>
+#include <paludis/standard_output_manager.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/join.hh>
#include <paludis/util/options.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/standard_output_manager.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_null_shared_ptr.hh>
#include <test/test_framework.hh>
diff --git a/paludis/repositories/unwritten/unwritten_repository_file.cc b/paludis/repositories/unwritten/unwritten_repository_file.cc
index 9eb04f4..261345a 100644
--- a/paludis/repositories/unwritten/unwritten_repository_file.cc
+++ b/paludis/repositories/unwritten/unwritten_repository_file.cc
@@ -27,6 +27,7 @@
#include <paludis/util/join.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/literal_metadata_key.hh>
@@ -41,6 +42,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <list>
+#include <algorithm>
using namespace paludis;
using namespace paludis::unwritten_repository;
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index f6f6c8f..709a549 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -43,6 +43,7 @@
#include <paludis/generator.hh>
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
using namespace paludis;
using namespace paludis::virtuals;
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 2adc86b..e93014e 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -30,6 +30,7 @@
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/hook.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/util/log.hh>
#include <paludis/util/operators.hh>
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index cab8ce6..9aeb06b 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -44,6 +44,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/environment.hh>
#include <paludis/notifier_callback.hh>
#include <paludis/repository.hh>
@@ -63,6 +64,7 @@
#include <paludis/package_id.hh>
#include <paludis/changed_choices.hh>
#include <paludis/additional_package_dep_spec_requirement.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/util/pimp-impl.hh>
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index a2e1209..cd66363 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -45,6 +45,7 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/tribool.hh>
#include <paludis/util/enum_iterator.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/environment.hh>
#include <paludis/notifier_callback.hh>
#include <paludis/package_id.hh>
diff --git a/paludis/resolver/resolver.cc b/paludis/resolver/resolver.cc
index 59a83b3..52e4b6f 100644
--- a/paludis/resolver/resolver.cc
+++ b/paludis/resolver/resolver.cc
@@ -35,12 +35,14 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/pimp-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/environment.hh>
#include <paludis/notifier_callback.hh>
#include <paludis/spec_tree.hh>
#include <paludis/repository.hh>
-#include <paludis/util/pimp-impl.hh>
+#include <algorithm>
#include <set>
using namespace paludis;
diff --git a/paludis/resolver/resolver_test.cc b/paludis/resolver/resolver_test.cc
index 53cd7ef..12a5682 100644
--- a/paludis/resolver/resolver_test.cc
+++ b/paludis/resolver/resolver_test.cc
@@ -48,6 +48,7 @@
#include <paludis/generator.hh>
#include <paludis/selection.hh>
#include <paludis/elike_slot_requirement.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
diff --git a/paludis/resolver/sanitised_dependencies.cc b/paludis/resolver/sanitised_dependencies.cc
index 34f7367..d88b1bd 100644
--- a/paludis/resolver/sanitised_dependencies.cc
+++ b/paludis/resolver/sanitised_dependencies.cc
@@ -34,6 +34,7 @@
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/log.hh>
#include <paludis/util/map.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/spec_tree.hh>
#include <paludis/slot_requirement.hh>
#include <paludis/metadata_key.hh>
@@ -43,6 +44,7 @@
#include <paludis/serialise-impl.hh>
#include <paludis/environment.hh>
#include <paludis/repository.hh>
+#include <algorithm>
#include <set>
#include <list>
diff --git a/paludis/resolver/spec_rewriter.cc b/paludis/resolver/spec_rewriter.cc
index 3496243..3213764 100644
--- a/paludis/resolver/spec_rewriter.cc
+++ b/paludis/resolver/spec_rewriter.cc
@@ -36,6 +36,7 @@
#include <paludis/filter.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <map>
#include <set>
diff --git a/paludis/set_file.cc b/paludis/set_file.cc
index 1b4bdd6..b944c32 100644
--- a/paludis/set_file.cc
+++ b/paludis/set_file.cc
@@ -34,6 +34,7 @@
#include <paludis/generator.hh>
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <list>
#include <vector>
#include <algorithm>
diff --git a/paludis/set_file_TEST.cc b/paludis/set_file_TEST.cc
index 084cdd9..6fe81a4 100644
--- a/paludis/set_file_TEST.cc
+++ b/paludis/set_file_TEST.cc
@@ -17,17 +17,20 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "set_file.hh"
-#include <test/test_runner.hh>
-#include <test/test_framework.hh>
+#include <paludis/set_file.hh>
+#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/safe_ifstream.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/dep_spec.hh>
#include <paludis/user_dep_spec.hh>
-#include <paludis/environments/test/test_environment.hh>
-#include <paludis/util/safe_ifstream.hh>
-#include <paludis/util/indirect_iterator-impl.hh>
+#include <test/test_runner.hh>
+#include <test/test_framework.hh>
+
+#include <algorithm>
using namespace test;
using namespace paludis;
diff --git a/paludis/show_suggest_visitor.cc b/paludis/show_suggest_visitor.cc
index c8155d3..9348669 100644
--- a/paludis/show_suggest_visitor.cc
+++ b/paludis/show_suggest_visitor.cc
@@ -33,6 +33,8 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/join.hh>
+#include <paludis/util/accept_visitor.hh>
+#include <algorithm>
#include <functional>
#include <set>
#include <list>
diff --git a/paludis/spec_tree.cc b/paludis/spec_tree.cc
index 6fb47ad..cf25e29 100644
--- a/paludis/spec_tree.cc
+++ b/paludis/spec_tree.cc
@@ -21,6 +21,8 @@
#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 <algorithm>
using namespace paludis;
using namespace paludis::spec_tree_internals;
diff --git a/paludis/spec_tree.hh b/paludis/spec_tree.hh
index 9e7b2ad..ab36c10 100644
--- a/paludis/spec_tree.hh
+++ b/paludis/spec_tree.hh
@@ -24,11 +24,8 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/select.hh>
#include <paludis/util/simple_visitor.hh>
-#include <paludis/util/sequence-fwd.hh>
-
#include <paludis/util/sequence.hh>
-#include <paludis/util/accept_visitor.hh>
-#include <algorithm>
+#include <paludis/formatter.hh>
namespace paludis
{
diff --git a/paludis/uninstall_task.cc b/paludis/uninstall_task.cc
index 7dcd3ca..73edda5 100644
--- a/paludis/uninstall_task.cc
+++ b/paludis/uninstall_task.cc
@@ -37,12 +37,14 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/package_database.hh>
#include <paludis/hook.hh>
#include <paludis/dep_tag.hh>
#include <paludis/repository.hh>
#include <paludis/output_manager_from_environment.hh>
#include <paludis/output_manager.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <map>
#include <set>
#include <list>
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index ad76b09..327cea5 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -29,6 +29,7 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/dep_label.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/util/options.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_named_values.hh>
@@ -38,6 +39,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/timestamp.hh>
#include <paludis/util/destringify.hh>
+#include <paludis/util/accept_visitor.hh>
#include <algorithm>
using namespace paludis;
diff --git a/python/dep_spec.cc b/python/dep_spec.cc
index c7a3493..19bc0f8 100644
--- a/python/dep_spec.cc
+++ b/python/dep_spec.cc
@@ -28,15 +28,17 @@
#include <paludis/environment.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/version_requirements.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
+
#include <paludis/util/save.hh>
#include <paludis/util/stringify.hh>
-
#include <paludis/util/clone-impl.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/wrapped_output_iterator-impl.hh>
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <type_traits>
#include <list>
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index 65daf6b..b16ae4b 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -30,6 +30,8 @@
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/accept_visitor.hh>
+#include <algorithm>
#include <list>
#include <ruby.h>
diff --git a/src/clients/adjutrix/downgrade_check.cc b/src/clients/adjutrix/downgrade_check.cc
index 29b83ef..e2822be 100644
--- a/src/clients/adjutrix/downgrade_check.cc
+++ b/src/clients/adjutrix/downgrade_check.cc
@@ -35,6 +35,7 @@
#include <paludis/filtered_generator.hh>
#include <paludis/selection.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <iostream>
#include <vector>
#include <map>
diff --git a/src/clients/adjutrix/find_insecure_packages.cc b/src/clients/adjutrix/find_insecure_packages.cc
index 925858b..6f6d580 100644
--- a/src/clients/adjutrix/find_insecure_packages.cc
+++ b/src/clients/adjutrix/find_insecure_packages.cc
@@ -32,6 +32,7 @@
#include <paludis/filtered_generator.hh>
#include <paludis/selection.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <set>
#include <map>
diff --git a/src/clients/adjutrix/find_reverse_deps.cc b/src/clients/adjutrix/find_reverse_deps.cc
index 8ba03b6..e2c2ac9 100644
--- a/src/clients/adjutrix/find_reverse_deps.cc
+++ b/src/clients/adjutrix/find_reverse_deps.cc
@@ -27,6 +27,7 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/options.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/dep_spec.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/package_id.hh>
diff --git a/src/clients/adjutrix/keywords_graph.cc b/src/clients/adjutrix/keywords_graph.cc
index 7a1f643..9f9bb76 100644
--- a/src/clients/adjutrix/keywords_graph.cc
+++ b/src/clients/adjutrix/keywords_graph.cc
@@ -36,6 +36,8 @@
#include <paludis/filtered_generator.hh>
#include <paludis/selection.hh>
#include <paludis/choice.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
+
#include <functional>
#include <set>
#include <map>
diff --git a/src/clients/appareo/appareo.cc b/src/clients/appareo/appareo.cc
index 9113c5a..60582ef 100644
--- a/src/clients/appareo/appareo.cc
+++ b/src/clients/appareo/appareo.cc
@@ -41,6 +41,7 @@
#include <paludis/util/set.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/package_database.hh>
+#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
diff --git a/src/clients/cave/cmd_fix_linkage.cc b/src/clients/cave/cmd_fix_linkage.cc
index 412a8c8..9c9f679 100644
--- a/src/clients/cave/cmd_fix_linkage.cc
+++ b/src/clients/cave/cmd_fix_linkage.cc
@@ -36,6 +36,7 @@
#include <paludis/notifier_callback.hh>
#include <paludis/version_operator.hh>
#include <paludis/version_requirements.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <iostream>
#include <set>
diff --git a/src/clients/cave/cmd_match.cc b/src/clients/cave/cmd_match.cc
index 881be22..8b40512 100644
--- a/src/clients/cave/cmd_match.cc
+++ b/src/clients/cave/cmd_match.cc
@@ -31,6 +31,7 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/singleton-impl.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/generator.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/filter.hh>
diff --git a/src/clients/cave/cmd_print_set.cc b/src/clients/cave/cmd_print_set.cc
index c336811..af9a12f 100644
--- a/src/clients/cave/cmd_print_set.cc
+++ b/src/clients/cave/cmd_print_set.cc
@@ -32,6 +32,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
+#include <paludis/util/accept_visitor.hh>
#include <cstdlib>
#include <iostream>
#include <algorithm>
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index f2f9f71..1b58fef 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -44,9 +44,11 @@
#include <paludis/util/pretty_print.hh>
#include <paludis/util/timestamp.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/action.hh>
#include <paludis/mask.hh>
#include <paludis/choice.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <cstdlib>
#include <iostream>
#include <algorithm>
diff --git a/src/clients/cave/cmd_uninstall.cc b/src/clients/cave/cmd_uninstall.cc
index 80d889e..72e19f3 100644
--- a/src/clients/cave/cmd_uninstall.cc
+++ b/src/clients/cave/cmd_uninstall.cc
@@ -35,6 +35,7 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
+#include <algorithm>
#include <iostream>
#include <set>
#include <cstdlib>
diff --git a/src/clients/cave/executables_common.cc b/src/clients/cave/executables_common.cc
index a1e52b0..b3ce920 100644
--- a/src/clients/cave/executables_common.cc
+++ b/src/clients/cave/executables_common.cc
@@ -33,6 +33,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/accept_visitor.hh>
#include <algorithm>
#include <set>
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index bfec2cb..f6afd6b 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -78,6 +78,7 @@
#include <paludis/package_dep_spec_properties.hh>
#include <paludis/elike_slot_requirement.hh>
#include <paludis/package_id.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <algorithm>
#include <iostream>
diff --git a/src/clients/inquisitio/do_search.cc b/src/clients/inquisitio/do_search.cc
index cb30866..cd90526 100644
--- a/src/clients/inquisitio/do_search.cc
+++ b/src/clients/inquisitio/do_search.cc
@@ -31,6 +31,7 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/notifier_callback.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/create_iterator-impl.hh>
diff --git a/src/clients/inquisitio/key_extractor.cc b/src/clients/inquisitio/key_extractor.cc
index 4914867..d5af664 100644
--- a/src/clients/inquisitio/key_extractor.cc
+++ b/src/clients/inquisitio/key_extractor.cc
@@ -27,6 +27,7 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/stringify_formatter.hh>
diff --git a/src/clients/instruo/instruo.cc b/src/clients/instruo/instruo.cc
index 285120b..430c597 100644
--- a/src/clients/instruo/instruo.cc
+++ b/src/clients/instruo/instruo.cc
@@ -43,9 +43,11 @@
#include <paludis/util/pretty_print.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/environments/no_config/no_config_environment.hh>
#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
+#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
diff --git a/src/clients/paludis/info.cc b/src/clients/paludis/info.cc
index 10d47c0..fbbdc57 100644
--- a/src/clients/paludis/info.cc
+++ b/src/clients/paludis/info.cc
@@ -31,6 +31,7 @@
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/package_database.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
diff --git a/src/clients/paludis/query.cc b/src/clients/paludis/query.cc
index ba2ca1e..08c7b2a 100644
--- a/src/clients/paludis/query.cc
+++ b/src/clients/paludis/query.cc
@@ -20,13 +20,14 @@
#include <src/output/colour.hh>
#include "query.hh"
#include <src/output/console_query_task.hh>
-#include <functional>
-#include <iomanip>
-#include <iostream>
#include <paludis/paludis.hh>
#include <paludis/fuzzy_finder.hh>
#include <paludis/filter.hh>
#include <string>
+#include <functional>
+#include <iomanip>
+#include <iostream>
+#include <algorithm>
/** \file
* Handle the --query action for the main paludis program.
diff --git a/src/clients/reconcilio/fix_linkage.cc b/src/clients/reconcilio/fix_linkage.cc
index 56666a8..0114893 100644
--- a/src/clients/reconcilio/fix_linkage.cc
+++ b/src/clients/reconcilio/fix_linkage.cc
@@ -35,6 +35,7 @@
#include <paludis/package_id.hh>
#include <paludis/version_requirements.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <src/output/colour.hh>
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index 8675157..cd895df 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -53,6 +53,7 @@
#include <paludis/output_manager.hh>
#include <paludis/dep_list.hh>
#include <paludis/notifier_callback.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <functional>
#include <algorithm>
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index a110a19..38ee187 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -33,6 +33,7 @@
#include <paludis/util/pretty_print.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/accept_visitor.hh>
#include <paludis/package_dep_spec_properties.hh>
#include <paludis/mask.hh>
#include <paludis/metadata_key.hh>
@@ -44,6 +45,7 @@
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/choice.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <list>
#include <algorithm>