aboutsummaryrefslogtreecommitdiff
path: root/paludis
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-26 18:58:38 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-26 19:00:38 +0000
commit5c2a332b70243cb583a29bb74f712bfca2c1fb76 (patch)
tree0a01f8e624caa2c6639181df45fa80bc20adba84 /paludis
parent79d9f02fb355d81c472f3d94b8b85d5a7639210c (diff)
downloadpaludis-5c2a332b70243cb583a29bb74f712bfca2c1fb76.tar.gz
paludis-5c2a332b70243cb583a29bb74f712bfca2c1fb76.tar.xz
Use Environment rather than PackageDatabase
Diffstat (limited to 'paludis')
-rw-r--r--paludis/broken_linkage_finder.cc2
-rw-r--r--paludis/elike_use_requirement_TEST.cc29
-rw-r--r--paludis/environment.cc102
-rw-r--r--paludis/environment.hh156
-rw-r--r--paludis/environment_implementation.cc26
-rw-r--r--paludis/environment_implementation.hh2
-rw-r--r--paludis/environments/no_config/no_config_environment.cc40
-rw-r--r--paludis/environments/no_config/no_config_environment.hh6
-rw-r--r--paludis/environments/no_config/no_config_environment_TEST.cc2
-rw-r--r--paludis/environments/paludis/mirrors_conf.cc11
-rw-r--r--paludis/environments/paludis/output_conf.cc4
-rw-r--r--paludis/environments/paludis/paludis_config.cc2
-rw-r--r--paludis/environments/paludis/paludis_environment.cc22
-rw-r--r--paludis/environments/paludis/paludis_environment.hh7
-rw-r--r--paludis/environments/paludis/paludis_environment_TEST.cc24
-rw-r--r--paludis/environments/paludis/use_conf.cc3
-rw-r--r--paludis/environments/portage/portage_environment.cc35
-rw-r--r--paludis/environments/portage/portage_environment.hh6
-rw-r--r--paludis/environments/portage/portage_environment_TEST.cc1
-rw-r--r--paludis/environments/test/test_environment.cc25
-rw-r--r--paludis/environments/test/test_environment.hh6
-rw-r--r--paludis/filter.cc12
-rw-r--r--paludis/filter_TEST.cc8
-rw-r--r--paludis/formatted_pretty_printer.cc8
-rw-r--r--paludis/fuzzy_finder.cc17
-rw-r--r--paludis/fuzzy_finder.hh6
-rw-r--r--paludis/fuzzy_finder_TEST.cc16
-rw-r--r--paludis/generator.cc48
-rw-r--r--paludis/generator_TEST.cc8
-rw-r--r--paludis/generator_handler.cc17
-rw-r--r--paludis/hooker.cc10
-rw-r--r--paludis/match_package.cc17
-rw-r--r--paludis/ndbam_merger.cc3
-rw-r--r--paludis/ndbam_unmerger.cc13
-rw-r--r--paludis/package_database.cc107
-rw-r--r--paludis/package_database.hh178
-rw-r--r--paludis/package_database_TEST.cc85
-rw-r--r--paludis/package_id.cc15
-rw-r--r--paludis/package_id.hh8
-rw-r--r--paludis/repositories/accounts/accounts_id.cc3
-rw-r--r--paludis/repositories/accounts/accounts_repository.cc3
-rw-r--r--paludis/repositories/accounts/accounts_repository_TEST.cc3
-rw-r--r--paludis/repositories/accounts/accounts_repository_store.cc4
-rw-r--r--paludis/repositories/e/aa_visitor_TEST.cc3
-rw-r--r--paludis/repositories/e/dep_parser.cc1
-rw-r--r--paludis/repositories/e/dep_parser_TEST.cc35
-rw-r--r--paludis/repositories/e/depend_rdepend_TEST.cc9
-rw-r--r--paludis/repositories/e/do_fetch_action.cc6
-rw-r--r--paludis/repositories/e/do_info_action.cc6
-rw-r--r--paludis/repositories/e/do_install_action.cc3
-rw-r--r--paludis/repositories/e/do_pretend_action.cc6
-rw-r--r--paludis/repositories/e/do_pretend_fetch_action.cc5
-rw-r--r--paludis/repositories/e/e_installed_repository.cc13
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc7
-rw-r--r--paludis/repositories/e/e_repository.cc7
-rw-r--r--paludis/repositories/e/e_repository.hh1
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc26
-rw-r--r--paludis/repositories/e/e_repository_TEST_0.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_1.cc4
-rw-r--r--paludis/repositories/e/e_repository_TEST_2.cc4
-rw-r--r--paludis/repositories/e/e_repository_TEST_3.cc4
-rw-r--r--paludis/repositories/e/e_repository_TEST_4.cc18
-rw-r--r--paludis/repositories/e/e_repository_TEST_ever.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_exheres_0.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_exlibs.cc4
-rw-r--r--paludis/repositories/e/e_repository_TEST_pbin.cc6
-rw-r--r--paludis/repositories/e/e_repository_TEST_phases.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_replacing.cc4
-rw-r--r--paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc4
-rw-r--r--paludis/repositories/e/e_repository_params.hh3
-rw-r--r--paludis/repositories/e/e_repository_sets_TEST.cc13
-rw-r--r--paludis/repositories/e/ebuild.cc2
-rw-r--r--paludis/repositories/e/ebuild.hh12
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc17
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc87
-rw-r--r--paludis/repositories/e/ebuild_id.cc21
-rw-r--r--paludis/repositories/e/exheres_layout.cc1
-rw-r--r--paludis/repositories/e/exndbam_repository.cc4
-rw-r--r--paludis/repositories/e/exndbam_repository_TEST.cc4
-rw-r--r--paludis/repositories/e/fetch_visitor.cc3
-rw-r--r--paludis/repositories/e/fetch_visitor_TEST.cc3
-rw-r--r--paludis/repositories/e/fix_locked_dependencies.cc1
-rw-r--r--paludis/repositories/e/fix_locked_dependencies_TEST.cc5
-rw-r--r--paludis/repositories/e/parse_dependency_label.cc7
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc10
-rw-r--r--paludis/repositories/e/source_uri_finder_TEST.cc7
-rw-r--r--paludis/repositories/e/traditional_layout.cc1
-rw-r--r--paludis/repositories/e/vdb_merger.cc4
-rw-r--r--paludis/repositories/e/vdb_repository.cc6
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc17
-rw-r--r--paludis/repositories/e/vdb_repository_TEST_cache.cc13
-rw-r--r--paludis/repositories/e/vdb_repository_TEST_eapis.cc9
-rw-r--r--paludis/repositories/e/vdb_unmerger.cc17
-rw-r--r--paludis/repositories/e/vdb_unmerger_TEST.cc3
-rw-r--r--paludis/repositories/fake/fake_package_id.cc21
-rw-r--r--paludis/repositories/gemcutter/gemcutter_repository_store.cc1
-rw-r--r--paludis/repositories/repository/repository_repository.cc3
-rw-r--r--paludis/repositories/repository/repository_repository_store.cc4
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_TEST.cc7
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_store.cc3
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc11
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc5
-rw-r--r--paludis/repositories/unpackaged/installed_repository_TEST.cc32
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc5
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository_TEST.cc17
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_TEST.cc5
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_store.cc1
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc9
-rw-r--r--paludis/repositories/virtuals/package_id.cc17
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc7
-rw-r--r--paludis/repositories/virtuals/virtuals_repository_TEST.cc22
-rw-r--r--paludis/repository.hh4
-rw-r--r--paludis/repository_name_cache_TEST.cc15
-rw-r--r--paludis/resolver/decider.cc1
-rw-r--r--paludis/resolver/destination_utils.cc8
-rw-r--r--paludis/resolver/find_replacing_helper.cc4
-rw-r--r--paludis/resolver/find_repository_for_helper.cc4
-rw-r--r--paludis/resolver/make_destination_filtered_generator_helper.cc2
-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_continue_on_failure.cc2
-rw-r--r--paludis/resolver/resolver_TEST_cycles.cc3
-rw-r--r--paludis/resolver/resolver_TEST_errors.cc3
-rw-r--r--paludis/resolver/resolver_TEST_fetches.cc2
-rw-r--r--paludis/resolver/resolver_TEST_purges.cc1
-rw-r--r--paludis/resolver/resolver_TEST_serialisation.cc3
-rw-r--r--paludis/resolver/resolver_TEST_simple.cc4
-rw-r--r--paludis/resolver/resolver_TEST_suggestions.cc3
-rw-r--r--paludis/resolver/resolver_TEST_uninstalls.cc1
-rw-r--r--paludis/resolver/resolver_TEST_virtuals.cc3
-rw-r--r--paludis/resolver/resolver_test.cc12
-rw-r--r--paludis/selection.cc8
-rw-r--r--paludis/selection_TEST.cc12
-rw-r--r--paludis/set_file.cc1
-rw-r--r--paludis/user_dep_spec.cc10
-rw-r--r--paludis/user_dep_spec_TEST.cc11
136 files changed, 890 insertions, 977 deletions
diff --git a/paludis/broken_linkage_finder.cc b/paludis/broken_linkage_finder.cc
index 7079a1b4e..ba828c4f3 100644
--- a/paludis/broken_linkage_finder.cc
+++ b/paludis/broken_linkage_finder.cc
@@ -36,11 +36,11 @@
#include <paludis/util/fs_stat.hh>
#include <paludis/util/fs_iterator.hh>
#include <paludis/util/fs_error.hh>
+#include <paludis/util/join.hh>
#include <paludis/contents.hh>
#include <paludis/environment.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
diff --git a/paludis/elike_use_requirement_TEST.cc b/paludis/elike_use_requirement_TEST.cc
index 31f9b17cb..f0872dd87 100644
--- a/paludis/elike_use_requirement_TEST.cc
+++ b/paludis/elike_use_requirement_TEST.cc
@@ -20,7 +20,6 @@
#include <paludis/dep_spec.hh>
#include <paludis/elike_use_requirement.hh>
-#include <paludis/package_database.hh>
#include <paludis/choice.hh>
#include <paludis/additional_package_dep_spec_requirement.hh>
@@ -65,7 +64,7 @@ TEST(ELikeUseRequirements, Simple)
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "pkg1", "1"));
set_conditionals(id, "enabled disabled");
@@ -101,7 +100,7 @@ TEST(ELikeUseRequirements, Portage)
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "pkg1", "1"));
set_conditionals(id, "enabled disabled");
@@ -137,7 +136,7 @@ TEST(ELikeUseRequirements, Multiple)
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "pkg1", "1"));
set_conditionals(id, "enabled disabled");
@@ -179,7 +178,7 @@ TEST(ELikeUseRequirements, Complex)
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
std::shared_ptr<FakePackageID> id2(fake->add_version("cat", "disabled", "1"));
@@ -277,7 +276,7 @@ TEST(ELikeUseRequirements, ComplexPortage)
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
std::shared_ptr<FakePackageID> id2(fake->add_version("cat", "disabled", "1"));
@@ -347,7 +346,7 @@ TEST(ELikeUseRequirements, Both)
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
std::shared_ptr<FakePackageID> id2(fake->add_version("cat", "disabled", "1"));
@@ -473,7 +472,7 @@ TEST(ELikeUseRequirements, Malformed)
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
@@ -498,7 +497,7 @@ TEST(ELikeUseRequirements, MalformedPortage)
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
@@ -527,7 +526,7 @@ TEST(ELikeUseRequirements, MalformedBoth)
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
@@ -551,7 +550,7 @@ TEST(ELikeUseRequirements, ComplexNonStrict)
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
std::shared_ptr<FakePackageID> id2(fake->add_version("cat", "disabled", "1"));
@@ -677,7 +676,7 @@ TEST(ELikeUseRequirements, PortageNonStrict)
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
std::shared_ptr<FakePackageID> id2(fake->add_version("cat", "disabled", "1"));
@@ -803,7 +802,7 @@ TEST(ELikeUseRequirements, Defaults)
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "pkg1", "1"));
set_conditionals(id, "enabled disabled");
@@ -839,7 +838,7 @@ TEST(ELikeUseRequirements, PrefixStar)
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "pkg1", "1"));
set_conditionals(id, "foo:enabled foo:disabled");
@@ -861,7 +860,7 @@ TEST(ELikeUseRequirements, QuestionDefaults)
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
std::shared_ptr<FakePackageID> id1(fake->add_version("cat", "pkg1", "1"));
set_conditionals(id1, "foo:enabled foo:disabled");
diff --git a/paludis/environment.cc b/paludis/environment.cc
index fa194c96d..c3443c240 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 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
@@ -18,6 +18,15 @@
*/
#include <paludis/environment.hh>
+#include <paludis/filter.hh>
+
+#include <paludis/util/stringify.hh>
+#include <paludis/util/join.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/sequence-impl.hh>
+
+#include <list>
+#include <algorithm>
using namespace paludis;
@@ -25,3 +34,94 @@ Environment::~Environment()
{
}
+const Filter &
+Environment::all_filter()
+{
+ static const Filter result((filter::All()));
+ return result;
+}
+
+namespace paludis
+{
+ template <>
+ struct WrappedForwardIteratorTraits<AmbiguousPackageNameError::OptionsConstIteratorTag>
+ {
+ typedef std::list<std::string>::const_iterator UnderlyingIterator;
+ };
+}
+
+DuplicateRepositoryError::DuplicateRepositoryError(const std::string & name) throw () :
+ Exception("A repository named '" + name + "' already exists")
+{
+}
+
+NoSuchPackageError::NoSuchPackageError(const std::string & our_name) throw () :
+ Exception("Could not find '" + our_name + "'"),
+ _name(our_name)
+{
+}
+
+NoSuchRepositoryError::NoSuchRepositoryError(const RepositoryName & n) throw () :
+ Exception("Could not find repository '" + stringify(n) + "'"),
+ _name(n)
+{
+}
+
+NoSuchRepositoryError::~NoSuchRepositoryError() throw ()
+{
+}
+
+RepositoryName
+NoSuchRepositoryError::name() const
+{
+ return _name;
+}
+
+struct AmbiguousPackageNameError::NameData
+{
+ std::string name;
+ std::list<std::string> names;
+};
+
+AmbiguousPackageNameError::AmbiguousPackageNameError(const std::string & our_name,
+ const std::shared_ptr<const Sequence<std::string> > & names) throw () :
+ Exception("Ambiguous package name '" + our_name + "' (candidates are " + join(names->begin(), names->end(), ", ") + ")"),
+ _name_data(new NameData)
+{
+ _name_data->name = our_name;
+ std::copy(names->begin(), names->end(), std::back_inserter(_name_data->names));
+}
+
+AmbiguousPackageNameError::AmbiguousPackageNameError(const AmbiguousPackageNameError & other) :
+ Exception(other),
+ _name_data(new NameData)
+{
+ _name_data->name = other._name_data->name;
+ _name_data->names = other._name_data->names;
+}
+
+AmbiguousPackageNameError::~AmbiguousPackageNameError() throw ()
+{
+ delete _name_data;
+}
+
+AmbiguousPackageNameError::OptionsConstIterator
+AmbiguousPackageNameError::begin_options() const
+{
+ return OptionsConstIterator(_name_data->names.begin());
+}
+
+AmbiguousPackageNameError::OptionsConstIterator
+AmbiguousPackageNameError::end_options() const
+{
+ return OptionsConstIterator(_name_data->names.end());
+}
+
+const std::string &
+AmbiguousPackageNameError::name() const
+{
+ return _name_data->name;
+}
+
+template class WrappedForwardIterator<AmbiguousPackageNameError::OptionsConstIteratorTag, const std::string>;
+
diff --git a/paludis/environment.hh b/paludis/environment.hh
index 953f9618e..16b12921c 100644
--- a/paludis/environment.hh
+++ b/paludis/environment.hh
@@ -21,11 +21,8 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENT_HH 1
#include <paludis/environment-fwd.hh>
-#include <paludis/util/options-fwd.hh>
-#include <paludis/util/tribool-fwd.hh>
-#include <paludis/util/visitor.hh>
+
#include <paludis/output_manager-fwd.hh>
-#include <paludis/util/pimp.hh>
#include <paludis/name-fwd.hh>
#include <paludis/hook-fwd.hh>
#include <paludis/repository-fwd.hh>
@@ -33,7 +30,6 @@
#include <paludis/spec_tree-fwd.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/mask-fwd.hh>
-#include <paludis/package_database-fwd.hh>
#include <paludis/selection-fwd.hh>
#include <paludis/selection_cache-fwd.hh>
#include <paludis/metadata_key_holder.hh>
@@ -42,6 +38,12 @@
#include <paludis/notifier_callback-fwd.hh>
#include <paludis/filter-fwd.hh>
+#include <paludis/util/options-fwd.hh>
+#include <paludis/util/tribool-fwd.hh>
+#include <paludis/util/visitor.hh>
+#include <paludis/util/pimp.hh>
+#include <paludis/util/sequence-fwd.hh>
+
/** \file
* Declarations for the Environment class.
*
@@ -55,12 +57,134 @@
namespace paludis
{
/**
+ * Thrown if a query results in more than one matching package.
+ *
+ * \ingroup g_exceptions
+ * \ingroup g_environment
+ */
+ class PALUDIS_VISIBLE AmbiguousPackageNameError :
+ public Exception
+ {
+ private:
+ struct NameData;
+ NameData * const _name_data;
+
+ std::string _name;
+
+ public:
+ ///\name Basic operations
+ ///\{
+
+ AmbiguousPackageNameError(const std::string & name, const std::shared_ptr<const Sequence<std::string> > &) throw ();
+
+ AmbiguousPackageNameError(const AmbiguousPackageNameError &);
+
+ virtual ~AmbiguousPackageNameError() throw ();
+
+ ///\}
+
+ /**
+ * The name of the package.
+ */
+ const std::string & name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ ///\name Iterate over possible matches
+ ///\{
+
+ struct OptionsConstIteratorTag;
+ typedef WrappedForwardIterator<OptionsConstIteratorTag, const std::string> OptionsConstIterator;
+
+ OptionsConstIterator begin_options() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ OptionsConstIterator end_options() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ ///\}
+ };
+
+ /**
+ * Thrown if a Repository with the same name as an existing member is added
+ * to an Environment.
+ *
+ * \ingroup g_exceptions
+ * \ingroup g_environment
+ */
+ class PALUDIS_VISIBLE DuplicateRepositoryError :
+ public Exception
+ {
+ public:
+ /**
+ * Constructor.
+ */
+ DuplicateRepositoryError(const std::string & name) throw ();
+ };
+
+ /**
+ * Thrown if there is no Package with the given name.
+ *
+ * \ingroup g_exceptions
+ * \ingroup g_environment
+ */
+ class PALUDIS_VISIBLE NoSuchPackageError :
+ public Exception
+ {
+ private:
+ std::string _name;
+
+ public:
+ ///\name Basic operations
+ ///\{
+
+ NoSuchPackageError(const std::string & name) throw ();
+
+ virtual ~NoSuchPackageError() throw ()
+ {
+ }
+
+ ///\}
+
+ /**
+ * Name of the package.
+ */
+ const std::string & name() const
+ {
+ return _name;
+ }
+ };
+
+ /**
+ * Thrown if there is no Repository in a RepositoryDatabase with the given
+ * name.
+ *
+ * \ingroup g_exceptions
+ * \ingroup g_environment
+ */
+ class PALUDIS_VISIBLE NoSuchRepositoryError :
+ public Exception
+ {
+ private:
+ const RepositoryName _name;
+
+ public:
+ ///\name Basic operations
+ ///\{
+
+ NoSuchRepositoryError(const RepositoryName &) throw ();
+
+ ~NoSuchRepositoryError() throw ();
+
+ ///\}
+
+ /**
+ * The name of our repository.
+ */
+ RepositoryName name() const;
+ };
+
+ /**
* Represents a working environment, which contains an available packages
* database and provides various methods for querying package visibility
* and options.
*
- * Contains a PackageDatabase, which in turn contains a number of Repository
- * instances.
+ * Holds a number of Repository instances.
*
* Environment itself is purely an interface class. Actual Environment
* implementations usually descend from EnvironmentImplementation, which
@@ -69,15 +193,15 @@ namespace paludis
* application.
*
* \ingroup g_environment
- * \see PackageDatabase
* \see EnvironmentFactory
* \see EnvironmentImplementation
+ * \see Repository
* \nosubgrouping
*/
class PALUDIS_VISIBLE Environment :
public MetadataKeyHolder
{
- private:
+ protected:
static const Filter & all_filter() PALUDIS_ATTRIBUTE((warn_unused_result));
public:
@@ -251,15 +375,6 @@ namespace paludis
///\}
- ///\name Database-related functions
- ///\{
-
- virtual std::shared_ptr<PackageDatabase> package_database()
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- virtual std::shared_ptr<const PackageDatabase> package_database() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
/**
* Select some packages.
*/
@@ -289,7 +404,7 @@ namespace paludis
/**
* Create a repository from a particular file.
*
- * Does not add the repository to the PackageDatabase.
+ * Does not add the repository to the Environment.
*
* This allows RepositoryRepository to add a repo config file, then
* sync that repo. If you aren't RepositoryRepository you shouldn't
@@ -622,7 +737,8 @@ namespace paludis
extern template class Pimp<CreateOutputManagerForRepositorySyncInfo>;
extern template class Pimp<CreateOutputManagerForPackageIDActionInfo>;
-
+ extern template class WrappedForwardIterator<Environment::RepositoryConstIteratorTag, const std::shared_ptr<Repository> >;
+ extern template class WrappedForwardIterator<AmbiguousPackageNameError::OptionsConstIteratorTag, const std::string>;
}
#endif
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index 13975fdbd..d7f7f339b 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -25,6 +25,7 @@
#include <paludis/distribution.hh>
#include <paludis/selection.hh>
#include <paludis/selection_cache.hh>
+#include <paludis/package_database.hh>
#include <paludis/util/log.hh>
#include <paludis/util/save.hh>
@@ -118,6 +119,7 @@ namespace paludis
template <>
struct Imp<EnvironmentImplementation>
{
+ std::shared_ptr<PackageDatabase> package_database;
std::map<unsigned, NotifierCallbackFunction> notifier_callbacks;
std::list<std::shared_ptr<const SelectionCache> > selection_caches;
@@ -126,7 +128,8 @@ namespace paludis
mutable std::shared_ptr<SetNameSet> set_names;
mutable SetsStore sets;
- Imp() :
+ Imp(const std::shared_ptr<PackageDatabase> & d) :
+ package_database(d),
loaded_sets(false)
{
}
@@ -134,7 +137,7 @@ namespace paludis
}
EnvironmentImplementation::EnvironmentImplementation() :
- _imp()
+ _imp(std::shared_ptr<PackageDatabase>(new PackageDatabase(this)))
{
}
@@ -292,8 +295,7 @@ EnvironmentImplementation::_need_sets() const
if (_imp->loaded_sets)
return;
- for (PackageDatabase::RepositoryConstIterator r(package_database()->begin_repositories()),
- r_end(package_database()->end_repositories()) ;
+ for (auto r(begin_repositories()), r_end(end_repositories()) ;
r != r_end ; ++r)
(*r)->populate_sets();
@@ -367,50 +369,50 @@ EnvironmentImplementation::set_always_exists(const SetName & s) const
void
EnvironmentImplementation::add_repository(int importance, const std::shared_ptr<Repository> & repository)
{
- package_database()->add_repository(importance, repository);
+ _imp->package_database->add_repository(importance, repository);
}
const std::shared_ptr<const Repository>
EnvironmentImplementation::fetch_repository(const RepositoryName & name) const
{
- return package_database()->fetch_repository(name);
+ return _imp->package_database->fetch_repository(name);
}
const std::shared_ptr<Repository>
EnvironmentImplementation::fetch_repository(const RepositoryName & name)
{
- return package_database()->fetch_repository(name);
+ return _imp->package_database->fetch_repository(name);
}
bool
EnvironmentImplementation::has_repository_named(const RepositoryName & name) const
{
- return package_database()->has_repository_named(name);
+ return _imp->package_database->has_repository_named(name);
}
QualifiedPackageName
EnvironmentImplementation::fetch_unique_qualified_package_name(const PackageNamePart & name,
const Filter & filter, const bool disambiguate) const
{
- return package_database()->fetch_unique_qualified_package_name(name, filter, disambiguate);
+ return _imp->package_database->fetch_unique_qualified_package_name(name, filter, disambiguate);
}
bool
EnvironmentImplementation::more_important_than(const RepositoryName & a, const RepositoryName & b) const
{
- return package_database()->more_important_than(a, b);
+ return _imp->package_database->more_important_than(a, b);
}
EnvironmentImplementation::RepositoryConstIterator
EnvironmentImplementation::begin_repositories() const
{
- return package_database()->begin_repositories();
+ return _imp->package_database->begin_repositories();
}
EnvironmentImplementation::RepositoryConstIterator
EnvironmentImplementation::end_repositories() const
{
- return package_database()->end_repositories();
+ return _imp->package_database->end_repositories();
}
DuplicateSetError::DuplicateSetError(const SetName & s) throw () :
diff --git a/paludis/environment_implementation.hh b/paludis/environment_implementation.hh
index 6a4fba76e..fd79e5d23 100644
--- a/paludis/environment_implementation.hh
+++ b/paludis/environment_implementation.hh
@@ -123,7 +123,7 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual QualifiedPackageName fetch_unique_qualified_package_name(
- const PackageNamePart &, const Filter &, const bool disambiguate) const
+ const PackageNamePart &, const Filter & = all_filter(), const bool disambiguate = true) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool more_important_than(const RepositoryName &, const RepositoryName &) const
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index 000d609ea..8ec8153b9 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -18,6 +18,7 @@
*/
#include <paludis/environments/no_config/no_config_environment.hh>
+
#include <paludis/util/tokeniser.hh>
#include <paludis/util/log.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -37,13 +38,16 @@
#include <paludis/util/fs_path.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/join.hh>
+
#include <paludis/standard_output_manager.hh>
#include <paludis/distribution.hh>
-#include <paludis/package_database.hh>
#include <paludis/hook.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/repository_factory.hh>
#include <paludis/choice.hh>
+#include <paludis/repository.hh>
+
#include <unordered_map>
#include <functional>
#include <algorithm>
@@ -73,14 +77,12 @@ namespace paludis
std::shared_ptr<Repository> master_repo;
std::list<std::shared_ptr<Repository> > extra_repos;
- std::shared_ptr<PackageDatabase> package_database;
-
std::shared_ptr<LiteralMetadataValueKey<std::string> > format_key;
std::shared_ptr<LiteralMetadataValueKey<FSPath> > repository_dir_key;
std::shared_ptr<LiteralMetadataValueKey<FSPath> > preferred_root_key;
std::shared_ptr<LiteralMetadataValueKey<FSPath> > system_root_key;
- Imp(NoConfigEnvironment * const env, const no_config_environment::Params & params);
+ Imp(const no_config_environment::Params & params);
void initialise(NoConfigEnvironment * const env);
};
@@ -149,14 +151,12 @@ namespace
}
}
-Imp<NoConfigEnvironment>::Imp(
- NoConfigEnvironment * const env, const no_config_environment::Params & p) :
+Imp<NoConfigEnvironment>::Imp(const no_config_environment::Params & p) :
params(p),
top_level_dir(p.repository_dir()),
write_cache(p.write_cache()),
accept_unstable(p.accept_unstable()),
is_vdb(is_vdb_repository(p.repository_dir(), p.repository_type())),
- package_database(std::make_shared<PackageDatabase>(env)),
format_key(std::make_shared<LiteralMetadataValueKey<std::string>>("format", "Format", mkt_significant, "no_config")),
repository_dir_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("repository_dir", "Repository dir",
mkt_normal, p.repository_dir())),
@@ -291,15 +291,15 @@ Imp<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
if (repo->name() == main_repository_name)
{
main_repo = repo;
- package_database->add_repository(3, repo);
+ env->add_repository(3, repo);
}
else if (stringify(repo->name()) == params.master_repository_name())
{
master_repo = repo;
- package_database->add_repository(2, repo);
+ env->add_repository(2, repo);
}
else
- package_database->add_repository(1, repo);
+ env->add_repository(1, repo);
}
}
catch (const NoGraphTopologicalOrderExistsError & x)
@@ -319,7 +319,7 @@ Imp<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "virtuals");
if ((*DistributionData::get_instance()->distribution_from_string(env->distribution())).support_old_style_virtuals())
- package_database->add_repository(-2, RepositoryFactory::get_instance()->create(env,
+ env->add_repository(-2, RepositoryFactory::get_instance()->create(env,
std::bind(from_keys, v_keys, std::placeholders::_1)));
#endif
}
@@ -336,7 +336,7 @@ Imp<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
keys->insert("provides_cache", "/var/empty");
keys->insert("location", stringify(top_level_dir.realpath()));
- package_database->add_repository(1, RepositoryFactory::get_instance()->create(env,
+ env->add_repository(1, RepositoryFactory::get_instance()->create(env,
std::bind(from_keys, keys, std::placeholders::_1)));
std::shared_ptr<Map<std::string, std::string> > iv_keys(std::make_shared<Map<std::string, std::string>>());
@@ -345,14 +345,14 @@ Imp<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
#ifdef ENABLE_VIRTUALS_REPOSITORY
if ((*DistributionData::get_instance()->distribution_from_string(env->distribution())).support_old_style_virtuals())
- package_database->add_repository(-2, RepositoryFactory::get_instance()->create(env,
+ env->add_repository(-2, RepositoryFactory::get_instance()->create(env,
std::bind(from_keys, iv_keys, std::placeholders::_1)));
#endif
}
}
NoConfigEnvironment::NoConfigEnvironment(const no_config_environment::Params & params) :
- _imp(this, params)
+ _imp(params)
{
_imp->initialise(this);
@@ -408,18 +408,6 @@ NoConfigEnvironment::master_repository() const
return _imp->master_repo;
}
-std::shared_ptr<PackageDatabase>
-NoConfigEnvironment::package_database()
-{
- return _imp->package_database;
-}
-
-std::shared_ptr<const PackageDatabase>
-NoConfigEnvironment::package_database() const
-{
- return _imp->package_database;
-}
-
bool
NoConfigEnvironment::accept_keywords(
const std::shared_ptr<const KeywordNameSet> & keywords,
diff --git a/paludis/environments/no_config/no_config_environment.hh b/paludis/environments/no_config/no_config_environment.hh
index 868eb37a2..60be54777 100644
--- a/paludis/environments/no_config/no_config_environment.hh
+++ b/paludis/environments/no_config/no_config_environment.hh
@@ -162,12 +162,6 @@ namespace paludis
const PackageDepSpec & spec) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<PackageDatabase> package_database()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::shared_ptr<const PackageDatabase> package_database() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual bool accept_license(const std::string &, const std::shared_ptr<const PackageID> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/environments/no_config/no_config_environment_TEST.cc b/paludis/environments/no_config/no_config_environment_TEST.cc
index 0da71bafa..c4403df15 100644
--- a/paludis/environments/no_config/no_config_environment_TEST.cc
+++ b/paludis/environments/no_config/no_config_environment_TEST.cc
@@ -40,7 +40,5 @@ TEST(NoConfigEnvironment, Construction)
n::repository_type() = no_config_environment::ncer_auto,
n::write_cache() = FSPath("/var/empty")
));
-
- EXPECT_TRUE(bool(e.package_database()));
}
diff --git a/paludis/environments/paludis/mirrors_conf.cc b/paludis/environments/paludis/mirrors_conf.cc
index 0ff5a2480..2f36bd20a 100644
--- a/paludis/environments/paludis/mirrors_conf.cc
+++ b/paludis/environments/paludis/mirrors_conf.cc
@@ -17,11 +17,13 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "mirrors_conf.hh"
-#include <paludis/environment.hh>
-#include <paludis/name.hh>
+#include <paludis/environments/paludis/mirrors_conf.hh>
#include <paludis/environments/paludis/paludis_environment.hh>
#include <paludis/environments/paludis/bashable_conf.hh>
+
+#include <paludis/environment.hh>
+#include <paludis/name.hh>
+
#include <paludis/util/log.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/tokeniser.hh>
@@ -30,6 +32,9 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/join.hh>
+#include <paludis/util/options.hh>
+
#include <functional>
#include <unordered_map>
#include <algorithm>
diff --git a/paludis/environments/paludis/output_conf.cc b/paludis/environments/paludis/output_conf.cc
index 3b9d50a16..2f3ebfaf3 100644
--- a/paludis/environments/paludis/output_conf.cc
+++ b/paludis/environments/paludis/output_conf.cc
@@ -22,6 +22,7 @@
#include <paludis/environments/paludis/paludis_config.hh>
#include <paludis/environments/paludis/paludis_environment.hh>
#include <paludis/environments/paludis/extra_distribution_data.hh>
+
#include <paludis/util/log.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/tokeniser.hh>
@@ -37,6 +38,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/simple_parser.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+
#include <paludis/user_dep_spec.hh>
#include <paludis/create_output_manager_info.hh>
#include <paludis/package_id.hh>
@@ -45,6 +47,8 @@
#include <paludis/output_manager_factory.hh>
#include <paludis/metadata_key.hh>
#include <paludis/distribution.hh>
+#include <paludis/version_spec.hh>
+
#include <list>
#include <vector>
#include <map>
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index 1f9bc882b..03b5f7b33 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -52,6 +52,8 @@
#include <paludis/util/fs_stat.hh>
#include <paludis/util/fs_error.hh>
#include <paludis/util/env_var_names.hh>
+#include <paludis/util/options.hh>
+#include <paludis/util/join.hh>
#include <paludis/distribution.hh>
#include <paludis/repository_factory.hh>
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index bfe9478f2..de4f65dab 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -59,6 +59,7 @@
#include <paludis/util/fs_iterator.hh>
#include <paludis/util/fs_error.hh>
#include <paludis/util/env_var_names.hh>
+#include <paludis/util/join.hh>
#include <functional>
#include <algorithm>
@@ -80,8 +81,6 @@ namespace paludis
std::shared_ptr<PaludisConfig> config;
- std::shared_ptr<PackageDatabase> package_database;
-
mutable Mutex sets_mutex;
mutable std::map<SetName, std::shared_ptr<const SetSpecTree> > sets;
@@ -91,10 +90,9 @@ namespace paludis
std::shared_ptr<LiteralMetadataValueKey<FSPath> > preferred_root_key;
std::shared_ptr<LiteralMetadataValueKey<FSPath> > system_root_key;
- Imp(PaludisEnvironment * const e, std::shared_ptr<PaludisConfig> c) :
+ Imp(std::shared_ptr<PaludisConfig> c) :
done_hooks(false),
config(c),
- package_database(std::make_shared<PackageDatabase>(e)),
format_key(std::make_shared<LiteralMetadataValueKey<std::string>>("format", "Format", mkt_significant, "paludis")),
config_location_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("conf_dir", "Config dir", mkt_normal,
FSPath(config->config_dir()))),
@@ -148,13 +146,13 @@ namespace paludis
}
PaludisEnvironment::PaludisEnvironment(const std::string & s) :
- _imp(this, std::shared_ptr<PaludisConfig>(std::make_shared<PaludisConfig>(this, s)))
+ _imp(std::shared_ptr<PaludisConfig>(std::make_shared<PaludisConfig>(this, s)))
{
Context context("When loading paludis environment:");
for (PaludisConfig::RepositoryConstIterator r(_imp->config->begin_repositories()),
r_end(_imp->config->end_repositories()) ; r != r_end ; ++r)
- _imp->package_database->add_repository(
+ add_repository(
RepositoryFactory::get_instance()->importance(this, *r),
RepositoryFactory::get_instance()->create(this, *r));
@@ -323,18 +321,6 @@ PaludisEnvironment::config_dir() const
return _imp->config->config_dir();
}
-std::shared_ptr<PackageDatabase>
-PaludisEnvironment::package_database()
-{
- return _imp->package_database;
-}
-
-std::shared_ptr<const PackageDatabase>
-PaludisEnvironment::package_database() const
-{
- return _imp->package_database;
-}
-
std::string
PaludisEnvironment::distribution() const
{
diff --git a/paludis/environments/paludis/paludis_environment.hh b/paludis/environments/paludis/paludis_environment.hh
index 29f93081c..553ff238a 100644
--- a/paludis/environments/paludis/paludis_environment.hh
+++ b/paludis/environments/paludis/paludis_environment.hh
@@ -20,7 +20,6 @@
#ifndef PALUDIS_GUARD_PALUDIS_DEFAULT_ENVIRONMENT_HH
#define PALUDIS_GUARD_PALUDIS_DEFAULT_ENVIRONMENT_HH 1
-#include <paludis/package_database.hh>
#include <paludis/environment_implementation.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/name-fwd.hh>
@@ -100,12 +99,6 @@ namespace paludis
const std::shared_ptr<OutputManager> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<PackageDatabase> package_database()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::shared_ptr<const PackageDatabase> package_database() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual std::string distribution() const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/environments/paludis/paludis_environment_TEST.cc b/paludis/environments/paludis/paludis_environment_TEST.cc
index 87b136bc8..ef5d28ab2 100644
--- a/paludis/environments/paludis/paludis_environment_TEST.cc
+++ b/paludis/environments/paludis/paludis_environment_TEST.cc
@@ -25,6 +25,8 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/options.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/stringify.hh>
+#include <paludis/util/join.hh>
#include <paludis/package_id.hh>
#include <paludis/user_dep_spec.hh>
@@ -163,16 +165,16 @@ TEST(PaludisEnvironment, Repositories)
std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
- EXPECT_TRUE(bool(env->package_database()->fetch_repository(RepositoryName("first"))));
- EXPECT_TRUE(bool(env->package_database()->fetch_repository(RepositoryName("second"))));
- EXPECT_TRUE(bool(env->package_database()->fetch_repository(RepositoryName("third"))));
- EXPECT_TRUE(bool(env->package_database()->fetch_repository(RepositoryName("fourth"))));
- EXPECT_TRUE(bool(env->package_database()->fetch_repository(RepositoryName("fifth"))));
-
- EXPECT_TRUE(env->package_database()->more_important_than(RepositoryName("first"), RepositoryName("second")));
- EXPECT_TRUE(env->package_database()->more_important_than(RepositoryName("second"), RepositoryName("third")));
- EXPECT_TRUE(env->package_database()->more_important_than(RepositoryName("fourth"), RepositoryName("third")));
- EXPECT_TRUE(env->package_database()->more_important_than(RepositoryName("fourth"), RepositoryName("fifth")));
- EXPECT_TRUE(env->package_database()->more_important_than(RepositoryName("second"), RepositoryName("fifth")));
+ EXPECT_TRUE(bool(env->fetch_repository(RepositoryName("first"))));
+ EXPECT_TRUE(bool(env->fetch_repository(RepositoryName("second"))));
+ EXPECT_TRUE(bool(env->fetch_repository(RepositoryName("third"))));
+ EXPECT_TRUE(bool(env->fetch_repository(RepositoryName("fourth"))));
+ EXPECT_TRUE(bool(env->fetch_repository(RepositoryName("fifth"))));
+
+ EXPECT_TRUE(env->more_important_than(RepositoryName("first"), RepositoryName("second")));
+ EXPECT_TRUE(env->more_important_than(RepositoryName("second"), RepositoryName("third")));
+ EXPECT_TRUE(env->more_important_than(RepositoryName("fourth"), RepositoryName("third")));
+ EXPECT_TRUE(env->more_important_than(RepositoryName("fourth"), RepositoryName("fifth")));
+ EXPECT_TRUE(env->more_important_than(RepositoryName("second"), RepositoryName("fifth")));
}
diff --git a/paludis/environments/paludis/use_conf.cc b/paludis/environments/paludis/use_conf.cc
index 4a7009e25..46dfcb665 100644
--- a/paludis/environments/paludis/use_conf.cc
+++ b/paludis/environments/paludis/use_conf.cc
@@ -20,9 +20,12 @@
#include <paludis/environments/paludis/use_conf.hh>
#include <paludis/environments/paludis/paludis_environment.hh>
#include <paludis/environments/paludis/bashable_conf.hh>
+
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/tribool.hh>
+#include <paludis/util/stringify.hh>
+
#include <paludis/paludislike_options_conf.hh>
#include <paludis/choice.hh>
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index 3cd2c53c3..414ad4ce5 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "portage_environment.hh"
+#include <paludis/environments/portage/portage_environment.hh>
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
@@ -42,13 +42,13 @@
#include <paludis/util/fs_error.hh>
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/env_var_names.hh>
+#include <paludis/util/join.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/hooker.hh>
#include <paludis/hook.hh>
#include <paludis/mask.hh>
#include <paludis/match_package.hh>
-#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/set_file.hh>
@@ -109,8 +109,6 @@ namespace paludis
int overlay_importance;
- std::shared_ptr<PackageDatabase> package_database;
-
const FSPath world_file;
mutable Mutex world_mutex;
@@ -120,12 +118,11 @@ namespace paludis
std::shared_ptr<LiteralMetadataValueKey<FSPath> > preferred_root_key;
std::shared_ptr<LiteralMetadataValueKey<FSPath> > system_root_key;
- Imp(Environment * const e, const std::string & s) :
+ Imp(const std::string & s) :
conf_dir(FSPath(s.empty() ? "/" : s) / SYSCONFDIR),
ignore_all_breaks_portage(false),
done_hooks(false),
overlay_importance(10),
- package_database(std::make_shared<PackageDatabase>(e)),
world_file(s + "/var/lib/portage/world"),
format_key(std::make_shared<LiteralMetadataValueKey<std::string>>("format", "Format", mkt_significant, "portage")),
config_location_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("conf_dir", "Config dir", mkt_normal,
@@ -230,7 +227,7 @@ namespace
}
PortageEnvironment::PortageEnvironment(const std::string & s) :
- _imp(this, s)
+ _imp(s)
{
using namespace std::placeholders;
@@ -470,8 +467,7 @@ PortageEnvironment::_add_virtuals_repository()
#ifdef ENABLE_VIRTUALS_REPOSITORY
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "virtuals");
- package_database()->add_repository(-2,
- RepositoryFactory::get_instance()->create(this, std::bind(from_keys, keys, std::placeholders::_1)));
+ add_repository(-2, RepositoryFactory::get_instance()->create(this, std::bind(from_keys, keys, std::placeholders::_1)));
#endif
}
@@ -482,8 +478,7 @@ PortageEnvironment::_add_installed_virtuals_repository()
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("root", stringify(preferred_root_key()->value()));
keys->insert("format", "installed_virtuals");
- package_database()->add_repository(-1,
- RepositoryFactory::get_instance()->create(this, std::bind(from_keys, keys, std::placeholders::_1)));
+ add_repository(-1, RepositoryFactory::get_instance()->create(this, std::bind(from_keys, keys, std::placeholders::_1)));
#endif
}
@@ -514,8 +509,7 @@ PortageEnvironment::_add_ebuild_repository(const FSPath & portdir, const std::st
builddir.append("/portage");
keys->insert("builddir", builddir);
- package_database()->add_repository(importance,
- RepositoryFactory::get_instance()->create(this, std::bind(from_keys, keys, std::placeholders::_1)));
+ add_repository(importance, RepositoryFactory::get_instance()->create(this, std::bind(from_keys, keys, std::placeholders::_1)));
}
void
@@ -540,8 +534,7 @@ PortageEnvironment::_add_vdb_repository()
if (! builddir.empty())
builddir.append("/portage");
keys->insert("builddir", builddir);
- package_database()->add_repository(1,
- RepositoryFactory::get_instance()->create(this, std::bind(from_keys, keys, std::placeholders::_1)));
+ add_repository(1, RepositoryFactory::get_instance()->create(this, std::bind(from_keys, keys, std::placeholders::_1)));
}
PortageEnvironment::~PortageEnvironment()
@@ -740,18 +733,6 @@ PortageEnvironment::bashrc_files() const
return result;
}
-std::shared_ptr<PackageDatabase>
-PortageEnvironment::package_database()
-{
- return _imp->package_database;
-}
-
-std::shared_ptr<const PackageDatabase>
-PortageEnvironment::package_database() const
-{
- return _imp->package_database;
-}
-
std::shared_ptr<const MirrorsSequence>
PortageEnvironment::mirrors(const std::string & m) const
{
diff --git a/paludis/environments/portage/portage_environment.hh b/paludis/environments/portage/portage_environment.hh
index c8ddfd28e..e7193e0d4 100644
--- a/paludis/environments/portage/portage_environment.hh
+++ b/paludis/environments/portage/portage_environment.hh
@@ -129,12 +129,6 @@ namespace paludis
const std::shared_ptr<OutputManager> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<PackageDatabase> package_database()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::shared_ptr<const PackageDatabase> package_database() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual bool accept_license(const std::string &, const std::shared_ptr<const PackageID> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/environments/portage/portage_environment_TEST.cc b/paludis/environments/portage/portage_environment_TEST.cc
index 97bd214ef..1f637f2fa 100644
--- a/paludis/environments/portage/portage_environment_TEST.cc
+++ b/paludis/environments/portage/portage_environment_TEST.cc
@@ -28,7 +28,6 @@
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/package_id.hh>
-#include <paludis/package_database.hh>
#include <paludis/dep_spec.hh>
#include <paludis/name.hh>
#include <paludis/user_dep_spec.hh>
diff --git a/paludis/environments/test/test_environment.cc b/paludis/environments/test/test_environment.cc
index f437c9361..aacb55293 100644
--- a/paludis/environments/test/test_environment.cc
+++ b/paludis/environments/test/test_environment.cc
@@ -32,12 +32,13 @@
#include <paludis/util/env_var_names.hh>
#include <paludis/standard_output_manager.hh>
-#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
#include <paludis/hook.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/choice.hh>
#include <paludis/literal_metadata_key.hh>
+#include <paludis/repository.hh>
+
#include <functional>
#include <unordered_map>
@@ -53,15 +54,13 @@ namespace paludis
template<>
struct Imp<TestEnvironment>
{
- std::shared_ptr<PackageDatabase> package_database;
std::unordered_map<std::string, Tribool> override_want_choice_enabled;
FSPath root;
Sets sets;
std::shared_ptr<LiteralMetadataValueKey<FSPath> > preferred_root_key;
std::shared_ptr<LiteralMetadataValueKey<FSPath> > system_root_key;
- Imp(Environment * const e, const FSPath & r) :
- package_database(std::make_shared<PackageDatabase>(e)),
+ Imp(const FSPath & r) :
root(r),
preferred_root_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("root", "Root", mkt_normal, root)),
system_root_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("system_root", "System Root", mkt_normal, FSPath("/")))
@@ -71,14 +70,14 @@ namespace paludis
}
TestEnvironment::TestEnvironment() :
- _imp(this, FSPath("/"))
+ _imp(FSPath("/"))
{
add_metadata_key(_imp->preferred_root_key);
add_metadata_key(_imp->system_root_key);
}
TestEnvironment::TestEnvironment(const FSPath & r) :
- _imp(this, r)
+ _imp(r)
{
add_metadata_key(_imp->preferred_root_key);
add_metadata_key(_imp->system_root_key);
@@ -100,25 +99,13 @@ TestEnvironment::accept_license(const std::string &, const std::shared_ptr<const
return true;
}
-std::shared_ptr<PackageDatabase>
-TestEnvironment::package_database()
-{
- return _imp->package_database;
-}
-
-std::shared_ptr<const PackageDatabase>
-TestEnvironment::package_database() const
-{
- return _imp->package_database;
-}
-
const std::shared_ptr<const PackageID>
TestEnvironment::fetch_package_id(const QualifiedPackageName & q,
const VersionSpec & v, const RepositoryName & r) const
{
using namespace std::placeholders;
- std::shared_ptr<const PackageIDSequence> ids(package_database()->fetch_repository(r)->package_ids(q, { }));
+ std::shared_ptr<const PackageIDSequence> ids(fetch_repository(r)->package_ids(q, { }));
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
if (v == (*i)->version())
diff --git a/paludis/environments/test/test_environment.hh b/paludis/environments/test/test_environment.hh
index 1d49812f5..d8abeac1f 100644
--- a/paludis/environments/test/test_environment.hh
+++ b/paludis/environments/test/test_environment.hh
@@ -60,12 +60,6 @@ namespace paludis
///\}
- virtual std::shared_ptr<PackageDatabase> package_database()
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::shared_ptr<const PackageDatabase> package_database() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
/**
* Convenience way of getting a package id.
*/
diff --git a/paludis/filter.cc b/paludis/filter.cc
index 62bbebea0..f6faff11d 100644
--- a/paludis/filter.cc
+++ b/paludis/filter.cc
@@ -23,15 +23,17 @@
#include <paludis/action.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
-#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
#include <paludis/match_package.hh>
+#include <paludis/repository.hh>
+#include <paludis/action_names.hh>
+
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
-#include <paludis/action_names.hh>
+#include <paludis/util/stringify.hh>
using namespace paludis;
@@ -141,7 +143,7 @@ namespace
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
{
- if (env->package_database()->fetch_repository(*r)->some_ids_might_support_action(SupportsActionTest<A_>()))
+ if (env->fetch_repository(*r)->some_ids_might_support_action(SupportsActionTest<A_>()))
result->insert(*r);
}
@@ -187,7 +189,7 @@ namespace
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
{
- if (env->package_database()->fetch_repository(*r)->some_ids_might_not_be_masked())
+ if (env->fetch_repository(*r)->some_ids_might_not_be_masked())
result->insert(*r);
}
@@ -240,7 +242,7 @@ namespace
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
{
- const std::shared_ptr<const Repository> repo(env->package_database()->fetch_repository(*r));
+ const std::shared_ptr<const Repository> repo(env->fetch_repository(*r));
if (repo->installed_root_key() && (equal == (root == repo->installed_root_key()->value())))
result->insert(*r);
}
diff --git a/paludis/filter_TEST.cc b/paludis/filter_TEST.cc
index 6069bc38b..f4f0942e4 100644
--- a/paludis/filter_TEST.cc
+++ b/paludis/filter_TEST.cc
@@ -21,7 +21,6 @@
#include <paludis/generator.hh>
#include <paludis/selection.hh>
#include <paludis/filtered_generator.hh>
-#include <paludis/package_database.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
@@ -32,6 +31,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/join.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <test/test_concepts.hh>
@@ -71,9 +71,9 @@ namespace test_cases
n::supports_uninstall() = true
)))
{
- env.package_database()->add_repository(1, repo1);
- env.package_database()->add_repository(10, repo2);
- env.package_database()->add_repository(0, inst_repo1);
+ env.add_repository(1, repo1);
+ env.add_repository(10, repo2);
+ env.add_repository(0, inst_repo1);
repo1->add_version(CategoryNamePart("cat") + PackageNamePart("a"), VersionSpec("1", { }));
repo1->add_version(CategoryNamePart("cat") + PackageNamePart("b"), VersionSpec("2", { }));
diff --git a/paludis/formatted_pretty_printer.cc b/paludis/formatted_pretty_printer.cc
index a8a511efe..7612b3c50 100644
--- a/paludis/formatted_pretty_printer.cc
+++ b/paludis/formatted_pretty_printer.cc
@@ -18,15 +18,17 @@
*/
#include <paludis/formatted_pretty_printer.hh>
-#include <paludis/util/pimp-impl.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/filter.hh>
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
#include <paludis/package_id.hh>
+#include <paludis/repository.hh>
+
+#include <paludis/util/pimp-impl.hh>
+#include <paludis/util/stringify.hh>
using namespace paludis;
@@ -172,7 +174,7 @@ FormattedPrettyPrinter::prettify(const std::shared_ptr<const PackageID> & v) con
{
if (_imp->env)
{
- auto repo(_imp->env->package_database()->fetch_repository(v->repository_name()));
+ auto repo(_imp->env->fetch_repository(v->repository_name()));
if (repo->installed_root_key())
return format_installed(stringify(*v));
else if (! v->masked())
diff --git a/paludis/fuzzy_finder.cc b/paludis/fuzzy_finder.cc
index 179353232..3846609ba 100644
--- a/paludis/fuzzy_finder.cc
+++ b/paludis/fuzzy_finder.cc
@@ -18,11 +18,6 @@
*/
#include <paludis/fuzzy_finder.hh>
-#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/damerau_levenshtein.hh>
-#include <paludis/util/options.hh>
-#include <paludis/package_database.hh>
#include <paludis/environment.hh>
#include <paludis/repository.hh>
#include <paludis/package_id.hh>
@@ -33,8 +28,15 @@
#include <paludis/filter_handler.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/selection.hh>
+
+#include <paludis/util/pimp-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/damerau_levenshtein.hh>
+#include <paludis/util/options.hh>
+#include <paludis/util/stringify.hh>
#include <paludis/util/set-impl.hh>
#include <paludis/util/sequence-impl.hh>
+
#include <list>
#include <algorithm>
#include <set>
@@ -202,15 +204,14 @@ FuzzyRepositoriesFinder::FuzzyRepositoriesFinder(const Environment & e, const st
if (0 != name.compare(0, 2, std::string("x-")))
{
RepositoryName xname(std::string("x-" + name));
- if (e.package_database()->has_repository_named(xname))
+ if (e.has_repository_named(xname))
{
_imp->candidates.push_back(xname);
return;
}
}
- for (PackageDatabase::RepositoryConstIterator r(e.package_database()->begin_repositories()),
- r_end(e.package_database()->end_repositories()) ; r != r_end ; ++r)
+ for (auto r(e.begin_repositories()), r_end(e.end_repositories()) ; r != r_end ; ++r)
if (distance_calculator.distance_with(tolower_0_cost(stringify((*r)->name()))) <= threshold)
_imp->candidates.push_back((*r)->name());
}
diff --git a/paludis/fuzzy_finder.hh b/paludis/fuzzy_finder.hh
index ae3686e46..90d1047e8 100644
--- a/paludis/fuzzy_finder.hh
+++ b/paludis/fuzzy_finder.hh
@@ -30,7 +30,7 @@
/** \file
* Declarations for paludis::FuzzyCandidatesFinder and paludis::FuzzyRepositoriesFinder
*
- * \ingroup g_package_database
+ * \ingroup g_environment
*/
namespace paludis
@@ -38,7 +38,7 @@ namespace paludis
/**
* Object to find package names to a given name
*
- * \ingroup g_package_database
+ * \ingroup g_environment
*/
class PALUDIS_VISIBLE FuzzyCandidatesFinder
{
@@ -70,7 +70,7 @@ namespace paludis
/**
* Object to find repositories similar to a given name
*
- * \ingroup g_package_database
+ * \ingroup g_environment
*/
class PALUDIS_VISIBLE FuzzyRepositoriesFinder
{
diff --git a/paludis/fuzzy_finder_TEST.cc b/paludis/fuzzy_finder_TEST.cc
index c282091fe..eff7bf0a4 100644
--- a/paludis/fuzzy_finder_TEST.cc
+++ b/paludis/fuzzy_finder_TEST.cc
@@ -25,7 +25,6 @@
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/package_database.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -50,13 +49,13 @@ namespace test_cases
r1->add_version("other-cat", "foo", "1");
r1->add_version("some-cat", "bar", "1");
r1->add_version("some-cat", "one-two-three", "1");
- e.package_database()->add_repository(1, r1);
+ e.add_repository(1, r1);
const std::shared_ptr<FakeRepository> r2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("r2")
)));
- e.package_database()->add_repository(2, r2);
+ e.add_repository(2, r2);
FuzzyCandidatesFinder f1(e, std::string("some-cat/one-two-thee"), filter::All());
TEST_CHECK_EQUAL(std::distance(f1.begin(), f1.end()), 1);
@@ -86,21 +85,20 @@ namespace test_cases
void run()
{
TestEnvironment e;
- PackageDatabase & p(*e.package_database());
- p.add_repository(1, std::shared_ptr<FakeRepository>(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
+ e.add_repository(1, std::shared_ptr<FakeRepository>(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("my-main-repository")))));
- p.add_repository(1, std::shared_ptr<FakeRepository>(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
+ e.add_repository(1, std::shared_ptr<FakeRepository>(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("x-new-repository")))));
- p.add_repository(1, std::shared_ptr<FakeRepository>(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
+ e.add_repository(1, std::shared_ptr<FakeRepository>(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("bar-overlay")))));
- p.add_repository(1, std::shared_ptr<FakeRepository>(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
+ e.add_repository(1, std::shared_ptr<FakeRepository>(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("baz-overlay")))));
- p.add_repository(1, std::shared_ptr<FakeRepository>(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
+ e.add_repository(1, std::shared_ptr<FakeRepository>(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("sunrise")))));
diff --git a/paludis/generator.cc b/paludis/generator.cc
index ffa0d5af0..e38ebede9 100644
--- a/paludis/generator.cc
+++ b/paludis/generator.cc
@@ -24,17 +24,20 @@
#include <paludis/action_names.hh>
#include <paludis/action.hh>
#include <paludis/match_package.hh>
+#include <paludis/package_dep_spec_properties.hh>
+#include <paludis/environment.hh>
+#include <paludis/package_id.hh>
+#include <paludis/metadata_key.hh>
+#include <paludis/repository.hh>
+
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/package_dep_spec_properties.hh>
-#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
-#include <paludis/package_id.hh>
-#include <paludis/metadata_key.hh>
+#include <paludis/util/stringify.hh>
+
#include <algorithm>
#include <functional>
@@ -142,7 +145,7 @@ namespace
{
using namespace std::placeholders;
std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
- if (env->package_database()->has_repository_named(name))
+ if (env->has_repository_named(name))
result->insert(name);
return result;
}
@@ -177,8 +180,7 @@ namespace
for (QualifiedPackageNameSet::ConstIterator q(qpns->begin()), q_end(qpns->end()) ;
q != q_end ; ++q)
{
- std::shared_ptr<const PackageIDSequence> id(
- env->package_database()->fetch_repository(*r)->package_ids(*q, x));
+ std::shared_ptr<const PackageIDSequence> id(env->fetch_repository(*r)->package_ids(*q, x));
for (PackageIDSequence::ConstIterator i(id->begin()), i_end(id->end()) ;
i != i_end ; ++i)
if ((*i)->from_repositories_key() && ((*i)->from_repositories_key()->value()->end() !=
@@ -216,7 +218,7 @@ namespace
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- if (env->package_database()->fetch_repository(*r)->has_category_named(name, x))
+ if (env->fetch_repository(*r)->has_category_named(name, x))
{
result->insert(name);
break;
@@ -251,7 +253,7 @@ namespace
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- if (env->package_database()->fetch_repository(*r)->has_category_named(name.category(), x))
+ if (env->fetch_repository(*r)->has_category_named(name.category(), x))
{
result->insert(name.category());
break;
@@ -271,7 +273,7 @@ namespace
r != r_end ; ++r)
for (CategoryNamePartSet::ConstIterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
- if (env->package_database()->fetch_repository(*r)->has_package_named(name, x))
+ if (env->fetch_repository(*r)->has_package_named(name, x))
result->insert(name);
return result;
@@ -321,11 +323,11 @@ namespace
if (spec.in_repository_ptr())
{
- if (env->package_database()->has_repository_named(*spec.in_repository_ptr()))
+ if (env->has_repository_named(*spec.in_repository_ptr()))
{
if (spec.installed_at_path_ptr())
{
- std::shared_ptr<const Repository> repo(env->package_database()->fetch_repository(
+ std::shared_ptr<const Repository> repo(env->fetch_repository(
*spec.in_repository_ptr()));
if (! repo->installed_root_key())
return result;
@@ -340,8 +342,8 @@ namespace
{
if (spec.installed_at_path_ptr())
{
- for (PackageDatabase::RepositoryConstIterator i(env->package_database()->begin_repositories()),
- i_end(env->package_database()->end_repositories()) ; i != i_end ; ++i)
+ for (auto i(env->begin_repositories()),
+ i_end(env->end_repositories()) ; i != i_end ; ++i)
{
if (! (*i)->installed_root_key())
continue;
@@ -369,7 +371,7 @@ namespace
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- if (env->package_database()->fetch_repository(*r)->has_category_named(*spec.category_name_part_ptr(), x))
+ if (env->fetch_repository(*r)->has_category_named(*spec.category_name_part_ptr(), x))
{
result->insert(*spec.category_name_part_ptr());
break;
@@ -384,7 +386,7 @@ namespace
r != r_end ; ++r)
{
std::shared_ptr<const CategoryNamePartSet> cats(
- env->package_database()->fetch_repository(*r)
+ env->fetch_repository(*r)
->category_names_containing_package(*spec.package_name_part_ptr(), x));
std::copy(cats->begin(), cats->end(), result->inserter());
}
@@ -396,7 +398,7 @@ namespace
std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- if (env->package_database()->fetch_repository(*r)->has_category_named(spec.package_ptr()->category(), x))
+ if (env->fetch_repository(*r)->has_category_named(spec.package_ptr()->category(), x))
{
result->insert(spec.package_ptr()->category());
break;
@@ -421,7 +423,7 @@ namespace
r != r_end ; ++r)
for (CategoryNamePartSet::ConstIterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
- if (env->package_database()->fetch_repository(*r)->has_package_named(*c + *spec.package_name_part_ptr(), x))
+ if (env->fetch_repository(*r)->has_package_named(*c + *spec.package_name_part_ptr(), x))
result->insert(*c + *spec.package_name_part_ptr());
return result;
@@ -431,7 +433,7 @@ namespace
std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
- if (env->package_database()->fetch_repository(*r)->has_package_named(*spec.package_ptr(), x))
+ if (env->fetch_repository(*r)->has_package_named(*spec.package_ptr(), x))
{
result->insert(*spec.package_ptr());
break;
@@ -458,7 +460,7 @@ namespace
q != q_end ; ++q)
{
std::shared_ptr<const PackageIDSequence> id(
- env->package_database()->fetch_repository(*r)->package_ids(*q, x));
+ env->fetch_repository(*r)->package_ids(*q, x));
for (PackageIDSequence::ConstIterator i(id->begin()), i_end(id->end()) ;
i != i_end ; ++i)
if (match_package(*env, spec, *i, from_id, options))
@@ -680,8 +682,8 @@ namespace
const RepositoryContentMayExcludes &) const
{
std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
- for (PackageDatabase::RepositoryConstIterator i(env->package_database()->begin_repositories()),
- i_end(env->package_database()->end_repositories()) ; i != i_end ; ++i)
+ for (auto i(env->begin_repositories()),
+ i_end(env->end_repositories()) ; i != i_end ; ++i)
if ((*i)->some_ids_might_support_action(SupportsActionTest<A_>()))
result->insert((*i)->name());
diff --git a/paludis/generator_TEST.cc b/paludis/generator_TEST.cc
index deff8e84c..092124f80 100644
--- a/paludis/generator_TEST.cc
+++ b/paludis/generator_TEST.cc
@@ -21,7 +21,6 @@
#include <paludis/generator.hh>
#include <paludis/selection.hh>
#include <paludis/filtered_generator.hh>
-#include <paludis/package_database.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
@@ -32,6 +31,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/join.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <test/test_concepts.hh>
@@ -69,9 +69,9 @@ namespace test_cases
n::supports_uninstall() = true
)))
{
- env.package_database()->add_repository(1, repo1);
- env.package_database()->add_repository(10, repo2);
- env.package_database()->add_repository(0, inst_repo1);
+ env.add_repository(1, repo1);
+ env.add_repository(10, repo2);
+ env.add_repository(0, inst_repo1);
repo1->add_version(CategoryNamePart("cat") + PackageNamePart("a"), VersionSpec("1", { }));
repo1->add_version(CategoryNamePart("cat") + PackageNamePart("b"), VersionSpec("2", { }));
diff --git a/paludis/generator_handler.cc b/paludis/generator_handler.cc
index ec474a7f0..8ce53c9a3 100644
--- a/paludis/generator_handler.cc
+++ b/paludis/generator_handler.cc
@@ -18,13 +18,15 @@
*/
#include <paludis/generator_handler.hh>
+#include <paludis/name.hh>
+#include <paludis/environment.hh>
+#include <paludis/repository.hh>
+
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/name.hh>
-#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
+
#include <functional>
#include <algorithm>
@@ -41,7 +43,7 @@ AllGeneratorHandlerBase::repositories(
{
using namespace std::placeholders;
std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
- std::transform(env->package_database()->begin_repositories(), env->package_database()->end_repositories(),
+ std::transform(env->begin_repositories(), env->end_repositories(),
result->inserter(), std::bind(&Repository::name, _1));
return result;
}
@@ -57,7 +59,7 @@ AllGeneratorHandlerBase::categories(
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
{
- std::shared_ptr<const CategoryNamePartSet> cats(env->package_database()->fetch_repository(*r)->category_names(may_exclude));
+ std::shared_ptr<const CategoryNamePartSet> cats(env->fetch_repository(*r)->category_names(may_exclude));
std::copy(cats->begin(), cats->end(), result->inserter());
}
@@ -80,7 +82,7 @@ AllGeneratorHandlerBase::packages(
c != c_end ; ++c)
{
std::shared_ptr<const QualifiedPackageNameSet> pkgs(
- env->package_database()->fetch_repository(*r)->package_names(*c, may_exclude));
+ env->fetch_repository(*r)->package_names(*c, may_exclude));
std::copy(pkgs->begin(), pkgs->end(), result->inserter());
}
}
@@ -103,8 +105,7 @@ AllGeneratorHandlerBase::ids(
for (QualifiedPackageNameSet::ConstIterator q(qpns->begin()), q_end(qpns->end()) ;
q != q_end ; ++q)
{
- std::shared_ptr<const PackageIDSequence> i(
- env->package_database()->fetch_repository(*r)->package_ids(*q, may_exclude));
+ std::shared_ptr<const PackageIDSequence> i(env->fetch_repository(*r)->package_ids(*q, may_exclude));
std::copy(i->begin(), i->end(), result->inserter());
}
}
diff --git a/paludis/hooker.cc b/paludis/hooker.cc
index 3aa1dc2fb..81e1845fa 100644
--- a/paludis/hooker.cc
+++ b/paludis/hooker.cc
@@ -21,10 +21,10 @@
#include <paludis/hooker.hh>
#include <paludis/environment.hh>
#include <paludis/hook.hh>
-#include <paludis/package_database.hh>
#include <paludis/about.hh>
#include <paludis/output_manager.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/repository.hh>
#include <paludis/util/log.hh>
#include <paludis/util/is_file_with_extension.hh>
@@ -746,15 +746,15 @@ Hooker::perform_hook(
switch (hook.output_dest)
{
case hod_stdout:
- for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
- r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
+ for (auto r(_imp->env->begin_repositories()),
+ r_end(_imp->env->end_repositories()) ; r != r_end ; ++r)
result.max_exit_status() = std::max(result.max_exit_status(),
((*r)->perform_hook(hook, optional_output_manager)).max_exit_status());
continue;
case hod_grab:
- for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
- r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
+ for (auto r(_imp->env->begin_repositories()),
+ r_end(_imp->env->end_repositories()) ; r != r_end ; ++r)
{
HookResult tmp((*r)->perform_hook(hook, optional_output_manager));
if (tmp.max_exit_status() > result.max_exit_status())
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index c80b29c16..5b0fa7d2d 100644
--- a/paludis/match_package.cc
+++ b/paludis/match_package.cc
@@ -22,20 +22,20 @@
#include <paludis/dep_spec_flattener.hh>
#include <paludis/environment.hh>
#include <paludis/version_requirements.hh>
-#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
#include <paludis/slot_requirement.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/util/set.hh>
-#include <paludis/util/options.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/sequence.hh>
#include <paludis/action.hh>
#include <paludis/repository.hh>
#include <paludis/additional_package_dep_spec_requirement.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/options.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/sequence.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/stringify.hh>
#include <functional>
#include <algorithm>
@@ -141,7 +141,7 @@ paludis::match_package_with_maybe_changes(
if (spec.installed_at_path_ptr())
{
- auto repo(env.package_database()->fetch_repository(id->repository_name()));
+ auto repo(env.fetch_repository(id->repository_name()));
if (! repo->installed_root_key())
return false;
if (repo->installed_root_key()->value() != *spec.installed_at_path_ptr())
@@ -156,7 +156,7 @@ paludis::match_package_with_maybe_changes(
if (id->masked())
return false;
- const std::shared_ptr<const Repository> dest(env.package_database()->fetch_repository(
+ const std::shared_ptr<const Repository> dest(env.fetch_repository(
spec.installable_to_repository_ptr()->repository()));
if (! dest->destination_interface())
return false;
@@ -173,8 +173,7 @@ paludis::match_package_with_maybe_changes(
return false;
bool ok(false);
- for (PackageDatabase::RepositoryConstIterator d(env.package_database()->begin_repositories()),
- d_end(env.package_database()->end_repositories()) ;
+ for (auto d(env.begin_repositories()), d_end(env.end_repositories()) ;
d != d_end ; ++d)
{
if (! (*d)->destination_interface())
diff --git a/paludis/ndbam_merger.cc b/paludis/ndbam_merger.cc
index edd81de0f..e94ae8368 100644
--- a/paludis/ndbam_merger.cc
+++ b/paludis/ndbam_merger.cc
@@ -34,14 +34,15 @@
#include <paludis/util/fs_stat.hh>
#include <paludis/util/env_var_names.hh>
#include <paludis/util/md5.hh>
+#include <paludis/util/join.hh>
#include <paludis/output_manager.hh>
#include <paludis/hook.hh>
#include <paludis/package_id.hh>
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/ndbam_merger.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/version_spec.hh>
#include <iomanip>
#include <list>
diff --git a/paludis/ndbam_unmerger.cc b/paludis/ndbam_unmerger.cc
index 71aefb3f5..72ded34fb 100644
--- a/paludis/ndbam_unmerger.cc
+++ b/paludis/ndbam_unmerger.cc
@@ -20,13 +20,15 @@
#include <paludis/ndbam_unmerger.hh>
#include <paludis/ndbam.hh>
-
-#include <paludis/util/destringify.hh>
-#include <paludis/util/md5.hh>
+#include <paludis/contents.hh>
#include <paludis/environment.hh>
#include <paludis/hook.hh>
-#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
+#include <paludis/output_manager.hh>
+#include <paludis/metadata_key.hh>
+
+#include <paludis/util/destringify.hh>
+#include <paludis/util/md5.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/pimp-impl.hh>
@@ -41,8 +43,7 @@
#include <paludis/util/timestamp.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/util/fs_iterator.hh>
-#include <paludis/output_manager.hh>
-#include <paludis/metadata_key.hh>
+
#include <functional>
#include <list>
#include <map>
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index 9fe051dae..f0ba5f02b 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -54,104 +54,12 @@ using namespace paludis;
namespace paludis
{
template <>
- struct WrappedForwardIteratorTraits<AmbiguousPackageNameError::OptionsConstIteratorTag>
- {
- typedef std::list<std::string>::const_iterator UnderlyingIterator;
- };
-
- template <>
struct WrappedForwardIteratorTraits<PackageDatabase::RepositoryConstIteratorTag>
{
typedef std::list<std::shared_ptr<Repository> >::const_iterator UnderlyingIterator;
};
}
-PackageDatabaseError::PackageDatabaseError(const std::string & our_message) throw () :
- Exception(our_message)
-{
-}
-
-PackageDatabaseLookupError::PackageDatabaseLookupError(const std::string & our_message) throw () :
- PackageDatabaseError(our_message)
-{
-}
-
-DuplicateRepositoryError::DuplicateRepositoryError(const std::string & name) throw () :
- PackageDatabaseError("A repository named '" + name + "' already exists")
-{
-}
-
-NoSuchPackageError::NoSuchPackageError(const std::string & our_name) throw () :
- PackageDatabaseLookupError("Could not find '" + our_name + "'"),
- _name(our_name)
-{
-}
-
-NoSuchRepositoryError::NoSuchRepositoryError(const RepositoryName & n) throw () :
- PackageDatabaseLookupError("Could not find repository '" + stringify(n) + "'"),
- _name(n)
-{
-}
-
-NoSuchRepositoryError::~NoSuchRepositoryError() throw ()
-{
-}
-
-RepositoryName
-NoSuchRepositoryError::name() const
-{
- return _name;
-}
-
-struct AmbiguousPackageNameError::NameData
-{
- std::string name;
- std::list<std::string> names;
-};
-
-template <typename I_>
-AmbiguousPackageNameError::AmbiguousPackageNameError(const std::string & our_name,
- I_ begin, const I_ end) throw () :
- PackageDatabaseLookupError("Ambiguous package name '" + our_name + "' (candidates are " +
- join(begin, end, ", ") + ")"),
- _name_data(new NameData)
-{
- _name_data->name = our_name;
- std::transform(begin, end, std::back_inserter(_name_data->names),
- &stringify<typename std::iterator_traits<I_>::value_type>);
-}
-
-AmbiguousPackageNameError::AmbiguousPackageNameError(const AmbiguousPackageNameError & other) :
- PackageDatabaseLookupError(other),
- _name_data(new NameData)
-{
- _name_data->name = other._name_data->name;
- _name_data->names = other._name_data->names;
-}
-
-AmbiguousPackageNameError::~AmbiguousPackageNameError() throw ()
-{
- delete _name_data;
-}
-
-AmbiguousPackageNameError::OptionsConstIterator
-AmbiguousPackageNameError::begin_options() const
-{
- return OptionsConstIterator(_name_data->names.begin());
-}
-
-AmbiguousPackageNameError::OptionsConstIterator
-AmbiguousPackageNameError::end_options() const
-{
- return OptionsConstIterator(_name_data->names.end());
-}
-
-const std::string &
-AmbiguousPackageNameError::name() const
-{
- return _name_data->name;
-}
-
namespace paludis
{
template<>
@@ -342,13 +250,19 @@ PackageDatabase::fetch_unique_qualified_package_name(const PackageNamePart & p,
if (! qpns.empty() && next(qpns.begin()) == qpns.end())
break;
- throw AmbiguousPackageNameError(stringify(p), first_iterator(result->begin()),
- first_iterator(result->end()));
+ auto candidates(std::make_shared<Sequence<std::string> >());
+ std::transform(first_iterator(result->begin()), first_iterator(result->end()), candidates->back_inserter(),
+ &stringify<QualifiedPackageName>);
+ throw AmbiguousPackageNameError(stringify(p), candidates);
} while (false);
if (! disambiguate)
- throw AmbiguousPackageNameError(stringify(p), first_iterator(result->begin()),
- first_iterator(result->end()));
+ {
+ auto candidates(std::make_shared<Sequence<std::string> >());
+ std::transform(first_iterator(result->begin()), first_iterator(result->end()), candidates->back_inserter(),
+ &stringify<QualifiedPackageName>);
+ throw AmbiguousPackageNameError(stringify(p), candidates);
+ }
Log::get_instance()->message("package_database.ambiguous_name", ll_warning, lc_context)
<< "Package name '" << p << "' is ambiguous, assuming you meant '" << *qpns.begin()
@@ -434,6 +348,5 @@ PackageDatabase::all_filter()
return result;
}
-template class WrappedForwardIterator<AmbiguousPackageNameError::OptionsConstIteratorTag, const std::string>;
template class WrappedForwardIterator<PackageDatabase::RepositoryConstIteratorTag, const std::shared_ptr<Repository> >;
diff --git a/paludis/package_database.hh b/paludis/package_database.hh
index f1fc47b7b..589b8e62c 100644
--- a/paludis/package_database.hh
+++ b/paludis/package_database.hh
@@ -26,13 +26,15 @@
#include <paludis/repository.hh>
#include <paludis/selection-fwd.hh>
#include <paludis/filter-fwd.hh>
+#include <paludis/version_spec.hh>
+#include <paludis/contents.hh>
+#include <paludis/environment.hh>
+
#include <paludis/util/exception.hh>
#include <paludis/util/join.hh>
#include <paludis/util/pimp.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/version_spec.hh>
-#include <paludis/contents.hh>
#include <iosfwd>
@@ -49,169 +51,6 @@
namespace paludis
{
/**
- * A PackageDatabaseError is an error that occurs when performing some
- * operation upon a PackageDatabase.
- *
- * \ingroup g_exceptions
- * \ingroup g_package_database
- */
- class PALUDIS_VISIBLE PackageDatabaseError :
- public Exception
- {
- protected:
- /**
- * Constructor.
- */
- PackageDatabaseError(const std::string & message) throw ();
- };
-
- /**
- * A PackageDatabaseLookupError descendent is thrown if an error occurs
- * when looking for something in a PackageDatabase.
- *
- * \ingroup g_exceptions
- * \ingroup g_package_database
- */
- class PALUDIS_VISIBLE PackageDatabaseLookupError :
- public PackageDatabaseError
- {
- protected:
- /**
- * Constructor.
- */
- PackageDatabaseLookupError(const std::string & message) throw ();
- };
-
- /**
- * Thrown if a PackageDatabase query results in more than one matching
- * Package.
- *
- * \ingroup g_exceptions
- * \ingroup g_package_database
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE AmbiguousPackageNameError :
- public PackageDatabaseLookupError
- {
- private:
- struct NameData;
- NameData * const _name_data;
-
- std::string _name;
-
- public:
- ///\name Basic operations
- ///\{
-
- template <typename I_>
- AmbiguousPackageNameError(const std::string & name,
- I_ begin, const I_ end) throw ();
-
- AmbiguousPackageNameError(const AmbiguousPackageNameError &);
-
- virtual ~AmbiguousPackageNameError() throw ();
-
- ///\}
-
- /**
- * The name of the package.
- */
- const std::string & name() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- ///\name Iterate over possible matches
- ///\{
-
- struct OptionsConstIteratorTag;
- typedef WrappedForwardIterator<OptionsConstIteratorTag,
- const std::string> OptionsConstIterator;
-
- OptionsConstIterator begin_options() const PALUDIS_ATTRIBUTE((warn_unused_result));
- OptionsConstIterator end_options() const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- ///\}
- };
-
- /**
- * Thrown if a Repository with the same name as an existing member is added
- * to a PackageDatabase.
- *
- * \ingroup g_exceptions
- * \ingroup g_package_database
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE DuplicateRepositoryError :
- public PackageDatabaseError
- {
- public:
- /**
- * Constructor.
- */
- DuplicateRepositoryError(const std::string & name) throw ();
- };
-
- /**
- * Thrown if there is no Package in a PackageDatabase with the given
- * name.
- *
- * \ingroup g_exceptions
- * \ingroup g_package_database
- */
- class PALUDIS_VISIBLE NoSuchPackageError :
- public PackageDatabaseLookupError
- {
- private:
- std::string _name;
-
- public:
- ///\name Basic operations
- ///\{
-
- NoSuchPackageError(const std::string & name) throw ();
-
- virtual ~NoSuchPackageError() throw ()
- {
- }
-
- ///\}
-
- /**
- * Name of the package.
- */
- const std::string & name() const
- {
- return _name;
- }
- };
-
- /**
- * Thrown if there is no Repository in a RepositoryDatabase with the given
- * name.
- *
- * \ingroup g_exceptions
- * \ingroup g_package_database
- */
- class PALUDIS_VISIBLE NoSuchRepositoryError : public PackageDatabaseLookupError
- {
- private:
- const RepositoryName _name;
-
- public:
- ///\name Basic operations
- ///\{
-
- NoSuchRepositoryError(const RepositoryName &) throw ();
-
- ~NoSuchRepositoryError() throw ();
-
- ///\}
-
- /**
- * The name of our repository.
- */
- RepositoryName name() const;
- };
-
- /**
* A PackageDatabase, which is owned by an Environment, contains a number of
* Repository instances and supports various querying methods.
*
@@ -219,19 +58,23 @@ namespace paludis
*/
class PALUDIS_VISIBLE PackageDatabase
{
+ friend class EnvironmentImplementation;
+ friend class WrappedForwardIteratorTraits<Environment::RepositoryConstIteratorTag>;
+
private:
Pimp<PackageDatabase> _imp;
static const Filter & all_filter() PALUDIS_ATTRIBUTE((warn_unused_result));
public:
+ ~PackageDatabase();
+
+ protected:
///\name Basic operations
///\{
explicit PackageDatabase(const Environment * const);
- ~PackageDatabase();
-
PackageDatabase(const PackageDatabase &) = delete;
PackageDatabase & operator= (const PackageDatabase &) = delete;
@@ -299,7 +142,6 @@ namespace paludis
};
extern template class WrappedForwardIterator<PackageDatabase::RepositoryConstIteratorTag, const std::shared_ptr<Repository> >;
- extern template class WrappedForwardIterator<AmbiguousPackageNameError::OptionsConstIteratorTag, const std::string>;
}
#endif
diff --git a/paludis/package_database_TEST.cc b/paludis/package_database_TEST.cc
index b56aa44b5..effe522d4 100644
--- a/paludis/package_database_TEST.cc
+++ b/paludis/package_database_TEST.cc
@@ -39,7 +39,6 @@ using namespace paludis;
TEST(PackageDatabase, Repositories)
{
TestEnvironment e;
- PackageDatabase & p(*e.package_database());
const std::shared_ptr<FakeRepository> r1(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
@@ -50,34 +49,34 @@ TEST(PackageDatabase, Repositories)
n::name() = RepositoryName("repo2")
)));
- EXPECT_THROW(p.fetch_repository(RepositoryName("repo1")), NoSuchRepositoryError);
- EXPECT_THROW(p.fetch_repository(RepositoryName("repo2")), NoSuchRepositoryError);
+ EXPECT_THROW(e.fetch_repository(RepositoryName("repo1")), NoSuchRepositoryError);
+ EXPECT_THROW(e.fetch_repository(RepositoryName("repo2")), NoSuchRepositoryError);
- p.add_repository(10, r1);
- ASSERT_TRUE(bool(p.fetch_repository(RepositoryName("repo1"))));
- EXPECT_EQ(RepositoryName("repo1"), p.fetch_repository(RepositoryName("repo1"))->name());
- EXPECT_THROW(p.fetch_repository(RepositoryName("repo2")), NoSuchRepositoryError);
+ e.add_repository(10, r1);
+ ASSERT_TRUE(bool(e.fetch_repository(RepositoryName("repo1"))));
+ EXPECT_EQ(RepositoryName("repo1"), e.fetch_repository(RepositoryName("repo1"))->name());
+ EXPECT_THROW(e.fetch_repository(RepositoryName("repo2")), NoSuchRepositoryError);
- EXPECT_THROW(p.add_repository(10, r1), DuplicateRepositoryError);
+ EXPECT_THROW(e.add_repository(10, r1), DuplicateRepositoryError);
- p.add_repository(11, r2);
- ASSERT_TRUE(bool(p.fetch_repository(RepositoryName("repo1"))));
- EXPECT_EQ(RepositoryName("repo1"), p.fetch_repository(RepositoryName("repo1"))->name());
- ASSERT_TRUE(bool(p.fetch_repository(RepositoryName("repo2"))));
- EXPECT_EQ(RepositoryName("repo2"), p.fetch_repository(RepositoryName("repo2"))->name());
+ e.add_repository(11, r2);
+ ASSERT_TRUE(bool(e.fetch_repository(RepositoryName("repo1"))));
+ EXPECT_EQ(RepositoryName("repo1"), e.fetch_repository(RepositoryName("repo1"))->name());
+ ASSERT_TRUE(bool(e.fetch_repository(RepositoryName("repo2"))));
+ EXPECT_EQ(RepositoryName("repo2"), e.fetch_repository(RepositoryName("repo2"))->name());
- EXPECT_THROW(p.add_repository(10, r1), DuplicateRepositoryError);
- EXPECT_THROW(p.add_repository(5, r2), DuplicateRepositoryError);
+ EXPECT_THROW(e.add_repository(10, r1), DuplicateRepositoryError);
+ EXPECT_THROW(e.add_repository(5, r2), DuplicateRepositoryError);
- ASSERT_TRUE(bool(p.fetch_repository(RepositoryName("repo1"))));
- EXPECT_EQ(RepositoryName("repo1"), p.fetch_repository(RepositoryName("repo1"))->name());
- ASSERT_TRUE(bool(p.fetch_repository(RepositoryName("repo2"))));
- EXPECT_EQ(RepositoryName("repo2"), p.fetch_repository(RepositoryName("repo2"))->name());
+ ASSERT_TRUE(bool(e.fetch_repository(RepositoryName("repo1"))));
+ EXPECT_EQ(RepositoryName("repo1"), e.fetch_repository(RepositoryName("repo1"))->name());
+ ASSERT_TRUE(bool(e.fetch_repository(RepositoryName("repo2"))));
+ EXPECT_EQ(RepositoryName("repo2"), e.fetch_repository(RepositoryName("repo2"))->name());
- EXPECT_TRUE(! p.more_important_than(RepositoryName("repo1"), RepositoryName("repo2")));
- EXPECT_TRUE(p.more_important_than(RepositoryName("repo2"), RepositoryName("repo1")));
- EXPECT_TRUE(! p.more_important_than(RepositoryName("repo2"), RepositoryName("repo2")));
- EXPECT_TRUE(! p.more_important_than(RepositoryName("repo1"), RepositoryName("repo1")));
+ EXPECT_TRUE(! e.more_important_than(RepositoryName("repo1"), RepositoryName("repo2")));
+ EXPECT_TRUE(e.more_important_than(RepositoryName("repo2"), RepositoryName("repo1")));
+ EXPECT_TRUE(! e.more_important_than(RepositoryName("repo2"), RepositoryName("repo2")));
+ EXPECT_TRUE(! e.more_important_than(RepositoryName("repo1"), RepositoryName("repo1")));
}
namespace
@@ -106,7 +105,6 @@ namespace
TEST(PackageDatabase, Disambiguation)
{
TestEnvironment e;
- PackageDatabase & p(*e.package_database());
std::shared_ptr<FakeRepository> r1(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
@@ -115,14 +113,14 @@ TEST(PackageDatabase, Disambiguation)
r1->add_version(CategoryNamePart("cat-one") + PackageNamePart("pkg-two"), VersionSpec("0", { }));
r1->add_version(CategoryNamePart("cat-two") + PackageNamePart("pkg-two"), VersionSpec("0", { }));
r1->add_version(CategoryNamePart("cat-two") + PackageNamePart("pkg-three"), VersionSpec("0", { }));
- p.add_repository(10, r1);
+ e.add_repository(10, r1);
std::shared_ptr<FakeRepository> r2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("repo2"))));
r2->add_version(CategoryNamePart("cat-three") + PackageNamePart("pkg-three"), VersionSpec("0", { }));
r2->add_version(CategoryNamePart("cat-three") + PackageNamePart("pkg-four"), VersionSpec("0", { }));
- p.add_repository(10, r2);
+ e.add_repository(10, r2);
std::shared_ptr<FakeRepository> r3(std::make_shared<CoolFakeRepository>(&e, RepositoryName("repo3")));
r3->add_version(CategoryNamePart("bad-cat1") + PackageNamePart("pkg-important"), VersionSpec("0", { }));
@@ -144,7 +142,7 @@ TEST(PackageDatabase, Disambiguation)
r3->add_version(CategoryNamePart("good-cat2") + PackageNamePart("pkg-fail4"), VersionSpec("0", { }));
r3->add_version(CategoryNamePart("avail-cat") + PackageNamePart("pkg-foo"), VersionSpec("0", { }));
- p.add_repository(10, r3);
+ e.add_repository(10, r3);
std::shared_ptr<FakeInstalledRepository> r4(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
@@ -157,28 +155,27 @@ TEST(PackageDatabase, Disambiguation)
r4->add_version(CategoryNamePart("good-cat1") + PackageNamePart("pkg-fail4"), VersionSpec("0", { }));
r4->add_version(CategoryNamePart("good-cat2") + PackageNamePart("pkg-fail4"), VersionSpec("0", { }));
r4->add_version(CategoryNamePart("inst-cat") + PackageNamePart("pkg-foo"), VersionSpec("0", { }));
- p.add_repository(10, r4);
+ e.add_repository(10, r4);
- EXPECT_EQ("cat-one/pkg-one", stringify(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-one"))));
- EXPECT_EQ("cat-three/pkg-four", stringify(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-four"))));
- EXPECT_EQ("good-cat1/pkg-important", stringify(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-important"))));
- EXPECT_EQ("good-cat1/pkg-installed", stringify(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-installed"))));
+ EXPECT_EQ("cat-one/pkg-one", stringify(e.fetch_unique_qualified_package_name(PackageNamePart("pkg-one"))));
+ EXPECT_EQ("cat-three/pkg-four", stringify(e.fetch_unique_qualified_package_name(PackageNamePart("pkg-four"))));
+ EXPECT_EQ("good-cat1/pkg-important", stringify(e.fetch_unique_qualified_package_name(PackageNamePart("pkg-important"))));
+ EXPECT_EQ("good-cat1/pkg-installed", stringify(e.fetch_unique_qualified_package_name(PackageNamePart("pkg-installed"))));
- EXPECT_THROW(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-two")), AmbiguousPackageNameError);
- EXPECT_THROW(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-three")), AmbiguousPackageNameError);
+ EXPECT_THROW(e.fetch_unique_qualified_package_name(PackageNamePart("pkg-two")), AmbiguousPackageNameError);
+ EXPECT_THROW(e.fetch_unique_qualified_package_name(PackageNamePart("pkg-three")), AmbiguousPackageNameError);
- EXPECT_THROW(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-fail1")), AmbiguousPackageNameError);
- EXPECT_THROW(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-fail2")), AmbiguousPackageNameError);
- EXPECT_THROW(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-fail3")), AmbiguousPackageNameError);
- EXPECT_THROW(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-fail4")), AmbiguousPackageNameError);
+ EXPECT_THROW(e.fetch_unique_qualified_package_name(PackageNamePart("pkg-fail1")), AmbiguousPackageNameError);
+ EXPECT_THROW(e.fetch_unique_qualified_package_name(PackageNamePart("pkg-fail2")), AmbiguousPackageNameError);
+ EXPECT_THROW(e.fetch_unique_qualified_package_name(PackageNamePart("pkg-fail3")), AmbiguousPackageNameError);
+ EXPECT_THROW(e.fetch_unique_qualified_package_name(PackageNamePart("pkg-fail4")), AmbiguousPackageNameError);
- EXPECT_THROW(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-five")), NoSuchPackageError);
+ EXPECT_THROW(e.fetch_unique_qualified_package_name(PackageNamePart("pkg-five")), NoSuchPackageError);
- EXPECT_THROW(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-one"),
+ EXPECT_THROW(e.fetch_unique_qualified_package_name(PackageNamePart("pkg-one"),
filter::SupportsAction<ConfigAction>()), NoSuchPackageError);
- EXPECT_EQ("inst-cat/pkg-foo", stringify(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-foo"))));
- EXPECT_EQ("avail-cat/pkg-foo", stringify(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-foo"), filter::SupportsAction<InstallAction>())));
- EXPECT_THROW(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-foo"), filter::All(), false), AmbiguousPackageNameError);
-
+ EXPECT_EQ("inst-cat/pkg-foo", stringify(e.fetch_unique_qualified_package_name(PackageNamePart("pkg-foo"))));
+ EXPECT_EQ("avail-cat/pkg-foo", stringify(e.fetch_unique_qualified_package_name(PackageNamePart("pkg-foo"), filter::SupportsAction<InstallAction>())));
+ EXPECT_THROW(e.fetch_unique_qualified_package_name(PackageNamePart("pkg-foo"), filter::All(), false), AmbiguousPackageNameError);
}
diff --git a/paludis/package_id.cc b/paludis/package_id.cc
index 1eafa8cec..82663e2e1 100644
--- a/paludis/package_id.cc
+++ b/paludis/package_id.cc
@@ -19,6 +19,11 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/name.hh>
+#include <paludis/version_spec.hh>
+#include <paludis/repository.hh>
+#include <paludis/environment.hh>
+
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/sequence-impl.hh>
@@ -29,10 +34,7 @@
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/wrapped_output_iterator-impl.hh>
#include <paludis/util/hashes.hh>
-#include <paludis/name.hh>
-#include <paludis/version_spec.hh>
-#include <paludis/repository.hh>
-#include <paludis/package_database.hh>
+
#include <functional>
#include <unordered_map>
#include <list>
@@ -170,12 +172,11 @@ namespace paludis
};
}
-PackageIDComparator::PackageIDComparator(const PackageDatabase * const db) :
+PackageIDComparator::PackageIDComparator(const Environment * const e) :
_imp()
{
unsigned c(0);
- for (PackageDatabase::RepositoryConstIterator r(db->begin_repositories()),
- r_end(db->end_repositories()) ; r != r_end ; ++r)
+ for (auto r(e->begin_repositories()), r_end(e->end_repositories()) ; r != r_end ; ++r)
_imp->m.insert(std::make_pair((*r)->name(), ++c));
}
diff --git a/paludis/package_id.hh b/paludis/package_id.hh
index 37976d4c2..1231f519c 100644
--- a/paludis/package_id.hh
+++ b/paludis/package_id.hh
@@ -57,8 +57,6 @@
namespace paludis
{
- class PackageDatabase;
-
/**
* A PackageID represents a unique package version in a particular
* Repository.
@@ -458,8 +456,8 @@ namespace paludis
/**
* A comparison functor that provides a less-than comparison on PackageID
* instances according to, in order, their name, their version, their
- * repository's importance according to the supplied PackageDatabase,
- * and PackageID::arbitrary_less_than_comparison.
+ * repository's importance according to the supplied Environment,
+ * and Environment::arbitrary_less_than_comparison.
*
* \ingroup g_package_id
* \since 0.26
@@ -481,7 +479,7 @@ namespace paludis
///\name Basic operations
///\{
- PackageIDComparator(const PackageDatabase * const);
+ PackageIDComparator(const Environment * const);
PackageIDComparator(const PackageIDComparator &);
~PackageIDComparator();
diff --git a/paludis/repositories/accounts/accounts_id.cc b/paludis/repositories/accounts/accounts_id.cc
index 6755da625..e8a13e840 100644
--- a/paludis/repositories/accounts/accounts_id.cc
+++ b/paludis/repositories/accounts/accounts_id.cc
@@ -38,7 +38,6 @@
#include <paludis/literal_metadata_key.hh>
#include <paludis/environment.hh>
#include <paludis/repository.hh>
-#include <paludis/package_database.hh>
#include <paludis/action.hh>
#include <paludis/user_dep_spec.hh>
#include <algorithm>
@@ -561,7 +560,7 @@ AccountsID::perform_action(Action & action) const
i != i_end ; ++i)
{
Context local_context("When cleaning '" + stringify(**i) + "':");
- auto repo(_imp->env->package_database()->fetch_repository((*i)->repository_name()));
+ auto repo(_imp->env->fetch_repository((*i)->repository_name()));
if (repo->format_key() && repo->format_key()->value() == "installed-accounts"
&& (*i)->name() == name())
continue;
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index 5400bacb1..55e8560a0 100644
--- a/paludis/repositories/accounts/accounts_repository.cc
+++ b/paludis/repositories/accounts/accounts_repository.cc
@@ -39,7 +39,6 @@
#include <paludis/filtered_generator.hh>
#include <paludis/hook.hh>
#include <paludis/common_sets.hh>
-#include <paludis/package_database.hh>
using namespace paludis;
using namespace paludis::accounts_repository;
@@ -397,7 +396,7 @@ bool
AccountsRepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> & id) const
{
auto env(_imp->params_if_installed ? _imp->params_if_installed->environment() : _imp->params_if_not_installed->environment());
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
std::string f(repo->format_key() ? repo->format_key()->value() : "");
return _imp->handler_if_installed && f == "accounts";
}
diff --git a/paludis/repositories/accounts/accounts_repository_TEST.cc b/paludis/repositories/accounts/accounts_repository_TEST.cc
index b96035bee..49aa1e8bc 100644
--- a/paludis/repositories/accounts/accounts_repository_TEST.cc
+++ b/paludis/repositories/accounts/accounts_repository_TEST.cc
@@ -32,7 +32,6 @@
#include <paludis/filtered_generator.hh>
#include <paludis/filter.hh>
#include <paludis/package_id.hh>
-#include <paludis/package_database.hh>
#include <memory>
@@ -49,6 +48,6 @@ TEST(AccountsRepository, Creation)
n::environment() = &env,
n::name() = RepositoryName("accounts")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
EXPECT_EQ("accounts", stringify(repo->name()));
}
diff --git a/paludis/repositories/accounts/accounts_repository_store.cc b/paludis/repositories/accounts/accounts_repository_store.cc
index fb782e316..879c224c3 100644
--- a/paludis/repositories/accounts/accounts_repository_store.cc
+++ b/paludis/repositories/accounts/accounts_repository_store.cc
@@ -35,7 +35,6 @@
#include <paludis/util/strip.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/name.hh>
-#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
#include <paludis/environment.hh>
#include <paludis/literal_metadata_key.hh>
@@ -101,8 +100,7 @@ AccountsRepositoryStore::_load(const RepositoryName & repository_name)
{
Context context("When loading data for AccountsRepository:");
- for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
- r_end(_imp->env->package_database()->end_repositories()) ;
+ for (auto r(_imp->env->begin_repositories()), r_end(_imp->env->end_repositories()) ;
r != r_end ; ++r)
{
Context r_context("When loading data for repository '" + stringify((*r)->name()) + ":");
diff --git a/paludis/repositories/e/aa_visitor_TEST.cc b/paludis/repositories/e/aa_visitor_TEST.cc
index 4d47e41d8..9c29e197d 100644
--- a/paludis/repositories/e/aa_visitor_TEST.cc
+++ b/paludis/repositories/e/aa_visitor_TEST.cc
@@ -25,7 +25,6 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
-#include <paludis/package_database.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
@@ -45,7 +44,7 @@ namespace test_cases
std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo"))));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
AAVisitor p1;
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index 7825cc302..bab3e7c30 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -46,7 +46,6 @@
#include <paludis/choice.hh>
#include <paludis/dep_spec_annotations.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/package_database.hh>
#include <paludis/always_enabled_dependency_label.hh>
#include <paludis/elike_blocker.hh>
#include <map>
diff --git a/paludis/repositories/e/dep_parser_TEST.cc b/paludis/repositories/e/dep_parser_TEST.cc
index b8f53cc5d..9cd51f374 100644
--- a/paludis/repositories/e/dep_parser_TEST.cc
+++ b/paludis/repositories/e/dep_parser_TEST.cc
@@ -23,7 +23,6 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
-#include <paludis/package_database.hh>
#include <paludis/unformatted_pretty_printer.hh>
#include <paludis/util/make_named_values.hh>
#include <sstream>
@@ -56,7 +55,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
UnformattedPrettyPrinter ff;
@@ -82,7 +81,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
UnformattedPrettyPrinter ff;
@@ -108,7 +107,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
UnformattedPrettyPrinter ff;
@@ -135,7 +134,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
SpecTreePrettyPrinter d1(ff, { });
@@ -171,7 +170,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
SpecTreePrettyPrinter d(ff, { });
@@ -193,7 +192,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
SpecTreePrettyPrinter d(ff, { });
@@ -215,7 +214,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
SpecTreePrettyPrinter d(ff, { });
@@ -249,7 +248,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
SpecTreePrettyPrinter d(ff, { });
@@ -275,7 +274,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
SpecTreePrettyPrinter d(ff, { });
@@ -300,7 +299,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
SpecTreePrettyPrinter d(ff, { });
@@ -321,7 +320,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
SpecTreePrettyPrinter d(ff, { ppo_multiline_allowed });
@@ -353,7 +352,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
SpecTreePrettyPrinter d(ff, { });
@@ -386,7 +385,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
SpecTreePrettyPrinter d(ff, { });
@@ -441,7 +440,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
SpecTreePrettyPrinter d(ff, { });
@@ -465,7 +464,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
SpecTreePrettyPrinter d(ff, { });
@@ -488,7 +487,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
UnformattedPrettyPrinter ff;
@@ -516,7 +515,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
UnformattedPrettyPrinter ff;
diff --git a/paludis/repositories/e/depend_rdepend_TEST.cc b/paludis/repositories/e/depend_rdepend_TEST.cc
index f1bf6ee98..e0125deb7 100644
--- a/paludis/repositories/e/depend_rdepend_TEST.cc
+++ b/paludis/repositories/e/depend_rdepend_TEST.cc
@@ -26,7 +26,6 @@
#include <paludis/util/sequence.hh>
#include <paludis/repository_factory.hh>
#include <paludis/repository.hh>
-#include <paludis/package_database.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/action.hh>
#include <paludis/selection.hh>
@@ -120,7 +119,7 @@ namespace
keys->insert("root", stringify(root));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "vdb");
@@ -130,17 +129,17 @@ namespace
v_keys->insert("root", stringify(root));
std::shared_ptr<Repository> v_repo(VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, v_repo);
+ env.add_repository(1, v_repo);
#ifdef ENABLE_VIRTUALS_REPOSITORY
std::shared_ptr<Map<std::string, std::string> > iv_keys(std::make_shared<Map<std::string, std::string>>());
iv_keys->insert("root", "/");
iv_keys->insert("format", "installed_virtuals");
- env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
+ env.add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, iv_keys, std::placeholders::_1)));
std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "virtuals");
- env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
+ env.add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, v_keys, std::placeholders::_1)));
#endif
diff --git a/paludis/repositories/e/do_fetch_action.cc b/paludis/repositories/e/do_fetch_action.cc
index 46ac11803..d79ec5653 100644
--- a/paludis/repositories/e/do_fetch_action.cc
+++ b/paludis/repositories/e/do_fetch_action.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 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
@@ -28,10 +28,14 @@
#include <paludis/repositories/e/make_use.hh>
#include <paludis/repositories/e/can_skip_phase.hh>
#include <paludis/repositories/e/ebuild.hh>
+
#include <paludis/util/strip.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_output_iterator.hh>
+#include <paludis/util/stringify.hh>
+#include <paludis/util/join.hh>
+
#include <paludis/dep_spec_flattener.hh>
#include <paludis/metadata_key.hh>
#include <paludis/environment.hh>
diff --git a/paludis/repositories/e/do_info_action.cc b/paludis/repositories/e/do_info_action.cc
index 54d4f70e0..2d89dfe99 100644
--- a/paludis/repositories/e/do_info_action.cc
+++ b/paludis/repositories/e/do_info_action.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 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
@@ -23,8 +23,12 @@
#include <paludis/repositories/e/check_userpriv.hh>
#include <paludis/repositories/e/make_use.hh>
#include <paludis/repositories/e/ebuild.hh>
+
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/stringify.hh>
+#include <paludis/util/join.hh>
+
#include <paludis/dep_spec_flattener.hh>
#include <paludis/action.hh>
#include <paludis/metadata_key.hh>
diff --git a/paludis/repositories/e/do_install_action.cc b/paludis/repositories/e/do_install_action.cc
index d12349040..bcd550a27 100644
--- a/paludis/repositories/e/do_install_action.cc
+++ b/paludis/repositories/e/do_install_action.cc
@@ -28,12 +28,15 @@
#include <paludis/repositories/e/can_skip_phase.hh>
#include <paludis/repositories/e/e_stripper.hh>
#include <paludis/repositories/e/ebuild.hh>
+
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/join.hh>
+
#include <paludis/action.hh>
#include <paludis/dep_spec_flattener.hh>
#include <paludis/metadata_key.hh>
diff --git a/paludis/repositories/e/do_pretend_action.cc b/paludis/repositories/e/do_pretend_action.cc
index d55fc8f19..a282dc306 100644
--- a/paludis/repositories/e/do_pretend_action.cc
+++ b/paludis/repositories/e/do_pretend_action.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 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,8 +26,12 @@
#include <paludis/repositories/e/required_use_verifier.hh>
#include <paludis/repositories/e/ebuild.hh>
#include <paludis/repositories/e/can_skip_phase.hh>
+
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/stringify.hh>
+#include <paludis/util/join.hh>
+
#include <paludis/dep_spec_flattener.hh>
#include <paludis/metadata_key.hh>
#include <paludis/environment.hh>
diff --git a/paludis/repositories/e/do_pretend_fetch_action.cc b/paludis/repositories/e/do_pretend_fetch_action.cc
index af9a0f0ed..e455b0357 100644
--- a/paludis/repositories/e/do_pretend_fetch_action.cc
+++ b/paludis/repositories/e/do_pretend_fetch_action.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 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
@@ -19,6 +19,9 @@
#include <paludis/repositories/e/do_pretend_fetch_action.hh>
#include <paludis/repositories/e/pretend_fetch_visitor.hh>
+
+#include <paludis/util/stringify.hh>
+
#include <paludis/action.hh>
#include <paludis/metadata_key.hh>
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index 2c670d198..4c07d8ad0 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -24,6 +24,7 @@
#include <paludis/repositories/e/eapi_phase.hh>
#include <paludis/repositories/e/ebuild.hh>
#include <paludis/repositories/e/e_repository.hh>
+
#include <paludis/util/visitor_cast.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/mutex.hh>
@@ -39,6 +40,8 @@
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/process.hh>
#include <paludis/util/fs_stat.hh>
+#include <paludis/util/join.hh>
+
#include <paludis/action.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
@@ -139,7 +142,7 @@ EInstalledRepository::some_ids_might_not_be_masked() const
bool
EInstalledRepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> & id) const
{
- auto repo(_imp->params.environment()->package_database()->fetch_repository(id->repository_name()));
+ auto repo(_imp->params.environment()->fetch_repository(id->repository_name()));
std::string f(repo->format_key() ? repo->format_key()->value() : "");
return f == "e" || f == "ebuild" || f == "exheres" || f == "portage";
}
@@ -311,10 +314,10 @@ EInstalledRepository::perform_info(
o != o_end ; ++o)
{
RepositoryName rn(*o);
- if (_imp->params.environment()->package_database()->has_repository_named(rn))
+ if (_imp->params.environment()->has_repository_named(rn))
{
const std::shared_ptr<const Repository> r(
- _imp->params.environment()->package_database()->fetch_repository(rn));
+ _imp->params.environment()->fetch_repository(rn));
Repository::MetadataConstIterator m(r->find_metadata("info_vars"));
if (r->end_metadata() != m)
{
@@ -333,9 +336,7 @@ EInstalledRepository::perform_info(
/* try to find an info_vars file from any repo */
if (! i)
{
- for (PackageDatabase::RepositoryConstIterator
- r(_imp->params.environment()->package_database()->begin_repositories()),
- r_end(_imp->params.environment()->package_database()->end_repositories()) ;
+ for (auto r(_imp->params.environment()->begin_repositories()), r_end(_imp->params.environment()->end_repositories()) ;
r != r_end ; ++r)
{
Repository::MetadataConstIterator m((*r)->find_metadata("info_vars"));
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index ec8cf9954..da4b28cfd 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -50,7 +50,6 @@
#include <paludis/literal_metadata_key.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/elike_choices.hh>
-#include <paludis/package_database.hh>
#include <paludis/always_enabled_dependency_label.hh>
#include <iterator>
@@ -972,19 +971,19 @@ namespace
void visit(const UninstallAction & a)
{
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
std::static_pointer_cast<const EInstalledRepository>(repo)->perform_uninstall(id, a);
}
void visit(const ConfigAction & a)
{
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
std::static_pointer_cast<const EInstalledRepository>(repo)->perform_config(id, a);
}
void visit(const InfoAction & a)
{
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
std::static_pointer_cast<const EInstalledRepository>(repo)->perform_info(id, a);
}
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index df5b02381..31748aa94 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -73,6 +73,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_null_shared_ptr.hh>
@@ -926,7 +927,7 @@ ERepository::params() const
bool
ERepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> & id) const
{
- auto repo(_imp->params.environment()->package_database()->fetch_repository(id->repository_name()));
+ auto repo(_imp->params.environment()->fetch_repository(id->repository_name()));
std::string f(repo->format_key() ? repo->format_key()->value() : "");
if (f == "e")
return static_cast<const ERepositoryID &>(*id).eapi()->supported()->can_be_pbin();
@@ -1214,7 +1215,7 @@ ERepository::repository_factory_create(
RepositoryName master_repository_name(f("master_repository"));
std::shared_ptr<Repository> master_repository_uncasted(
- env->package_database()->fetch_repository(master_repository_name));
+ env->fetch_repository(master_repository_name));
std::string format("unknown");
if (master_repository_uncasted->format_key())
@@ -1248,7 +1249,7 @@ ERepository::repository_factory_create(
try
{
std::shared_ptr<Repository> master_repository_uncasted(
- env->package_database()->fetch_repository(master_repository_name));
+ env->fetch_repository(master_repository_name));
std::string format("unknown");
if (master_repository_uncasted->format_key())
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index 3fc9c5e77..0a78c6941 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_E_REPOSITORY_HH 1
#include <paludis/repository.hh>
-#include <paludis/package_database.hh>
#include <paludis/mask-fwd.hh>
#include <paludis/util/pimp.hh>
#include <paludis/repositories/e/e_repository_params.hh>
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 39ad42a2e..709fcdf5a 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -379,7 +379,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -424,7 +424,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -477,7 +477,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
for (int pass = 1 ; pass <= 3 ; ++pass)
{
@@ -557,7 +557,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -600,7 +600,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1))));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -680,7 +680,7 @@ namespace test_cases
keys18->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo18(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys18, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo18);
+ env.add_repository(1, repo18);
std::shared_ptr<Map<std::string, std::string> > keys19(std::make_shared<Map<std::string, std::string>>());
keys19->insert("format", "e");
@@ -690,7 +690,7 @@ namespace test_cases
keys19->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo19(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys19, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo19);
+ env.add_repository(1, repo19);
TEST_CHECK((*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=category/package-1::test-repo-18",
@@ -735,7 +735,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -769,7 +769,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1))));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
bool has_one(false), has_two(false);
int count(0);
@@ -810,7 +810,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1))));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
bool has_one(false), has_two(false), has_three(false);
int count(0);
@@ -857,7 +857,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1))));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
repo->make_manifest(QualifiedPackageName("category/package"));
std::multiset<std::string> made_manifest, reference_manifest;
@@ -907,7 +907,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
FetchAction action(make_named_values<FetchActionOptions>(
n::errors() = std::make_shared<Sequence<FetchActionFailure>>(),
@@ -1014,7 +1014,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1))));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
FetchAction action(make_named_values<FetchActionOptions>(
n::errors() = std::make_shared<Sequence<FetchActionFailure>>(),
diff --git a/paludis/repositories/e/e_repository_TEST_0.cc b/paludis/repositories/e/e_repository_TEST_0.cc
index 99eb4a710..b942f67ff 100644
--- a/paludis/repositories/e/e_repository_TEST_0.cc
+++ b/paludis/repositories/e/e_repository_TEST_0.cc
@@ -122,7 +122,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_0_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
@@ -133,17 +133,17 @@ namespace test_cases
)));
installed_repo->add_version("cat", "pretend-installed", "0")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
installed_repo->add_version("cat", "pretend-installed", "1")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
- env.package_database()->add_repository(2, installed_repo);
+ env.add_repository(2, installed_repo);
#ifdef ENABLE_VIRTUALS_REPOSITORY
std::shared_ptr<Map<std::string, std::string> > iv_keys(std::make_shared<Map<std::string, std::string>>());
iv_keys->insert("root", "/");
iv_keys->insert("format", "installed_virtuals");
- env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
+ env.add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, iv_keys, std::placeholders::_1)));
std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "virtuals");
- env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
+ env.add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, v_keys, std::placeholders::_1)));
#endif
diff --git a/paludis/repositories/e/e_repository_TEST_1.cc b/paludis/repositories/e/e_repository_TEST_1.cc
index b25028c0d..7e6f853b6 100644
--- a/paludis/repositories/e/e_repository_TEST_1.cc
+++ b/paludis/repositories/e/e_repository_TEST_1.cc
@@ -115,7 +115,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_1_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
@@ -124,7 +124,7 @@ namespace test_cases
n::suitable_destination() = true,
n::supports_uninstall() = true
)));
- env.package_database()->add_repository(2, installed_repo);
+ env.add_repository(2, installed_repo);
InstallAction action(make_named_values<InstallActionOptions>(
n::destination() = installed_repo,
diff --git a/paludis/repositories/e/e_repository_TEST_2.cc b/paludis/repositories/e/e_repository_TEST_2.cc
index 54db72039..16d5fdb1d 100644
--- a/paludis/repositories/e/e_repository_TEST_2.cc
+++ b/paludis/repositories/e/e_repository_TEST_2.cc
@@ -115,7 +115,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_2_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
@@ -124,7 +124,7 @@ namespace test_cases
n::suitable_destination() = true,
n::supports_uninstall() = true
)));
- env.package_database()->add_repository(2, installed_repo);
+ env.add_repository(2, installed_repo);
InstallAction action(make_named_values<InstallActionOptions>(
n::destination() = installed_repo,
diff --git a/paludis/repositories/e/e_repository_TEST_3.cc b/paludis/repositories/e/e_repository_TEST_3.cc
index 45d186c45..79c0e02d5 100644
--- a/paludis/repositories/e/e_repository_TEST_3.cc
+++ b/paludis/repositories/e/e_repository_TEST_3.cc
@@ -115,7 +115,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_3_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
@@ -124,7 +124,7 @@ namespace test_cases
n::suitable_destination() = true,
n::supports_uninstall() = true
)));
- env.package_database()->add_repository(2, installed_repo);
+ env.add_repository(2, installed_repo);
InstallAction action(make_named_values<InstallActionOptions>(
n::destination() = installed_repo,
diff --git a/paludis/repositories/e/e_repository_TEST_4.cc b/paludis/repositories/e/e_repository_TEST_4.cc
index 3492f6534..141cd3a9a 100644
--- a/paludis/repositories/e/e_repository_TEST_4.cc
+++ b/paludis/repositories/e/e_repository_TEST_4.cc
@@ -116,7 +116,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_4_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
@@ -125,7 +125,7 @@ namespace test_cases
n::suitable_destination() = true,
n::supports_uninstall() = true
)));
- env.package_database()->add_repository(2, installed_repo);
+ env.add_repository(2, installed_repo);
InstallAction action(make_named_values<InstallActionOptions>(
n::destination() = installed_repo,
@@ -277,7 +277,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_4_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "vdb");
@@ -287,7 +287,7 @@ namespace test_cases
v_keys->insert("root", stringify(root));
std::shared_ptr<Repository> v_repo(VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, v_repo);
+ env.add_repository(1, v_repo);
{
InstallAction action(make_named_values<InstallActionOptions>(
@@ -343,7 +343,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_4_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<Map<std::string, std::string> > b_keys(std::make_shared<Map<std::string, std::string>>());
b_keys->insert("format", "e");
@@ -363,7 +363,7 @@ namespace test_cases
b_keys->insert("root", stringify(root));
std::shared_ptr<Repository> b_repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, b_keys, std::placeholders::_1)));
- env.package_database()->add_repository(2, b_repo);
+ env.add_repository(2, b_repo);
std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "vdb");
@@ -373,7 +373,7 @@ namespace test_cases
v_keys->insert("root", stringify(root));
std::shared_ptr<Repository> v_repo(VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, v_repo);
+ env.add_repository(1, v_repo);
{
InstallAction action(make_named_values<InstallActionOptions>(
@@ -448,7 +448,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_4_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
@@ -457,7 +457,7 @@ namespace test_cases
n::suitable_destination() = true,
n::supports_uninstall() = true
)));
- env.package_database()->add_repository(2, installed_repo);
+ env.add_repository(2, installed_repo);
{
PretendAction pretend_action(make_named_values<PretendActionOptions>(
diff --git a/paludis/repositories/e/e_repository_TEST_ever.cc b/paludis/repositories/e/e_repository_TEST_ever.cc
index 5aa7813e0..f1fd198e1 100644
--- a/paludis/repositories/e/e_repository_TEST_ever.cc
+++ b/paludis/repositories/e/e_repository_TEST_ever.cc
@@ -123,7 +123,7 @@ namespace
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_ever_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
@@ -134,17 +134,17 @@ namespace
)));
installed_repo->add_version("cat", "pretend-installed", "0")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
installed_repo->add_version("cat", "pretend-installed", "1")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
- env.package_database()->add_repository(2, installed_repo);
+ env.add_repository(2, installed_repo);
#ifdef ENABLE_VIRTUALS_REPOSITORY
std::shared_ptr<Map<std::string, std::string> > iv_keys(std::make_shared<Map<std::string, std::string>>());
iv_keys->insert("root", "/");
iv_keys->insert("format", "installed_virtuals");
- env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
+ env.add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, iv_keys, std::placeholders::_1)));
std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "virtuals");
- env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
+ env.add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, v_keys, std::placeholders::_1)));
#endif
diff --git a/paludis/repositories/e/e_repository_TEST_exheres_0.cc b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
index 3eea8c5a4..31cb7f15f 100644
--- a/paludis/repositories/e/e_repository_TEST_exheres_0.cc
+++ b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
@@ -120,7 +120,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_exheres_0_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
@@ -131,17 +131,17 @@ namespace test_cases
)));
installed_repo->add_version("cat", "pretend-installed", "0")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
installed_repo->add_version("cat", "pretend-installed", "1")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
- env.package_database()->add_repository(2, installed_repo);
+ env.add_repository(2, installed_repo);
#ifdef ENABLE_VIRTUALS_REPOSITORY
std::shared_ptr<Map<std::string, std::string> > iv_keys(std::make_shared<Map<std::string, std::string>>());
iv_keys->insert("root", "/");
iv_keys->insert("format", "installed_virtuals");
- env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
+ env.add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, iv_keys, std::placeholders::_1)));
std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "virtuals");
- env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
+ env.add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, v_keys, std::placeholders::_1)));
#endif
diff --git a/paludis/repositories/e/e_repository_TEST_exlibs.cc b/paludis/repositories/e/e_repository_TEST_exlibs.cc
index 505f220c9..3d5af11fb 100644
--- a/paludis/repositories/e/e_repository_TEST_exlibs.cc
+++ b/paludis/repositories/e/e_repository_TEST_exlibs.cc
@@ -131,7 +131,7 @@ namespace
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_exlibs_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
@@ -140,7 +140,7 @@ namespace
n::suitable_destination() = true,
n::supports_uninstall() = true
)));
- env.package_database()->add_repository(2, installed_repo);
+ env.add_repository(2, installed_repo);
InstallAction action(make_named_values<InstallActionOptions>(
n::destination() = installed_repo,
diff --git a/paludis/repositories/e/e_repository_TEST_pbin.cc b/paludis/repositories/e/e_repository_TEST_pbin.cc
index c27bca9e4..27a46b6d5 100644
--- a/paludis/repositories/e/e_repository_TEST_pbin.cc
+++ b/paludis/repositories/e/e_repository_TEST_pbin.cc
@@ -125,7 +125,7 @@ namespace test_cases
keys->insert("root", stringify(root));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<Map<std::string, std::string> > b_keys(std::make_shared<Map<std::string, std::string>>());
b_keys->insert("format", "e");
@@ -145,7 +145,7 @@ namespace test_cases
b_keys->insert("root", stringify(root));
std::shared_ptr<Repository> b_repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, b_keys, std::placeholders::_1)));
- env.package_database()->add_repository(2, b_repo);
+ env.add_repository(2, b_repo);
std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "vdb");
@@ -155,7 +155,7 @@ namespace test_cases
v_keys->insert("root", stringify(root));
std::shared_ptr<Repository> v_repo(VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, v_repo);
+ env.add_repository(1, v_repo);
{
InstallAction bin_action(make_named_values<InstallActionOptions>(
diff --git a/paludis/repositories/e/e_repository_TEST_phases.cc b/paludis/repositories/e/e_repository_TEST_phases.cc
index 29728e89a..b20afd33c 100644
--- a/paludis/repositories/e/e_repository_TEST_phases.cc
+++ b/paludis/repositories/e/e_repository_TEST_phases.cc
@@ -131,7 +131,7 @@ namespace
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_phases_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
@@ -142,17 +142,17 @@ namespace
)));
installed_repo->add_version("cat", "pretend-installed", "0")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
installed_repo->add_version("cat", "pretend-installed", "1")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
- env.package_database()->add_repository(2, installed_repo);
+ env.add_repository(2, installed_repo);
#ifdef ENABLE_VIRTUALS_REPOSITORY
std::shared_ptr<Map<std::string, std::string> > iv_keys(std::make_shared<Map<std::string, std::string>>());
iv_keys->insert("root", "/");
iv_keys->insert("format", "installed_virtuals");
- env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
+ env.add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, iv_keys, std::placeholders::_1)));
std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "virtuals");
- env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
+ env.add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, v_keys, std::placeholders::_1)));
#endif
diff --git a/paludis/repositories/e/e_repository_TEST_replacing.cc b/paludis/repositories/e/e_repository_TEST_replacing.cc
index 93b8defc2..17c236367 100644
--- a/paludis/repositories/e/e_repository_TEST_replacing.cc
+++ b/paludis/repositories/e/e_repository_TEST_replacing.cc
@@ -127,7 +127,7 @@ namespace
keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_replacing_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
@@ -139,7 +139,7 @@ namespace
installed_repo->add_version("cat", replacing_pkg_name, "1")->set_slot(SlotName("1"));
installed_repo->add_version("cat", replacing_pkg_name, "2")->set_slot(SlotName("2"));
installed_repo->add_version("cat", replacing_pkg_name, "3")->set_slot(SlotName("3"));
- env.package_database()->add_repository(2, installed_repo);
+ env.add_repository(2, installed_repo);
const std::shared_ptr<const PackageIDSequence> rlist(env[selection::AllVersionsSorted(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(replacing, &env, { })),
diff --git a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
index 19861d100..366a7522b 100644
--- a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
+++ b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
@@ -117,7 +117,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath(stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root")).realpath()));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
@@ -128,7 +128,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath(stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root")).realpath()));
std::shared_ptr<Repository> installed_repo(VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, installed_repo);
+ env.add_repository(1, installed_repo);
InstallAction action(make_named_values<InstallActionOptions>(
n::destination() = installed_repo,
diff --git a/paludis/repositories/e/e_repository_params.hh b/paludis/repositories/e/e_repository_params.hh
index a5dc7ded9..7c3c368c4 100644
--- a/paludis/repositories/e/e_repository_params.hh
+++ b/paludis/repositories/e/e_repository_params.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -34,7 +34,6 @@
namespace paludis
{
class Environment;
- class PackageDatabase;
class ERepository;
typedef Sequence<std::shared_ptr<const ERepository> > ERepositorySequence;
diff --git a/paludis/repositories/e/e_repository_sets_TEST.cc b/paludis/repositories/e/e_repository_sets_TEST.cc
index ca7aabaa5..a32a2a112 100644
--- a/paludis/repositories/e/e_repository_sets_TEST.cc
+++ b/paludis/repositories/e/e_repository_sets_TEST.cc
@@ -26,6 +26,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/set.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/join.hh>
#include <paludis/unformatted_pretty_printer.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -63,7 +64,7 @@ namespace test_cases
keys->insert("profiles", "e_repository_sets_TEST_dir/repo1/profiles/profile");
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const SetNameSet> sets_list(env.set_names());
TEST_CHECK_EQUAL(join(sets_list->begin(), sets_list->end(), " "), "everything insecurity "
@@ -99,8 +100,8 @@ namespace test_cases
n::supports_uninstall() = true
)));
installed->add_version("cat-two", "bar", "1.5");
- env.package_database()->add_repository(0, installed);
- env.package_database()->add_repository(1, repo);
+ env.add_repository(0, installed);
+ env.add_repository(1, repo);
std::shared_ptr<const SetSpecTree> set1(env.set(SetName("set1::test-repo-1")));
TEST_CHECK(bool(set1));
@@ -131,7 +132,7 @@ namespace test_cases
keys->insert("profiles", "e_repository_sets_TEST_dir/repo1/profiles/profile");
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const SetSpecTree> insecurity(env.set(SetName("insecurity::test-repo-1")));
UnformattedPrettyPrinter ff;
@@ -162,7 +163,7 @@ namespace test_cases
keys->insert("profiles", "e_repository_sets_TEST_dir/repo1/profiles/profile");
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<FakeInstalledRepository> installed(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
@@ -175,7 +176,7 @@ namespace test_cases
installed->add_version("cat-three", "baz", "1.0");
installed->add_version("cat-four", "xyzzy", "1.1.0")->set_slot(SlotName("1"));
installed->add_version("cat-four", "xyzzy", "2.0.1")->set_slot(SlotName("2"));
- env.package_database()->add_repository(0, installed);
+ env.add_repository(0, installed);
std::shared_ptr<const SetSpecTree> security(env.set(SetName("security::test-repo-1")));
UnformattedPrettyPrinter ff;
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 11b7bc648..377b6fb49 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -511,7 +511,7 @@ EbuildMetadataCommand::load(const std::shared_ptr<const EbuildID> & id)
id->set_eapi(s);
else
{
- auto repo(params.environment()->package_database()->fetch_repository(id->repository_name()));
+ auto repo(params.environment()->fetch_repository(id->repository_name()));
auto e_repo(std::static_pointer_cast<const ERepository>(repo));
id->set_eapi(e_repo->params().eapi_when_unspecified());
}
diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh
index 538399bee..57259c34d 100644
--- a/paludis/repositories/e/ebuild.hh
+++ b/paludis/repositories/e/ebuild.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 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
@@ -23,10 +23,18 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/map-fwd.hh>
#include <paludis/util/process-fwd.hh>
-#include <paludis/package_database.hh>
+#include <paludis/util/named_value.hh>
+#include <paludis/util/fs_path.hh>
+
#include <paludis/action-fwd.hh>
#include <paludis/fs_merger-fwd.hh>
+#include <paludis/output_manager-fwd.hh>
+#include <paludis/repository-fwd.hh>
+#include <paludis/package_id-fwd.hh>
+#include <paludis/merger.hh>
+
#include <string>
+#include <memory>
/** \file
* Declarations for the EbuildCommand classes.
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index 538ad6e00..b3bfa68f4 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -18,7 +18,11 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "ebuild_flat_metadata_cache.hh"
+#include <paludis/repositories/e/ebuild_flat_metadata_cache.hh>
+#include <paludis/repositories/e/dep_parser.hh>
+#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
+
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/join.hh>
@@ -30,13 +34,12 @@
#include <paludis/util/timestamp.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/util/fs_error.hh>
-#include <paludis/repositories/e/dep_parser.hh>
-#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
#include <paludis/util/pimp-impl.hh>
+
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/unformatted_pretty_printer.hh>
+#include <paludis/repository.hh>
+
#include <set>
#include <map>
#include <list>
@@ -131,7 +134,7 @@ namespace
{
std::set<std::string> tokens;
tokenise_whitespace(lines[m.inherited()->flat_list_index()], std::inserter(tokens, tokens.begin()));
- auto repo(_imp->env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(_imp->env->fetch_repository(id->repository_name()));
FSPath eclassdir((repo->location_key()->value() / "eclass").realpath_if_exists());
for (std::set<std::string>::const_iterator it(tokens.begin()),
it_end(tokens.end()); it_end != it; ++it)
@@ -399,7 +402,7 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
{
std::vector<std::string> eclasses;
tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(keys["_eclasses_"], "\t", "", std::back_inserter(eclasses));
- auto repo(_imp->env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(_imp->env->fetch_repository(id->repository_name()));
FSPath eclassdir((repo->location_key()->value() / "eclass").realpath_if_exists());
for (std::vector<std::string>::const_iterator it(eclasses.begin()),
it_end(eclasses.end()); it_end != it; ++it)
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc
index ba6763fd5..f05eeba55 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc
@@ -35,6 +35,7 @@
#include <paludis/util/timestamp.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/join.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <iterator>
@@ -73,7 +74,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-1",
@@ -100,7 +101,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-stale-1",
@@ -128,7 +129,7 @@ namespace test_cases
keys->insert("eapi_when_unknown", "1");
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-guessed-eapi-1",
@@ -155,7 +156,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-eclass-1",
@@ -185,7 +186,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-eclass-stale-1",
@@ -212,7 +213,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-eclass-wrong-1",
@@ -239,7 +240,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-eclass-gone-1",
@@ -266,7 +267,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-detection-1",
@@ -293,7 +294,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-1",
@@ -321,7 +322,7 @@ namespace test_cases
keys->insert("eapi_when_unknown", "1");
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-guessed-eapi-1",
@@ -348,7 +349,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-guessed-eapi-extension-1",
@@ -375,7 +376,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-no-guessed-eapi-1",
@@ -402,7 +403,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-empty-1",
@@ -430,7 +431,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-stale-1",
@@ -457,7 +458,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-no-mtime-1",
@@ -484,7 +485,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-no-mtime-stale-1",
@@ -511,7 +512,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-bad-mtime-1",
@@ -538,7 +539,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-no-eapi-1",
@@ -565,7 +566,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-duplicate-key-1",
@@ -592,7 +593,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclass-1",
@@ -622,7 +623,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclass-stale-1",
@@ -649,7 +650,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclass-wrong-1",
@@ -675,7 +676,7 @@ namespace test_cases
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclass-gone-1",
@@ -702,7 +703,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-full-eclass-1",
@@ -732,7 +733,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-full-eclass-nonstandard-1",
@@ -762,7 +763,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-full-eclass-stale-1",
@@ -789,7 +790,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-full-eclass-wrong-1",
@@ -816,7 +817,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-full-eclass-gone-1",
@@ -843,7 +844,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclasses-truncated-1",
@@ -877,7 +878,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclasses-bad-mtime-1",
@@ -904,7 +905,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclasses-spaces-1",
@@ -932,7 +933,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlib-1",
@@ -963,7 +964,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlib-percat-1",
@@ -994,7 +995,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlib-stale-1",
@@ -1022,7 +1023,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlib-wrong-1",
@@ -1050,7 +1051,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlib-gone-1",
@@ -1078,7 +1079,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlibs-truncated-1",
@@ -1113,7 +1114,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlibs-bad-mtime-1",
@@ -1141,7 +1142,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlibs-spaces-1",
@@ -1175,7 +1176,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/write-1",
@@ -1210,7 +1211,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/write-eapi1-1",
@@ -1247,7 +1248,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/write-eclasses-1",
@@ -1283,7 +1284,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/write-exlibs-1",
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 775edecab..6e776da37 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -67,6 +67,7 @@
#include <paludis/util/singleton-impl.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/fs_stat.hh>
+#include <paludis/util/join.hh>
#include <set>
#include <iterator>
@@ -207,7 +208,7 @@ namespace
{
if (! g.empty())
return g;
- auto repo(env->package_database()->fetch_repository(repo_name));
+ auto repo(env->fetch_repository(repo_name));
auto e_repo(std::static_pointer_cast<const ERepository>(repo));
return e_repo->params().eapi_when_unknown();
}
@@ -242,7 +243,7 @@ EbuildID::need_keys_added() const
add_metadata_key(_imp->fs_location);
- auto repo(_imp->environment->package_database()->fetch_repository(repository_name()));
+ auto repo(_imp->environment->fetch_repository(repository_name()));
auto e_repo(std::static_pointer_cast<const ERepository>(repo));
FSPath cache_file(e_repo->params().cache());
cache_file /= stringify(name().category());
@@ -526,7 +527,7 @@ EbuildID::need_masks_added() const
return;
}
- auto repo(_imp->environment->package_database()->fetch_repository(_imp->repository_name));
+ auto repo(_imp->environment->fetch_repository(_imp->repository_name));
auto e_repo(std::static_pointer_cast<const ERepository>(repo));
if (keywords_key())
@@ -1230,7 +1231,7 @@ namespace
void visit(InstallAction & a)
{
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
auto e_repo(std::static_pointer_cast<const ERepository>(repo));
do_install_action(
env,
@@ -1241,7 +1242,7 @@ namespace
void visit(FetchAction & a)
{
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
auto e_repo(std::static_pointer_cast<const ERepository>(repo));
do_fetch_action(
env,
@@ -1252,7 +1253,7 @@ namespace
void visit(PretendFetchAction & a)
{
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
auto e_repo(std::static_pointer_cast<const ERepository>(repo));
do_pretend_fetch_action(
env,
@@ -1263,7 +1264,7 @@ namespace
void visit(PretendAction & action)
{
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
auto e_repo(std::static_pointer_cast<const ERepository>(repo));
if (! do_pretend_action(
env,
@@ -1275,7 +1276,7 @@ namespace
void visit(InfoAction & action)
{
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
auto e_repo(std::static_pointer_cast<const ERepository>(repo));
do_info_action(
env,
@@ -1428,7 +1429,7 @@ EbuildID::make_choice_value(
if (! eapi()->supported())
throw InternalError(PALUDIS_HERE, "Unsupported EAPI");
- auto repo(_imp->environment->package_database()->fetch_repository(repository_name()));
+ auto repo(_imp->environment->fetch_repository(repository_name()));
auto e_repo(std::static_pointer_cast<const ERepository>(repo));
std::string name_with_prefix_s;
@@ -1625,7 +1626,7 @@ EbuildID::add_build_options(const std::shared_ptr<Choices> & choices) const
void
EbuildID::purge_invalid_cache() const
{
- auto repo(_imp->environment->package_database()->fetch_repository(repository_name()));
+ auto repo(_imp->environment->fetch_repository(repository_name()));
auto e_repo(std::static_pointer_cast<const ERepository>(repo));
FSPath write_cache_file(e_repo->params().write_cache());
diff --git a/paludis/repositories/e/exheres_layout.cc b/paludis/repositories/e/exheres_layout.cc
index 5179914a2..1fd3e090a 100644
--- a/paludis/repositories/e/exheres_layout.cc
+++ b/paludis/repositories/e/exheres_layout.cc
@@ -46,7 +46,6 @@
#include <paludis/choice.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/package_id.hh>
-#include <paludis/package_database.hh>
#include <unordered_map>
#include <functional>
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 9177c0e9a..57b62e9a8 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -24,6 +24,7 @@
#include <paludis/repositories/e/eapi_phase.hh>
#include <paludis/repositories/e/extra_distribution_data.hh>
#include <paludis/repositories/e/can_skip_phase.hh>
+
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/log.hh>
#include <paludis/util/sequence.hh>
@@ -37,6 +38,8 @@
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/join.hh>
+
#include <paludis/output_manager.hh>
#include <paludis/distribution.hh>
#include <paludis/environment.hh>
@@ -47,6 +50,7 @@
#include <paludis/package_id.hh>
#include <paludis/action.hh>
#include <paludis/literal_metadata_key.hh>
+
#include <functional>
using namespace paludis;
diff --git a/paludis/repositories/e/exndbam_repository_TEST.cc b/paludis/repositories/e/exndbam_repository_TEST.cc
index 21e6836ee..a96534669 100644
--- a/paludis/repositories/e/exndbam_repository_TEST.cc
+++ b/paludis/repositories/e/exndbam_repository_TEST.cc
@@ -140,7 +140,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("exndbam_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> repo1(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo1);
+ env.add_repository(1, repo1);
keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "exndbam");
@@ -149,7 +149,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("exndbam_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> exndbam_repo(ExndbamRepository::ExndbamRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(0, exndbam_repo);
+ env.add_repository(0, exndbam_repo);
TEST_CHECK(exndbam_repo->package_ids(QualifiedPackageName("cat/pkg"), { })->empty());
diff --git a/paludis/repositories/e/fetch_visitor.cc b/paludis/repositories/e/fetch_visitor.cc
index 387c413f7..9296084b6 100644
--- a/paludis/repositories/e/fetch_visitor.cc
+++ b/paludis/repositories/e/fetch_visitor.cc
@@ -30,7 +30,6 @@
#include <paludis/repository.hh>
#include <paludis/about.hh>
#include <paludis/output_manager.hh>
-#include <paludis/package_database.hh>
#include <paludis/util/system.hh>
#include <paludis/util/process.hh>
@@ -163,7 +162,7 @@ FetchVisitor::visit(const FetchableURISpecTree::NodeType<FetchableURIDepSpec>::T
if (! *_imp->labels.begin())
throw ActionFailedError("No fetch action label available");
- auto repo(_imp->env->package_database()->fetch_repository(_imp->id->repository_name()));
+ auto repo(_imp->env->fetch_repository(_imp->id->repository_name()));
SourceURIFinder source_uri_finder(_imp->env, repo.get(),
node.spec()->original_url(), node.spec()->filename(), _imp->mirrors_name, _imp->get_mirrors_fn);
(*_imp->labels.begin())->accept(source_uri_finder);
diff --git a/paludis/repositories/e/fetch_visitor_TEST.cc b/paludis/repositories/e/fetch_visitor_TEST.cc
index 16d47907b..061919974 100644
--- a/paludis/repositories/e/fetch_visitor_TEST.cc
+++ b/paludis/repositories/e/fetch_visitor_TEST.cc
@@ -29,7 +29,6 @@
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
-#include <paludis/package_database.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
@@ -70,7 +69,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
TEST_CHECK(FSPath("fetch_visitor_TEST_dir/in/input1").stat().exists());
diff --git a/paludis/repositories/e/fix_locked_dependencies.cc b/paludis/repositories/e/fix_locked_dependencies.cc
index e312277a5..bb613609b 100644
--- a/paludis/repositories/e/fix_locked_dependencies.cc
+++ b/paludis/repositories/e/fix_locked_dependencies.cc
@@ -27,7 +27,6 @@
#include <paludis/util/accept_visitor.hh>
#include <paludis/dep_spec.hh>
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
#include <paludis/elike_slot_requirement.hh>
#include <paludis/selection.hh>
diff --git a/paludis/repositories/e/fix_locked_dependencies_TEST.cc b/paludis/repositories/e/fix_locked_dependencies_TEST.cc
index 4c1ed3e23..74f8a1a06 100644
--- a/paludis/repositories/e/fix_locked_dependencies_TEST.cc
+++ b/paludis/repositories/e/fix_locked_dependencies_TEST.cc
@@ -26,7 +26,6 @@
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/package_database.hh>
#include <paludis/unformatted_pretty_printer.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -48,7 +47,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
@@ -58,7 +57,7 @@ namespace test_cases
n::suitable_destination() = true,
n::supports_uninstall() = true
)));
- env.package_database()->add_repository(2, installed_repo);
+ env.add_repository(2, installed_repo);
installed_repo->add_version("cat", "installed", "1")->set_slot(SlotName("monkey"));
std::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string("paludis-1"));
diff --git a/paludis/repositories/e/parse_dependency_label.cc b/paludis/repositories/e/parse_dependency_label.cc
index 9c55b968b..0cb185772 100644
--- a/paludis/repositories/e/parse_dependency_label.cc
+++ b/paludis/repositories/e/parse_dependency_label.cc
@@ -20,17 +20,20 @@
#include <paludis/repositories/e/parse_dependency_label.hh>
#include <paludis/repositories/e/dep_parser.hh>
#include <paludis/repositories/e/eapi.hh>
+
#include <paludis/util/log.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/singleton-impl.hh>
+
#include <paludis/dep_label.hh>
#include <paludis/choice.hh>
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/always_enabled_dependency_label.hh>
+#include <paludis/repository.hh>
+
#include <map>
#include <set>
@@ -45,7 +48,7 @@ namespace
const std::string label,
const ChoiceNameWithPrefix n)
{
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (repo->installed_root_key())
return false;
diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc
index a8e86d69c..c8754ecdf 100644
--- a/paludis/repositories/e/pipe_command_handler.cc
+++ b/paludis/repositories/e/pipe_command_handler.cc
@@ -24,6 +24,7 @@
#include <paludis/repositories/e/dep_parser.hh>
#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
#include <paludis/repositories/e/e_repository_id.hh>
+
#include <paludis/util/log.hh>
#include <paludis/util/join.hh>
#include <paludis/util/exception.hh>
@@ -37,10 +38,10 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/save.hh>
+
#include <paludis/output_manager.hh>
#include <paludis/package_id.hh>
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
@@ -49,6 +50,9 @@
#include <paludis/choice.hh>
#include <paludis/dep_spec_annotations.hh>
#include <paludis/unformatted_pretty_printer.hh>
+#include <paludis/version_spec.hh>
+#include <paludis/repository.hh>
+
#include <vector>
#include <limits>
#include <sstream>
@@ -432,9 +436,9 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
}
else
{
- if (! environment->package_database()->has_repository_named(RepositoryName("installed")))
+ if (! environment->has_repository_named(RepositoryName("installed")))
return "Eno installed repository available";
- std::shared_ptr<const Repository> repo(environment->package_database()->fetch_repository(RepositoryName("installed")));
+ std::shared_ptr<const Repository> repo(environment->fetch_repository(RepositoryName("installed")));
Repository::MetadataConstIterator key(repo->find_metadata("location"));
if (repo->end_metadata() == key)
return "Einstalled repository has no location key";
diff --git a/paludis/repositories/e/source_uri_finder_TEST.cc b/paludis/repositories/e/source_uri_finder_TEST.cc
index 93326819d..693a875bf 100644
--- a/paludis/repositories/e/source_uri_finder_TEST.cc
+++ b/paludis/repositories/e/source_uri_finder_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011 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
@@ -23,7 +23,6 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/package_database.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
@@ -58,7 +57,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
SourceURIFinder f(&env, repo.get(), "http://example.com/path/input", "output", "monkey",
get_mirrors_fn);
@@ -88,7 +87,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
SourceURIFinder f(&env, repo.get(), "mirror://example/path/input", "output", "repo", get_mirrors_fn);
URIMirrorsThenListedLabel label("mirrors-then-listed");
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index 95f90f92d..6917db02f 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -44,7 +44,6 @@
#include <paludis/util/deferred_construction_ptr.hh>
#include <paludis/package_id.hh>
-#include <paludis/package_database.hh>
#include <paludis/choice.hh>
#include <paludis/literal_metadata_key.hh>
diff --git a/paludis/repositories/e/vdb_merger.cc b/paludis/repositories/e/vdb_merger.cc
index 0bba3f871..b67d3b081 100644
--- a/paludis/repositories/e/vdb_merger.cc
+++ b/paludis/repositories/e/vdb_merger.cc
@@ -36,14 +36,14 @@
#include <paludis/util/safe_ofstream.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/env_var_names.hh>
+#include <paludis/util/md5.hh>
#include <paludis/output_manager.hh>
#include <paludis/hook.hh>
#include <paludis/package_id.hh>
-#include <paludis/util/md5.hh>
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/version_spec.hh>
#include <iomanip>
#include <list>
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index efc673faa..bef18331e 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -40,7 +40,6 @@
#include <paludis/hook.hh>
#include <paludis/match_package.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
#include <paludis/repositories/e/ebuild.hh>
#include <paludis/repository_name_cache.hh>
@@ -78,6 +77,7 @@
#include <paludis/util/destringify.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/join.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/create_iterator-impl.hh>
@@ -1360,8 +1360,8 @@ VDBRepository::perform_updates()
std::cout << std::endl << "Checking for updates (package moves etc):" << std::endl;
std::map<FSPath, std::time_t, FSPathComparator> update_timestamps;
- for (PackageDatabase::RepositoryConstIterator r(_imp->params.environment()->package_database()->begin_repositories()),
- r_end(_imp->params.environment()->package_database()->end_repositories()) ;
+ for (auto r(_imp->params.environment()->begin_repositories()),
+ r_end(_imp->params.environment()->end_repositories()) ;
r != r_end ; ++r)
{
Context context_2("When performing updates from '" + stringify((*r)->name()) + "':");
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index 5d08251c6..4580f73a6 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -21,7 +21,6 @@
#include <paludis/repositories/e/e_repository.hh>
#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
#include <paludis/environments/test/test_environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/options.hh>
@@ -30,6 +29,7 @@
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/fs_iterator.hh>
#include <paludis/util/fs_stat.hh>
+#include <paludis/util/join.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
@@ -40,6 +40,7 @@
#include <paludis/action.hh>
#include <paludis/choice.hh>
#include <paludis/unformatted_pretty_printer.hh>
+#include <paludis/contents.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_null_shared_ptr.hh>
@@ -146,7 +147,7 @@ namespace test_cases
keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> e1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
@@ -216,7 +217,7 @@ namespace test_cases
keys->insert("world", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "world-no-match-no-eol"));
std::shared_ptr<Repository> repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<const PackageID> e1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
@@ -285,7 +286,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> repo1(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo1);
+ env.add_repository(1, repo1);
keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "e");
@@ -301,7 +302,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> repo2(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(2, repo2);
+ env.add_repository(2, repo2);
keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
@@ -312,7 +313,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(0, vdb_repo);
+ env.add_repository(0, vdb_repo);
InstallAction install_action(make_named_values<InstallActionOptions>(
n::destination() = vdb_repo,
@@ -415,7 +416,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> repo1(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo1);
+ env.add_repository(1, repo1);
keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
@@ -426,7 +427,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(0, vdb_repo);
+ env.add_repository(0, vdb_repo);
TEST_CHECK(vdb_repo->package_ids(QualifiedPackageName("cat/pkg"), { })->empty());
diff --git a/paludis/repositories/e/vdb_repository_TEST_cache.cc b/paludis/repositories/e/vdb_repository_TEST_cache.cc
index 89cab6119..21dff2867 100644
--- a/paludis/repositories/e/vdb_repository_TEST_cache.cc
+++ b/paludis/repositories/e/vdb_repository_TEST_cache.cc
@@ -21,7 +21,6 @@
#include <paludis/repositories/e/e_repository.hh>
#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
#include <paludis/environments/test/test_environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/options.hh>
@@ -149,7 +148,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("vdb_repository_TEST_cache_dir/root").realpath()));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
@@ -160,7 +159,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("vdb_repository_TEST_cache_dir/root").realpath()));
std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(0, vdb_repo);
+ env.add_repository(0, vdb_repo);
UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
n::config_protect() = "",
@@ -393,7 +392,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("vdb_repository_TEST_cache_dir/root").realpath()));
std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(0, vdb_repo);
+ env.add_repository(0, vdb_repo);
TEST_CHECK(! provides_cache.stat().exists());
@@ -514,7 +513,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("vdb_repository_TEST_cache_dir/root").realpath()));
std::shared_ptr<Repository> repo1(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo1);
+ env.add_repository(1, repo1);
keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "e");
@@ -530,7 +529,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("vdb_repository_TEST_cache_dir/root").realpath()));
std::shared_ptr<Repository> repo2(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(2, repo2);
+ env.add_repository(2, repo2);
keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
@@ -541,7 +540,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("vdb_repository_TEST_cache_dir/root").realpath()));
std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(0, vdb_repo);
+ env.add_repository(0, vdb_repo);
UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
n::config_protect() = "",
diff --git a/paludis/repositories/e/vdb_repository_TEST_eapis.cc b/paludis/repositories/e/vdb_repository_TEST_eapis.cc
index 9ae972402..9a42781c2 100644
--- a/paludis/repositories/e/vdb_repository_TEST_eapis.cc
+++ b/paludis/repositories/e/vdb_repository_TEST_eapis.cc
@@ -21,7 +21,6 @@
#include <paludis/repositories/e/e_repository.hh>
#include <paludis/repositories/e/spec_tree_pretty_printer.hh>
#include <paludis/environments/test/test_environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/options.hh>
@@ -127,7 +126,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("vdb_repository_TEST_eapis_dir/root").realpath()));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
@@ -138,7 +137,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("vdb_repository_TEST_eapis_dir/root").realpath()));
std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(0, vdb_repo);
+ env.add_repository(0, vdb_repo);
InstallAction install_action(make_named_values<InstallActionOptions>(
n::destination() = vdb_repo,
@@ -256,7 +255,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("vdb_repository_TEST_eapis_dir/root").realpath()));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
@@ -267,7 +266,7 @@ namespace test_cases
keys->insert("root", stringify(FSPath("vdb_repository_TEST_eapis_dir/root").realpath()));
std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- env.package_database()->add_repository(0, vdb_repo);
+ env.add_repository(0, vdb_repo);
InstallAction install_action(make_named_values<InstallActionOptions>(
n::destination() = vdb_repo,
diff --git a/paludis/repositories/e/vdb_unmerger.cc b/paludis/repositories/e/vdb_unmerger.cc
index 631d1f25b..e9ed59c7a 100644
--- a/paludis/repositories/e/vdb_unmerger.cc
+++ b/paludis/repositories/e/vdb_unmerger.cc
@@ -18,16 +18,12 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "vdb_unmerger.hh"
-#include "vdb_contents_tokeniser.hh"
+#include <paludis/repositories/e/vdb_unmerger.hh>
+#include <paludis/repositories/e/vdb_contents_tokeniser.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/md5.hh>
-#include <paludis/environment.hh>
-#include <paludis/hook.hh>
-#include <paludis/package_database.hh>
-#include <paludis/package_id.hh>
-#include <paludis/metadata_key.hh>
+#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/join.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/log.hh>
@@ -41,8 +37,13 @@
#include <paludis/util/timestamp.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/util/fs_iterator.hh>
+
+#include <paludis/environment.hh>
+#include <paludis/hook.hh>
+#include <paludis/package_id.hh>
+#include <paludis/metadata_key.hh>
+#include <paludis/contents.hh>
#include <paludis/output_manager.hh>
-#include <paludis/util/safe_ifstream.hh>
#include <list>
#include <map>
diff --git a/paludis/repositories/e/vdb_unmerger_TEST.cc b/paludis/repositories/e/vdb_unmerger_TEST.cc
index b6c331895..9b534721c 100644
--- a/paludis/repositories/e/vdb_unmerger_TEST.cc
+++ b/paludis/repositories/e/vdb_unmerger_TEST.cc
@@ -29,7 +29,6 @@
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/user_dep_spec.hh>
-#include <paludis/package_database.hh>
#include <paludis/generator.hh>
#include <paludis/selection.hh>
#include <paludis/filtered_generator.hh>
@@ -120,7 +119,7 @@ namespace
keys->insert("location", stringify(FSPath::cwd() / "vdb_unmerger_TEST_dir" / "repo"));
keys->insert("builddir", stringify(FSPath::cwd() / "vdb_unmerger_TEST_dir" / "build"));
repo = VDBRepository::repository_factory_create(&env, std::bind(from_keys, keys, std::placeholders::_1));
- env.package_database()->add_repository(0, repo);
+ env.add_repository(0, repo);
unmerger = std::make_shared<VDBUnmergerNoDisplay>(make_named_values<VDBUnmergerOptions>(
n::config_protect() = "/protected_file /protected_dir",
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index ed1691af5..9789db4c0 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -20,6 +20,7 @@
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/repositories/fake/fake_repository_base.hh>
#include <paludis/repositories/fake/dep_parser.hh>
+
#include <paludis/name.hh>
#include <paludis/action.hh>
#include <paludis/environment.hh>
@@ -28,10 +29,10 @@
#include <paludis/dep_spec.hh>
#include <paludis/choice.hh>
#include <paludis/user_dep_spec.hh>
-#include <paludis/package_database.hh>
#include <paludis/always_enabled_dependency_label.hh>
#include <paludis/pretty_printer.hh>
#include <paludis/call_pretty_printer.hh>
+
#include <paludis/util/stringify.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/pimp-impl.hh>
@@ -48,6 +49,8 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/singleton-impl.hh>
+#include <paludis/util/join.hh>
+
#include <map>
#include <list>
#include <sstream>
@@ -982,7 +985,7 @@ FakePackageID::extra_hash_value() const
bool
FakePackageID::supports_action(const SupportsActionTestBase & b) const
{
- auto repo(_imp->env->package_database()->fetch_repository(repository_name()));
+ auto repo(_imp->env->fetch_repository(repository_name()));
return repo->some_ids_might_support_action(b);
}
@@ -1103,7 +1106,7 @@ namespace
void visit(const InstallAction & a)
{
SupportsActionTest<InstallAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -1111,7 +1114,7 @@ namespace
void visit(const UninstallAction & a)
{
SupportsActionTest<UninstallAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -1119,7 +1122,7 @@ namespace
void visit(const FetchAction & a)
{
SupportsActionTest<FetchAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -1127,7 +1130,7 @@ namespace
void visit(const ConfigAction & a)
{
SupportsActionTest<ConfigAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -1135,7 +1138,7 @@ namespace
void visit(const InfoAction & a)
{
SupportsActionTest<InfoAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -1143,7 +1146,7 @@ namespace
void visit(const PretendAction & a)
{
SupportsActionTest<PretendAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -1151,7 +1154,7 @@ namespace
void visit(const PretendFetchAction & a)
{
SupportsActionTest<PretendFetchAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
diff --git a/paludis/repositories/gemcutter/gemcutter_repository_store.cc b/paludis/repositories/gemcutter/gemcutter_repository_store.cc
index 61852fdb2..61a2a6578 100644
--- a/paludis/repositories/gemcutter/gemcutter_repository_store.cc
+++ b/paludis/repositories/gemcutter/gemcutter_repository_store.cc
@@ -34,7 +34,6 @@
#include <paludis/version_spec.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
#include <functional>
#include <unordered_map>
#include <algorithm>
diff --git a/paludis/repositories/repository/repository_repository.cc b/paludis/repositories/repository/repository_repository.cc
index dd842bbda..00a5e83a6 100644
--- a/paludis/repositories/repository/repository_repository.cc
+++ b/paludis/repositories/repository/repository_repository.cc
@@ -38,7 +38,6 @@
#include <paludis/package_id.hh>
#include <paludis/output_manager.hh>
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
#include <list>
using namespace paludis;
@@ -336,7 +335,7 @@ RepositoryRepository::sync_host_key() const
bool
RepositoryRepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> & id) const
{
- auto repo(_imp->params.environment()->package_database()->fetch_repository(id->repository_name()));
+ auto repo(_imp->params.environment()->fetch_repository(id->repository_name()));
std::string f(repo->format_key() ? repo->format_key()->value() : "");
return f == "unavailable";
}
diff --git a/paludis/repositories/repository/repository_repository_store.cc b/paludis/repositories/repository/repository_repository_store.cc
index dfc1c164b..a2b59a174 100644
--- a/paludis/repositories/repository/repository_repository_store.cc
+++ b/paludis/repositories/repository/repository_repository_store.cc
@@ -32,7 +32,6 @@
#include <paludis/version_spec.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
#include <functional>
#include <unordered_map>
#include <algorithm>
@@ -84,8 +83,7 @@ RepositoryRepositoryStore::~RepositoryRepositoryStore()
void
RepositoryRepositoryStore::_populate()
{
- for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
- r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
+ for (auto r(_imp->env->begin_repositories()), r_end(_imp->env->end_repositories()) ; r != r_end ; ++r)
_populate_one((*r)->name());
}
diff --git a/paludis/repositories/unavailable/unavailable_repository_TEST.cc b/paludis/repositories/unavailable/unavailable_repository_TEST.cc
index 5b78e7863..4e00c07e1 100644
--- a/paludis/repositories/unavailable/unavailable_repository_TEST.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_TEST.cc
@@ -34,7 +34,6 @@
#include <paludis/filtered_generator.hh>
#include <paludis/filter.hh>
#include <paludis/package_id.hh>
-#include <paludis/package_database.hh>
#include <memory>
@@ -54,7 +53,7 @@ TEST(UnavailableRepository, Creation)
n::sync() = std::make_shared<Map<std::string, std::string> >(),
n::sync_options() = std::make_shared<Map<std::string, std::string> >()
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
EXPECT_EQ("unavailable", stringify(repo->name()));
}
@@ -69,7 +68,7 @@ TEST(UnavailableRepository, Contents)
n::sync() = std::make_shared<Map<std::string, std::string> >(),
n::sync_options() = std::make_shared<Map<std::string, std::string> >()
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
EXPECT_EQ("unavailable", stringify(repo->name()));
std::shared_ptr<const PackageIDSequence> contents(
@@ -95,7 +94,7 @@ TEST(UnavailableRepository, Contents)
n::environment() = &env,
n::name() = RepositoryName("bar")
)));
- env.package_database()->add_repository(2, hide_bar);
+ env.add_repository(2, hide_bar);
repo->invalidate();
std::shared_ptr<const PackageIDSequence> contents_without_bar(
diff --git a/paludis/repositories/unavailable/unavailable_repository_store.cc b/paludis/repositories/unavailable/unavailable_repository_store.cc
index 85e9ffdf6..bd3df3c28 100644
--- a/paludis/repositories/unavailable/unavailable_repository_store.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_store.cc
@@ -38,7 +38,6 @@
#include <paludis/version_spec.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
#include <functional>
#include <unordered_map>
#include <algorithm>
@@ -108,7 +107,7 @@ UnavailableRepositoryStore::_populate_one(const Environment * const env, const F
UnavailableRepositoryFile file(f);
- bool has_repo(env->package_database()->has_repository_named(RepositoryName(file.repo_name())));
+ bool has_repo(env->has_repository_named(RepositoryName(file.repo_name())));
if (! _imp->seen_repo_names.insert(file.repo_name()).second)
{
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index 29d0edd29..e59cc6f41 100644
--- a/paludis/repositories/unpackaged/installed_id.cc
+++ b/paludis/repositories/unpackaged/installed_id.cc
@@ -19,8 +19,7 @@
#include <paludis/repositories/unpackaged/installed_id.hh>
#include <paludis/repositories/unpackaged/installed_repository.hh>
-#include <paludis/ndbam.hh>
-#include <paludis/ndbam_unmerger.hh>
+
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/system.hh>
#include <paludis/util/stringify.hh>
@@ -35,10 +34,13 @@
#include <paludis/util/singleton-impl.hh>
#include <paludis/util/fs_iterator.hh>
#include <paludis/util/fs_stat.hh>
+#include <paludis/util/join.hh>
+
+#include <paludis/ndbam.hh>
+#include <paludis/ndbam_unmerger.hh>
#include <paludis/output_manager.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
-#include <paludis/package_database.hh>
#include <paludis/contents.hh>
#include <paludis/environment.hh>
#include <paludis/metadata_key.hh>
@@ -50,6 +52,7 @@
#include <paludis/always_enabled_dependency_label.hh>
#include <paludis/pretty_printer.hh>
#include <paludis/call_pretty_printer.hh>
+
#include <functional>
using namespace paludis;
@@ -825,7 +828,7 @@ InstalledUnpackagedID::uninstall(const bool replace,
{
Context context("When uninstalling '" + stringify(*this) + "':");
- auto repo(_imp->env->package_database()->fetch_repository(repository_name()));
+ auto repo(_imp->env->fetch_repository(repository_name()));
bool last((! replace) && (! if_for_install_id));
if (last)
{
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 14cc03232..252c20c90 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -47,7 +47,6 @@
#include <paludis/selection.hh>
#include <paludis/hook.hh>
#include <paludis/common_sets.hh>
-#include <paludis/package_database.hh>
#include <paludis/unformatted_pretty_printer.hh>
#include <sstream>
#include <sys/time.h>
@@ -273,7 +272,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
if (! is_suitable_destination_for(m.package_id()))
throw ActionFailedError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
- auto repo(_imp->params.environment()->package_database()->fetch_repository(m.package_id()->repository_name()));
+ auto repo(_imp->params.environment()->fetch_repository(m.package_id()->repository_name()));
FSPath install_under("/");
{
Repository::MetadataConstIterator k(repo->find_metadata("install_under"));
@@ -402,7 +401,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
bool
InstalledUnpackagedRepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> & id) const
{
- auto repo(_imp->params.environment()->package_database()->fetch_repository(id->repository_name()));
+ auto repo(_imp->params.environment()->fetch_repository(id->repository_name()));
std::string f(repo->format_key() ? repo->format_key()->value() : "");
return f == "unpackaged";
}
diff --git a/paludis/repositories/unpackaged/installed_repository_TEST.cc b/paludis/repositories/unpackaged/installed_repository_TEST.cc
index 9dc5b0cce..31e3c5540 100644
--- a/paludis/repositories/unpackaged/installed_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/installed_repository_TEST.cc
@@ -22,7 +22,6 @@
#include <paludis/environments/test/test_environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
#include <paludis/action.hh>
#include <paludis/user_dep_spec.hh>
@@ -32,6 +31,7 @@
#include <paludis/filtered_generator.hh>
#include <paludis/selection.hh>
#include <paludis/standard_output_manager.hh>
+#include <paludis/contents.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/join.hh>
@@ -108,7 +108,7 @@ TEST(InstalledRepository, Content)
n::location() = FSPath("installed_repository_TEST_dir/repo1"),
n::root() = FSPath("installed_repository_TEST_dir/root")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageIDSequence> ids(
env[selection::AllVersionsSorted(generator::All())]);
@@ -126,7 +126,7 @@ TEST(InstalledRepository, Metadata)
n::location() = FSPath("installed_repository_TEST_dir/repo1"),
n::root() = FSPath("installed_repository_TEST_dir/root")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(
generator::Matches(parse_user_package_dep_spec("cat-one/foo:0",
@@ -173,7 +173,7 @@ TEST(InstalledRepository, Masks)
n::location() = FSPath("installed_repository_TEST_dir/repo1"),
n::root() = FSPath("installed_repository_TEST_dir/root")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(
generator::Matches(parse_user_package_dep_spec("cat-one/foo:0",
@@ -198,7 +198,7 @@ TEST(InstalledRepository, Actions)
n::location() = FSPath("installed_repository_TEST_dir/repo1"),
n::root() = FSPath("installed_repository_TEST_dir/root")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
EXPECT_TRUE(! repo->some_ids_might_support_action(SupportsActionTest<InstallAction>()));
EXPECT_TRUE(! repo->some_ids_might_support_action(SupportsActionTest<ConfigAction>()));
@@ -228,7 +228,7 @@ TEST(InstalledRepository, UninstallLast)
n::location() = FSPath("installed_repository_TEST_dir/repo2"),
n::root() = FSPath("installed_repository_TEST_dir/root2")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageIDSequence> pre_ids(env[selection::AllVersionsSorted(generator::All())]);
EXPECT_EQ("cat-one/foo-1.2.3:fred::installed-unpackaged",
@@ -275,7 +275,7 @@ TEST(InstalledRepository, UninstallNotLast)
n::location() = FSPath("installed_repository_TEST_dir/repo3"),
n::root() = FSPath("installed_repository_TEST_dir/root3")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageIDSequence> pre_ids(env[selection::AllVersionsSorted(generator::All())]);
EXPECT_EQ("cat-one/foo-1.2.3:fred::installed-unpackaged cat-one/foo-3.2.1:barney::installed-unpackaged",
@@ -318,7 +318,7 @@ TEST(InstalledRepository, MultipleOps)
n::location() = FSPath("installed_repository_TEST_dir/repo4"),
n::root() = FSPath("installed_repository_TEST_dir/root4")
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageIDSequence> pre_ids(env[selection::AllVersionsSorted(generator::All())]);
EXPECT_EQ("", join(indirect_iterator(pre_ids->begin()), indirect_iterator(pre_ids->end()), " "));
@@ -335,7 +335,7 @@ TEST(InstalledRepository, MultipleOps)
n::location() = FSPath("installed_repository_TEST_dir/repo4"),
n::root() = FSPath("installed_repository_TEST_dir/root4")
)));
- env.package_database()->add_repository(0, repo);
+ env.add_repository(0, repo);
std::shared_ptr<Repository> source_repo(std::make_shared<UnpackagedRepository>(
RepositoryName("unpackaged"),
@@ -353,7 +353,7 @@ TEST(InstalledRepository, MultipleOps)
n::strip() = indeterminate,
n::version() = VersionSpec("1.0", { })
)));
- env.package_database()->add_repository(1, source_repo);
+ env.add_repository(1, source_repo);
{
const std::shared_ptr<const PackageIDSequence> pre_ids(env[selection::AllVersionsSorted(
@@ -393,7 +393,7 @@ TEST(InstalledRepository, MultipleOps)
n::location() = FSPath("installed_repository_TEST_dir/repo4"),
n::root() = FSPath("installed_repository_TEST_dir/root4")
)));
- env.package_database()->add_repository(0, repo);
+ env.add_repository(0, repo);
std::shared_ptr<Repository> source_repo(std::make_shared<UnpackagedRepository>(
RepositoryName("unpackaged"),
@@ -411,7 +411,7 @@ TEST(InstalledRepository, MultipleOps)
n::strip() = indeterminate,
n::version() = VersionSpec("1.0", { })
)));
- env.package_database()->add_repository(1, source_repo);
+ env.add_repository(1, source_repo);
{
const std::shared_ptr<const PackageIDSequence> pre_ids(env[selection::AllVersionsSorted(
@@ -453,7 +453,7 @@ TEST(InstalledRepository, MultipleOps)
n::location() = FSPath("installed_repository_TEST_dir/repo4"),
n::root() = FSPath("installed_repository_TEST_dir/root4")
)));
- env.package_database()->add_repository(0, repo);
+ env.add_repository(0, repo);
std::shared_ptr<Repository> source_repo(std::make_shared<UnpackagedRepository>(
RepositoryName("unpackaged"),
@@ -471,7 +471,7 @@ TEST(InstalledRepository, MultipleOps)
n::strip() = indeterminate,
n::version() = VersionSpec("1.0", { })
)));
- env.package_database()->add_repository(1, source_repo);
+ env.add_repository(1, source_repo);
{
const std::shared_ptr<const PackageIDSequence> pre_ids(env[selection::AllVersionsSorted(
@@ -513,7 +513,7 @@ TEST(InstalledRepository, MultipleOps)
n::location() = FSPath("installed_repository_TEST_dir/repo4"),
n::root() = FSPath("installed_repository_TEST_dir/root4")
)));
- env.package_database()->add_repository(0, repo);
+ env.add_repository(0, repo);
{
const std::shared_ptr<const PackageIDSequence> pre_ids(env[selection::AllVersionsSorted(
@@ -557,7 +557,7 @@ TEST(InstalledRepository, MultipleOps)
n::location() = FSPath("installed_repository_TEST_dir/repo4"),
n::root() = FSPath("installed_repository_TEST_dir/root4")
)));
- env.package_database()->add_repository(0, repo);
+ env.add_repository(0, repo);
{
const std::shared_ptr<const PackageIDSequence> pre_ids(env[selection::AllVersionsSorted(
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index 379782192..1eb637f00 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -20,6 +20,7 @@
#include <paludis/repositories/unpackaged/unpackaged_id.hh>
#include <paludis/repositories/unpackaged/unpackaged_key.hh>
#include <paludis/repositories/unpackaged/unpackaged_stripper.hh>
+
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/visitor_cast.hh>
@@ -30,10 +31,11 @@
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/util/singleton-impl.hh>
+#include <paludis/util/timestamp.hh>
+
#include <paludis/output_manager.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
-#include <paludis/package_database.hh>
#include <paludis/environment.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
@@ -42,6 +44,7 @@
#include <paludis/elike_choices.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/always_enabled_dependency_label.hh>
+#include <paludis/repository.hh>
using namespace paludis;
using namespace paludis::unpackaged_repositories;
diff --git a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
index 0d89315c9..86d09db83 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
@@ -22,7 +22,6 @@
#include <paludis/environments/test/test_environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
#include <paludis/action.hh>
#include <paludis/metadata_key.hh>
@@ -85,7 +84,7 @@ TEST(UnpackagedRepository, Members)
n::strip() = indeterminate,
n::version() = VersionSpec("1.0", { })
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageIDSequence> ids(
env[selection::AllVersionsSorted(generator::All())]);
@@ -111,7 +110,7 @@ TEST(UnpackagedRepository, Metadata)
n::strip() = indeterminate,
n::version() = VersionSpec("1.0", { })
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id(
*env[selection::RequireExactlyOne(generator::All())]->begin());
@@ -143,7 +142,7 @@ TEST(UnpackagedRepository, Masks)
n::strip() = indeterminate,
n::version() = VersionSpec("1.0", { })
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
const std::shared_ptr<const PackageID> id(
*env[selection::RequireExactlyOne(generator::All())]->begin());
@@ -170,7 +169,7 @@ TEST(UnpackagedRepository, Actions)
n::strip() = indeterminate,
n::version() = VersionSpec("1.0", { })
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
EXPECT_TRUE(repo->some_ids_might_support_action(SupportsActionTest<InstallAction>()));
EXPECT_TRUE(! repo->some_ids_might_support_action(SupportsActionTest<ConfigAction>()));
@@ -208,7 +207,7 @@ TEST(UnpackagedRepository, Install)
n::strip() = indeterminate,
n::version() = VersionSpec("1.0", { })
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<Repository> installed_repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
@@ -217,7 +216,7 @@ TEST(UnpackagedRepository, Install)
n::location() = FSPath("unpackaged_repository_TEST_dir/installed"),
n::root() = FSPath("unpackaged_repository_TEST_dir/root")
)));
- env.package_database()->add_repository(0, installed_repo);
+ env.add_repository(0, installed_repo);
EXPECT_TRUE(! FSPath("unpackaged_repository_TEST_dir/root/first").stat().is_regular_file());
@@ -256,7 +255,7 @@ TEST(UnpackagedRepository, InstallUnder)
n::strip() = indeterminate,
n::version() = VersionSpec("1.0", { })
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
std::shared_ptr<Repository> installed_repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
@@ -265,7 +264,7 @@ TEST(UnpackagedRepository, InstallUnder)
n::location() = FSPath("unpackaged_repository_TEST_dir/under_installed"),
n::root() = FSPath("unpackaged_repository_TEST_dir/under_root")
)));
- env.package_database()->add_repository(0, installed_repo);
+ env.add_repository(0, installed_repo);
EXPECT_TRUE(! FSPath("unpackaged_repository_TEST_dir/under_root/magic/pixie/first").stat().is_regular_file());
diff --git a/paludis/repositories/unwritten/unwritten_repository_TEST.cc b/paludis/repositories/unwritten/unwritten_repository_TEST.cc
index 0df4c719b..019ed700b 100644
--- a/paludis/repositories/unwritten/unwritten_repository_TEST.cc
+++ b/paludis/repositories/unwritten/unwritten_repository_TEST.cc
@@ -34,7 +34,6 @@
#include <paludis/filter.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/package_database.hh>
#include <memory>
@@ -62,7 +61,7 @@ TEST(UnwrittenRepository, Creation)
n::sync() = std::make_shared<Map<std::string, std::string> >(),
n::sync_options() = std::make_shared<Map<std::string, std::string> >()
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
EXPECT_EQ("unwritten", stringify(repo->name()));
}
@@ -77,7 +76,7 @@ TEST(UnwrittenRepository, Contents)
n::sync() = std::make_shared<Map<std::string, std::string> >(),
n::sync_options() = std::make_shared<Map<std::string, std::string> >()
)));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
EXPECT_EQ("unwritten", stringify(repo->name()));
std::shared_ptr<const PackageIDSequence> contents(
diff --git a/paludis/repositories/unwritten/unwritten_repository_store.cc b/paludis/repositories/unwritten/unwritten_repository_store.cc
index 2626d7c09..03ccd29e1 100644
--- a/paludis/repositories/unwritten/unwritten_repository_store.cc
+++ b/paludis/repositories/unwritten/unwritten_repository_store.cc
@@ -37,7 +37,6 @@
#include <paludis/version_spec.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
#include <functional>
#include <unordered_map>
#include <algorithm>
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 7d017a428..88ee2a538 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -22,9 +22,9 @@
#include <paludis/environment.hh>
#include <paludis/hook.hh>
-#include <paludis/package_database.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/action.hh>
+
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
@@ -35,6 +35,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/stringify.hh>
#include <functional>
#include <unordered_map>
@@ -137,8 +138,8 @@ InstalledVirtualsRepository::need_ids() const
/* Populate our _imp->entries. We need to iterate over each repository in
* our env's package database, see if it has a provides interface, and if it
* does create an entry for each provided package. */
- for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
- r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
+ for (auto r(_imp->env->begin_repositories()),
+ r_end(_imp->env->end_repositories()) ; r != r_end ; ++r)
{
if (! (**r).provides_interface())
continue;
@@ -353,7 +354,7 @@ InstalledVirtualsRepository::repository_factory_dependencies(
bool
InstalledVirtualsRepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> & id) const
{
- auto repo(_imp->env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(_imp->env->fetch_repository(id->repository_name()));
std::string f(repo->format_key() ? repo->format_key()->value() : "");
return f == "virtuals";
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index dcad0e4b6..a2231e576 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -36,7 +36,6 @@
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
#include <paludis/mask.hh>
-#include <paludis/package_database.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/selection.hh>
@@ -387,7 +386,7 @@ namespace
void visit(const InstallAction & a)
{
SupportsActionTest<InstallAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -395,7 +394,7 @@ namespace
void visit(const UninstallAction & a)
{
SupportsActionTest<UninstallAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -403,7 +402,7 @@ namespace
void visit(const ConfigAction & a)
{
SupportsActionTest<ConfigAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -411,7 +410,7 @@ namespace
void visit(const FetchAction & a)
{
SupportsActionTest<FetchAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -419,7 +418,7 @@ namespace
void visit(const InfoAction & a)
{
SupportsActionTest<InfoAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -427,7 +426,7 @@ namespace
void visit(const PretendAction & a)
{
SupportsActionTest<PretendAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -435,7 +434,7 @@ namespace
void visit(const PretendFetchAction & a)
{
SupportsActionTest<PretendFetchAction> t;
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (! repo->some_ids_might_support_action(t))
throw ActionFailedError("Unsupported action: " + a.simple_name());
}
@@ -452,7 +451,7 @@ VirtualsPackageID::perform_action(Action & a) const
bool
VirtualsPackageID::supports_action(const SupportsActionTestBase & b) const
{
- auto repo(_imp->env->package_database()->fetch_repository(repository_name()));
+ auto repo(_imp->env->fetch_repository(repository_name()));
return repo->some_ids_might_support_action(b);
}
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index bb6026d91..1aa80ccf4 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -22,7 +22,6 @@
#include <paludis/environment.hh>
#include <paludis/match_package.hh>
-#include <paludis/package_database.hh>
#include <paludis/action.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/selection.hh>
@@ -151,8 +150,7 @@ VirtualsRepository::need_names() const
Log::get_instance()->message("virtuals.need_names", ll_debug, lc_context) << "VirtualsRepository need_names";
/* Determine our virtual name -> package mappings. */
- for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
- r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
+ for (auto r(_imp->env->begin_repositories()), r_end(_imp->env->end_repositories()) ; r != r_end ; ++r)
{
if (! (**r).provides_interface())
continue;
@@ -170,8 +168,7 @@ VirtualsRepository::need_names() const
std::vector<std::pair<QualifiedPackageName, std::shared_ptr<const PackageDepSpec> > > new_names;
- for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
- r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
+ for (auto r(_imp->env->begin_repositories()), r_end(_imp->env->end_repositories()) ; r != r_end ; ++r)
{
if (! (**r).virtuals_interface())
continue;
diff --git a/paludis/repositories/virtuals/virtuals_repository_TEST.cc b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
index e38d4a4f7..529fb40e8 100644
--- a/paludis/repositories/virtuals/virtuals_repository_TEST.cc
+++ b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
@@ -25,7 +25,6 @@
#include <paludis/environments/test/test_environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
@@ -37,6 +36,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/options.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/join.hh>
#include <gtest/gtest.h>
@@ -60,9 +60,9 @@ TEST(VirtualsRepository, Works)
ASSERT_TRUE(repo->virtuals_interface());
- env.package_database()->add_repository(2, virtuals);
- env.package_database()->add_repository(3, repo);
- env.package_database()->add_repository(4, installed);
+ env.add_repository(2, virtuals);
+ env.add_repository(3, repo);
+ env.add_repository(4, installed);
repo->add_version("cat", "pkg", "1")->provide_key()->set_from_string("virtual/pkg");
repo->add_version("cat", "pkg", "2")->provide_key()->set_from_string("virtual/pkg");
@@ -100,10 +100,10 @@ TEST(VirtualsRepository, Duplicates)
n::supports_uninstall() = true
)));
- env.package_database()->add_repository(2, virtuals);
- env.package_database()->add_repository(3, repo1);
- env.package_database()->add_repository(4, repo2);
- env.package_database()->add_repository(5, installed);
+ env.add_repository(2, virtuals);
+ env.add_repository(3, repo1);
+ env.add_repository(4, repo2);
+ env.add_repository(5, installed);
repo1->add_version("cat", "pkg", "1")->provide_key()->set_from_string("virtual/pkg");
repo1->add_version("cat", "pkg", "2")->provide_key()->set_from_string("virtual/pkg");
@@ -141,9 +141,9 @@ TEST(VirtualsRepository, Recursion)
n::name() = RepositoryName("repo2")
)));
- env.package_database()->add_repository(2, repo1);
- env.package_database()->add_repository(3, repo2);
- env.package_database()->add_repository(4, virtuals);
+ env.add_repository(2, repo1);
+ env.add_repository(3, repo2);
+ env.add_repository(4, virtuals);
repo1->add_version("virtual", "gkp", "1")->provide_key()->set_from_string("virtual/pkg");
repo1->add_virtual_package(QualifiedPackageName("virtual/pkg"), std::make_shared<PackageDepSpec>(
diff --git a/paludis/repository.hh b/paludis/repository.hh
index a0cbe9370..c85f88f5c 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -247,8 +247,8 @@ namespace paludis
};
/**
- * A Repository provides a representation of a physical repository to a
- * PackageDatabase.
+ * A Repository provides a representation of a physical repository to an
+ * Environment.
*
* \ingroup g_repository
* \nosubgrouping
diff --git a/paludis/repository_name_cache_TEST.cc b/paludis/repository_name_cache_TEST.cc
index acda6a9d2..96d2511fc 100644
--- a/paludis/repository_name_cache_TEST.cc
+++ b/paludis/repository_name_cache_TEST.cc
@@ -18,7 +18,6 @@
*/
#include <paludis/repository_name_cache.hh>
-#include <paludis/package_database.hh>
#include <paludis/util/join.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -39,7 +38,7 @@ TEST(RepositoryNameCache, Empty)
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(10, repo);
+ env.add_repository(10, repo);
RepositoryNameCache cache(FSPath("/var/empty"), repo.get());
EXPECT_TRUE(! cache.usable());
@@ -52,7 +51,7 @@ TEST(RepositoryNameCache, NotGenerated)
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(10, repo);
+ env.add_repository(10, repo);
RepositoryNameCache cache(FSPath("repository_name_cache_TEST_dir/not_generated"), repo.get());
EXPECT_TRUE(cache.usable());
@@ -67,7 +66,7 @@ TEST(RepositoryNameCache, NotExisting)
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(10, repo);
+ env.add_repository(10, repo);
RepositoryNameCache cache(FSPath("repository_name_cache_TEST_dir/not_existing"), repo.get());
EXPECT_TRUE(cache.usable());
@@ -82,7 +81,7 @@ TEST(RepositoryNameCache, OldFormat)
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(10, repo);
+ env.add_repository(10, repo);
RepositoryNameCache cache(FSPath("repository_name_cache_TEST_dir/old_format"), repo.get());
EXPECT_TRUE(cache.usable());
@@ -97,7 +96,7 @@ TEST(RepositoryNameCache, BadRepo)
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(10, repo);
+ env.add_repository(10, repo);
RepositoryNameCache cache(FSPath("repository_name_cache_TEST_dir/bad_repo"), repo.get());
EXPECT_TRUE(cache.usable());
@@ -112,7 +111,7 @@ TEST(RepositoryNameCache, Good)
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(10, repo);
+ env.add_repository(10, repo);
RepositoryNameCache cache(FSPath("repository_name_cache_TEST_dir/good_repo"), repo.get());
EXPECT_TRUE(cache.usable());
@@ -135,7 +134,7 @@ TEST(RepositoryNameCache, Generate)
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- env.package_database()->add_repository(10, repo);
+ env.add_repository(10, repo);
RepositoryNameCache cache(FSPath("repository_name_cache_TEST_dir/generated"), repo.get());
repo->add_package(QualifiedPackageName("bar/foo"));
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index 9ee4c43dd..735a1bbaf 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -57,7 +57,6 @@
#include <paludis/notifier_callback.hh>
#include <paludis/repository.hh>
#include <paludis/filtered_generator.hh>
-#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
#include <paludis/generator.hh>
#include <paludis/selection.hh>
diff --git a/paludis/resolver/destination_utils.cc b/paludis/resolver/destination_utils.cc
index 2d281142e..85f78a838 100644
--- a/paludis/resolver/destination_utils.cc
+++ b/paludis/resolver/destination_utils.cc
@@ -18,6 +18,9 @@
*/
#include <paludis/resolver/destination_utils.hh>
+
+#include <paludis/util/stringify.hh>
+
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/filtered_generator.hh>
@@ -25,7 +28,7 @@
#include <paludis/generator_handler.hh>
#include <paludis/filter.hh>
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
+#include <paludis/repository.hh>
using namespace paludis;
using namespace paludis::resolver;
@@ -65,8 +68,7 @@ namespace
{
using namespace std::placeholders;
std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
- for (auto r(env->package_database()->begin_repositories()),
- r_end(env->package_database()->end_repositories()) ;
+ for (auto r(env->begin_repositories()), r_end(env->end_repositories()) ;
r != r_end ; ++r)
if (! (*r)->installed_root_key())
if ((*r)->destination_interface())
diff --git a/paludis/resolver/find_replacing_helper.cc b/paludis/resolver/find_replacing_helper.cc
index 92a0c520f..88e315501 100644
--- a/paludis/resolver/find_replacing_helper.cc
+++ b/paludis/resolver/find_replacing_helper.cc
@@ -28,7 +28,6 @@
#include <paludis/elike_slot_requirement.hh>
#include <paludis/metadata_key.hh>
#include <paludis/repository.hh>
-#include <paludis/package_database.hh>
#include <paludis/environment.hh>
#include <paludis/generator.hh>
#include <paludis/filtered_generator.hh>
@@ -80,8 +79,7 @@ FindReplacingHelper::operator() (
if (repo->installed_root_key())
{
- for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
- r_end(_imp->env->package_database()->end_repositories()) ;
+ for (auto r(_imp->env->begin_repositories()), r_end(_imp->env->end_repositories()) ;
r != r_end ; ++r)
if ((*r)->installed_root_key() &&
(*r)->installed_root_key()->value() == repo->installed_root_key()->value())
diff --git a/paludis/resolver/find_repository_for_helper.cc b/paludis/resolver/find_repository_for_helper.cc
index ecda6badc..1951b0e49 100644
--- a/paludis/resolver/find_repository_for_helper.cc
+++ b/paludis/resolver/find_repository_for_helper.cc
@@ -32,7 +32,6 @@
#include <paludis/metadata_key.hh>
#include <paludis/package_dep_spec_collection.hh>
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/repository.hh>
using namespace paludis;
@@ -74,8 +73,7 @@ FindRepositoryForHelper::operator() (
{
std::shared_ptr<const Repository> result;
- for (auto r(_imp->env->package_database()->begin_repositories()),
- r_end(_imp->env->package_database()->end_repositories()) ;
+ for (auto r(_imp->env->begin_repositories()), r_end(_imp->env->end_repositories()) ;
r != r_end ; ++r)
{
switch (resolution->resolvent().destination_type())
diff --git a/paludis/resolver/make_destination_filtered_generator_helper.cc b/paludis/resolver/make_destination_filtered_generator_helper.cc
index 6dd1d52b9..b8077230c 100644
--- a/paludis/resolver/make_destination_filtered_generator_helper.cc
+++ b/paludis/resolver/make_destination_filtered_generator_helper.cc
@@ -29,11 +29,9 @@
#include <paludis/filter_handler.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/generator.hh>
-#include <paludis/package_database.hh>
#include <paludis/repository.hh>
#include <paludis/metadata_key.hh>
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
using namespace paludis;
using namespace paludis::resolver;
diff --git a/paludis/resolver/resolver_TEST_any.cc b/paludis/resolver/resolver_TEST_any.cc
index c3829dd65..794c7ddd7 100644
--- a/paludis/resolver/resolver_TEST_any.cc
+++ b/paludis/resolver/resolver_TEST_any.cc
@@ -37,7 +37,6 @@
#include <paludis/util/make_shared_copy.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/repository_factory.hh>
-#include <paludis/package_database.hh>
#include <paludis/resolver/resolver_test.hh>
#include <test/test_runner.hh>
diff --git a/paludis/resolver/resolver_TEST_blockers.cc b/paludis/resolver/resolver_TEST_blockers.cc
index 5981d1a40..fe15af79f 100644
--- a/paludis/resolver/resolver_TEST_blockers.cc
+++ b/paludis/resolver/resolver_TEST_blockers.cc
@@ -36,7 +36,6 @@
#include <paludis/util/make_shared_copy.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/repository_factory.hh>
-#include <paludis/package_database.hh>
#include <paludis/resolver/resolver_test.hh>
#include <test/test_runner.hh>
diff --git a/paludis/resolver/resolver_TEST_continue_on_failure.cc b/paludis/resolver/resolver_TEST_continue_on_failure.cc
index 265884b70..f4b490b45 100644
--- a/paludis/resolver/resolver_TEST_continue_on_failure.cc
+++ b/paludis/resolver/resolver_TEST_continue_on_failure.cc
@@ -40,9 +40,9 @@
#include <paludis/util/tribool.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/visitor_cast.hh>
+#include <paludis/util/join.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/repository_factory.hh>
-#include <paludis/package_database.hh>
#include <paludis/resolver/resolver_test.hh>
#include <test/test_runner.hh>
diff --git a/paludis/resolver/resolver_TEST_cycles.cc b/paludis/resolver/resolver_TEST_cycles.cc
index 3aa2998ac..d12c2013e 100644
--- a/paludis/resolver/resolver_TEST_cycles.cc
+++ b/paludis/resolver/resolver_TEST_cycles.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 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
@@ -35,7 +35,6 @@
#include <paludis/util/make_shared_copy.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/repository_factory.hh>
-#include <paludis/package_database.hh>
#include <paludis/resolver/resolver_test.hh>
#include <test/test_runner.hh>
diff --git a/paludis/resolver/resolver_TEST_errors.cc b/paludis/resolver/resolver_TEST_errors.cc
index 30effd7c5..43a50d1d3 100644
--- a/paludis/resolver/resolver_TEST_errors.cc
+++ b/paludis/resolver/resolver_TEST_errors.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 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
@@ -35,7 +35,6 @@
#include <paludis/util/make_shared_copy.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/repository_factory.hh>
-#include <paludis/package_database.hh>
#include <paludis/resolver/resolver_test.hh>
#include <test/test_runner.hh>
diff --git a/paludis/resolver/resolver_TEST_fetches.cc b/paludis/resolver/resolver_TEST_fetches.cc
index 5693aa0df..364015f9d 100644
--- a/paludis/resolver/resolver_TEST_fetches.cc
+++ b/paludis/resolver/resolver_TEST_fetches.cc
@@ -39,9 +39,9 @@
#include <paludis/util/tribool.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/visitor_cast.hh>
+#include <paludis/util/join.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/repository_factory.hh>
-#include <paludis/package_database.hh>
#include <paludis/resolver/resolver_test.hh>
#include <test/test_runner.hh>
diff --git a/paludis/resolver/resolver_TEST_purges.cc b/paludis/resolver/resolver_TEST_purges.cc
index 0aad6f1a7..071495a04 100644
--- a/paludis/resolver/resolver_TEST_purges.cc
+++ b/paludis/resolver/resolver_TEST_purges.cc
@@ -37,7 +37,6 @@
#include <paludis/util/return_literal_function.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/repository_factory.hh>
-#include <paludis/package_database.hh>
#include <paludis/resolver/resolver_test.hh>
#include <test/test_runner.hh>
diff --git a/paludis/resolver/resolver_TEST_serialisation.cc b/paludis/resolver/resolver_TEST_serialisation.cc
index 28cda3466..0962f6e68 100644
--- a/paludis/resolver/resolver_TEST_serialisation.cc
+++ b/paludis/resolver/resolver_TEST_serialisation.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 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
@@ -36,7 +36,6 @@
#include <paludis/util/string_list_stream.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/repository_factory.hh>
-#include <paludis/package_database.hh>
#include <paludis/serialise.hh>
#include <paludis/resolver/resolver_test.hh>
diff --git a/paludis/resolver/resolver_TEST_simple.cc b/paludis/resolver/resolver_TEST_simple.cc
index 740802e75..1a09da7c7 100644
--- a/paludis/resolver/resolver_TEST_simple.cc
+++ b/paludis/resolver/resolver_TEST_simple.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 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
@@ -35,8 +35,6 @@
#include <paludis/util/make_shared_copy.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/repository_factory.hh>
-#include <paludis/package_database.hh>
-
#include <paludis/resolver/resolver_test.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
diff --git a/paludis/resolver/resolver_TEST_suggestions.cc b/paludis/resolver/resolver_TEST_suggestions.cc
index c0b02ba0a..8fadb8509 100644
--- a/paludis/resolver/resolver_TEST_suggestions.cc
+++ b/paludis/resolver/resolver_TEST_suggestions.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 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
@@ -35,7 +35,6 @@
#include <paludis/util/make_shared_copy.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/repository_factory.hh>
-#include <paludis/package_database.hh>
#include <paludis/resolver/resolver_test.hh>
#include <test/test_runner.hh>
diff --git a/paludis/resolver/resolver_TEST_uninstalls.cc b/paludis/resolver/resolver_TEST_uninstalls.cc
index 76a2a8fea..37da841ad 100644
--- a/paludis/resolver/resolver_TEST_uninstalls.cc
+++ b/paludis/resolver/resolver_TEST_uninstalls.cc
@@ -39,7 +39,6 @@
#include <paludis/util/return_literal_function.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/repository_factory.hh>
-#include <paludis/package_database.hh>
#include <paludis/resolver/resolver_test.hh>
#include <test/test_runner.hh>
diff --git a/paludis/resolver/resolver_TEST_virtuals.cc b/paludis/resolver/resolver_TEST_virtuals.cc
index cda1512b8..18cf869ab 100644
--- a/paludis/resolver/resolver_TEST_virtuals.cc
+++ b/paludis/resolver/resolver_TEST_virtuals.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2009, 2010, 2011 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
@@ -35,7 +35,6 @@
#include <paludis/util/make_shared_copy.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/repository_factory.hh>
-#include <paludis/package_database.hh>
#include <paludis/resolver/resolver_test.hh>
#include <test/test_runner.hh>
diff --git a/paludis/resolver/resolver_test.cc b/paludis/resolver/resolver_test.cc
index b4f410adc..d0a9a569e 100644
--- a/paludis/resolver/resolver_test.cc
+++ b/paludis/resolver/resolver_test.cc
@@ -38,9 +38,9 @@
#include <paludis/util/set-impl.hh>
#include <paludis/util/tribool.hh>
#include <paludis/util/visitor_cast.hh>
+#include <paludis/util/join.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repository_factory.hh>
-#include <paludis/package_database.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
@@ -138,7 +138,7 @@ ResolverTestCase::ResolverTestCase(const std::string & t, const std::string & s,
keys->insert("builddir", stringify(FSPath::cwd() / ("resolver_TEST_" + t + "_dir") / "build"));
repo = RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, keys, std::placeholders::_1));
- env.package_database()->add_repository(1, repo);
+ env.add_repository(1, repo);
keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
@@ -148,7 +148,7 @@ ResolverTestCase::ResolverTestCase(const std::string & t, const std::string & s,
keys->insert("builddir", stringify(FSPath::cwd() / ("resolver_TEST_" + t + "_dir") / "build"));
inst_repo = RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, keys, std::placeholders::_1));
- env.package_database()->add_repository(1, inst_repo);
+ env.add_repository(1, inst_repo);
fake_inst_repo = std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
@@ -157,11 +157,11 @@ ResolverTestCase::ResolverTestCase(const std::string & t, const std::string & s,
n::suitable_destination() = true,
n::supports_uninstall() = true
));
- env.package_database()->add_repository(1, fake_inst_repo);
+ env.add_repository(1, fake_inst_repo);
#ifdef ENABLE_VIRTUALS_REPOSITORY
- env.package_database()->add_repository(0, RepositoryFactory::get_instance()->create(&env, virtuals_repo_keys));
- env.package_database()->add_repository(0, RepositoryFactory::get_instance()->create(&env, installed_virtuals_repo_keys));
+ env.add_repository(0, RepositoryFactory::get_instance()->create(&env, virtuals_repo_keys));
+ env.add_repository(0, RepositoryFactory::get_instance()->create(&env, installed_virtuals_repo_keys));
#endif
interest_in_spec_helper.set_follow_installed_dependencies(true);
diff --git a/paludis/selection.cc b/paludis/selection.cc
index a5e11a739..30f97fca6 100644
--- a/paludis/selection.cc
+++ b/paludis/selection.cc
@@ -188,7 +188,7 @@ namespace
s->insert(*q);
std::shared_ptr<const PackageIDSet> i(_fg.filter().ids(env, _fg.generator().ids(env, r, s, may_excludes)));
if (! i->empty())
- result->push_back(*std::max_element(i->begin(), i->end(), PackageIDComparator(env->package_database().get())));
+ result->push_back(*std::max_element(i->begin(), i->end(), PackageIDComparator(env)));
}
return result;
@@ -230,7 +230,7 @@ namespace
std::shared_ptr<const PackageIDSet> i(_fg.filter().ids(env, _fg.generator().ids(env, r, p, may_excludes)));
std::copy(i->begin(), i->end(), result->back_inserter());
- result->sort(PackageIDComparator(env->package_database().get()));
+ result->sort(PackageIDComparator(env));
return result;
}
@@ -323,7 +323,7 @@ namespace
m->second->push_back(*i);
}
- PackageIDComparator comparator(env->package_database().get());
+ PackageIDComparator comparator(env);
for (SlotMap::iterator i(by_slot.begin()), i_end(by_slot.end()) ;
i != i_end ; ++i)
i->second->sort(comparator);
@@ -390,7 +390,7 @@ namespace
m->second->push_back(*i);
}
- PackageIDComparator comparator(env->package_database().get());
+ PackageIDComparator comparator(env);
for (SlotMap::iterator i(by_slot.begin()), i_end(by_slot.end()) ;
i != i_end ; ++i)
i->second->sort(comparator);
diff --git a/paludis/selection_TEST.cc b/paludis/selection_TEST.cc
index 4d5c82049..f40801bb8 100644
--- a/paludis/selection_TEST.cc
+++ b/paludis/selection_TEST.cc
@@ -25,12 +25,12 @@
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/user_dep_spec.hh>
-#include <paludis/package_database.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/join.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <test/test_concepts.hh>
@@ -58,7 +58,7 @@ namespace test_cases
r1->add_version("r1c1", "r1c1p2", "2");
r1->add_version("rac1", "rac1pa", "1");
r1->add_version("rac1", "rac1pa", "2");
- env.package_database()->add_repository(11, r1);
+ env.add_repository(11, r1);
TEST_CHECK(true);
std::shared_ptr<FakeRepository> r2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
@@ -66,7 +66,7 @@ namespace test_cases
n::name() = RepositoryName("repo2"))));
r2->add_version("rac1", "rac1pa", "1");
r2->add_version("rac1", "rac1pa", "3");
- env.package_database()->add_repository(10, r2);
+ env.add_repository(10, r2);
TEST_CHECK(true);
PackageDepSpec d1(parse_user_package_dep_spec("r1c1/r1c1p1", &env, { }));
@@ -125,7 +125,7 @@ namespace test_cases
r1->add_version("cat", "pkg", "2")->set_slot(SlotName("c"));
r1->add_version("cat", "pkg", "3")->set_slot(SlotName("c"));
r1->add_version("cat", "pkg", "4")->set_slot(SlotName("a"));
- env.package_database()->add_repository(10, r1);
+ env.add_repository(10, r1);
TEST_CHECK(true);
std::shared_ptr<FakeRepository> r2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
@@ -133,7 +133,7 @@ namespace test_cases
n::name() = RepositoryName("repo2"))));
r2->add_version("cat", "pkg", "1")->set_slot(SlotName("a"));
r2->add_version("cat", "pkg", "3")->set_slot(SlotName("b"));
- env.package_database()->add_repository(5, r2);
+ env.add_repository(5, r2);
TEST_CHECK(true);
PackageDepSpec d(parse_user_package_dep_spec("cat/pkg", &env, { }));
@@ -158,7 +158,7 @@ namespace test_cases
n::environment() = &env,
n::name() = RepositoryName("repo3"))));
r3->add_version("cat", "other", "1")->set_slot(SlotName("a"));
- env.package_database()->add_repository(5, r3);
+ env.add_repository(5, r3);
TEST_CHECK(true);
PackageDepSpec c(parse_user_package_dep_spec("cat/*", &env, { updso_allow_wildcards }));
diff --git a/paludis/set_file.cc b/paludis/set_file.cc
index 5fb98923c..e3c0f2b0e 100644
--- a/paludis/set_file.cc
+++ b/paludis/set_file.cc
@@ -33,7 +33,6 @@
#include <paludis/util/env_var_names.hh>
#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index 3ab3f7520..ad3c31065 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -24,12 +24,14 @@
#include <paludis/version_operator.hh>
#include <paludis/version_spec.hh>
#include <paludis/version_requirements.hh>
-#include <paludis/package_database.hh>
#include <paludis/filter.hh>
#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/contents.hh>
+#include <paludis/repository.hh>
+
#include <paludis/util/options.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_named_values.hh>
@@ -42,6 +44,8 @@
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/tribool.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/join.hh>
+
#include <algorithm>
using namespace paludis;
@@ -77,7 +81,7 @@ namespace
{
if (options[updso_no_disambiguation])
throw PackageDepSpecError("Need an explicit category specified");
- result.package(env->package_database()->fetch_unique_qualified_package_name(PackageNamePart(s),
+ result.package(env->fetch_unique_qualified_package_name(PackageNamePart(s),
filter::And(filter, filter::Matches(result, make_null_shared_ptr(), { }))));
}
}
@@ -794,7 +798,7 @@ UserKeyRequirement::requirement_met(
const MetadataKey * key(0);
- auto repo(env->package_database()->fetch_repository(id->repository_name()));
+ auto repo(env->fetch_repository(id->repository_name()));
if (0 == _imp->key.compare(0, 3, "::$"))
{
if (_imp->key == "::$format")
diff --git a/paludis/user_dep_spec_TEST.cc b/paludis/user_dep_spec_TEST.cc
index edf039715..a5fbf9ea5 100644
--- a/paludis/user_dep_spec_TEST.cc
+++ b/paludis/user_dep_spec_TEST.cc
@@ -19,7 +19,6 @@
#include <paludis/dep_spec.hh>
#include <paludis/user_dep_spec.hh>
-#include <paludis/package_database.hh>
#include <paludis/match_package.hh>
#include <paludis/version_requirements.hh>
@@ -31,6 +30,8 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/stringify.hh>
+#include <paludis/util/join.hh>
#include <paludis/environments/test/test_environment.hh>
@@ -326,8 +327,8 @@ TEST_F(UserDepSpecTest, Disambiguation)
n::suitable_destination() = true,
n::supports_uninstall() = true
)));
- env.package_database()->add_repository(1, fake);
- env.package_database()->add_repository(2, fake_inst);
+ env.add_repository(1, fake);
+ env.add_repository(2, fake_inst);
fake->add_version("cat", "pkg1", "1");
fake->add_version("cat", "pkg2", "1");
fake->add_version("dog", "pkg2", "1");
@@ -377,7 +378,7 @@ TEST(UserPackageDepSpec, Sets)
std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake"))));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
fake->add_version("cat", "world", "1");
fake->add_version("cat", "moon", "1");
@@ -405,7 +406,7 @@ TEST_F(UserDepSpecTest, Keys)
std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake"))));
- env.package_database()->add_repository(1, fake);
+ env.add_repository(1, fake);
std::shared_ptr<FakePackageID> pkg1(fake->add_version("cat", "pkg1", "1"));
pkg1->keywords_key()->set_from_string("~a ~b");