diff options
author | 2011-03-26 18:58:38 +0000 | |
---|---|---|
committer | 2011-03-26 19:00:38 +0000 | |
commit | 5c2a332b70243cb583a29bb74f712bfca2c1fb76 (patch) | |
tree | 0a01f8e624caa2c6639181df45fa80bc20adba84 /src/clients/cave | |
parent | 79d9f02fb355d81c472f3d94b8b85d5a7639210c (diff) | |
download | paludis-5c2a332b70243cb583a29bb74f712bfca2c1fb76.tar.gz paludis-5c2a332b70243cb583a29bb74f712bfca2c1fb76.tar.xz |
Use Environment rather than PackageDatabase
Diffstat (limited to 'src/clients/cave')
38 files changed, 75 insertions, 85 deletions
diff --git a/src/clients/cave/cmd_config.cc b/src/clients/cave/cmd_config.cc index 057d82331..0877de636 100644 --- a/src/clients/cave/cmd_config.cc +++ b/src/clients/cave/cmd_config.cc @@ -26,7 +26,6 @@ #include <paludis/util/make_named_values.hh> #include <paludis/util/make_null_shared_ptr.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/user_dep_spec.hh> #include <paludis/generator.hh> diff --git a/src/clients/cave/cmd_digest.cc b/src/clients/cave/cmd_digest.cc index 430bc518e..3c8ea88f4 100644 --- a/src/clients/cave/cmd_digest.cc +++ b/src/clients/cave/cmd_digest.cc @@ -31,10 +31,10 @@ #include <paludis/util/map.hh> #include <paludis/util/make_named_values.hh> #include <paludis/util/make_null_shared_ptr.hh> +#include <paludis/util/stringify.hh> #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/generator.hh> #include <paludis/filtered_generator.hh> @@ -118,7 +118,7 @@ DigestCommand::run( RepositoryName repo(*next(cmdline.begin_parameters())); Filter repo_filter(filter::Matches(make_package_dep_spec({ }).in_repository(repo), make_null_shared_ptr(), { })); QualifiedPackageName pkg(std::string::npos == cmdline.begin_parameters()->find('/') ? - env->package_database()->fetch_unique_qualified_package_name(PackageNamePart(*cmdline.begin_parameters()), repo_filter) : + env->fetch_unique_qualified_package_name(PackageNamePart(*cmdline.begin_parameters()), repo_filter) : QualifiedPackageName(*cmdline.begin_parameters())); auto ids((*env)[selection::AllVersionsSorted(generator::Package(pkg) & generator::InRepository(repo))]); @@ -153,7 +153,7 @@ DigestCommand::run( cout << endl; } - auto r(env->package_database()->fetch_repository(repo)); + auto r(env->fetch_repository(repo)); if (r->manifest_interface()) { cout << "Making manifest..." << endl; diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc index e1bdc14b4..b9b71c12c 100644 --- a/src/clients/cave/cmd_execute_resolution.cc +++ b/src/clients/cave/cmd_execute_resolution.cc @@ -78,8 +78,8 @@ #include <paludis/selection.hh> #include <paludis/filtered_generator.hh> #include <paludis/filter.hh> -#include <paludis/package_database.hh> #include <paludis/elike_blocker.hh> +#include <paludis/repository.hh> #include <set> #include <iterator> @@ -943,7 +943,7 @@ namespace case x1_post: done_action(env, action_string, ensequence(install_item.origin_id_spec()), install_item.replacing_specs(), 0 == retcode); - env->package_database()->fetch_repository(install_item.destination_repository_name())->invalidate(); + env->fetch_repository(install_item.destination_repository_name())->invalidate(); break; } diff --git a/src/clients/cave/cmd_find_candidates.cc b/src/clients/cave/cmd_find_candidates.cc index ee55cbd36..21db9b8e4 100644 --- a/src/clients/cave/cmd_find_candidates.cc +++ b/src/clients/cave/cmd_find_candidates.cc @@ -25,7 +25,6 @@ #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/generator.hh> #include <paludis/filtered_generator.hh> @@ -44,6 +43,7 @@ #include <paludis/util/indirect_iterator-impl.hh> #include <paludis/util/visitor_cast.hh> #include <paludis/util/make_null_shared_ptr.hh> +#include <paludis/util/stringify.hh> #include <cstdlib> #include <iostream> @@ -212,8 +212,8 @@ FindCandidatesCommand::run_hosted( step("Searching repositories"); RepositoryNames repository_names; - for (PackageDatabase::RepositoryConstIterator r(env->package_database()->begin_repositories()), - r_end(env->package_database()->end_repositories()) ; r != r_end ; ++r) + for (Environment::RepositoryConstIterator r(env->begin_repositories()), + r_end(env->end_repositories()) ; r != r_end ; ++r) repository_names.insert((*r)->name()); step("Searching categories"); @@ -222,7 +222,7 @@ FindCandidatesCommand::run_hosted( for (RepositoryNames::const_iterator r(repository_names.begin()), r_end(repository_names.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)); const std::shared_ptr<const CategoryNamePartSet> cats(repo->category_names({ })); std::copy(cats->begin(), cats->end(), std::inserter(category_names, category_names.end())); } @@ -233,7 +233,7 @@ FindCandidatesCommand::run_hosted( for (RepositoryNames::const_iterator r(repository_names.begin()), r_end(repository_names.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)); for (CategoryNames::const_iterator c(category_names.begin()), c_end(category_names.end()) ; c != c_end ; ++c) { diff --git a/src/clients/cave/cmd_fix_cache.cc b/src/clients/cave/cmd_fix_cache.cc index f536c9075..16a745308 100644 --- a/src/clients/cave/cmd_fix_cache.cc +++ b/src/clients/cave/cmd_fix_cache.cc @@ -24,9 +24,10 @@ #include <paludis/args/args.hh> #include <paludis/args/do_help.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> + #include <paludis/util/indirect_iterator-impl.hh> +#include <paludis/util/stringify.hh> #include <iostream> #include <set> @@ -116,8 +117,8 @@ FixCacheCommand::run( if (cmdline.a_installable.specified()) { all = false; - for (IndirectIterator<PackageDatabase::RepositoryConstIterator, const Repository> - r(env->package_database()->begin_repositories()), r_end(env->package_database()->end_repositories()); + for (IndirectIterator<Environment::RepositoryConstIterator, const Repository> + r(env->begin_repositories()), r_end(env->end_repositories()); r != r_end; ++r) if (! r->installed_root_key()) repository_names.insert(r->name()); @@ -126,16 +127,16 @@ FixCacheCommand::run( if (cmdline.a_installed.specified()) { all = false; - for (IndirectIterator<PackageDatabase::RepositoryConstIterator, const Repository> - r(env->package_database()->begin_repositories()), r_end(env->package_database()->end_repositories()); + for (IndirectIterator<Environment::RepositoryConstIterator, const Repository> + r(env->begin_repositories()), r_end(env->end_repositories()); r != r_end; ++r) if (r->installed_root_key()) repository_names.insert(r->name()); } if (all) - for (IndirectIterator<PackageDatabase::RepositoryConstIterator, const Repository> - r(env->package_database()->begin_repositories()), r_end(env->package_database()->end_repositories()); + for (IndirectIterator<Environment::RepositoryConstIterator, const Repository> + r(env->begin_repositories()), r_end(env->end_repositories()); r != r_end; ++r) repository_names.insert(r->name()); @@ -143,7 +144,7 @@ FixCacheCommand::run( r != r_end; ++r) { cout << fuc(fs_fixing(), fv<'s'>(stringify(*r))); - const std::shared_ptr<Repository> repo(env->package_database()->fetch_repository(*r)); + const std::shared_ptr<Repository> repo(env->fetch_repository(*r)); repo->regenerate_cache(); } diff --git a/src/clients/cave/cmd_generate_metadata.cc b/src/clients/cave/cmd_generate_metadata.cc index fee73df62..c38b657c8 100644 --- a/src/clients/cave/cmd_generate_metadata.cc +++ b/src/clients/cave/cmd_generate_metadata.cc @@ -23,7 +23,6 @@ #include <paludis/args/do_help.hh> #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/util/set.hh> #include <paludis/util/wrapped_forward_iterator.hh> @@ -33,6 +32,7 @@ #include <paludis/util/accept_visitor.hh> #include <paludis/util/thread_pool.hh> #include <paludis/util/mutex.hh> +#include <paludis/util/stringify.hh> #include <paludis/generator.hh> #include <paludis/filtered_generator.hh> #include <paludis/filter.hh> diff --git a/src/clients/cave/cmd_has_version.cc b/src/clients/cave/cmd_has_version.cc index 18cb85672..7d587868e 100644 --- a/src/clients/cave/cmd_has_version.cc +++ b/src/clients/cave/cmd_has_version.cc @@ -22,7 +22,6 @@ #include <paludis/args/do_help.hh> #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/util/set.hh> #include <paludis/util/wrapped_forward_iterator.hh> diff --git a/src/clients/cave/cmd_import.cc b/src/clients/cave/cmd_import.cc index 48a3d789b..04bb0b4ef 100644 --- a/src/clients/cave/cmd_import.cc +++ b/src/clients/cave/cmd_import.cc @@ -37,7 +37,6 @@ #include <paludis/repository.hh> #include <paludis/metadata_key.hh> #include <paludis/repository_factory.hh> -#include <paludis/package_database.hh> #include <paludis/unformatted_pretty_printer.hh> #include <iostream> @@ -224,7 +223,7 @@ ImportCommand::run( for (PackageIDSequence::ConstIterator i(old_ids->begin()), i_end(old_ids->end()) ; i != i_end ; ++i) { - auto repo(env->package_database()->fetch_repository((*i)->repository_name())); + auto repo(env->fetch_repository((*i)->repository_name())); if (! repo->format_key()) continue; if (repo->format_key()->value() != "installed_unpackaged") @@ -291,7 +290,7 @@ ImportCommand::run( keys->insert("preserve_work", preserve_work); std::shared_ptr<Repository> repo(RepositoryFactory::get_instance()->create(env.get(), std::bind(from_keys, keys, std::placeholders::_1))); - env->package_database()->add_repository(10, repo); + env->add_repository(10, repo); std::shared_ptr<const PackageIDSequence> ids(repo->package_ids(package, { })); if (1 != std::distance(ids->begin(), ids->end())) throw InternalError(PALUDIS_HERE, "ids is '" + join(indirect_iterator(ids->begin()), indirect_iterator( diff --git a/src/clients/cave/cmd_info.cc b/src/clients/cave/cmd_info.cc index a0b8d1330..d04006c58 100644 --- a/src/clients/cave/cmd_info.cc +++ b/src/clients/cave/cmd_info.cc @@ -29,7 +29,6 @@ #include <paludis/args/do_help.hh> #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/user_dep_spec.hh> #include <paludis/filter.hh> @@ -44,12 +43,16 @@ #include <paludis/util/pretty_print.hh> #include <paludis/util/timestamp.hh> #include <paludis/util/make_null_shared_ptr.hh> +#include <paludis/util/stringify.hh> +#include <paludis/util/join.hh> #include <paludis/action.hh> #include <paludis/about_metadata.hh> +#include <paludis/contents.hh> #include <cstdlib> #include <iostream> #include <algorithm> #include <set> +#include <sstream> #include "command_command_line.hh" @@ -408,8 +411,7 @@ InfoCommand::run( do_about(cmdline, env); do_env(cmdline, env); - for (PackageDatabase::RepositoryConstIterator 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) do_one_repository(cmdline, env, *r); diff --git a/src/clients/cave/cmd_manage_search_index.cc b/src/clients/cave/cmd_manage_search_index.cc index 52b76a740..23e74051b 100644 --- a/src/clients/cave/cmd_manage_search_index.cc +++ b/src/clients/cave/cmd_manage_search_index.cc @@ -26,7 +26,6 @@ #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/generator.hh> #include <paludis/filtered_generator.hh> @@ -49,6 +48,7 @@ #include <paludis/util/iterator_funcs.hh> #include <paludis/util/accept_visitor.hh> #include <paludis/util/mutex.hh> +#include <paludis/util/stringify.hh> #include <cstdlib> #include <iostream> diff --git a/src/clients/cave/cmd_match.cc b/src/clients/cave/cmd_match.cc index c41a31cd8..c6ad4952e 100644 --- a/src/clients/cave/cmd_match.cc +++ b/src/clients/cave/cmd_match.cc @@ -23,7 +23,6 @@ #include <paludis/args/do_help.hh> #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/util/set.hh> #include <paludis/util/wrapped_forward_iterator.hh> diff --git a/src/clients/cave/cmd_mirror.cc b/src/clients/cave/cmd_mirror.cc index 0dcd36f6f..f51560916 100644 --- a/src/clients/cave/cmd_mirror.cc +++ b/src/clients/cave/cmd_mirror.cc @@ -32,10 +32,10 @@ #include <paludis/util/map.hh> #include <paludis/util/make_named_values.hh> #include <paludis/util/make_null_shared_ptr.hh> +#include <paludis/util/stringify.hh> #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/generator.hh> #include <paludis/filtered_generator.hh> diff --git a/src/clients/cave/cmd_perform.cc b/src/clients/cave/cmd_perform.cc index ca6d2c768..b9d48200f 100644 --- a/src/clients/cave/cmd_perform.cc +++ b/src/clients/cave/cmd_perform.cc @@ -26,7 +26,6 @@ #include <paludis/args/do_help.hh> #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/user_dep_spec.hh> #include <paludis/generator.hh> @@ -44,6 +43,7 @@ #include <paludis/util/make_named_values.hh> #include <paludis/util/iterator_funcs.hh> #include <paludis/util/make_null_shared_ptr.hh> +#include <paludis/util/stringify.hh> #include <cstdlib> #include <iostream> #include <algorithm> @@ -542,7 +542,7 @@ PerformCommand::run( if (! cmdline.a_destination.specified()) throw args::DoHelp("--destination must be specified for an install"); - const std::shared_ptr<Repository> destination(env->package_database()->fetch_repository( + const std::shared_ptr<Repository> destination(env->fetch_repository( RepositoryName(cmdline.a_destination.argument()))); OutputManagerFromIPCOrEnvironment output_manager_holder(env.get(), cmdline, id); @@ -568,7 +568,7 @@ PerformCommand::run( if (! cmdline.a_destination.specified()) throw args::DoHelp("--destination must be specified for a pretend"); - const std::shared_ptr<Repository> destination(env->package_database()->fetch_repository( + const std::shared_ptr<Repository> destination(env->fetch_repository( RepositoryName(cmdline.a_destination.argument()))); OutputManagerFromIPCOrEnvironment output_manager_holder(env.get(), cmdline, id); diff --git a/src/clients/cave/cmd_print_best_version.cc b/src/clients/cave/cmd_print_best_version.cc index 6691611be..1ef5eb044 100644 --- a/src/clients/cave/cmd_print_best_version.cc +++ b/src/clients/cave/cmd_print_best_version.cc @@ -22,7 +22,6 @@ #include <paludis/args/do_help.hh> #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/util/set.hh> #include <paludis/util/wrapped_forward_iterator.hh> diff --git a/src/clients/cave/cmd_print_categories.cc b/src/clients/cave/cmd_print_categories.cc index 112d3721e..312704d03 100644 --- a/src/clients/cave/cmd_print_categories.cc +++ b/src/clients/cave/cmd_print_categories.cc @@ -22,10 +22,10 @@ #include <paludis/args/do_help.hh> #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/util/set.hh> #include <paludis/util/wrapped_forward_iterator.hh> +#include <paludis/util/stringify.hh> #include <cstdlib> #include <iostream> #include <algorithm> @@ -95,8 +95,7 @@ PrintCategoriesCommand::run( throw args::DoHelp("print-categories takes no parameters"); std::set<CategoryNamePart> categories; - for (PackageDatabase::RepositoryConstIterator 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 (cmdline.a_repository.specified()) diff --git a/src/clients/cave/cmd_print_dependent_ids.cc b/src/clients/cave/cmd_print_dependent_ids.cc index ca0da8c31..7caae7afd 100644 --- a/src/clients/cave/cmd_print_dependent_ids.cc +++ b/src/clients/cave/cmd_print_dependent_ids.cc @@ -25,7 +25,6 @@ #include <paludis/args/do_help.hh> #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/util/set.hh> #include <paludis/util/wrapped_forward_iterator.hh> @@ -33,6 +32,7 @@ #include <paludis/util/visitor_cast.hh> #include <paludis/util/map.hh> #include <paludis/util/make_null_shared_ptr.hh> +#include <paludis/util/stringify.hh> #include <paludis/resolver/collect_depped_upon.hh> #include <paludis/generator.hh> #include <paludis/filtered_generator.hh> diff --git a/src/clients/cave/cmd_print_id_environment_variable.cc b/src/clients/cave/cmd_print_id_environment_variable.cc index e98d549a1..2e2d89873 100644 --- a/src/clients/cave/cmd_print_id_environment_variable.cc +++ b/src/clients/cave/cmd_print_id_environment_variable.cc @@ -32,7 +32,6 @@ #include <paludis/selection.hh> #include <paludis/package_id.hh> #include <paludis/repository.hh> -#include <paludis/package_database.hh> #include <iostream> #include <cstdlib> @@ -99,7 +98,7 @@ namespace const PrintIDEnvironmentVariableCommandLine & cmdline ) { - auto repo(env->package_database()->fetch_repository(id->repository_name())); + auto repo(env->fetch_repository(id->repository_name())); if (0 != repo->environment_variable_interface()) { diff --git a/src/clients/cave/cmd_print_ids.cc b/src/clients/cave/cmd_print_ids.cc index 4abfa66f4..3cfae9289 100644 --- a/src/clients/cave/cmd_print_ids.cc +++ b/src/clients/cave/cmd_print_ids.cc @@ -23,7 +23,6 @@ #include <paludis/args/do_help.hh> #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/util/set.hh> #include <paludis/util/wrapped_forward_iterator.hh> @@ -31,6 +30,7 @@ #include <paludis/util/visitor_cast.hh> #include <paludis/util/map.hh> #include <paludis/util/make_null_shared_ptr.hh> +#include <paludis/util/stringify.hh> #include <paludis/generator.hh> #include <paludis/filtered_generator.hh> #include <paludis/filter.hh> diff --git a/src/clients/cave/cmd_print_packages.cc b/src/clients/cave/cmd_print_packages.cc index f07b76fb5..59ef434a2 100644 --- a/src/clients/cave/cmd_print_packages.cc +++ b/src/clients/cave/cmd_print_packages.cc @@ -24,10 +24,10 @@ #include <paludis/args/args.hh> #include <paludis/args/do_help.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/util/wrapped_forward_iterator.hh> #include <paludis/util/set.hh> +#include <paludis/util/stringify.hh> #include <iostream> #include <cstdlib> @@ -94,7 +94,7 @@ PrintPackagesCommand::run( std::set<QualifiedPackageName> all_packages; - for (PackageDatabase::RepositoryConstIterator 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 (cmdline.a_repository.specified()) diff --git a/src/clients/cave/cmd_print_repositories.cc b/src/clients/cave/cmd_print_repositories.cc index 56d14e2fc..897cfdaf8 100644 --- a/src/clients/cave/cmd_print_repositories.cc +++ b/src/clients/cave/cmd_print_repositories.cc @@ -22,7 +22,6 @@ #include <paludis/args/args.hh> #include <paludis/args/do_help.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/util/set.hh> #include <paludis/util/wrapped_forward_iterator.hh> @@ -94,8 +93,8 @@ PrintRepositoriesCommand::run( std::set<RepositoryName> repository_names; - for (IndirectIterator<PackageDatabase::RepositoryConstIterator, const Repository> - r(env->package_database()->begin_repositories()), r_end(env->package_database()->end_repositories()); + for (IndirectIterator<Environment::RepositoryConstIterator, const Repository> + r(env->begin_repositories()), r_end(env->end_repositories()); r != r_end; ++r) { if (cmdline.a_repository_format.specified()) diff --git a/src/clients/cave/cmd_print_repository_metadata.cc b/src/clients/cave/cmd_print_repository_metadata.cc index c0a25cae5..abeed8a96 100644 --- a/src/clients/cave/cmd_print_repository_metadata.cc +++ b/src/clients/cave/cmd_print_repository_metadata.cc @@ -28,7 +28,7 @@ #include <paludis/util/options.hh> #include <paludis/environment.hh> #include <paludis/metadata_key.hh> -#include <paludis/package_database.hh> +#include <paludis/repository.hh> #include <iostream> #include <algorithm> @@ -133,7 +133,7 @@ PrintRepositoryMetadataCommand::run( throw args::DoHelp("print-repository-metadata takes exactly one parameter"); RepositoryName name(*cmdline.begin_parameters()); - const std::shared_ptr<const Repository> repo(env->package_database()->fetch_repository(name)); + const std::shared_ptr<const Repository> repo(env->fetch_repository(name)); for (Repository::MetadataConstIterator m(repo->begin_metadata()), m_end(repo->end_metadata()) ; m != m_end ; ++m) diff --git a/src/clients/cave/cmd_print_set.cc b/src/clients/cave/cmd_print_set.cc index 181d4dbbe..1d383c5b5 100644 --- a/src/clients/cave/cmd_print_set.cc +++ b/src/clients/cave/cmd_print_set.cc @@ -24,7 +24,6 @@ #include <paludis/args/do_help.hh> #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/spec_tree.hh> #include <paludis/util/set.hh> @@ -33,6 +32,7 @@ #include <paludis/util/visitor_cast.hh> #include <paludis/util/map.hh> #include <paludis/util/accept_visitor.hh> +#include <paludis/util/stringify.hh> #include <cstdlib> #include <iostream> #include <algorithm> diff --git a/src/clients/cave/cmd_print_sets.cc b/src/clients/cave/cmd_print_sets.cc index c307bb886..18b915cf0 100644 --- a/src/clients/cave/cmd_print_sets.cc +++ b/src/clients/cave/cmd_print_sets.cc @@ -22,7 +22,6 @@ #include <paludis/args/args.hh> #include <paludis/args/do_help.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/util/indirect_iterator-impl.hh> #include <paludis/util/set.hh> diff --git a/src/clients/cave/cmd_print_sync_protocols.cc b/src/clients/cave/cmd_print_sync_protocols.cc index d6f1bc176..529e94f08 100644 --- a/src/clients/cave/cmd_print_sync_protocols.cc +++ b/src/clients/cave/cmd_print_sync_protocols.cc @@ -22,7 +22,6 @@ #include <paludis/args/args.hh> #include <paludis/args/do_help.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/util/fs_iterator.hh> #include <paludis/util/fs_stat.hh> diff --git a/src/clients/cave/cmd_print_unused_distfiles.cc b/src/clients/cave/cmd_print_unused_distfiles.cc index 489a3ebd5..a9a1e3ecc 100644 --- a/src/clients/cave/cmd_print_unused_distfiles.cc +++ b/src/clients/cave/cmd_print_unused_distfiles.cc @@ -31,7 +31,6 @@ #include <paludis/mask.hh> #include <paludis/metadata_key.hh> #include <paludis/name.hh> -#include <paludis/package_database.hh> #include <paludis/package_id.hh> #include <paludis/repository.hh> #include <paludis/selection.hh> @@ -165,7 +164,7 @@ PrintUnusedDistfilesCommand::run( c != c_end ; ++c) selections.push_back(selection::AllVersionsUnsorted(generator::InRepository(RepositoryName(*c)))); - std::set<std::shared_ptr<const PackageID>, PackageIDComparator> already_done((PackageIDComparator(env->package_database().get()))); + std::set<std::shared_ptr<const PackageID>, PackageIDComparator> already_done((PackageIDComparator(env.get()))); for (auto s(selections.begin()), s_end(selections.end()) ; s != s_end ; ++s) { @@ -191,9 +190,8 @@ PrintUnusedDistfilesCommand::run( std::set<FSPath, FSPathComparator> distdirs; - const std::shared_ptr<const PackageDatabase> pkgdb(env->package_database()); - for (auto repo(pkgdb->begin_repositories()), end(pkgdb->end_repositories()) ; - repo != end ; ++repo) + for (auto repo(env->begin_repositories()), end(env->end_repositories()) ; + repo != end ; ++repo) { auto distdir_metadata((*repo)->find_metadata("distdir")); if (distdir_metadata != (*repo)->end_metadata()) diff --git a/src/clients/cave/cmd_report.cc b/src/clients/cave/cmd_report.cc index 2376752ec..4aefa3a7d 100644 --- a/src/clients/cave/cmd_report.cc +++ b/src/clients/cave/cmd_report.cc @@ -27,7 +27,6 @@ #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/user_dep_spec.hh> #include <paludis/filter.hh> @@ -50,6 +49,8 @@ #include <paludis/util/make_null_shared_ptr.hh> #include <paludis/util/accept_visitor.hh> #include <paludis/util/make_named_values.hh> +#include <paludis/util/stringify.hh> +#include <paludis/util/join.hh> #include <paludis/resolver/collect_purges.hh> #include <paludis/resolver/collect_installed.hh> diff --git a/src/clients/cave/cmd_search.cc b/src/clients/cave/cmd_search.cc index 1a36dd0f4..c3f8ed3c8 100644 --- a/src/clients/cave/cmd_search.cc +++ b/src/clients/cave/cmd_search.cc @@ -28,7 +28,6 @@ #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/user_dep_spec.hh> #include <paludis/filter.hh> @@ -49,6 +48,7 @@ #include <paludis/util/mutex.hh> #include <paludis/util/iterator_funcs.hh> #include <paludis/util/make_null_shared_ptr.hh> +#include <paludis/util/stringify.hh> #include <cstdlib> #include <iostream> diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc index dead782ab..df3017767 100644 --- a/src/clients/cave/cmd_show.cc +++ b/src/clients/cave/cmd_show.cc @@ -29,7 +29,6 @@ #include <paludis/args/do_help.hh> #include <paludis/name.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/user_dep_spec.hh> #include <paludis/filter.hh> @@ -46,12 +45,15 @@ #include <paludis/util/timestamp.hh> #include <paludis/util/make_null_shared_ptr.hh> #include <paludis/util/accept_visitor.hh> +#include <paludis/util/stringify.hh> +#include <paludis/util/join.hh> #include <paludis/action.hh> #include <paludis/mask.hh> #include <paludis/choice.hh> #include <paludis/partially_made_package_dep_spec.hh> #include <paludis/mask_utils.hh> #include <paludis/permitted_choice_value_parameter_values.hh> +#include <paludis/contents.hh> #include <cstdlib> #include <iostream> #include <algorithm> @@ -1107,7 +1109,7 @@ namespace { cout << fuc(fs_repository_heading(), fv<'s'>(stringify(s))); - const std::shared_ptr<const Repository> repo(env->package_database()->fetch_repository(s)); + const std::shared_ptr<const Repository> repo(env->fetch_repository(s)); std::set<std::shared_ptr<const MetadataKey>, MetadataKeyComparator> keys(repo->begin_metadata(), repo->end_metadata()); for (std::set<std::shared_ptr<const MetadataKey>, MetadataKeyComparator>::const_iterator k(keys.begin()), k_end(keys.end()) ; k != k_end ; ++k) @@ -1172,7 +1174,7 @@ namespace for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ; i != i_end ; ++i) { - auto repo(env->package_database()->fetch_repository((*i)->repository_name())); + auto repo(env->fetch_repository((*i)->repository_name())); if (repo->installed_root_key()) all_installed->push_back(*i); else @@ -1228,7 +1230,7 @@ namespace header_out << " "; need_space = true; - auto repo(env->package_database()->fetch_repository((*i)->repository_name())); + auto repo(env->fetch_repository((*i)->repository_name())); if (repo->installed_root_key()) header_out << fuc(fs_package_version_installed(), fv<'s'>(stringify((*i)->canonical_form(idcf_version)))); else @@ -1406,7 +1408,7 @@ ShowCommand::run( try { RepositoryName repo_name(*p); - if (env->package_database()->has_repository_named(repo_name)) + if (env->has_repository_named(repo_name)) { do_one_repository(cmdline, env, basic_ppos, repo_name); continue; diff --git a/src/clients/cave/cmd_sync.cc b/src/clients/cave/cmd_sync.cc index 04d8d5b6b..fe9ede49c 100644 --- a/src/clients/cave/cmd_sync.cc +++ b/src/clients/cave/cmd_sync.cc @@ -21,7 +21,6 @@ #include "exceptions.hh" #include "colours.hh" #include "format_user_config.hh" -#include <paludis/package_database.hh> #include <paludis/util/action_queue.hh> #include <paludis/util/mutex.hh> #include <paludis/util/named_value.hh> @@ -32,6 +31,8 @@ #include <paludis/util/executor.hh> #include <paludis/util/timestamp.hh> #include <paludis/util/make_null_shared_ptr.hh> +#include <paludis/util/stringify.hh> +#include <paludis/util/join.hh> #include <paludis/output_manager.hh> #include <paludis/standard_output_manager.hh> #include <paludis/repository.hh> @@ -139,7 +140,7 @@ namespace if (cmdline.a_sequential.specified()) return ""; - const std::shared_ptr<const Repository> r(env->package_database()->fetch_repository(name)); + const std::shared_ptr<const Repository> r(env->fetch_repository(name)); if (r->sync_host_key() && r->sync_host_key()->value()->end() != r->sync_host_key()->value()->find(cmdline.a_suffix.argument())) return r->sync_host_key()->value()->find(cmdline.a_suffix.argument())->second; else @@ -172,7 +173,7 @@ namespace make_null_shared_ptr()).max_exit_status()) throw SyncFailedError("Sync aborted by hook"); - const std::shared_ptr<Repository> repo(env->package_database()->fetch_repository(name)); + const std::shared_ptr<Repository> repo(env->fetch_repository(name)); CreateOutputManagerForRepositorySyncInfo info(repo->name(), cmdline.a_sequential.specified() ? oe_exclusive : oe_with_others, ClientOutputFeatures() + cof_summary_at_end); @@ -200,7 +201,7 @@ namespace try { - const std::shared_ptr<Repository> repo(env->package_database()->fetch_repository(name)); + const std::shared_ptr<Repository> repo(env->fetch_repository(name)); if (! repo->sync(cmdline.a_suffix.argument(), cmdline.a_revision.argument(), output_manager)) skipped = true; @@ -375,13 +376,12 @@ SyncCommand::run( p != p_end ; ++p) { RepositoryName n(*p); - if (! env->package_database()->has_repository_named(n)) + if (! env->has_repository_named(n)) throw NothingMatching(*p); repos.insert(n); } else - for (PackageDatabase::RepositoryConstIterator p(env->package_database()->begin_repositories()), - p_end(env->package_database()->end_repositories()) ; + for (auto p(env->begin_repositories()), p_end(env->end_repositories()) ; p != p_end ; ++p) repos.insert((*p)->name()); @@ -399,8 +399,7 @@ SyncCommand::run( retcode |= sync_these(env, cmdline, repos); - for (PackageDatabase::RepositoryConstIterator r(env->package_database()->begin_repositories()), - r_end(env->package_database()->end_repositories()) ; r != r_end ; ++r) + for (auto r(env->begin_repositories()), r_end(env->end_repositories()) ; r != r_end ; ++r) { (*r)->invalidate(); (*r)->purge_invalid_cache(); diff --git a/src/clients/cave/cmd_sync_protocol_options.cc b/src/clients/cave/cmd_sync_protocol_options.cc index 1c7a29754..46b01c0fb 100644 --- a/src/clients/cave/cmd_sync_protocol_options.cc +++ b/src/clients/cave/cmd_sync_protocol_options.cc @@ -23,7 +23,6 @@ #include <paludis/args/do_help.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/util/fs_iterator.hh> @@ -32,6 +31,7 @@ #include <paludis/util/process.hh> #include <paludis/util/system.hh> #include <paludis/util/env_var_names.hh> +#include <paludis/util/join.hh> #include <cstdlib> #include <iostream> diff --git a/src/clients/cave/cmd_update_world.cc b/src/clients/cave/cmd_update_world.cc index 08d6553a6..e2ebd3e0b 100644 --- a/src/clients/cave/cmd_update_world.cc +++ b/src/clients/cave/cmd_update_world.cc @@ -25,8 +25,8 @@ #include <paludis/util/iterator_funcs.hh> #include <paludis/util/options.hh> #include <paludis/util/sequence.hh> +#include <paludis/util/stringify.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/generator.hh> #include <paludis/selection.hh> #include <paludis/filter.hh> @@ -126,7 +126,7 @@ UpdateWorldCommand::run( QualifiedPackageName q("x/x"); if (std::string::npos == p->find('/')) - q = env->package_database()->fetch_unique_qualified_package_name(PackageNamePart(*p)); + q = env->fetch_unique_qualified_package_name(PackageNamePart(*p)); else q = QualifiedPackageName(*p); diff --git a/src/clients/cave/cmd_verify.cc b/src/clients/cave/cmd_verify.cc index c1a9358bc..8dbe003bd 100644 --- a/src/clients/cave/cmd_verify.cc +++ b/src/clients/cave/cmd_verify.cc @@ -34,8 +34,8 @@ #include <paludis/util/md5.hh> #include <paludis/util/fs_stat.hh> #include <paludis/util/make_null_shared_ptr.hh> +#include <paludis/util/stringify.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/repository.hh> #include <paludis/user_dep_spec.hh> #include <paludis/generator.hh> @@ -47,6 +47,7 @@ #include <paludis/hook.hh> #include <paludis/metadata_key.hh> #include <paludis/output_manager_from_environment.hh> +#include <paludis/contents.hh> #include <cstdlib> #include <iostream> #include <algorithm> diff --git a/src/clients/cave/executables_common.cc b/src/clients/cave/executables_common.cc index 4dc507ab5..123768003 100644 --- a/src/clients/cave/executables_common.cc +++ b/src/clients/cave/executables_common.cc @@ -27,7 +27,6 @@ #include <paludis/filtered_generator.hh> #include <paludis/generator.hh> #include <paludis/metadata_key.hh> -#include <paludis/package_database.hh> #include <paludis/package_id.hh> #include <paludis/selection.hh> #include <paludis/user_dep_spec.hh> diff --git a/src/clients/cave/owner_common.cc b/src/clients/cave/owner_common.cc index 156c4a1c3..183f26150 100644 --- a/src/clients/cave/owner_common.cc +++ b/src/clients/cave/owner_common.cc @@ -2,7 +2,7 @@ /* * Copyright (c) 2008 Alexander Færøy - * 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 @@ -27,13 +27,13 @@ #include <paludis/generator.hh> #include <paludis/metadata_key.hh> #include <paludis/name.hh> -#include <paludis/package_database.hh> #include <paludis/package_id.hh> #include <paludis/repository.hh> #include <paludis/selection.hh> #include <paludis/util/indirect_iterator-impl.hh> #include <paludis/util/wrapped_forward_iterator.hh> #include <paludis/util/fs_stat.hh> +#include <paludis/util/stringify.hh> #include <algorithm> #include <functional> diff --git a/src/clients/cave/parse_spec_with_nice_error.cc b/src/clients/cave/parse_spec_with_nice_error.cc index 22f1b907d..688f37d7e 100644 --- a/src/clients/cave/parse_spec_with_nice_error.cc +++ b/src/clients/cave/parse_spec_with_nice_error.cc @@ -19,7 +19,7 @@ #include "parse_spec_with_nice_error.hh" #include "exceptions.hh" -#include <paludis/package_database.hh> +#include <paludis/environment.hh> using namespace paludis; using namespace cave; diff --git a/src/clients/cave/resolve_cmdline.cc b/src/clients/cave/resolve_cmdline.cc index 2a107d758..204171ba9 100644 --- a/src/clients/cave/resolve_cmdline.cc +++ b/src/clients/cave/resolve_cmdline.cc @@ -21,7 +21,6 @@ #include <paludis/args/do_help.hh> #include <paludis/repository.hh> #include <paludis/environment.hh> -#include <paludis/package_database.hh> #include <paludis/util/map.hh> #include <paludis/util/log.hh> #include <paludis/repository_factory.hh> @@ -450,7 +449,7 @@ ResolveCommandLineImportOptions::apply(const std::shared_ptr<Environment> & env) std::shared_ptr<Repository> repo(RepositoryFactory::get_instance()->create(env.get(), std::bind(from_keys, keys, std::placeholders::_1))); - env->package_database()->add_repository(10, repo); + env->add_repository(10, repo); } void diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc index cd8d64325..cfb68dc1e 100644 --- a/src/clients/cave/resolve_common.cc +++ b/src/clients/cave/resolve_common.cc @@ -102,7 +102,6 @@ #include <paludis/package_id.hh> #include <paludis/filtered_generator.hh> #include <paludis/metadata_key.hh> -#include <paludis/package_database.hh> #include <paludis/filter.hh> #include <paludis/generator.hh> #include <paludis/selection.hh> @@ -689,7 +688,7 @@ namespace if (std::string::npos != s.find('/')) return QualifiedPackageName(s); else - return env->package_database()->fetch_unique_qualified_package_name(PackageNamePart(s)); + return env->fetch_unique_qualified_package_name(PackageNamePart(s)); } struct AllowPretend diff --git a/src/clients/cave/size_common.cc b/src/clients/cave/size_common.cc index 22a095d89..c06927830 100644 --- a/src/clients/cave/size_common.cc +++ b/src/clients/cave/size_common.cc @@ -28,7 +28,6 @@ #include <paludis/generator.hh> #include <paludis/metadata_key.hh> #include <paludis/name.hh> -#include <paludis/package_database.hh> #include <paludis/package_id.hh> #include <paludis/repository.hh> #include <paludis/selection.hh> |