aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-06 13:21:13 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-07 11:32:56 +0000
commit81ef7b0468950cade215c889d47143db21720695 (patch)
tree9fe89084961f1bbf5c35619f82d802e457443b8a /src
parent20cc98f89f0208619fa8845d784463f03a7c9234 (diff)
downloadpaludis-81ef7b0468950cade215c889d47143db21720695.tar.gz
paludis-81ef7b0468950cade215c889d47143db21720695.tar.xz
Pass ID to match_package
Diffstat (limited to 'src')
-rw-r--r--src/clients/adjutrix/downgrade_check.cc5
-rw-r--r--src/clients/adjutrix/find_insecure_packages.cc5
-rw-r--r--src/clients/adjutrix/find_reverse_deps.cc31
-rw-r--r--src/clients/adjutrix/keywords_graph.cc5
-rw-r--r--src/clients/cave/cmd_config.cc5
-rw-r--r--src/clients/cave/cmd_contents.cc6
-rw-r--r--src/clients/cave/cmd_digest.cc5
-rwxr-xr-xsrc/clients/cave/cmd_display_resolution.cc8
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc12
-rw-r--r--src/clients/cave/cmd_find_candidates.cc7
-rw-r--r--src/clients/cave/cmd_has_version.cc5
-rw-r--r--src/clients/cave/cmd_info.cc6
-rw-r--r--src/clients/cave/cmd_match.cc5
-rw-r--r--src/clients/cave/cmd_perform.cc6
-rw-r--r--src/clients/cave/cmd_print_best_version.cc5
-rw-r--r--src/clients/cave/cmd_print_id_actions.cc5
-rw-r--r--src/clients/cave/cmd_print_id_contents.cc6
-rw-r--r--src/clients/cave/cmd_print_id_environment_variable.cc5
-rw-r--r--src/clients/cave/cmd_print_id_masks.cc4
-rw-r--r--src/clients/cave/cmd_print_id_metadata.cc5
-rw-r--r--src/clients/cave/cmd_print_ids.cc5
-rw-r--r--src/clients/cave/cmd_report.cc4
-rw-r--r--src/clients/cave/cmd_search.cc5
-rw-r--r--src/clients/cave/cmd_show.cc14
-rw-r--r--src/clients/cave/cmd_uninstall.cc4
-rw-r--r--src/clients/cave/cmd_verify.cc6
-rw-r--r--src/clients/cave/executables_common.cc5
-rw-r--r--src/clients/cave/resolve_common.cc4
-rw-r--r--src/clients/cave/select_format_for_spec.cc10
-rw-r--r--src/clients/cave/select_format_for_spec.hh5
-rw-r--r--src/clients/cave/size_common.cc5
-rw-r--r--src/clients/paludis/applets.cc12
-rw-r--r--src/clients/paludis/do_config.cc5
-rw-r--r--src/clients/paludis/do_contents.cc5
-rw-r--r--src/clients/paludis/do_executables.cc3
-rw-r--r--src/clients/paludis/info.cc8
-rw-r--r--src/output/console_install_task.cc16
-rw-r--r--src/output/console_query_task.cc8
38 files changed, 151 insertions, 114 deletions
diff --git a/src/clients/adjutrix/downgrade_check.cc b/src/clients/adjutrix/downgrade_check.cc
index aeb7dbdae..676fac7cc 100644
--- a/src/clients/adjutrix/downgrade_check.cc
+++ b/src/clients/adjutrix/downgrade_check.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
@@ -29,6 +29,7 @@
#include <paludis/util/safe_ofstream.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/fs_stat.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/package_id.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
@@ -119,7 +120,7 @@ namespace
part_spec.package(b->first.first);
if ("(none)" != b->first.second)
part_spec.slot_requirement(std::make_shared<UserSlotExactRequirement>(SlotName(b->first.second)));
- if (! env[selection::SomeArbitraryVersion(generator::Matches(part_spec, { }))]->empty())
+ if (! env[selection::SomeArbitraryVersion(generator::Matches(part_spec, make_null_shared_ptr(), { }))]->empty())
{
results.insert(std::make_pair(b->first, stringify(b->second) + " -> nothing on " + desc));
exit_status |= 2;
diff --git a/src/clients/adjutrix/find_insecure_packages.cc b/src/clients/adjutrix/find_insecure_packages.cc
index 377e2318e..44da9ba56 100644
--- a/src/clients/adjutrix/find_insecure_packages.cc
+++ b/src/clients/adjutrix/find_insecure_packages.cc
@@ -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
@@ -33,6 +33,7 @@
#include <paludis/selection.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <set>
#include <map>
@@ -86,7 +87,7 @@ namespace
void visit(const SetSpecTree::NodeType<PackageDepSpec>::Type & node)
{
std::shared_ptr<const PackageIDSequence> insecure(_env[selection::AllVersionsSorted(
- generator::Matches(*node.spec(), { }))]);
+ generator::Matches(*node.spec(), make_null_shared_ptr(), { }))]);
for (PackageIDSequence::ConstIterator i(insecure->begin()),
i_end(insecure->end()) ; i != i_end ; ++i)
if (node.spec()->tag())
diff --git a/src/clients/adjutrix/find_reverse_deps.cc b/src/clients/adjutrix/find_reverse_deps.cc
index 66c45d1ef..2189a7645 100644
--- a/src/clients/adjutrix/find_reverse_deps.cc
+++ b/src/clients/adjutrix/find_reverse_deps.cc
@@ -28,6 +28,7 @@
#include <paludis/util/options.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/package_id.hh>
@@ -56,6 +57,7 @@ namespace
{
private:
const Environment * const _env;
+ const std::shared_ptr<const PackageID> _from_id;
const PackageIDSequence & _entries;
std::string _depname;
std::string _p;
@@ -69,10 +71,11 @@ namespace
std::set<SetName> _recursing_sets;
public:
- ReverseDepChecker(const Environment * const e,
+ ReverseDepChecker(const Environment * const e, const std::shared_ptr<const PackageID> & f,
const PackageIDSequence & entries,
const std::string & p) :
_env(e),
+ _from_id(f),
_entries(entries),
_depname(""),
_p(p),
@@ -159,10 +162,10 @@ namespace
}
void
- ReverseDepChecker::visit(const DependencySpecTree::NodeType<PackageDepSpec>::Type & node)
+ ReverseDepChecker::visit(const DependencySpecTree::NodeType<PackageDepSpec>::Type & node)
{
std::shared_ptr<const PackageIDSequence> dep_entries((*_env)[selection::AllVersionsSorted(
- generator::Matches(*node.spec(), { mpo_ignore_additional_requirements }))]);
+ generator::Matches(*node.spec(), _from_id, { mpo_ignore_additional_requirements }))]);
std::shared_ptr<PackageIDSequence> matches(std::make_shared<PackageIDSequence>());
bool header_written = false;
@@ -216,24 +219,24 @@ namespace
bool found_matches(false);
- for (IndirectIterator<PackageIDSequence::ConstIterator> e(p_entries->begin()), e_end(p_entries->end()) ;
+ for (auto e(p_entries->begin()), e_end(p_entries->end()) ;
e != e_end ; ++e)
{
try
{
- ReverseDepChecker checker(&env, entries, stringify(p) + "-" + stringify(e->canonical_form(idcf_version)));
+ ReverseDepChecker checker(&env, *e, entries, stringify(p) + "-" + stringify((*e)->canonical_form(idcf_version)));
- if (e->build_dependencies_key())
- checker.check(e->build_dependencies_key()->value(), e->build_dependencies_key()->raw_name());
+ if ((*e)->build_dependencies_key())
+ checker.check((*e)->build_dependencies_key()->value(), (*e)->build_dependencies_key()->raw_name());
- if (e->run_dependencies_key())
- checker.check(e->run_dependencies_key()->value(), e->run_dependencies_key()->raw_name());
+ if ((*e)->run_dependencies_key())
+ checker.check((*e)->run_dependencies_key()->value(), (*e)->run_dependencies_key()->raw_name());
- if (e->post_dependencies_key())
- checker.check(e->post_dependencies_key()->value(), e->post_dependencies_key()->raw_name());
+ if ((*e)->post_dependencies_key())
+ checker.check((*e)->post_dependencies_key()->value(), (*e)->post_dependencies_key()->raw_name());
- if (e->suggested_dependencies_key())
- checker.check(e->suggested_dependencies_key()->value(), e->suggested_dependencies_key()->raw_name());
+ if ((*e)->suggested_dependencies_key())
+ checker.check((*e)->suggested_dependencies_key()->value(), (*e)->suggested_dependencies_key()->raw_name());
found_matches |= checker.found_matches();
}
@@ -304,7 +307,7 @@ int do_find_reverse_deps(NoConfigEnvironment & env)
}
std::shared_ptr<const PackageIDSequence> entries(env[selection::AllVersionsSorted(generator::Matches(
- *spec, { }))]);
+ *spec, make_null_shared_ptr(), { }))]);
int ret(0);
if (entries->empty())
diff --git a/src/clients/adjutrix/keywords_graph.cc b/src/clients/adjutrix/keywords_graph.cc
index 581b12787..2d0679f72 100644
--- a/src/clients/adjutrix/keywords_graph.cc
+++ b/src/clients/adjutrix/keywords_graph.cc
@@ -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
@@ -27,6 +27,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/repository.hh>
#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
@@ -86,7 +87,7 @@ namespace
FindUnusedPackagesTask task(&e, &repo);
std::shared_ptr<const PackageIDSequence> packages(e[selection::AllVersionsGroupedBySlot(
generator::InRepository(repo.name()) &
- generator::Matches(make_package_dep_spec({ }).package(package), { }))]);
+ generator::Matches(make_package_dep_spec({ }).package(package), make_null_shared_ptr(), { }))]);
std::shared_ptr<const PackageIDSequence> unused(task.execute(package));
if (packages->empty())
diff --git a/src/clients/cave/cmd_config.cc b/src/clients/cave/cmd_config.cc
index 6ee0d2f0b..7f19c590a 100644
--- a/src/clients/cave/cmd_config.cc
+++ b/src/clients/cave/cmd_config.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,6 +23,7 @@
#include <paludis/args/do_help.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#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>
@@ -95,7 +96,7 @@ ConfigCommand::run(
PackageDepSpec spec(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(), { }));
const std::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsUnsorted(
- generator::Matches(spec, { }) | filter::SupportsAction<ConfigAction>())]);
+ generator::Matches(spec, make_null_shared_ptr(), { }) | filter::SupportsAction<ConfigAction>())]);
if (ids->empty())
nothing_matching_error(env.get(), *cmdline.begin_parameters(), filter::SupportsAction<ConfigAction>());
else if (1 != std::distance(ids->begin(), ids->end()))
diff --git a/src/clients/cave/cmd_contents.cc b/src/clients/cave/cmd_contents.cc
index 3758143d7..7eb9ec89d 100644
--- a/src/clients/cave/cmd_contents.cc
+++ b/src/clients/cave/cmd_contents.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 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
@@ -31,6 +31,7 @@
#include <paludis/util/options.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/filter.hh>
#include <paludis/generator.hh>
#include <paludis/filtered_generator.hh>
@@ -129,7 +130,8 @@ ContentsCommand::run(
{ }, filter::InstalledAtRoot(env->preferred_root_key()->value())));
std::shared_ptr<const PackageIDSequence> entries(
- (*env)[selection::AllVersionsSorted(generator::Matches(spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
+ (*env)[selection::AllVersionsSorted(generator::Matches(spec, make_null_shared_ptr(), { })
+ | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
nothing_matching_error(env.get(), *cmdline.begin_parameters(), filter::InstalledAtRoot(env->preferred_root_key()->value()));
diff --git a/src/clients/cave/cmd_digest.cc b/src/clients/cave/cmd_digest.cc
index beb26c1b3..c47a153b4 100644
--- a/src/clients/cave/cmd_digest.cc
+++ b/src/clients/cave/cmd_digest.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
@@ -31,6 +31,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/return_literal_function.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/name.hh>
#include <paludis/environment.hh>
@@ -111,7 +112,7 @@ DigestCommand::run(
throw args::DoHelp("digest takes exactly two parameters");
RepositoryName repo(*next(cmdline.begin_parameters()));
- Filter repo_filter(filter::Matches(make_package_dep_spec({ }).in_repository(repo), { }));
+ 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) :
QualifiedPackageName(*cmdline.begin_parameters()));
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 6273c3596..b5aebc52b 100755
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.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
@@ -317,7 +317,7 @@ namespace
{
const std::shared_ptr<const PackageID> maybe_id(id_for_decision_or_null(decision));
if (maybe_id)
- return match_package(*env, spec, maybe_id, { });
+ return match_package(*env, spec, maybe_id, make_null_shared_ptr(), { });
else
{
/* could also match slot here too */
@@ -1417,8 +1417,8 @@ namespace
cout << fuc(fs_unable_unsuitable_did_not_meet(), fv<'s'>(s));
if ((*c)->spec().if_package() && (*c)->spec().if_package()->additional_requirements_ptr() &&
- (! match_package(*env, *(*c)->spec().if_package(), u->package_id(), { })) &&
- match_package(*env, *(*c)->spec().if_package(), u->package_id(), { mpo_ignore_additional_requirements }))
+ (! match_package(*env, *(*c)->spec().if_package(), u->package_id(), (*c)->from_id(), { })) &&
+ match_package(*env, *(*c)->spec().if_package(), u->package_id(), (*c)->from_id(), { mpo_ignore_additional_requirements }))
{
for (AdditionalPackageDepSpecRequirements::ConstIterator a((*c)->spec().if_package()->additional_requirements_ptr()->begin()),
a_end((*c)->spec().if_package()->additional_requirements_ptr()->end()) ;
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index 3f3b682c6..d5d499686 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.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
@@ -148,7 +148,7 @@ namespace
const PackageDepSpec & spec)
{
const std::shared_ptr<const PackageIDSequence> ids((*env)[selection::BestVersionOnly(
- generator::Matches(spec, { }))]);
+ generator::Matches(spec, make_null_shared_ptr(), { }))]);
if (ids->empty())
return stringify(spec);
else
@@ -307,7 +307,7 @@ namespace
else
r.append(", ");
- const auto replacing_ids((*env)[selection::BestVersionOnly(generator::Matches(*i, { }))]);
+ const auto replacing_ids((*env)[selection::BestVersionOnly(generator::Matches(*i, make_null_shared_ptr(), { }))]);
if (replacing_ids->empty())
r.append(stringify(*i));
else if (id_specs->empty() || *id_specs->begin()->package_ptr() != (*replacing_ids->begin())->name())
@@ -332,7 +332,7 @@ namespace
if (! r.empty())
r.append(", ");
- const auto ids((*env)[selection::BestVersionOnly(generator::Matches(*i, { }))]);
+ const auto ids((*env)[selection::BestVersionOnly(generator::Matches(*i, make_null_shared_ptr(), { }))]);
if (ids->empty())
r.append(stringify(*i));
else
@@ -1591,7 +1591,7 @@ namespace
std::string r;
if (! j.replacing_specs()->empty())
{
- const auto origin_ids((*env)[selection::BestVersionOnly(generator::Matches(j.origin_id_spec(), { }))]);
+ const auto origin_ids((*env)[selection::BestVersionOnly(generator::Matches(j.origin_id_spec(), make_null_shared_ptr(), { }))]);
for (auto i(j.replacing_specs()->begin()), i_end(j.replacing_specs()->end()) ;
i != i_end ; ++i)
@@ -1601,7 +1601,7 @@ namespace
else
r.append(", ");
- const auto ids((*env)[selection::BestVersionOnly(generator::Matches(*i, { }))]);
+ const auto ids((*env)[selection::BestVersionOnly(generator::Matches(*i, make_null_shared_ptr(), { }))]);
if (ids->empty())
r.append(stringify(*i));
else if (origin_ids->empty() || (*origin_ids->begin())->name() != (*ids->begin())->name())
diff --git a/src/clients/cave/cmd_find_candidates.cc b/src/clients/cave/cmd_find_candidates.cc
index 215b40aa8..e0346a110 100644
--- a/src/clients/cave/cmd_find_candidates.cc
+++ b/src/clients/cave/cmd_find_candidates.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
@@ -43,6 +43,7 @@
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <cstdlib>
#include <iostream>
@@ -193,7 +194,7 @@ FindCandidatesCommand::run_hosted(
for (auto m(matches.begin()), m_end(matches.end()) ;
m != m_end ; ++m)
if (match_package(*env, *m, *(*env)[selection::RequireExactlyOne(generator::Matches(
- parse_user_package_dep_spec(*s, env.get(), { }), { }))]->begin(), { }))
+ parse_user_package_dep_spec(*s, env.get(), { }), make_null_shared_ptr(), { }))]->begin(), make_null_shared_ptr(), { }))
{
ok = true;
break;
@@ -298,7 +299,7 @@ FindCandidatesCommand::run_hosted(
k_end(search_options.a_matching.end_args()) ;
k != k_end ; ++k)
{
- generator::Matches m(parse_user_package_dep_spec(*k, env.get(), { updso_allow_wildcards }), { });
+ generator::Matches m(parse_user_package_dep_spec(*k, env.get(), { updso_allow_wildcards }), make_null_shared_ptr(), { });
if (match_generator)
match_generator = std::make_shared<generator::Union>(*match_generator, m);
diff --git a/src/clients/cave/cmd_has_version.cc b/src/clients/cave/cmd_has_version.cc
index 3015fcbaa..b96bed002 100644
--- a/src/clients/cave/cmd_has_version.cc
+++ b/src/clients/cave/cmd_has_version.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
@@ -29,6 +29,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/generator.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/filter.hh>
@@ -96,7 +97,7 @@ HasVersionCommand::run(
throw args::DoHelp("has-version takes exactly one parameter");
auto s(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(), { }));
- auto ids((*env)[selection::BestVersionOnly(generator::Matches(s, { }) | filter::InstalledAtRoot(
+ auto ids((*env)[selection::BestVersionOnly(generator::Matches(s, make_null_shared_ptr(), { }) | filter::InstalledAtRoot(
env->preferred_root_key()->value()))]);
if (ids->empty())
diff --git a/src/clients/cave/cmd_info.cc b/src/clients/cave/cmd_info.cc
index 3f621dc1f..24056a1d2 100644
--- a/src/clients/cave/cmd_info.cc
+++ b/src/clients/cave/cmd_info.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
@@ -376,9 +376,9 @@ 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->preferred_root_key()->value()))]);
+ spec, make_null_shared_ptr(), { }) | 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())]);
+ spec, make_null_shared_ptr(), { }) | filter::SupportsAction<InstallAction>() | filter::NotMasked())]);
if (installed_ids->empty() && installable_ids->empty())
nothing_matching_error(env.get(), param, filter::InstalledAtRoot(env->preferred_root_key()->value()));
diff --git a/src/clients/cave/cmd_match.cc b/src/clients/cave/cmd_match.cc
index 058c25150..dfe5b01d7 100644
--- a/src/clients/cave/cmd_match.cc
+++ b/src/clients/cave/cmd_match.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
@@ -32,6 +32,7 @@
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/singleton-impl.hh>
#include <paludis/util/accept_visitor.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/generator.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/filter.hh>
@@ -409,7 +410,7 @@ MatchCommand::run_hosted(
const PackageDepSpec & spec)
{
const std::shared_ptr<const PackageID> id(*((*env)[selection::RequireExactlyOne(
- generator::Matches(spec, { }))])->begin());
+ generator::Matches(spec, make_null_shared_ptr(), { }))])->begin());
std::list<std::string> texts;
diff --git a/src/clients/cave/cmd_perform.cc b/src/clients/cave/cmd_perform.cc
index f8228d93d..2dcdf172c 100644
--- a/src/clients/cave/cmd_perform.cc
+++ b/src/clients/cave/cmd_perform.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
@@ -409,7 +409,7 @@ PerformCommand::run(
const auto spec_str(*next(cmdline.begin_parameters()));
const auto spec(parse_user_package_dep_spec(spec_str, env.get(), { }));
- const auto ids((*env)[selection::AllVersionsUnsorted(generator::Matches(spec, { }))]);
+ const auto ids((*env)[selection::AllVersionsUnsorted(generator::Matches(spec, make_null_shared_ptr(), { }))]);
if (ids->empty())
nothing_matching_error(env.get(), spec_str, filter::All());
else if (1 != std::distance(ids->begin(), ids->end()))
@@ -429,7 +429,7 @@ PerformCommand::run(
p != p_end ; ++p)
{
PackageDepSpec rspec(parse_user_package_dep_spec(*p, env.get(), { }));
- const std::shared_ptr<const PackageIDSequence> rids((*env)[selection::AllVersionsUnsorted(generator::Matches(rspec, { }))]);
+ const std::shared_ptr<const PackageIDSequence> rids((*env)[selection::AllVersionsUnsorted(generator::Matches(rspec, make_null_shared_ptr(), { }))]);
if (rids->empty())
nothing_matching_error(env.get(), *p, filter::All());
else if (1 != std::distance(rids->begin(), rids->end()))
diff --git a/src/clients/cave/cmd_print_best_version.cc b/src/clients/cave/cmd_print_best_version.cc
index 5059ebf19..e39489c30 100644
--- a/src/clients/cave/cmd_print_best_version.cc
+++ b/src/clients/cave/cmd_print_best_version.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
@@ -29,6 +29,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/generator.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/filter.hh>
@@ -108,7 +109,7 @@ PrintBestVersionCommand::run(
throw args::DoHelp("print-best-version takes exactly one parameter");
auto s(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(), { }));
- auto ids((*env)[selection::BestVersionOnly(generator::Matches(s, { }) | filter::InstalledAtRoot(
+ auto ids((*env)[selection::BestVersionOnly(generator::Matches(s, make_null_shared_ptr(), { }) | filter::InstalledAtRoot(
env->preferred_root_key()->value()))]);
if (ids->empty())
diff --git a/src/clients/cave/cmd_print_id_actions.cc b/src/clients/cave/cmd_print_id_actions.cc
index 8e696e771..473dfee13 100644
--- a/src/clients/cave/cmd_print_id_actions.cc
+++ b/src/clients/cave/cmd_print_id_actions.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
@@ -24,6 +24,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/environment.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/filtered_generator.hh>
@@ -107,7 +108,7 @@ PrintIDActionsCommand::run(
PackageDepSpec spec(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(), { updso_allow_wildcards }));
std::shared_ptr<const PackageIDSequence> entries(
- (*env)[selection::AllVersionsSorted(generator::Matches(spec, { }))]);
+ (*env)[selection::AllVersionsSorted(generator::Matches(spec, make_null_shared_ptr(), { }))]);
if (entries->empty())
throw NothingMatching(spec);
diff --git a/src/clients/cave/cmd_print_id_contents.cc b/src/clients/cave/cmd_print_id_contents.cc
index 416179245..f60db7c4f 100644
--- a/src/clients/cave/cmd_print_id_contents.cc
+++ b/src/clients/cave/cmd_print_id_contents.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 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
@@ -29,6 +29,7 @@
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/options.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/filter.hh>
#include <paludis/generator.hh>
#include <paludis/filtered_generator.hh>
@@ -160,7 +161,8 @@ PrintIDContentsCommand::run(
{ 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->preferred_root_key()->value()))]);
+ (*env)[selection::AllVersionsSorted(generator::Matches(spec, make_null_shared_ptr(), { }) |
+ filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
throw NothingMatching(spec);
diff --git a/src/clients/cave/cmd_print_id_environment_variable.cc b/src/clients/cave/cmd_print_id_environment_variable.cc
index b7c96e94a..9e7b372f6 100644
--- a/src/clients/cave/cmd_print_id_environment_variable.cc
+++ b/src/clients/cave/cmd_print_id_environment_variable.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010, 2011 Ciaran McCreesh
* Copyright (c) 2010 David Leverton
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -24,6 +24,7 @@
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
#include <paludis/util/map.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/environment.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/filtered_generator.hh>
@@ -134,7 +135,7 @@ PrintIDEnvironmentVariableCommand::run(
PackageDepSpec spec(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(), { updso_allow_wildcards }));
std::shared_ptr<const PackageIDSequence> entries(
- (*env)[selection::AllVersionsSorted(generator::Matches(spec, { }))]);
+ (*env)[selection::AllVersionsSorted(generator::Matches(spec, make_null_shared_ptr(), { }))]);
if (entries->empty())
throw NothingMatching(spec);
diff --git a/src/clients/cave/cmd_print_id_masks.cc b/src/clients/cave/cmd_print_id_masks.cc
index 3f509417d..1937eb6aa 100644
--- a/src/clients/cave/cmd_print_id_masks.cc
+++ b/src/clients/cave/cmd_print_id_masks.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
@@ -186,7 +186,7 @@ PrintIDMasksCommand::run(
PackageDepSpec spec(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(), { updso_allow_wildcards }));
std::shared_ptr<const PackageIDSequence> entries(
- (*env)[selection::AllVersionsSorted(generator::Matches(spec, { }))]);
+ (*env)[selection::AllVersionsSorted(generator::Matches(spec, make_null_shared_ptr(), { }))]);
if (entries->empty())
throw NothingMatching(spec);
diff --git a/src/clients/cave/cmd_print_id_metadata.cc b/src/clients/cave/cmd_print_id_metadata.cc
index 2ce293dc0..960742561 100644
--- a/src/clients/cave/cmd_print_id_metadata.cc
+++ b/src/clients/cave/cmd_print_id_metadata.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 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
@@ -26,6 +26,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/environment.hh>
#include <paludis/metadata_key.hh>
#include <paludis/user_dep_spec.hh>
@@ -151,7 +152,7 @@ PrintIDMetadataCommand::run(
PackageDepSpec spec(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(), { updso_allow_wildcards }));
std::shared_ptr<const PackageIDSequence> entries(
- (*env)[selection::AllVersionsSorted(generator::Matches(spec, { }))]);
+ (*env)[selection::AllVersionsSorted(generator::Matches(spec, make_null_shared_ptr(), { }))]);
if (entries->empty())
throw NothingMatching(spec);
diff --git a/src/clients/cave/cmd_print_ids.cc b/src/clients/cave/cmd_print_ids.cc
index aa1427ba9..daa5d08ee 100644
--- a/src/clients/cave/cmd_print_ids.cc
+++ b/src/clients/cave/cmd_print_ids.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 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
@@ -30,6 +30,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/generator.hh>
#include <paludis/filtered_generator.hh>
#include <paludis/filter.hh>
@@ -289,7 +290,7 @@ PrintIDsCommand::run(
m != m_end ; ++m)
{
PackageDepSpec s(parse_user_package_dep_spec(*m, env.get(), { updso_allow_wildcards }));
- g = g & generator::Matches(s, { });
+ g = g & generator::Matches(s, make_null_shared_ptr(), { });
}
}
diff --git a/src/clients/cave/cmd_report.cc b/src/clients/cave/cmd_report.cc
index db8b224c0..8bbc34881 100644
--- a/src/clients/cave/cmd_report.cc
+++ b/src/clients/cave/cmd_report.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
@@ -110,7 +110,7 @@ namespace
.version_requirement(make_named_values<VersionRequirement>(
n::version_operator() = vo_equal,
n::version_spec() = id->version())),
- { })) |
+ make_null_shared_ptr(), { })) |
filter::SupportsAction<InstallAction>())]);
if (! ids->empty())
diff --git a/src/clients/cave/cmd_search.cc b/src/clients/cave/cmd_search.cc
index 8c5d1b16d..de06f763e 100644
--- a/src/clients/cave/cmd_search.cc
+++ b/src/clients/cave/cmd_search.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
@@ -48,6 +48,7 @@
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <cstdlib>
#include <iostream>
@@ -113,7 +114,7 @@ namespace
const PackageDepSpec & spec)
{
const std::shared_ptr<const PackageID> id(*((*env)[selection::RequireExactlyOne(
- generator::Matches(spec, { }))])->begin());
+ generator::Matches(spec, make_null_shared_ptr(), { }))])->begin());
result->insert(id->name());
}
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index 7f776c7e9..fe838e91b 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 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
@@ -176,7 +176,7 @@ namespace
void visit(const SetSpecTree::NodeType<PackageDepSpec>::Type & node)
{
- out << fuc(select_format_for_spec(env, *node.spec(),
+ out << fuc(select_format_for_spec(env, *node.spec(), make_null_shared_ptr(),
fs_set_spec_installed(),
fs_set_spec_installable(),
fs_set_spec_unavailable()),
@@ -226,7 +226,7 @@ namespace
{
cout << fuc(fs_wildcard_heading(), fv<'s'>(stringify(s)));
- const std::shared_ptr<const PackageIDSequence> names((*env)[selection::BestVersionOnly(generator::Matches(s, { }))]);
+ const std::shared_ptr<const PackageIDSequence> names((*env)[selection::BestVersionOnly(generator::Matches(s, make_null_shared_ptr(), { }))]);
if (names->empty())
throw NothingMatching(s);
@@ -234,7 +234,7 @@ namespace
i != i_end ; ++i)
{
PackageDepSpec name_spec(make_package_dep_spec({ }).package((*i)->name()));
- cout << fuc(select_format_for_spec(env, name_spec,
+ cout << fuc(select_format_for_spec(env, name_spec, make_null_shared_ptr(),
fs_wildcard_spec_installed(),
fs_wildcard_spec_installable(),
fs_wildcard_spec_unavailable()
@@ -1259,7 +1259,7 @@ namespace
{
cout << fuc(fs_package_heading(), fv<'s'>(stringify(s)));
- auto ids((*env)[selection::AllVersionsGroupedBySlot(generator::Matches(s, { }))]);
+ auto ids((*env)[selection::AllVersionsGroupedBySlot(generator::Matches(s, make_null_shared_ptr(), { }))]);
if (ids->empty())
throw NothingMatching(s);
@@ -1274,7 +1274,7 @@ namespace
for (auto r(repos.begin()), r_end(repos.end()) ; r != r_end ; ++r)
{
auto r_ids((*env)[selection::AllVersionsGroupedBySlot(generator::Matches(
- PartiallyMadePackageDepSpec(s).in_repository(*r), { }))]);
+ PartiallyMadePackageDepSpec(s).in_repository(*r), make_null_shared_ptr(), { }))]);
if (! r_ids->empty())
do_one_package_with_ids(cmdline, env, s, r_ids, cout, rest_out);
}
@@ -1294,7 +1294,7 @@ namespace
const PackageDepSpec & s)
{
const std::shared_ptr<const PackageIDSequence> ids((*env)[selection::BestVersionOnly(generator::Matches(s,
- { }))]);
+ make_null_shared_ptr(), { }))]);
if (ids->empty())
throw NothingMatching(s);
diff --git a/src/clients/cave/cmd_uninstall.cc b/src/clients/cave/cmd_uninstall.cc
index d7829fc93..5f5798e7e 100644
--- a/src/clients/cave/cmd_uninstall.cc
+++ b/src/clients/cave/cmd_uninstall.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
@@ -142,7 +142,7 @@ UninstallCommand::run(
{
PackageDepSpec spec(parse_user_package_dep_spec(*p, env.get(), { updso_allow_wildcards }));
const std::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsSorted(
- generator::Matches(spec, { }) | filter::SupportsAction<UninstallAction>())]);
+ generator::Matches(spec, make_null_shared_ptr(), { }) | filter::SupportsAction<UninstallAction>())]);
if (ids->empty())
nothing_matching_error(env.get(), *p, filter::SupportsAction<UninstallAction>());
else if ((! cmdline.a_all_versions.specified()) && has_multiple_versions(ids))
diff --git a/src/clients/cave/cmd_verify.cc b/src/clients/cave/cmd_verify.cc
index 8139be2c8..624ee8ef1 100644
--- a/src/clients/cave/cmd_verify.cc
+++ b/src/clients/cave/cmd_verify.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
@@ -32,6 +32,7 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/md5.hh>
#include <paludis/util/fs_stat.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
#include <paludis/repository.hh>
@@ -213,7 +214,8 @@ VerifyCommand::run(
{ 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->preferred_root_key()->value()))]);
+ (*env)[selection::AllVersionsSorted(generator::Matches(spec, make_null_shared_ptr(), { }) |
+ filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
nothing_matching_error(env.get(), *cmdline.begin_parameters(), filter::InstalledAtRoot(env->preferred_root_key()->value()));
diff --git a/src/clients/cave/executables_common.cc b/src/clients/cave/executables_common.cc
index a255a29ea..73dd0418a 100644
--- a/src/clients/cave/executables_common.cc
+++ b/src/clients/cave/executables_common.cc
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2009 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
@@ -37,6 +37,7 @@
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/accept_visitor.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <algorithm>
#include <set>
@@ -115,7 +116,7 @@ paludis::cave::executables_common(
filter::InstalledAtRoot(env->preferred_root_key()->value())));
std::shared_ptr<const PackageIDSequence> entries(
- (*env)[selection::AllVersionsSorted(generator::Matches(spec, { }) |
+ (*env)[selection::AllVersionsSorted(generator::Matches(spec, make_null_shared_ptr(), { }) |
filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index e554495be..210ab4382 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.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
@@ -791,7 +791,7 @@ paludis::cave::resolve_common(
for (args::StringSetArg::ConstIterator i(resolution_options.a_preset.begin_args()),
i_end(resolution_options.a_preset.end_args()) ;
i != i_end ; ++i)
- get_initial_constraints_for_helper.add_preset_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ get_initial_constraints_for_helper.add_preset_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }), make_null_shared_ptr());
get_initial_constraints_for_helper.set_reinstall_scm_days(reinstall_scm_days(resolution_options));
diff --git a/src/clients/cave/select_format_for_spec.cc b/src/clients/cave/select_format_for_spec.cc
index 94be4a937..5a59b6d73 100644
--- a/src/clients/cave/select_format_for_spec.cc
+++ b/src/clients/cave/select_format_for_spec.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 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,14 +35,15 @@ T_
paludis::cave::select_format_for_spec(
const std::shared_ptr<const Environment> & env,
const PackageDepSpec & spec,
+ const std::shared_ptr<const PackageID> & from_id,
const T_ & if_installed,
const T_ & if_installable,
const T_ & if_unavailable
)
{
- if (! (*env)[selection::SomeArbitraryVersion(generator::Matches(spec, { }) | filter::InstalledAtRoot(env->system_root_key()->value()))]->empty())
+ if (! (*env)[selection::SomeArbitraryVersion(generator::Matches(spec, from_id, { }) | filter::InstalledAtRoot(env->system_root_key()->value()))]->empty())
return if_installed;
- if (! (*env)[selection::SomeArbitraryVersion(generator::Matches(spec, { }) | filter::SupportsAction<InstallAction>()
+ if (! (*env)[selection::SomeArbitraryVersion(generator::Matches(spec, from_id, { }) | filter::SupportsAction<InstallAction>()
| filter::NotMasked())]->empty())
return if_installable;
return if_unavailable;
@@ -51,6 +52,7 @@ paludis::cave::select_format_for_spec(
template std::string paludis::cave::select_format_for_spec(
const std::shared_ptr<const Environment> & env,
const PackageDepSpec & spec,
+ const std::shared_ptr<const PackageID> & from_id,
const std::string & if_installed,
const std::string & if_installable,
const std::string & if_unavailable
@@ -59,6 +61,7 @@ template std::string paludis::cave::select_format_for_spec(
template FormatString<'i', 's'> paludis::cave::select_format_for_spec(
const std::shared_ptr<const Environment> & env,
const PackageDepSpec & spec,
+ const std::shared_ptr<const PackageID> & from_id,
const FormatString<'i', 's'> & if_installed,
const FormatString<'i', 's'> & if_installable,
const FormatString<'i', 's'> & if_unavailable
@@ -67,6 +70,7 @@ template FormatString<'i', 's'> paludis::cave::select_format_for_spec(
template FormatString<'s'> paludis::cave::select_format_for_spec(
const std::shared_ptr<const Environment> & env,
const PackageDepSpec & spec,
+ const std::shared_ptr<const PackageID> & from_id,
const FormatString<'s'> & if_installed,
const FormatString<'s'> & if_installable,
const FormatString<'s'> & if_unavailable
diff --git a/src/clients/cave/select_format_for_spec.hh b/src/clients/cave/select_format_for_spec.hh
index a946e772d..a967607d5 100644
--- a/src/clients/cave/select_format_for_spec.hh
+++ b/src/clients/cave/select_format_for_spec.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 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,9 @@
#include <paludis/util/attributes.hh>
#include <paludis/environment-fwd.hh>
#include <paludis/dep_spec-fwd.hh>
+#include <paludis/package_id-fwd.hh>
#include <string>
+#include <memory>
namespace paludis
{
@@ -33,6 +35,7 @@ namespace paludis
T_ select_format_for_spec(
const std::shared_ptr<const Environment> &,
const PackageDepSpec &,
+ const std::shared_ptr<const PackageID> & from_id,
const T_ & if_installed,
const T_ & if_installable,
const T_ & if_unavailable
diff --git a/src/clients/cave/size_common.cc b/src/clients/cave/size_common.cc
index 9559e01d8..8bcace5b8 100644
--- a/src/clients/cave/size_common.cc
+++ b/src/clients/cave/size_common.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
@@ -39,6 +39,7 @@
#include <paludis/util/fs_path.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <algorithm>
#include <functional>
#include <iostream>
@@ -93,7 +94,7 @@ paludis::cave::size_common(
const bool best)
{
PackageDepSpec spec(parse_user_package_dep_spec(q, env.get(), { }));
- std::shared_ptr<const PackageIDSequence> entries((*env)[selection::AllVersionsSorted(generator::Matches(spec, { }) |
+ std::shared_ptr<const PackageIDSequence> entries((*env)[selection::AllVersionsSorted(generator::Matches(spec, make_null_shared_ptr(), { }) |
filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index 04982ab42..92a191278 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -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
@@ -187,7 +187,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->preferred_root_key()->value()))]);
+ generator::Matches(*spec, make_null_shared_ptr(), { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
return_code = 1;
@@ -205,7 +205,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->preferred_root_key()->value()))]);
+ generator::Matches(*spec, make_null_shared_ptr(), { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
/* make built_with_use work for virtuals... icky... */
while (! entries->empty())
@@ -246,7 +246,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->preferred_root_key()->value()))]);
+ generator::Matches(*spec, make_null_shared_ptr(), { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
while (! entries->empty())
{
@@ -291,10 +291,10 @@ 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->preferred_root_key()->value()))]);
+ generator::Matches(*spec, make_null_shared_ptr(), { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
- entries = (*env)[selection::AllVersionsSorted(generator::Matches(*spec, { }))];
+ entries = (*env)[selection::AllVersionsSorted(generator::Matches(*spec, make_null_shared_ptr(), { }))];
if (entries->empty())
throw NoSuchPackageError(spec_str);
diff --git a/src/clients/paludis/do_config.cc b/src/clients/paludis/do_config.cc
index c1d14ee90..d78a31c66 100644
--- a/src/clients/paludis/do_config.cc
+++ b/src/clients/paludis/do_config.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
@@ -81,7 +81,8 @@ namespace
filter::InstalledAtRoot(env->preferred_root_key()->value()))));
std::shared_ptr<const PackageIDSequence> entries(
- (*env)[selection::AllVersionsUnsorted(generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
+ (*env)[selection::AllVersionsUnsorted(generator::Matches(*spec, make_null_shared_ptr(), { })
+ | 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 e15189e08..3e7c726f2 100644
--- a/src/clients/paludis/do_contents.cc
+++ b/src/clients/paludis/do_contents.cc
@@ -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
@@ -87,7 +87,8 @@ do_one_contents(
filter::InstalledAtRoot(env->preferred_root_key()->value()))));
std::shared_ptr<const PackageIDSequence> entries(
- (*env)[selection::AllVersionsSorted(generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
+ (*env)[selection::AllVersionsSorted(generator::Matches(*spec, make_null_shared_ptr(), { })
+ | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
throw NoSuchPackageError(q);
diff --git a/src/clients/paludis/do_executables.cc b/src/clients/paludis/do_executables.cc
index 2b94dd8a9..143f1d481 100644
--- a/src/clients/paludis/do_executables.cc
+++ b/src/clients/paludis/do_executables.cc
@@ -139,7 +139,8 @@ do_one_executables(
filter::InstalledAtRoot(env->preferred_root_key()->value()))));
std::shared_ptr<const PackageIDSequence> entries(
- (*env)[selection::AllVersionsSorted(generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
+ (*env)[selection::AllVersionsSorted(generator::Matches(*spec, make_null_shared_ptr(), { })
+ | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
if (entries->empty())
throw NoSuchPackageError(q);
diff --git a/src/clients/paludis/info.cc b/src/clients/paludis/info.cc
index 94d37b98a..fd8e02566 100644
--- a/src/clients/paludis/info.cc
+++ b/src/clients/paludis/info.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
@@ -239,11 +239,11 @@ int do_one_info(
std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(q, env.get(), { })));
std::shared_ptr<const PackageIDSequence>
- entries((*env)[selection::AllVersionsSorted(generator::Matches(*spec, { }))]),
+ entries((*env)[selection::AllVersionsSorted(generator::Matches(*spec, make_null_shared_ptr(), { }))]),
installed_entries((*env)[selection::AllVersionsSorted(
- generator::Matches(*spec, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]),
+ generator::Matches(*spec, make_null_shared_ptr(), { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]),
installable_entries((*env)[selection::AllVersionsSorted(
- generator::Matches(*spec, { }) | filter::SupportsAction<InstallAction>() | filter::NotMasked())]);
+ generator::Matches(*spec, make_null_shared_ptr(), { }) | filter::SupportsAction<InstallAction>() | filter::NotMasked())]);
std::shared_ptr<PackageIDSequence> to_show_entries(std::make_shared<PackageIDSequence>());
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index fdcbea2bf..f6d922aa8 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -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
@@ -512,16 +512,16 @@ ConsoleInstallTask::on_display_merge_list_entry(const DepListEntry & d)
std::shared_ptr<const PackageIDSequence> existing_repo((*environment())[selection::AllVersionsSorted(repo ?
generator::Matches(make_package_dep_spec({ })
- .package(d.package_id()->name()).in_repository(*repo), { }) :
+ .package(d.package_id()->name()).in_repository(*repo), d.package_id(), { }) :
generator::Matches(make_package_dep_spec({ })
- .package(d.package_id()->name()), { }) | filter::InstalledAtRoot(environment()->preferred_root_key()->value())
+ .package(d.package_id()->name()), d.package_id(), { }) | 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), { }) :
+ .package(d.package_id()->name()).in_repository(*repo), d.package_id(), { }) :
generator::Matches(make_package_dep_spec({ })
- .package(d.package_id()->name()), { }) | filter::InstalledAtRoot(environment()->preferred_root_key()->value()))
+ .package(d.package_id()->name()), d.package_id(), { }) | filter::InstalledAtRoot(environment()->preferred_root_key()->value()))
| filter::SameSlot(d.package_id()))]);
display_merge_list_entry_start(d, m);
@@ -1430,8 +1430,10 @@ ConsoleInstallTask::display_merge_list_entry_package_tags(const DepListEntry & d
std::shared_ptr<const PackageDepSpec> spec(
std::static_pointer_cast<const DependencyDepTag>(tag->tag())->dependency());
+ std::shared_ptr<const PackageID> id(
+ std::static_pointer_cast<const DependencyDepTag>(tag->tag())->package_id());
if (d.kind() != dlk_masked && d.kind() != dlk_block && (*environment())[selection::SomeArbitraryVersion(
- generator::Matches(*spec, { }) |
+ generator::Matches(*spec, id, { }) |
filter::InstalledAtRoot(environment()->preferred_root_key()->value()))]->empty())
unsatisfied_dependents.insert(tag->tag()->short_text());
else
@@ -1670,7 +1672,7 @@ ConsoleInstallTask::on_all_masked_error(const AllMaskedError & e)
{
std::shared_ptr<const PackageIDSequence> p(
(*environment())[selection::AllVersionsSorted(
- generator::Matches(e.query(), { })
+ generator::Matches(e.query(), e.from_id(), { })
| filter::SupportsAction<InstallAction>())]);
if (p->empty())
{
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index cbd7628f7..efd5b35f7 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.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
@@ -94,7 +94,7 @@ ConsoleQueryTask::show(const PackageDepSpec & a, const std::shared_ptr<const Pac
if (! a.package_ptr())
{
std::shared_ptr<const PackageIDSequence> entries(
- (*_imp->env)[selection::BestVersionOnly(generator::Matches(a, { }))]);
+ (*_imp->env)[selection::BestVersionOnly(generator::Matches(a, display_entry, { }))]);
if (entries->empty())
throw NoSuchPackageError(stringify(a));
@@ -117,9 +117,9 @@ ConsoleQueryTask::show_one(const PackageDepSpec & a, const std::shared_ptr<const
/* prefer the best installed version, then the best visible version, then
* the best version */
std::shared_ptr<const PackageIDSequence>
- entries((*_imp->env)[selection::AllVersionsSorted(generator::Matches(a, { }))]),
+ entries((*_imp->env)[selection::AllVersionsSorted(generator::Matches(a, display_entry, { }))]),
preferred_entries((*_imp->env)[selection::AllVersionsSorted(
- generator::Matches(a, { }) | filter::InstalledAtRoot(_imp->env->preferred_root_key()->value()))]);
+ generator::Matches(a, display_entry, { }) | filter::InstalledAtRoot(_imp->env->preferred_root_key()->value()))]);
if (entries->empty())
throw NoSuchPackageError(stringify(a));
if (preferred_entries->empty())