aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-13 13:53:06 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-13 13:53:06 +0100
commitd4ae54b97e6fc3218443b389618ee1c71674c097 (patch)
tree9ad5879ac7cb7ffa0511cd0e1a804006b0c5e50f /src
parent7db9b623aa303e9c16bb113444e9fcceb0e0cddf (diff)
downloadpaludis-d4ae54b97e6fc3218443b389618ee1c71674c097.tar.gz
paludis-d4ae54b97e6fc3218443b389618ee1c71674c097.tar.xz
env->root() -> env->preferred_root_key()
Diffstat (limited to 'src')
-rw-r--r--src/clients/cave/cmd_contents.cc6
-rw-r--r--src/clients/cave/cmd_info.cc4
-rw-r--r--src/clients/cave/cmd_print_id_contents.cc4
-rw-r--r--src/clients/cave/cmd_verify.cc6
-rw-r--r--src/clients/cave/executables_common.cc4
-rw-r--r--src/clients/cave/owner_common.cc2
-rw-r--r--src/clients/paludis/applets.cc8
-rw-r--r--src/clients/paludis/do_config.cc4
-rw-r--r--src/clients/paludis/do_contents.cc6
-rw-r--r--src/clients/paludis/do_executables.cc6
-rw-r--r--src/clients/paludis/info.cc2
-rw-r--r--src/clients/paludis/uninstall.cc3
-rw-r--r--src/output/console_install_task.cc11
-rw-r--r--src/output/console_query_task.cc2
14 files changed, 34 insertions, 34 deletions
diff --git a/src/clients/cave/cmd_contents.cc b/src/clients/cave/cmd_contents.cc
index 0af6e25c0..9ff5f325d 100644
--- a/src/clients/cave/cmd_contents.cc
+++ b/src/clients/cave/cmd_contents.cc
@@ -124,13 +124,13 @@ ContentsCommand::run(
throw args::DoHelp("contents takes exactly one parameter");
PackageDepSpec spec(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(),
- { }, filter::InstalledAtRoot(env->root())));
+ { }, filter::InstalledAtRoot(env->preferred_root_key()->value())));
std::shared_ptr<const PackageIDSequence> entries(
- (*env)[selection::AllVersionsSorted(generator::Matches(spec, { }) | filter::InstalledAtRoot(env->root()))]);
+ (*env)[selection::AllVersionsSorted(generator::Matches(spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
- nothing_matching_error(env.get(), *cmdline.begin_parameters(), filter::InstalledAtRoot(env->root()));
+ nothing_matching_error(env.get(), *cmdline.begin_parameters(), filter::InstalledAtRoot(env->preferred_root_key()->value()));
const std::shared_ptr<const PackageID> id(*entries->last());
if (! id->contents_key())
diff --git a/src/clients/cave/cmd_info.cc b/src/clients/cave/cmd_info.cc
index 3114932a1..2caab8e1a 100644
--- a/src/clients/cave/cmd_info.cc
+++ b/src/clients/cave/cmd_info.cc
@@ -363,12 +363,12 @@ namespace
PackageDepSpec spec(parse_user_package_dep_spec(param, env.get(), { }));
const std::shared_ptr<const PackageIDSequence> installed_ids((*env)[selection::AllVersionsSorted(generator::Matches(
- spec, { }) | filter::InstalledAtRoot(env->root()))]);
+ spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
const std::shared_ptr<const PackageIDSequence> installable_ids((*env)[selection::BestVersionOnly(generator::Matches(
spec, { }) | filter::SupportsAction<InstallAction>() | filter::NotMasked())]);
if (installed_ids->empty() && installable_ids->empty())
- nothing_matching_error(env.get(), param, filter::InstalledAtRoot(env->root()));
+ nothing_matching_error(env.get(), param, filter::InstalledAtRoot(env->preferred_root_key()->value()));
for (PackageIDSequence::ConstIterator i(installed_ids->begin()), i_end(installed_ids->end()) ;
i != i_end ; ++i)
diff --git a/src/clients/cave/cmd_print_id_contents.cc b/src/clients/cave/cmd_print_id_contents.cc
index b67269e63..aeeb789e8 100644
--- a/src/clients/cave/cmd_print_id_contents.cc
+++ b/src/clients/cave/cmd_print_id_contents.cc
@@ -158,10 +158,10 @@ PrintIDContentsCommand::run(
throw args::DoHelp("print-id-contents takes exactly one parameter");
PackageDepSpec spec(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(),
- { updso_allow_wildcards }, filter::InstalledAtRoot(env->root())));
+ { updso_allow_wildcards }, filter::InstalledAtRoot(env->preferred_root_key()->value())));
std::shared_ptr<const PackageIDSequence> entries(
- (*env)[selection::AllVersionsSorted(generator::Matches(spec, { }) | filter::InstalledAtRoot(env->root()))]);
+ (*env)[selection::AllVersionsSorted(generator::Matches(spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
throw NothingMatching(spec);
diff --git a/src/clients/cave/cmd_verify.cc b/src/clients/cave/cmd_verify.cc
index b80816565..b1ed122a6 100644
--- a/src/clients/cave/cmd_verify.cc
+++ b/src/clients/cave/cmd_verify.cc
@@ -203,13 +203,13 @@ VerifyCommand::run(
throw args::DoHelp("verify takes exactly one parameter");
PackageDepSpec spec(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(),
- { updso_allow_wildcards }, filter::InstalledAtRoot(env->root())));
+ { updso_allow_wildcards }, filter::InstalledAtRoot(env->preferred_root_key()->value())));
std::shared_ptr<const PackageIDSequence> entries(
- (*env)[selection::AllVersionsSorted(generator::Matches(spec, { }) | filter::InstalledAtRoot(env->root()))]);
+ (*env)[selection::AllVersionsSorted(generator::Matches(spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
- nothing_matching_error(env.get(), *cmdline.begin_parameters(), filter::InstalledAtRoot(env->root()));
+ nothing_matching_error(env.get(), *cmdline.begin_parameters(), filter::InstalledAtRoot(env->preferred_root_key()->value()));
int exit_status(0);
for (PackageIDSequence::ConstIterator i(entries->begin()), i_end(entries->end()) ;
diff --git a/src/clients/cave/executables_common.cc b/src/clients/cave/executables_common.cc
index b3ce92028..f54a7d3b3 100644
--- a/src/clients/cave/executables_common.cc
+++ b/src/clients/cave/executables_common.cc
@@ -112,8 +112,8 @@ paludis::cave::executables_common(
PackageDepSpec(parse_user_package_dep_spec(
param, env.get(),
{ updso_allow_wildcards },
- filter::InstalledAtRoot(env->root()))),
- { }) | filter::InstalledAtRoot(env->root()))]);
+ filter::InstalledAtRoot(env->preferred_root_key()->value()))),
+ { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
throw NoSuchPackageError(param);
diff --git a/src/clients/cave/owner_common.cc b/src/clients/cave/owner_common.cc
index 4c7544456..9d1b030f0 100644
--- a/src/clients/cave/owner_common.cc
+++ b/src/clients/cave/owner_common.cc
@@ -83,7 +83,7 @@ paludis::cave::owner_common(
}
std::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsSorted(generator::All() |
- filter::InstalledAtRoot(env->root()))]);
+ filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
for (PackageIDSequence::ConstIterator p(ids->begin()), p_end(ids->end()); p != p_end; ++p)
{
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index 52091c0cc..7ce8eb4b9 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -188,7 +188,7 @@ int do_has_version(const std::shared_ptr<Environment> & env)
std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
parse_user_package_dep_spec(query, env.get(), { })));
std::shared_ptr<const PackageIDSequence> entries((*env)[selection::SomeArbitraryVersion(
- generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->root()))]);
+ generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
return_code = 1;
@@ -206,7 +206,7 @@ int do_best_version(const std::shared_ptr<Environment> & env)
std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
parse_user_package_dep_spec(query, env.get(), { })));
std::shared_ptr<const PackageIDSequence> entries((*env)[selection::AllVersionsSorted(
- generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->root()))]);
+ generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
/* make built_with_use work for virtuals... icky... */
while (! entries->empty())
@@ -247,7 +247,7 @@ int do_match(const std::shared_ptr<Environment> & env)
std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
parse_user_package_dep_spec(query, env.get(), { })));
std::shared_ptr<const PackageIDSequence> entries((*env)[selection::AllVersionsSorted(
- generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->root()))]);
+ generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
while (! entries->empty())
{
@@ -292,7 +292,7 @@ int do_environment_variable(const std::shared_ptr<Environment> & env)
parse_user_package_dep_spec(spec_str, env.get(), { })));
std::shared_ptr<const PackageIDSequence> entries((*env)[selection::AllVersionsSorted(
- generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->root()))]);
+ generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
entries = (*env)[selection::AllVersionsSorted(generator::Matches(*spec, { }))];
diff --git a/src/clients/paludis/do_config.cc b/src/clients/paludis/do_config.cc
index 3bc40c09e..c1d14ee90 100644
--- a/src/clients/paludis/do_config.cc
+++ b/src/clients/paludis/do_config.cc
@@ -78,10 +78,10 @@ namespace
std::shared_ptr<PackageDepSpec> spec(
std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(target, env.get(), { },
- filter::InstalledAtRoot(env->root()))));
+ filter::InstalledAtRoot(env->preferred_root_key()->value()))));
std::shared_ptr<const PackageIDSequence> entries(
- (*env)[selection::AllVersionsUnsorted(generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->root()))]);
+ (*env)[selection::AllVersionsUnsorted(generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
throw NoSuchPackageError(target);
diff --git a/src/clients/paludis/do_contents.cc b/src/clients/paludis/do_contents.cc
index d713e2b2d..e15189e08 100644
--- a/src/clients/paludis/do_contents.cc
+++ b/src/clients/paludis/do_contents.cc
@@ -84,10 +84,10 @@ do_one_contents(
std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
parse_user_package_dep_spec(q, env.get(), UserPackageDepSpecOptions() + updso_allow_wildcards,
- filter::InstalledAtRoot(env->root()))));
+ filter::InstalledAtRoot(env->preferred_root_key()->value()))));
std::shared_ptr<const PackageIDSequence> entries(
- (*env)[selection::AllVersionsSorted(generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->root()))]);
+ (*env)[selection::AllVersionsSorted(generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
throw NoSuchPackageError(q);
@@ -143,7 +143,7 @@ do_contents(const std::shared_ptr<Environment> & env)
{
cerr << " Looking for suggestions:" << endl;
- FuzzyCandidatesFinder f(*env, e.name(), filter::InstalledAtRoot(env->root()));
+ FuzzyCandidatesFinder f(*env, e.name(), filter::InstalledAtRoot(env->preferred_root_key()->value()));
if (f.begin() == f.end())
cerr << "No suggestions found." << endl;
diff --git a/src/clients/paludis/do_executables.cc b/src/clients/paludis/do_executables.cc
index 406decb0d..5a242427f 100644
--- a/src/clients/paludis/do_executables.cc
+++ b/src/clients/paludis/do_executables.cc
@@ -136,10 +136,10 @@ do_one_executables(
std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
parse_user_package_dep_spec(q, env.get(), UserPackageDepSpecOptions() + updso_allow_wildcards,
- filter::InstalledAtRoot(env->root()))));
+ filter::InstalledAtRoot(env->preferred_root_key()->value()))));
std::shared_ptr<const PackageIDSequence> entries(
- (*env)[selection::AllVersionsSorted(generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->root()))]);
+ (*env)[selection::AllVersionsSorted(generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
throw NoSuchPackageError(q);
@@ -195,7 +195,7 @@ do_executables(const std::shared_ptr<Environment> & env)
{
cerr << " Looking for suggestions:" << endl;
- FuzzyCandidatesFinder f(*env, e.name(), filter::InstalledAtRoot(env->root()));
+ FuzzyCandidatesFinder f(*env, e.name(), filter::InstalledAtRoot(env->preferred_root_key()->value()));
if (f.begin() == f.end())
cerr << "No suggestions found." << endl;
diff --git a/src/clients/paludis/info.cc b/src/clients/paludis/info.cc
index fbbdc5736..5a6b50226 100644
--- a/src/clients/paludis/info.cc
+++ b/src/clients/paludis/info.cc
@@ -225,7 +225,7 @@ int do_one_info(
std::shared_ptr<const PackageIDSequence>
entries((*env)[selection::AllVersionsSorted(generator::Matches(*spec, { }))]),
installed_entries((*env)[selection::AllVersionsSorted(
- generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->root()))]),
+ generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]),
installable_entries((*env)[selection::AllVersionsSorted(
generator::Matches(*spec, { }) | filter::SupportsAction<InstallAction>() | filter::NotMasked())]);
diff --git a/src/clients/paludis/uninstall.cc b/src/clients/paludis/uninstall.cc
index ae63b9350..45fa16835 100644
--- a/src/clients/paludis/uninstall.cc
+++ b/src/clients/paludis/uninstall.cc
@@ -30,6 +30,7 @@
#include <paludis/generator.hh>
#include <paludis/selection.hh>
#include <paludis/filter.hh>
+#include <paludis/metadata_key.hh>
#include <iostream>
#include <limits>
@@ -306,7 +307,7 @@ namespace
try
{
- FuzzyCandidatesFinder f(*env, e.name(), filter::InstalledAtRoot(env->root()));
+ FuzzyCandidatesFinder f(*env, e.name(), filter::InstalledAtRoot(env->preferred_root_key()->value()));
if (f.begin() == f.end())
cerr << "No suggestions found." << endl;
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index ec5f2274c..b08399b05 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -514,14 +514,14 @@ ConsoleInstallTask::on_display_merge_list_entry(const DepListEntry & d)
generator::Matches(make_package_dep_spec({ })
.package(d.package_id()->name()).in_repository(*repo), { }) :
generator::Matches(make_package_dep_spec({ })
- .package(d.package_id()->name()), { }) | filter::InstalledAtRoot(environment()->root())
+ .package(d.package_id()->name()), { }) | filter::InstalledAtRoot(environment()->preferred_root_key()->value())
)]);;
std::shared_ptr<const PackageIDSequence> existing_slot_repo((*environment())[selection::AllVersionsSorted((repo ?
generator::Matches(make_package_dep_spec({ })
.package(d.package_id()->name()).in_repository(*repo), { }) :
generator::Matches(make_package_dep_spec({ })
- .package(d.package_id()->name()), { }) | filter::InstalledAtRoot(environment()->root()))
+ .package(d.package_id()->name()), { }) | filter::InstalledAtRoot(environment()->preferred_root_key()->value()))
| filter::SameSlot(d.package_id()))]);
display_merge_list_entry_start(d, m);
@@ -973,11 +973,10 @@ ConsoleInstallTask::display_merge_list_entry_for(const PackageID & d, const Disp
void
ConsoleInstallTask::display_merge_list_entry_repository(const DepListEntry & d, const DisplayMode m)
{
- // XXX fix this once the new resolver's in
std::shared_ptr<const PackageIDSequence> inst((*environment())[selection::BestVersionOnly(
generator::Package(d.package_id()->name()) |
filter::SameSlot(d.package_id()) |
- filter::InstalledAtRoot(environment()->root()))]);
+ filter::InstalledAtRoot(environment()->preferred_root_key()->value()))]);
bool changed(normal_entry == m &&
! inst->empty() && (*inst->begin())->from_repositories_key() &&
(*inst->begin())->from_repositories_key()->value()->end() ==
@@ -1446,7 +1445,7 @@ ConsoleInstallTask::display_merge_list_entry_package_tags(const DepListEntry & d
std::static_pointer_cast<const DependencyDepTag>(tag->tag())->dependency());
if (d.kind() != dlk_masked && d.kind() != dlk_block && (*environment())[selection::SomeArbitraryVersion(
generator::Matches(*spec, { }) |
- filter::InstalledAtRoot(environment()->root()))]->empty())
+ filter::InstalledAtRoot(environment()->preferred_root_key()->value()))]->empty())
unsatisfied_dependents.insert(tag->tag()->short_text());
else
dependents.insert(tag->tag()->short_text());
@@ -1948,7 +1947,7 @@ ConsoleInstallTask::show_resume_command(const std::string & resume_command_templ
void
ConsoleInstallTask::on_installed_paludis()
{
- std::string r(stringify(environment()->root()));
+ std::string r(stringify(environment()->preferred_root_key()->value()));
std::string exec_mode(getenv_with_default("PALUDIS_EXEC_PALUDIS", ""));
if ("always" != exec_mode)
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index 27c1999ab..5b89ea974 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -119,7 +119,7 @@ ConsoleQueryTask::show_one(const PackageDepSpec & a, const std::shared_ptr<const
std::shared_ptr<const PackageIDSequence>
entries((*_imp->env)[selection::AllVersionsSorted(generator::Matches(a, { }))]),
preferred_entries((*_imp->env)[selection::AllVersionsSorted(
- generator::Matches(a, { }) | filter::InstalledAtRoot(_imp->env->root()))]);
+ generator::Matches(a, { }) | filter::InstalledAtRoot(_imp->env->preferred_root_key()->value()))]);
if (entries->empty())
throw NoSuchPackageError(stringify(a));
if (preferred_entries->empty())