aboutsummaryrefslogtreecommitdiff
path: root/paludis
diff options
context:
space:
mode:
Diffstat (limited to 'paludis')
-rw-r--r--paludis/environments/paludis/keywords_conf.cc6
-rw-r--r--paludis/environments/paludis/licenses_conf.cc6
-rw-r--r--paludis/environments/paludis/output_conf.cc4
-rw-r--r--paludis/environments/paludis/package_mask_conf.cc4
-rw-r--r--paludis/environments/paludis/paludis_environment_TEST.cc17
-rw-r--r--paludis/environments/paludis/suggestions_conf.cc6
-rw-r--r--paludis/environments/portage/portage_environment.cc13
-rw-r--r--paludis/environments/portage/portage_environment_TEST.cc21
-rw-r--r--paludis/filter.cc12
-rw-r--r--paludis/filter.hh13
-rw-r--r--paludis/filter_TEST.cc13
-rw-r--r--paludis/formatted_pretty_printer.cc8
-rw-r--r--paludis/generator.cc12
-rw-r--r--paludis/generator.hh10
-rw-r--r--paludis/generator_TEST.cc15
-rw-r--r--paludis/legacy/dep_list.cc45
-rw-r--r--paludis/legacy/dep_list.hh4
-rw-r--r--paludis/legacy/dep_list_exceptions.cc7
-rw-r--r--paludis/legacy/dep_list_exceptions.hh10
-rw-r--r--paludis/legacy/install_task.cc14
-rw-r--r--paludis/legacy/query_visitor.cc6
-rw-r--r--paludis/legacy/report_task.cc5
-rw-r--r--paludis/legacy/show_suggest_visitor.cc6
-rw-r--r--paludis/legacy/uninstall_list.cc8
-rw-r--r--paludis/legacy/uninstall_task.cc8
-rw-r--r--paludis/match_package.cc9
-rw-r--r--paludis/match_package.hh14
-rw-r--r--paludis/package_database.cc5
-rw-r--r--paludis/package_dep_spec_collection.cc16
-rw-r--r--paludis/package_dep_spec_collection.hh4
-rw-r--r--paludis/paludislike_options_conf.cc7
-rw-r--r--paludis/repositories/e/e_repository.cc4
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc57
-rw-r--r--paludis/repositories/e/e_repository_TEST_0.cc51
-rw-r--r--paludis/repositories/e/e_repository_TEST_1.cc13
-rw-r--r--paludis/repositories/e/e_repository_TEST_2.cc19
-rw-r--r--paludis/repositories/e/e_repository_TEST_3.cc5
-rw-r--r--paludis/repositories/e/e_repository_TEST_4.cc47
-rw-r--r--paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc5
-rw-r--r--paludis/repositories/e/e_repository_TEST_ever.cc5
-rw-r--r--paludis/repositories/e/e_repository_TEST_exheres_0.cc113
-rw-r--r--paludis/repositories/e/e_repository_TEST_exlibs.cc5
-rw-r--r--paludis/repositories/e/e_repository_TEST_pbin.cc7
-rw-r--r--paludis/repositories/e/e_repository_TEST_phases.cc5
-rw-r--r--paludis/repositories/e/e_repository_TEST_replacing.cc7
-rw-r--r--paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc5
-rw-r--r--paludis/repositories/e/e_repository_news.cc5
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc93
-rw-r--r--paludis/repositories/e/exheres_profile.cc4
-rw-r--r--paludis/repositories/e/exndbam_repository_TEST.cc7
-rw-r--r--paludis/repositories/e/fetch_visitor_TEST.cc5
-rw-r--r--paludis/repositories/e/fix_locked_dependencies.cc4
-rw-r--r--paludis/repositories/e/info_metadata_key.cc5
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc8
-rw-r--r--paludis/repositories/e/traditional_profile.cc11
-rw-r--r--paludis/repositories/e/vdb_repository.cc4
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc60
-rw-r--r--paludis/repositories/e/vdb_unmerger_TEST.cc4
-rw-r--r--paludis/repositories/unpackaged/installed_repository_TEST.cc18
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc4
-rw-r--r--paludis/resolver/allowed_to_remove_helper.cc6
-rw-r--r--paludis/resolver/always_via_binary_helper.cc6
-rw-r--r--paludis/resolver/can_use_helper.cc6
-rw-r--r--paludis/resolver/collect_depped_upon.cc13
-rw-r--r--paludis/resolver/collect_provided.cc4
-rw-r--r--paludis/resolver/confirm_helper.cc5
-rw-r--r--paludis/resolver/constraint.cc55
-rw-r--r--paludis/resolver/constraint.hh4
-rw-r--r--paludis/resolver/decider.cc43
-rw-r--r--paludis/resolver/decider.hh6
-rw-r--r--paludis/resolver/get_constraints_for_dependent_helper.cc7
-rw-r--r--paludis/resolver/get_constraints_for_purge_helper.cc7
-rw-r--r--paludis/resolver/get_constraints_for_via_binary_helper.cc4
-rw-r--r--paludis/resolver/get_initial_constraints_for_helper.cc8
-rw-r--r--paludis/resolver/get_initial_constraints_for_helper.hh4
-rw-r--r--paludis/resolver/get_resolvents_for_helper.cc7
-rw-r--r--paludis/resolver/get_resolvents_for_helper.hh3
-rw-r--r--paludis/resolver/interest_in_spec_helper.cc13
-rw-r--r--paludis/resolver/order_early_helper.cc7
-rw-r--r--paludis/resolver/reason_utils-fwd.hh6
-rw-r--r--paludis/resolver/reason_utils.cc53
-rw-r--r--paludis/resolver/remove_if_dependent_helper.cc6
-rw-r--r--paludis/resolver/resolver_functions.hh3
-rw-r--r--paludis/resolver/sanitised_dependencies.cc5
-rw-r--r--paludis/resolver/sanitised_dependencies.hh4
-rw-r--r--paludis/selection_TEST.cc41
-rw-r--r--paludis/serialise.cc4
-rw-r--r--paludis/set_file.cc5
-rw-r--r--paludis/user_dep_spec.cc5
-rw-r--r--paludis/user_dep_spec_TEST.cc69
90 files changed, 729 insertions, 588 deletions
diff --git a/paludis/environments/paludis/keywords_conf.cc b/paludis/environments/paludis/keywords_conf.cc
index ab8dc04de..3586b2126 100644
--- a/paludis/environments/paludis/keywords_conf.cc
+++ b/paludis/environments/paludis/keywords_conf.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
@@ -149,7 +149,7 @@ KeywordsConf::query(const std::shared_ptr<const KeywordNameSet> & k, const std::
for (PDSToKeywordsList::const_iterator j(i->second.begin()), j_end(i->second.end()) ;
j != j_end ; ++j)
{
- if (! match_package(*_imp->env, *j->first, e, { }))
+ if (! match_package(*_imp->env, *j->first, e, make_null_shared_ptr(), { }))
continue;
for (KeywordsList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
@@ -215,7 +215,7 @@ KeywordsConf::query(const std::shared_ptr<const KeywordNameSet> & k, const std::
for (PDSToKeywordsList::const_iterator j(_imp->unqualified.begin()), j_end(_imp->unqualified.end()) ;
j != j_end ; ++j)
{
- if (! match_package(*_imp->env, *j->first, e, { }))
+ if (! match_package(*_imp->env, *j->first, e, make_null_shared_ptr(), { }))
continue;
for (KeywordsList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
diff --git a/paludis/environments/paludis/licenses_conf.cc b/paludis/environments/paludis/licenses_conf.cc
index 52e2e8f68..8e6d925dc 100644
--- a/paludis/environments/paludis/licenses_conf.cc
+++ b/paludis/environments/paludis/licenses_conf.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
@@ -143,7 +143,7 @@ LicensesConf::query(const std::string & t, const std::shared_ptr<const PackageID
for (PDSToLicensesList::const_iterator j(i->second.begin()), j_end(i->second.end()) ;
j != j_end ; ++j)
{
- if (! match_package(*_imp->env, *j->first, e, { }))
+ if (! match_package(*_imp->env, *j->first, e, make_null_shared_ptr(), { }))
continue;
for (LicensesList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
@@ -208,7 +208,7 @@ LicensesConf::query(const std::string & t, const std::shared_ptr<const PackageID
for (PDSToLicensesList::const_iterator j(_imp->unqualified.begin()), j_end(_imp->unqualified.end()) ;
j != j_end ; ++j)
{
- if (! match_package(*_imp->env, *j->first, e, { }))
+ if (! match_package(*_imp->env, *j->first, e, make_null_shared_ptr(), { }))
continue;
for (LicensesList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
diff --git a/paludis/environments/paludis/output_conf.cc b/paludis/environments/paludis/output_conf.cc
index a97ec1801..1e760e173 100644
--- a/paludis/environments/paludis/output_conf.cc
+++ b/paludis/environments/paludis/output_conf.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
@@ -196,7 +196,7 @@ namespace
return false;
if (rule.matches_requirement() && ! match_package(*env, *rule.matches_requirement(),
- i.package_id(), { }))
+ i.package_id(), make_null_shared_ptr(), { }))
return false;
if (! rule.ignore_unfetched_requirement().is_indeterminate())
diff --git a/paludis/environments/paludis/package_mask_conf.cc b/paludis/environments/paludis/package_mask_conf.cc
index 75ff80fc6..763801199 100644
--- a/paludis/environments/paludis/package_mask_conf.cc
+++ b/paludis/environments/paludis/package_mask_conf.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
@@ -104,7 +104,7 @@ PackageMaskConf::query(const std::shared_ptr<const PackageID> & e) const
if (indirect_iterator(_imp->masks.end()) != std::find_if(
indirect_iterator(_imp->masks.begin()),
indirect_iterator(_imp->masks.end()),
- std::bind(&match_package, std::ref(*_imp->env), _1, std::cref(e), MatchPackageOptions())))
+ std::bind(&match_package, std::ref(*_imp->env), _1, std::cref(e), make_null_shared_ptr(), MatchPackageOptions())))
return true;
{
diff --git a/paludis/environments/paludis/paludis_environment_TEST.cc b/paludis/environments/paludis/paludis_environment_TEST.cc
index 787e471be..ee5d69d68 100644
--- a/paludis/environments/paludis/paludis_environment_TEST.cc
+++ b/paludis/environments/paludis/paludis_environment_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 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,6 +23,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/package_id.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
@@ -63,10 +64,10 @@ namespace test_cases
std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
const std::shared_ptr<const PackageID> one(*(*env)[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
- env.get(), { })), { }))]->begin());
+ env.get(), { })), make_null_shared_ptr(), { }))]->begin());
const std::shared_ptr<const PackageID> three(*(*env)[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-two-3",
- env.get(), { })), { }))]->begin());
+ env.get(), { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(get_use("foo", one));
TEST_CHECK(! get_use("foofoo", one));
@@ -97,7 +98,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*(*env)[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
- env.get(), { })), { }))]->begin());
+ env.get(), { })), make_null_shared_ptr(), { }))]->begin());
std::shared_ptr<const Choice> foo_cards;
for (Choices::ConstIterator c(id1->choices_key()->value()->begin()), c_end(id1->choices_key()->value()->end()) ;
c != c_end ; ++c)
@@ -123,10 +124,10 @@ namespace test_cases
const std::shared_ptr<const PackageID> one(*(*env)[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
- env.get(), { })), { }))]->begin());
+ env.get(), { })), make_null_shared_ptr(), { }))]->begin());
const std::shared_ptr<const PackageID> three(*(*env)[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-two-3",
- env.get(), { })), { }))]->begin());
+ env.get(), { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(get_use("foo", one));
TEST_CHECK(! get_use("foofoo", one));
@@ -156,10 +157,10 @@ namespace test_cases
const std::shared_ptr<const PackageID> one(*(*env)[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
- env.get(), { })), { }))]->begin());
+ env.get(), { })), make_null_shared_ptr(), { }))]->begin());
const std::shared_ptr<const PackageID> three(*(*env)[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-two-3",
- env.get(), { })), { }))]->begin());
+ env.get(), { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(get_use("foo", one));
TEST_CHECK(! get_use("foofoo", one));
diff --git a/paludis/environments/paludis/suggestions_conf.cc b/paludis/environments/paludis/suggestions_conf.cc
index dbd5e5dce..226413d0c 100644
--- a/paludis/environments/paludis/suggestions_conf.cc
+++ b/paludis/environments/paludis/suggestions_conf.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
@@ -194,7 +194,7 @@ SuggestionsConf::interest_in_suggestion(
for (PDSToValuesList::const_iterator j(i->second.begin()), j_end(i->second.end()) ;
j != j_end ; ++j)
{
- if (! match_package(*_imp->env, *j->first, from_id, { }))
+ if (! match_package(*_imp->env, *j->first, from_id, make_null_shared_ptr(), { }))
continue;
for (ValuesList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
@@ -269,7 +269,7 @@ SuggestionsConf::interest_in_suggestion(
for (PDSToValuesList::const_iterator j(_imp->unqualified.begin()), j_end(_imp->unqualified.end()) ;
j != j_end ; ++j)
{
- if (! match_package(*_imp->env, *j->first, from_id, { }))
+ if (! match_package(*_imp->env, *j->first, from_id, make_null_shared_ptr(), { }))
continue;
for (ValuesList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index 19b1f992d..f6b26c6cd 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.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
@@ -40,6 +40,7 @@
#include <paludis/util/fs_stat.hh>
#include <paludis/util/fs_iterator.hh>
#include <paludis/util/fs_error.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/hooker.hh>
@@ -586,7 +587,7 @@ PortageEnvironment::want_choice_enabled(
for (PackageUse::const_iterator i(_imp->package_use.begin()), i_end(_imp->package_use.end()) ;
i != i_end ; ++i)
{
- if (! match_package(*this, *i->first, id, { }))
+ if (! match_package(*this, *i->first, id, make_null_shared_ptr(), { }))
continue;
if (i->second == stringify(f))
@@ -642,7 +643,7 @@ PortageEnvironment::accept_keywords(const std::shared_ptr <const KeywordNameSet>
for (PackageKeywords::const_iterator it(_imp->package_keywords.begin()),
it_end(_imp->package_keywords.end()); it_end != it; ++it)
{
- if (! match_package(*this, *it->first, d, { }))
+ if (! match_package(*this, *it->first, d, make_null_shared_ptr(), { }))
continue;
if ("-*" == it->second)
@@ -677,7 +678,7 @@ PortageEnvironment::unmasked_by_user(const std::shared_ptr<const PackageID> & e)
{
for (PackageUnmask::const_iterator i(_imp->package_unmask.begin()), i_end(_imp->package_unmask.end()) ;
i != i_end ; ++i)
- if (match_package(*this, **i, e, { }))
+ if (match_package(*this, **i, e, make_null_shared_ptr(), { }))
return true;
return false;
@@ -702,7 +703,7 @@ PortageEnvironment::known_choice_value_names(const std::shared_ptr<const Package
for (PackageUse::const_iterator i(_imp->package_use.begin()), i_end(_imp->package_use.end()) ;
i != i_end ; ++i)
{
- if (! match_package(*this, *i->first, id, { }))
+ if (! match_package(*this, *i->first, id, make_null_shared_ptr(), { }))
continue;
if (0 == i->second.compare(0, prefix_lower.length(), prefix_lower, 0, prefix_lower.length()))
@@ -862,7 +863,7 @@ PortageEnvironment::mask_for_user(const std::shared_ptr<const PackageID> & d, co
{
for (PackageMask::const_iterator i(_imp->package_mask.begin()), i_end(_imp->package_mask.end()) ;
i != i_end ; ++i)
- if (match_package(*this, **i, d, { }))
+ if (match_package(*this, **i, d, make_null_shared_ptr(), { }))
return std::make_shared<UserConfigMask>(o);
return std::shared_ptr<const Mask>();
diff --git a/paludis/environments/portage/portage_environment_TEST.cc b/paludis/environments/portage/portage_environment_TEST.cc
index c6fcbf56a..3e86d66de 100644
--- a/paludis/environments/portage/portage_environment_TEST.cc
+++ b/paludis/environments/portage/portage_environment_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -24,6 +24,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/options.hh>
#include <paludis/util/safe_ifstream.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/package_id.hh>
#include <paludis/package_database.hh>
#include <paludis/dep_spec.hh>
@@ -85,11 +86,11 @@ namespace test_cases
const std::shared_ptr<const PackageID> idx(*env[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-x-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(get_use("one", env, idx));
TEST_CHECK(get_use("two", env, idx));
@@ -120,7 +121,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
std::shared_ptr<const Choice> foo_cards;
for (Choices::ConstIterator c(id1->choices_key()->value()->begin()), c_end(id1->choices_key()->value()->end()) ;
c != c_end ; ++c)
@@ -143,7 +144,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> idx(*env[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-x-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(accept_keyword(env, KeywordName("arch"), idx));
TEST_CHECK(accept_keyword(env, KeywordName("other_arch"), idx));
@@ -151,7 +152,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(accept_keyword(env, KeywordName("arch"), id1));
TEST_CHECK(accept_keyword(env, KeywordName("other_arch"), id1));
@@ -159,7 +160,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id2(*env[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-two-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(accept_keyword(env, KeywordName("other_arch"), id2));
TEST_CHECK(accept_keyword(env, KeywordName("arch"), id2));
@@ -167,7 +168,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id3(*env[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-three-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(! accept_keyword(env, KeywordName("other_arch"), id3));
TEST_CHECK(! accept_keyword(env, KeywordName("arch"), id3));
@@ -175,14 +176,14 @@ namespace test_cases
const std::shared_ptr<const PackageID> id4(*env[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-four-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(accept_keyword(env, KeywordName("fred"), id4));
std::shared_ptr<const KeywordNameSet> empty(std::make_shared<KeywordNameSet>());
TEST_CHECK(env.accept_keywords(empty, id4));
const std::shared_ptr<const PackageID> id5(*env[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-five-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(accept_keyword(env, KeywordName("~foo"), id5));
TEST_CHECK(! accept_keyword(env, KeywordName("foo"), id5));
}
diff --git a/paludis/filter.cc b/paludis/filter.cc
index ecf4b2385..ae413f11e 100644
--- a/paludis/filter.cc
+++ b/paludis/filter.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
@@ -394,10 +394,12 @@ namespace
AllFilterHandlerBase
{
const PackageDepSpec spec;
+ const std::shared_ptr<const PackageID> from_id;
const MatchPackageOptions options;
- MatchesHandler(const PackageDepSpec & s, const MatchPackageOptions & o) :
+ MatchesHandler(const PackageDepSpec & s, const std::shared_ptr<const PackageID> & f, const MatchPackageOptions & o) :
spec(s),
+ from_id(f),
options(o)
{
}
@@ -411,7 +413,7 @@ namespace
for (PackageIDSet::ConstIterator i(id->begin()), i_end(id->end()) ;
i != i_end ; ++i)
{
- if (match_package(*env, spec, *i, options))
+ if (match_package(*env, spec, *i, from_id, options))
result->insert(*i);
}
@@ -484,8 +486,8 @@ filter::NoSlot::NoSlot() :
{
}
-filter::Matches::Matches(const PackageDepSpec & spec, const MatchPackageOptions & o) :
- Filter(std::make_shared<MatchesHandler>(spec, o))
+filter::Matches::Matches(const PackageDepSpec & spec, const std::shared_ptr<const PackageID> & f, const MatchPackageOptions & o) :
+ Filter(std::make_shared<MatchesHandler>(spec, f, o))
{
}
diff --git a/paludis/filter.hh b/paludis/filter.hh
index adfa0a72f..b2b7fe681 100644
--- a/paludis/filter.hh
+++ b/paludis/filter.hh
@@ -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
@@ -276,7 +276,16 @@ namespace paludis
public Filter
{
public:
- Matches(const PackageDepSpec &, const MatchPackageOptions &);
+ /**
+ * \param spec_id The PackageID the spec comes from. May be null. Used
+ * for [use=] style dependencies.
+ *
+ * \since 0.58 takes spec_id
+ */
+ Matches(
+ const PackageDepSpec &,
+ const std::shared_ptr<const PackageID> & from_id,
+ const MatchPackageOptions &);
};
}
diff --git a/paludis/filter_TEST.cc b/paludis/filter_TEST.cc
index 24a9d8acb..6069bc38b 100644
--- a/paludis/filter_TEST.cc
+++ b/paludis/filter_TEST.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/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <test/test_concepts.hh>
@@ -96,7 +97,7 @@ namespace test_cases
std::shared_ptr<const PackageIDSequence> got_none(env[selection::AllVersionsSorted(
generator::Matches(parse_user_package_dep_spec("not/exist", &env,
- { }), { }) | filter)]);
+ { }), make_null_shared_ptr(), { }) | filter)]);
TEST_CHECK(bool(got_none));
TEST_CHECK_EQUAL(join(indirect_iterator(got_none->begin()), indirect_iterator(got_none->end()), ", "), "");
}
@@ -222,7 +223,7 @@ namespace test_cases
{
MatchesFilterTestCase() :
FilterTestCaseBase("matches", filter::Matches(parse_user_package_dep_spec("cat/a",
- &env, { }), { }))
+ &env, { }), make_null_shared_ptr(), { }))
{
}
@@ -240,7 +241,7 @@ namespace test_cases
{
MatchesCatWildcardFilterTestCase() :
FilterTestCaseBase("matches cat wildcard", filter::Matches(parse_user_package_dep_spec("*/a",
- &env, { updso_allow_wildcards }), { }))
+ &env, { updso_allow_wildcards }), make_null_shared_ptr(), { }))
{
}
@@ -258,7 +259,7 @@ namespace test_cases
{
MatchesPkgWildcardFilterTestCase() :
FilterTestCaseBase("matches pkg wildcard", filter::Matches(parse_user_package_dep_spec("cat/*",
- &env, { updso_allow_wildcards }), { }))
+ &env, { updso_allow_wildcards }), make_null_shared_ptr(), { }))
{
}
@@ -279,7 +280,7 @@ namespace test_cases
MatchesAllWildcardFilterTestCase() :
FilterTestCaseBase("matches all wildcard", filter::Matches(
parse_user_package_dep_spec(">=*/*-2",
- &env, { updso_allow_wildcards }), { }))
+ &env, { updso_allow_wildcards }), make_null_shared_ptr(), { }))
{
}
diff --git a/paludis/formatted_pretty_printer.cc b/paludis/formatted_pretty_printer.cc
index fbea1960a..acd35153d 100644
--- a/paludis/formatted_pretty_printer.cc
+++ b/paludis/formatted_pretty_printer.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
@@ -61,13 +61,13 @@ FormattedPrettyPrinter::prettify(const PackageDepSpec & v) const
if (_imp->env)
{
{
- auto ids((*_imp->env)[selection::SomeArbitraryVersion(generator::Matches(v, { }) |
+ auto ids((*_imp->env)[selection::SomeArbitraryVersion(generator::Matches(v, _imp->package_id, { }) |
filter::InstalledAtRoot(_imp->env->preferred_root_key()->value()))]);
if (! ids->empty())
return format_installed(stringify(v));
}
{
- auto ids((*_imp->env)[selection::SomeArbitraryVersion(generator::Matches(v, { }) |
+ auto ids((*_imp->env)[selection::SomeArbitraryVersion(generator::Matches(v, _imp->package_id, { }) |
filter::SupportsAction<InstallAction>() | filter::NotMasked())]);
if (! ids->empty())
return format_installed(stringify(v));
@@ -85,7 +85,7 @@ FormattedPrettyPrinter::prettify(const BlockDepSpec & v) const
if (_imp->env)
{
{
- auto ids((*_imp->env)[selection::SomeArbitraryVersion(generator::Matches(v.blocking(), { }) |
+ auto ids((*_imp->env)[selection::SomeArbitraryVersion(generator::Matches(v.blocking(), _imp->package_id, { }) |
filter::InstalledAtRoot(_imp->env->preferred_root_key()->value()))]);
if (! ids->empty())
return format_masked(stringify(v));
diff --git a/paludis/generator.cc b/paludis/generator.cc
index a889b43d0..b9d0a6dc0 100644
--- a/paludis/generator.cc
+++ b/paludis/generator.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
@@ -278,10 +278,12 @@ namespace
AllGeneratorHandlerBase
{
const PackageDepSpec spec;
+ const std::shared_ptr<const PackageID> from_id;
const MatchPackageOptions options;
- MatchesGeneratorHandler(const PackageDepSpec & s, const MatchPackageOptions & o) :
+ MatchesGeneratorHandler(const PackageDepSpec & s, const std::shared_ptr<const PackageID> & i, const MatchPackageOptions & o) :
spec(s),
+ from_id(i),
options(o)
{
}
@@ -446,7 +448,7 @@ namespace
env->package_database()->fetch_repository(*r)->package_ids(*q));
for (PackageIDSequence::ConstIterator i(id->begin()), i_end(id->end()) ;
i != i_end ; ++i)
- if (match_package(*env, spec, *i, options))
+ if (match_package(*env, spec, *i, from_id, options))
result->insert(*i);
}
}
@@ -734,8 +736,8 @@ generator::Package::Package(const QualifiedPackageName & n) :
{
}
-generator::Matches::Matches(const PackageDepSpec & spec, const MatchPackageOptions & o) :
- Generator(std::make_shared<MatchesGeneratorHandler>(spec, o))
+generator::Matches::Matches(const PackageDepSpec & spec, const std::shared_ptr<const PackageID> & f, const MatchPackageOptions & o) :
+ Generator(std::make_shared<MatchesGeneratorHandler>(spec, f, o))
{
}
diff --git a/paludis/generator.hh b/paludis/generator.hh
index 6b5162d5f..3fbdf4066 100644
--- a/paludis/generator.hh
+++ b/paludis/generator.hh
@@ -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
@@ -152,7 +152,13 @@ namespace paludis
public Generator
{
public:
- Matches(const PackageDepSpec &, const MatchPackageOptions &);
+ /**
+ * \param spec_id The PackageID the spec comes from. May be null. Used for
+ * [use=] style dependencies.
+ *
+ * \since 0.58 takes spec_id
+ */
+ Matches(const PackageDepSpec &, const std::shared_ptr<const PackageID> & from_id, const MatchPackageOptions &);
};
/**
diff --git a/paludis/generator_TEST.cc b/paludis/generator_TEST.cc
index e687c3082..deff8e84c 100644
--- a/paludis/generator_TEST.cc
+++ b/paludis/generator_TEST.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/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <test/test_concepts.hh>
@@ -122,7 +123,7 @@ namespace test_cases
{
MatchesGeneratorTestCase() :
GeneratorTestCaseBase("matches", generator::Matches(parse_user_package_dep_spec("cat/a",
- &env, { }), { }))
+ &env, { }), make_null_shared_ptr(), { }))
{
}
@@ -140,7 +141,7 @@ namespace test_cases
{
MatchesCatWildcardGeneratorTestCase() :
GeneratorTestCaseBase("matches cat wildcard", generator::Matches(parse_user_package_dep_spec("*/a",
- &env, { updso_allow_wildcards }), { }))
+ &env, { updso_allow_wildcards }), make_null_shared_ptr(), { }))
{
}
@@ -158,7 +159,7 @@ namespace test_cases
{
MatchesPkgWildcardGeneratorTestCase() :
GeneratorTestCaseBase("matches pkg wildcard", generator::Matches(parse_user_package_dep_spec("cat/*",
- &env, { updso_allow_wildcards }), { }))
+ &env, { updso_allow_wildcards }), make_null_shared_ptr(), { }))
{
}
@@ -179,7 +180,7 @@ namespace test_cases
MatchesAllWildcardGeneratorTestCase() :
GeneratorTestCaseBase("matches all wildcard", generator::Matches(
parse_user_package_dep_spec(">=*/*-2",
- &env, { updso_allow_wildcards }), { }))
+ &env, { updso_allow_wildcards }), make_null_shared_ptr(), { }))
{
}
@@ -287,9 +288,9 @@ namespace test_cases
IntersectionGeneratorTestCase() :
GeneratorTestCaseBase("intersection", generator::Intersection(
generator::Matches(parse_user_package_dep_spec("*/a",
- &env, { updso_allow_wildcards }), { }),
+ &env, { updso_allow_wildcards }), make_null_shared_ptr(), { }),
generator::Matches(parse_user_package_dep_spec("cat/*",
- &env, { updso_allow_wildcards }), { })
+ &env, { updso_allow_wildcards }), make_null_shared_ptr(), { })
))
{
}
diff --git a/paludis/legacy/dep_list.cc b/paludis/legacy/dep_list.cc
index d7cc9f741..ebfc010d9 100644
--- a/paludis/legacy/dep_list.cc
+++ b/paludis/legacy/dep_list.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -259,12 +259,14 @@ namespace
{
const Environment * const env;
const PackageDepSpec & a;
+ const std::shared_ptr<const PackageID> from_id;
const MatchPackageOptions & o;
MatchDepListEntryAgainstPackageDepSpec(const Environment * const ee,
- const PackageDepSpec & aa, const MatchPackageOptions & oo) :
+ const PackageDepSpec & aa, const std::shared_ptr<const PackageID> & f, const MatchPackageOptions & oo) :
env(ee),
a(aa),
+ from_id(f),
o(oo)
{
}
@@ -278,7 +280,7 @@ namespace
case dlk_provided:
case dlk_already_installed:
case dlk_subpackage:
- return match_package(*env, a, e.second->package_id(), o);
+ return match_package(*env, a, e.second->package_id(), from_id, o);
case dlk_block:
case dlk_masked:
@@ -425,7 +427,7 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::T
/* find already installed things */
// TODO: check destinations
std::shared_ptr<const PackageIDSequence> already_installed((*d->_imp->env)[selection::AllVersionsSorted(
- generator::Matches(*node.spec(), d->_imp->opts->match_package_options()) |
+ generator::Matches(*node.spec(), d->_imp->current_package_id(), d->_imp->opts->match_package_options()) |
filter::InstalledAtRoot(d->_imp->env->preferred_root_key()->value()))]);
/* are we already on the merge list? */
@@ -436,7 +438,8 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::T
q = std::make_pair(d->_imp->merge_list_index.begin(), d->_imp->merge_list_index.end());
MergeListIndex::iterator qq(std::find_if(q.first, q.second,
- MatchDepListEntryAgainstPackageDepSpec(d->_imp->env, *node.spec(), d->_imp->opts->match_package_options())));
+ MatchDepListEntryAgainstPackageDepSpec(d->_imp->env, *node.spec(),
+ d->_imp->current_package_id(), d->_imp->opts->match_package_options())));
MergeList::iterator existing_merge_list_entry(qq == q.second ? d->_imp->merge_list.end() : qq->second);
if (existing_merge_list_entry != d->_imp->merge_list.end())
@@ -484,7 +487,8 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::T
/* find installable candidates, and find the best visible candidate */
std::shared_ptr<const PackageID> best_visible_candidate;
std::shared_ptr<const PackageIDSequence> installable_candidates(
- (*d->_imp->env)[selection::AllVersionsSorted(generator::Matches(*node.spec(), d->_imp->opts->match_package_options()) &
+ (*d->_imp->env)[selection::AllVersionsSorted(generator::Matches(*node.spec(),
+ d->_imp->current_package_id(), d->_imp->opts->match_package_options()) &
generator::SomeIDsMightSupportAction<InstallAction>())]);
for (PackageIDSequence::ReverseConstIterator p(installable_candidates->rbegin()),
@@ -582,17 +586,18 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::T
if (already_installed->empty() || ! can_fall_back)
{
if (! node.spec()->additional_requirements_ptr())
- throw AllMaskedError(*node.spec());
+ throw AllMaskedError(*node.spec(), d->_imp->current_package_id());
std::shared_ptr<const PackageIDSequence> match_except_reqs((*d->_imp->env)[selection::AllVersionsSorted(
- generator::Matches(*node.spec(), d->_imp->opts->match_package_options() + mpo_ignore_additional_requirements))]);
+ generator::Matches(*node.spec(), d->_imp->current_package_id(),
+ d->_imp->opts->match_package_options() + mpo_ignore_additional_requirements))]);
for (PackageIDSequence::ReverseConstIterator i(match_except_reqs->rbegin()),
i_end(match_except_reqs->rend()) ; i != i_end ; ++i)
if (! (*i)->masked())
throw AdditionalRequirementsNotMetError(*node.spec(), *i);
- throw AllMaskedError(*node.spec());
+ throw AllMaskedError(*node.spec(), d->_imp->current_package_id());
}
else
{
@@ -868,10 +873,10 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<BlockDepSpec>::Typ
PackageDepSpec just_package(make_package_dep_spec({ }).package(
*node.spec()->blocking().package_ptr()));
already_installed = (*d->_imp->env)[selection::AllVersionsUnsorted(
- generator::Matches(just_package, d->_imp->opts->match_package_options()) |
+ generator::Matches(just_package, make_null_shared_ptr(), d->_imp->opts->match_package_options()) |
filter::InstalledAtRoot(d->_imp->env->preferred_root_key()->value()))];
- MatchDepListEntryAgainstPackageDepSpec m(d->_imp->env, just_package, d->_imp->opts->match_package_options());
+ MatchDepListEntryAgainstPackageDepSpec m(d->_imp->env, just_package, make_null_shared_ptr(), d->_imp->opts->match_package_options());
for (std::pair<MergeListIndex::const_iterator, MergeListIndex::const_iterator> p(
d->_imp->merge_list_index.equal_range(*node.spec()->blocking().package_ptr())) ;
p.first != p.second ; ++p.first)
@@ -904,7 +909,7 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<BlockDepSpec>::Typ
for (PackageIDSequence::ConstIterator aa(already_installed->begin()),
aa_end(already_installed->end()) ; aa != aa_end ; ++aa)
{
- if (! match_package(*d->_imp->env, node.spec()->blocking(), *aa, d->_imp->opts->match_package_options()))
+ if (! match_package(*d->_imp->env, node.spec()->blocking(), *aa, d->_imp->current_package_id(), d->_imp->opts->match_package_options()))
continue;
bool replaced(false);
@@ -974,7 +979,8 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<BlockDepSpec>::Typ
for (std::list<MergeList::const_iterator>::const_iterator r(will_be_installed.begin()),
r_end(will_be_installed.end()) ; r != r_end ; ++r)
{
- if (! match_package(*d->_imp->env, node.spec()->blocking(), (*r)->package_id(), d->_imp->opts->match_package_options()))
+ if (! match_package(*d->_imp->env, node.spec()->blocking(), (*r)->package_id(),
+ d->_imp->current_package_id(), d->_imp->opts->match_package_options()))
continue;
/* ignore if it's a virtual/blah (not <virtual/blah-1) block and it's blocking
@@ -1011,7 +1017,8 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<BlockDepSpec>::Typ
for (MergeList::const_iterator r(d->_imp->merge_list.begin()),
r_end(d->_imp->merge_list.end()) ; r != r_end ; ++r)
{
- if (! match_package(*d->_imp->env, node.spec()->blocking(), r->package_id(), d->_imp->opts->match_package_options()))
+ if (! match_package(*d->_imp->env, node.spec()->blocking(), r->package_id(),
+ d->_imp->current_package_id(), d->_imp->opts->match_package_options()))
continue;
/* ignore if it's a virtual/blah (not <virtual/blah-1) block and it's blocking
@@ -1171,7 +1178,7 @@ DepList::add_package(const std::shared_ptr<const PackageID> & p, const std::shar
/* add provides */
if (p->provide_key())
{
- DepSpecFlattener<ProvideSpecTree, PackageDepSpec> f(_imp->env, _imp->current_package_id());
+ DepSpecFlattener<ProvideSpecTree, PackageDepSpec> f(_imp->env, p);
p->provide_key()->value()->top()->accept(f);
if (f.begin() != f.end() && ! (*DistributionData::get_instance()->distribution_from_string(
@@ -1195,7 +1202,7 @@ DepList::add_package(const std::shared_ptr<const PackageID> & p, const std::shar
z = std::make_pair(_imp->merge_list_index.begin(), _imp->merge_list_index.end());
MergeListIndex::iterator zz(std::find_if(z.first, z.second,
- MatchDepListEntryAgainstPackageDepSpec(_imp->env, *pp, _imp->opts->match_package_options())));
+ MatchDepListEntryAgainstPackageDepSpec(_imp->env, *pp, p, _imp->opts->match_package_options())));
if (zz != z.second)
continue;
@@ -1708,7 +1715,7 @@ DepList::replaced(const PackageID & m) const
PackageDepSpec spec(make_package_dep_spec({ }).package(m.name()));
while (p.second != ((p.first = std::find_if(p.first, p.second,
- MatchDepListEntryAgainstPackageDepSpec(_imp->env, spec, _imp->opts->match_package_options())))))
+ MatchDepListEntryAgainstPackageDepSpec(_imp->env, spec, make_null_shared_ptr(), _imp->opts->match_package_options())))))
{
if (! slot_is_same(*p.first->second->package_id(), m))
p.first = next(p.first);
@@ -1720,7 +1727,7 @@ DepList::replaced(const PackageID & m) const
}
bool
-DepList::match_on_list(const PackageDepSpec & a) const
+DepList::match_on_list(const PackageDepSpec & a, const std::shared_ptr<const PackageID> & from_id) const
{
std::pair<MergeListIndex::const_iterator, MergeListIndex::const_iterator> p;
if (a.package_ptr())
@@ -1729,7 +1736,7 @@ DepList::match_on_list(const PackageDepSpec & a) const
p = std::make_pair(_imp->merge_list_index.begin(), _imp->merge_list_index.end());
return p.second != std::find_if(p.first, p.second,
- MatchDepListEntryAgainstPackageDepSpec(_imp->env, a, _imp->opts->match_package_options()));
+ MatchDepListEntryAgainstPackageDepSpec(_imp->env, a, from_id, _imp->opts->match_package_options()));
}
DepList::Iterator
diff --git a/paludis/legacy/dep_list.hh b/paludis/legacy/dep_list.hh
index 036d977d2..ed3bed494 100644
--- a/paludis/legacy/dep_list.hh
+++ b/paludis/legacy/dep_list.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -295,7 +295,7 @@ namespace paludis
/**
* Return whether a spec matches an item in the list.
*/
- bool match_on_list(const PackageDepSpec &) const;
+ bool match_on_list(const PackageDepSpec &, const std::shared_ptr<const PackageID> & from_id) const;
/**
* Whether we have any errors.
diff --git a/paludis/legacy/dep_list_exceptions.cc b/paludis/legacy/dep_list_exceptions.cc
index f2dd9bdc4..55af89d02 100644
--- a/paludis/legacy/dep_list_exceptions.cc
+++ b/paludis/legacy/dep_list_exceptions.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 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
@@ -28,9 +28,10 @@ DepListError::DepListError(const std::string & m) throw () :
{
}
-AllMaskedError::AllMaskedError(const PackageDepSpec & q) throw () :
+AllMaskedError::AllMaskedError(const PackageDepSpec & q, const std::shared_ptr<const PackageID> & i) throw () :
DepListError("Error searching for '" + stringify(q) + "': no available versions"),
- _query(q)
+ _query(q),
+ _from_id(i)
{
}
diff --git a/paludis/legacy/dep_list_exceptions.hh b/paludis/legacy/dep_list_exceptions.hh
index e1e84054f..7552602e0 100644
--- a/paludis/legacy/dep_list_exceptions.hh
+++ b/paludis/legacy/dep_list_exceptions.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 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
@@ -65,12 +65,13 @@ namespace paludis
{
private:
const PackageDepSpec _query;
+ const std::shared_ptr<const PackageID> _from_id;
public:
///\name Basic operations
///\{
- AllMaskedError(const PackageDepSpec & query) throw ();
+ AllMaskedError(const PackageDepSpec & query, const std::shared_ptr<const PackageID> & id) throw ();
virtual ~AllMaskedError() throw ()
{
@@ -85,6 +86,11 @@ namespace paludis
{
return _query;
}
+
+ const std::shared_ptr<const PackageID> from_id() const
+ {
+ return _from_id;
+ }
};
/**
diff --git a/paludis/legacy/install_task.cc b/paludis/legacy/install_task.cc
index 9476bc366..3cd20133e 100644
--- a/paludis/legacy/install_task.cc
+++ b/paludis/legacy/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
@@ -252,7 +252,7 @@ namespace
return std::make_shared<DepListEntryHandledSkippedDependent>(
*(*env)[selection::RequireExactlyOne(generator::Matches(
parse_user_package_dep_spec(s.substr(1), env,
- { }), { }))]->begin());
+ { }), make_null_shared_ptr(), { }))]->begin());
case 'F':
if (s.length() != 1)
@@ -299,7 +299,7 @@ InstallTask::set_targets_from_serialisation(const std::string & format,
throw InternalError(PALUDIS_HERE, "Serialised value '" + *s + "' too short: no package_id");
const std::shared_ptr<const PackageID> package_id(*(*_imp->env)[selection::RequireExactlyOne(
generator::Matches(parse_user_package_dep_spec(*tokens.begin(),
- _imp->env, { }), { }))]->begin());
+ _imp->env, { }), make_null_shared_ptr(), { }))]->begin());
tokens.pop_front();
if (tokens.empty())
@@ -504,7 +504,7 @@ InstallTask::_add_target(const std::string & target)
else
{
std::shared_ptr<const PackageIDSequence> names((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(*spec, { }) | filter::SupportsAction<InstallAction>())]);
+ generator::Matches(*spec, make_null_shared_ptr(), { }) | filter::SupportsAction<InstallAction>())]);
if (names->empty())
{
@@ -1538,7 +1538,7 @@ namespace
void visit(const DependencySpecTree::NodeType<PackageDepSpec>::Type & node)
{
if (! failure)
- if ((*env)[selection::SomeArbitraryVersion(generator::Matches(*node.spec(), { })
+ if ((*env)[selection::SomeArbitraryVersion(generator::Matches(*node.spec(), id, { })
| filter::InstalledAtRoot(env->preferred_root_key()->value()))]->empty())
failure = node.spec();
}
@@ -1728,7 +1728,7 @@ namespace
if (! d->handled())
continue;
- if (! match_package(*env, *node.spec(), d->package_id(), { }))
+ if (! match_package(*env, *node.spec(), d->package_id(), id, { }))
continue;
CheckHandledVisitor v;
@@ -1743,7 +1743,7 @@ namespace
/* no match on the dep list, fall back to installed packages. if
* there are no matches here it's not a problem because of or-deps. */
std::shared_ptr<const PackageIDSequence> installed((*env)[selection::AllVersionsUnsorted(
- generator::Matches(*node.spec(), { }) |
+ generator::Matches(*node.spec(), id, { }) |
filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
for (PackageIDSequence::ConstIterator i(installed->begin()), i_end(installed->end()) ;
diff --git a/paludis/legacy/query_visitor.cc b/paludis/legacy/query_visitor.cc
index 0ddec62a6..b63c9d905 100644
--- a/paludis/legacy/query_visitor.cc
+++ b/paludis/legacy/query_visitor.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -91,7 +91,7 @@ QueryVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::Type & n
// TODO: check destinations
std::shared_ptr<const PackageIDSequence> matches((*_imp->environment)[selection::AllVersionsUnsorted(
- generator::Matches(*node.spec(), _imp->dep_list->options()->match_package_options()) |
+ generator::Matches(*node.spec(), _imp->id, _imp->dep_list->options()->match_package_options()) |
filter::InstalledAtRoot(_imp->environment->preferred_root_key()->value()))]);
if (indirect_iterator(matches->end()) != std::find_if(indirect_iterator(matches->begin()), indirect_iterator(matches->end()),
@@ -102,7 +102,7 @@ QueryVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::Type & n
}
/* check the merge list for any new packages that match */
- if (_imp->dep_list->match_on_list(*node.spec()))
+ if (_imp->dep_list->match_on_list(*node.spec(), _imp->id))
{
_imp->result = true;
return;
diff --git a/paludis/legacy/report_task.cc b/paludis/legacy/report_task.cc
index 4924b5511..289348df2 100644
--- a/paludis/legacy/report_task.cc
+++ b/paludis/legacy/report_task.cc
@@ -36,6 +36,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/package_database.hh>
#include <paludis/version_requirements.hh>
#include <paludis/partially_made_package_dep_spec.hh>
@@ -104,7 +105,7 @@ namespace
VulnerableChecker::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() && simple_visitor_cast<const GLSADepTag>(*node.spec()->tag()))
@@ -217,7 +218,7 @@ ReportTask::execute()
.version_requirement(make_named_values<VersionRequirement>(
n::version_operator() = vo_equal,
n::version_spec() = (*v)->version())),
- { })) |
+ make_null_shared_ptr(), { })) |
filter::SupportsAction<InstallAction>()))]);
if (! installable->empty())
diff --git a/paludis/legacy/show_suggest_visitor.cc b/paludis/legacy/show_suggest_visitor.cc
index fa53eccb1..88ee5eb78 100644
--- a/paludis/legacy/show_suggest_visitor.cc
+++ b/paludis/legacy/show_suggest_visitor.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -191,7 +191,7 @@ ShowSuggestVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::Ty
}
std::shared_ptr<const PackageIDSequence> installed_matches((*_imp->environment)[selection::AllVersionsSorted(
- generator::Matches(*node.spec(), _imp->dep_list->options()->match_package_options())
+ generator::Matches(*node.spec(), _imp->id, _imp->dep_list->options()->match_package_options())
| filter::InstalledAtRoot(_imp->environment->preferred_root_key()->value()))]);
if (! installed_matches->empty())
{
@@ -203,7 +203,7 @@ ShowSuggestVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::Ty
}
std::shared_ptr<const PackageIDSequence> matches((*_imp->environment)[selection::AllVersionsSorted(
- generator::Matches(*node.spec(), _imp->dep_list->options()->match_package_options())
+ generator::Matches(*node.spec(), _imp->id, _imp->dep_list->options()->match_package_options())
| filter::SupportsAction<InstallAction>())]);
if (matches->empty())
{
diff --git a/paludis/legacy/uninstall_list.cc b/paludis/legacy/uninstall_list.cc
index 4ec04cff9..305f16aec 100644
--- a/paludis/legacy/uninstall_list.cc
+++ b/paludis/legacy/uninstall_list.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
@@ -183,7 +183,7 @@ UninstallList::add_errors_for_system()
v != v_end && ! needed ; ++v)
{
const std::shared_ptr<const PackageIDSequence> virtuals((*_imp->env)[selection::AllVersionsUnsorted(
- generator::Matches(**v, { }))]);
+ generator::Matches(**v, l->package_id(), { }))]);
for (PackageIDSequence::ConstIterator i(virtuals->begin()), i_end(virtuals->end()) ;
i != i_end && ! needed ; ++i)
if (match_package_in_set(*_imp->env, *system, *i, { }))
@@ -330,8 +330,8 @@ namespace
std::shared_ptr<const PackageIDSequence> m(
best_only ?
- (*env)[selection::BestVersionOnly(generator::Matches(*node.spec(), { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))] :
- (*env)[selection::AllVersionsSorted(generator::Matches(*node.spec(), { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
+ (*env)[selection::BestVersionOnly(generator::Matches(*node.spec(), pkg, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))] :
+ (*env)[selection::AllVersionsSorted(generator::Matches(*node.spec(), pkg, { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
for (PackageIDSequence::ConstIterator it = m->begin(), it_end = m->end();
it_end != it; ++it)
matches->insert(make_named_values<DepTagEntry>(
diff --git a/paludis/legacy/uninstall_task.cc b/paludis/legacy/uninstall_task.cc
index 98bf9efcf..45aa3d37e 100644
--- a/paludis/legacy/uninstall_task.cc
+++ b/paludis/legacy/uninstall_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
@@ -179,7 +179,7 @@ UninstallTask::add_target(const std::string & target)
{
/* blech. wildcards. */
std::shared_ptr<const PackageIDSequence> names((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(*pds, { }) | filter::SupportsAction<UninstallAction>())]);
+ generator::Matches(*pds, make_null_shared_ptr(), { }) | filter::SupportsAction<UninstallAction>())]);
if (names->empty())
{
/* no match. we'll get an error from this later anyway. */
@@ -263,7 +263,7 @@ UninstallTask::execute()
Context local_context("When looking for target '" + stringify(**t) + "':");
std::shared_ptr<const PackageIDSequence> r((*_imp->env)[selection::AllVersionsSorted(
- generator::Matches(**t, { }) |
+ generator::Matches(**t, make_null_shared_ptr(), { }) |
filter::SupportsAction<UninstallAction>())]);
if (r->empty())
{
@@ -331,7 +331,7 @@ UninstallTask::execute()
{
bool remove(true);
std::shared_ptr<const PackageIDSequence> installed((*_imp->env)[selection::AllVersionsUnsorted(
- generator::Matches(make_package_dep_spec({ }).package(i->first), { }) |
+ generator::Matches(make_package_dep_spec({ }).package(i->first), make_null_shared_ptr(), { }) |
filter::InstalledAtRoot(_imp->env->preferred_root_key()->value())
)]);
for (PackageIDSequence::ConstIterator r(installed->begin()), r_end(installed->end()) ;
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index 0bc470bdf..ef0141346 100644
--- a/paludis/match_package.cc
+++ b/paludis/match_package.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
@@ -35,6 +35,7 @@
#include <paludis/additional_package_dep_spec_requirement.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <functional>
#include <algorithm>
@@ -81,6 +82,7 @@ paludis::match_package_with_maybe_changes(
const PackageDepSpec & spec,
const ChangedChoices * const maybe_changes_to_owner,
const std::shared_ptr<const PackageID> & id,
+ const std::shared_ptr<const PackageID> &,
const ChangedChoices * const maybe_changes_to_target,
const MatchPackageOptions & options)
{
@@ -219,9 +221,10 @@ paludis::match_package(
const Environment & env,
const PackageDepSpec & spec,
const std::shared_ptr<const PackageID> & id,
+ const std::shared_ptr<const PackageID> & from_id,
const MatchPackageOptions & options)
{
- return match_package_with_maybe_changes(env, spec, 0, id, 0, options);
+ return match_package_with_maybe_changes(env, spec, 0, id, from_id, 0, options);
}
bool
@@ -237,6 +240,6 @@ paludis::match_package_in_set(
target.top()->accept(f);
return indirect_iterator(f.end()) != std::find_if(
indirect_iterator(f.begin()), indirect_iterator(f.end()),
- std::bind(&match_package, std::cref(env), _1, std::cref(id), std::cref(options)));
+ std::bind(&match_package, std::cref(env), _1, std::cref(id), make_null_shared_ptr(), std::cref(options)));
}
diff --git a/paludis/match_package.hh b/paludis/match_package.hh
index f1a67ed04..992ef1648 100644
--- a/paludis/match_package.hh
+++ b/paludis/match_package.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 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
@@ -44,12 +44,18 @@ namespace paludis
* Return whether the specified PackageID matches the specified
* PackageDepSpec.
*
+ * \param spec_id The PackageID the spec comes from. May be null. Used for
+ * [use=] style dependencies.
+ *
+ * \since 0.58 takes spec_id
+ *
* \ingroup g_query
*/
bool match_package(
const Environment & env,
const PackageDepSpec & spec,
const std::shared_ptr<const PackageID> & id,
+ const std::shared_ptr<const PackageID> & spec_id,
const MatchPackageOptions & options)
PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE;
@@ -58,6 +64,11 @@ namespace paludis
* PackageDepSpec, with the specified ChangedChoices applied to the target
* and the ID from which the dep came.
*
+ * \param spec_id The PackageID the spec comes from. May be null. Used for
+ * [use=] style dependencies.
+ *
+ * \since 0.58 takes spec_id
+ *
* \ingroup g_query
* \since 0.51
*/
@@ -66,6 +77,7 @@ namespace paludis
const PackageDepSpec & spec,
const ChangedChoices * const maybe_changes_to_owner,
const std::shared_ptr<const PackageID> & id,
+ const std::shared_ptr<const PackageID> & spec_id,
const ChangedChoices * const maybe_changes_to_target,
const MatchPackageOptions & options)
PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE;
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index 17e978b88..2a239dfb0 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -42,6 +42,7 @@
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/member_iterator.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <functional>
#include <algorithm>
#include <list>
@@ -279,7 +280,7 @@ PackageDatabase::fetch_unique_qualified_package_name(const PackageNamePart & p,
std::set<std::pair<CategoryNamePart, RepositoryName>, CategoryRepositoryNamePairComparator> checked;
std::shared_ptr<const PackageIDSequence> pkgs((*_imp->environment)[selection::AllVersionsUnsorted(
- generator::Matches(make_package_dep_spec({ }).package_name_part(p), { }) | f)]);
+ generator::Matches(make_package_dep_spec({ }).package_name_part(p), make_null_shared_ptr(), { }) | f)]);
for (IndirectIterator<PackageIDSequence::ConstIterator> it(pkgs->begin()),
it_end(pkgs->end()); it_end != it; ++it)
diff --git a/paludis/package_dep_spec_collection.cc b/paludis/package_dep_spec_collection.cc
index b18247281..73e08876a 100644
--- a/paludis/package_dep_spec_collection.cc
+++ b/paludis/package_dep_spec_collection.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,13 +32,19 @@ namespace paludis
template <>
struct Imp<PackageDepSpecCollection>
{
+ const std::shared_ptr<const PackageID> from_id;
std::multimap<QualifiedPackageName, PackageDepSpec> by_name;
std::list<PackageDepSpec> unnamed;
+
+ Imp(const std::shared_ptr<const PackageID> & i) :
+ from_id(i)
+ {
+ }
};
}
-PackageDepSpecCollection::PackageDepSpecCollection() :
- Pimp<PackageDepSpecCollection>()
+PackageDepSpecCollection::PackageDepSpecCollection(const std::shared_ptr<const PackageID> & i) :
+ Pimp<PackageDepSpecCollection>(i)
{
}
@@ -61,12 +67,12 @@ PackageDepSpecCollection::match_any(
{
auto named(_imp->by_name.equal_range(id->name()));
for ( ; named.first != named.second ; ++named.first)
- if (match_package(*env, named.first->second, id, opts))
+ if (match_package(*env, named.first->second, id, _imp->from_id, opts))
return true;
for (auto u(_imp->unnamed.begin()), u_end(_imp->unnamed.end()) ;
u != u_end ; ++u)
- if (match_package(*env, *u, id, opts))
+ if (match_package(*env, *u, id, _imp->from_id, opts))
return true;
return false;
diff --git a/paludis/package_dep_spec_collection.hh b/paludis/package_dep_spec_collection.hh
index 7ce3beb2f..673bd334f 100644
--- a/paludis/package_dep_spec_collection.hh
+++ b/paludis/package_dep_spec_collection.hh
@@ -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
@@ -34,7 +34,7 @@ namespace paludis
private Pimp<PackageDepSpecCollection>
{
public:
- PackageDepSpecCollection();
+ explicit PackageDepSpecCollection(const std::shared_ptr<const PackageID> & from_id);
~PackageDepSpecCollection();
void insert(const PackageDepSpec &);
diff --git a/paludis/paludislike_options_conf.cc b/paludis/paludislike_options_conf.cc
index f58b296f4..59fb38d16 100644
--- a/paludis/paludislike_options_conf.cc
+++ b/paludis/paludislike_options_conf.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
@@ -32,6 +32,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/active_object_ptr.hh>
#include <paludis/util/deferred_construction_ptr.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/choice.hh>
#include <paludis/dep_spec.hh>
#include <paludis/name.hh>
@@ -426,7 +427,7 @@ namespace
{
if (maybe_id)
{
- if (! match_package(*env, i->spec(), maybe_id, { }))
+ if (! match_package(*env, i->spec(), maybe_id, make_null_shared_ptr(), { }))
continue;
}
else
@@ -453,7 +454,7 @@ namespace
{
if (maybe_id)
{
- if (! match_package(*env, i->spec(), maybe_id, { }))
+ if (! match_package(*env, i->spec(), maybe_id, make_null_shared_ptr(), { }))
continue;
}
else
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index d880933be..471d3acd4 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
* Copyright (c) 2006 Danny van Dyk
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -670,7 +670,7 @@ ERepository::repository_masked(const std::shared_ptr<const PackageID> & id) cons
else
for (std::list<std::pair<std::shared_ptr<const PackageDepSpec>, std::shared_ptr<const RepositoryMaskInfo> > >::const_iterator
k(r->second.begin()), k_end(r->second.end()) ; k != k_end ; ++k)
- if (match_package(*_imp->params.environment(), *k->first, id, { }))
+ if (match_package(*_imp->params.environment(), *k->first, id, make_null_shared_ptr(), { }))
return k->second;
return std::shared_ptr<const RepositoryMaskInfo>();
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 705970bd4..bdfe329e6 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.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/util/set.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/util/fs_stat.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_id.hh>
@@ -497,7 +498,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(id1->end_metadata() != id1->find_metadata("EAPI"));
TEST_CHECK(simple_visitor_cast<const MetadataValueKey<std::string> >(**id1->find_metadata("EAPI")));
@@ -516,7 +517,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id2(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-2",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(id2->end_metadata() != id2->find_metadata("EAPI"));
TEST_CHECK(bool(id2->short_description_key()));
@@ -532,7 +533,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id3(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-3",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(id3->end_metadata() != id3->find_metadata("EAPI"));
TEST_CHECK(bool(id3->short_description_key()));
@@ -578,7 +579,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-two-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(id1->end_metadata() != id1->find_metadata("EAPI"));
TEST_CHECK_EQUAL(std::static_pointer_cast<const erepository::ERepositoryID>(id1)->eapi()->name(), "UNKNOWN");
@@ -622,13 +623,13 @@ namespace test_cases
const std::shared_ptr<const PackageID> p1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
const std::shared_ptr<const PackageID> p2(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-two/pkg-two-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
const std::shared_ptr<const PackageID> p4(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-2",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
test_choice(p1, "flag1", true, true, false);
test_choice(p1, "flag2", false, false, true);
@@ -709,29 +710,29 @@ namespace test_cases
TEST_CHECK((*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=category/package-1::test-repo-18",
- &env, { })), { }))]->begin())->masked());
+ &env, { })), make_null_shared_ptr(), { }))]->begin())->masked());
TEST_CHECK((*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=category/package-2::test-repo-18",
- &env, { })), { }))]->begin())->masked());
+ &env, { })), make_null_shared_ptr(), { }))]->begin())->masked());
TEST_CHECK(! (*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=category/package-3::test-repo-18",
- &env, { })), { }))]->begin())->masked());
+ &env, { })), make_null_shared_ptr(), { }))]->begin())->masked());
TEST_CHECK(! (*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=category/package-4::test-repo-18",
- &env, { })), { }))]->begin())->masked());
+ &env, { })), make_null_shared_ptr(), { }))]->begin())->masked());
TEST_CHECK((*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=category/package-1::test-repo-19",
- &env, { })), { }))]->begin())->masked());
+ &env, { })), make_null_shared_ptr(), { }))]->begin())->masked());
TEST_CHECK(! (*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=category/package-2::test-repo-19",
- &env, { })), { }))]->begin())->masked());
+ &env, { })), make_null_shared_ptr(), { }))]->begin())->masked());
TEST_CHECK((*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=category/package-3::test-repo-19",
- &env, { })), { }))]->begin())->masked());
+ &env, { })), make_null_shared_ptr(), { }))]->begin())->masked());
TEST_CHECK(! (*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=category/package-4::test-repo-19",
- &env, { })), { }))]->begin())->masked());
+ &env, { })), make_null_shared_ptr(), { }))]->begin())->masked());
}
} test_e_repository_repository_masks;
@@ -759,13 +760,13 @@ namespace test_cases
TEST_CHECK((*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/masked-0",
- &env, { })), { }))]->begin())->masked());
+ &env, { })), make_null_shared_ptr(), { }))]->begin())->masked());
TEST_CHECK(! (*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/was_masked-0",
- &env, { })), { }))]->begin())->masked());
+ &env, { })), make_null_shared_ptr(), { }))]->begin())->masked());
TEST_CHECK(! (*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/not_masked-0",
- &env, { })), { }))]->begin())->masked());
+ &env, { })), make_null_shared_ptr(), { }))]->begin())->masked());
}
}
} test_e_repository_query_profile_masks;
@@ -944,7 +945,7 @@ namespace test_cases
TestMessageSuffix suffix("no files", true);
const std::shared_ptr<const PackageID> no_files_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/no-files",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(no_files_id));
TEST_CHECK(bool(no_files_id->short_description_key()));
TEST_CHECK_EQUAL(no_files_id->short_description_key()->value(), "The Short Description");
@@ -955,7 +956,7 @@ namespace test_cases
TestMessageSuffix suffix("fetched files", true);
const std::shared_ptr<const PackageID> fetched_files_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/fetched-files",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(fetched_files_id));
TEST_CHECK((FSPath("e_repository_TEST_dir") / "distdir" / "already-fetched.txt").stat().is_regular_file());
fetched_files_id->perform_action(action);
@@ -967,7 +968,7 @@ namespace test_cases
TEST_CHECK(! (FSPath("e_repository_TEST_dir") / "distdir" / "fetchable-1.txt").stat().is_regular_file());
const std::shared_ptr<const PackageID> fetchable_files_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/fetchable-files",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(fetchable_files_id));
fetchable_files_id->perform_action(action);
TEST_CHECK((FSPath("e_repository_TEST_dir") / "distdir" / "fetchable-1.txt").stat().is_regular_file());
@@ -978,7 +979,7 @@ namespace test_cases
TEST_CHECK(! (FSPath("e_repository_TEST_dir") / "distdir" / "arrowed.txt").stat().is_regular_file());
const std::shared_ptr<const PackageID> arrow_files_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/arrow-files",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(arrow_files_id));
arrow_files_id->perform_action(action);
TEST_CHECK((FSPath("e_repository_TEST_dir") / "distdir" / "arrowed.txt").stat().is_regular_file());
@@ -988,7 +989,7 @@ namespace test_cases
TestMessageSuffix suffix("unfetchable files", true);
const std::shared_ptr<const PackageID> unfetchable_files_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/unfetchable-files",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(unfetchable_files_id));
TEST_CHECK_THROWS(unfetchable_files_id->perform_action(action), ActionFailedError);
}
@@ -996,7 +997,7 @@ namespace test_cases
{
const std::shared_ptr<const PackageID> no_files_restricted_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/no-files-restricted",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(no_files_restricted_id));
no_files_restricted_id->perform_action(action);
}
@@ -1004,7 +1005,7 @@ namespace test_cases
{
const std::shared_ptr<const PackageID> fetched_files_restricted_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/fetched-files-restricted",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(fetched_files_restricted_id));
fetched_files_restricted_id->perform_action(action);
}
@@ -1012,7 +1013,7 @@ namespace test_cases
{
const std::shared_ptr<const PackageID> fetchable_files_restricted_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/fetchable-files-restricted",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(fetchable_files_restricted_id));
TEST_CHECK_THROWS(fetchable_files_restricted_id->perform_action(action), ActionFailedError);
}
@@ -1050,7 +1051,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id(*env[selection::AllVersionsSorted(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("category/package",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
repo->make_manifest(id->name());
id->perform_action(action);
diff --git a/paludis/repositories/e/e_repository_TEST_0.cc b/paludis/repositories/e/e_repository_TEST_0.cc
index bb18821aa..df8e925c2 100644
--- a/paludis/repositories/e/e_repository_TEST_0.cc
+++ b/paludis/repositories/e/e_repository_TEST_0.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
@@ -30,6 +30,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_id.hh>
@@ -159,7 +160,7 @@ namespace test_cases
{
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=virtual/virtual-pretend-installed-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
}
#endif
@@ -168,7 +169,7 @@ namespace test_cases
TestMessageSuffix suffix("in-ebuild die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/in-ebuild-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -177,7 +178,7 @@ namespace test_cases
TestMessageSuffix suffix("in-subshell die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/in-subshell-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -186,7 +187,7 @@ namespace test_cases
TestMessageSuffix suffix("success", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/success",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -195,7 +196,7 @@ namespace test_cases
TestMessageSuffix suffix("unpack die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/unpack-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -204,7 +205,7 @@ namespace test_cases
TestMessageSuffix suffix("econf die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/econf-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -213,7 +214,7 @@ namespace test_cases
TestMessageSuffix suffix("emake fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/emake-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -222,7 +223,7 @@ namespace test_cases
TestMessageSuffix suffix("emake die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/emake-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -231,7 +232,7 @@ namespace test_cases
TestMessageSuffix suffix("einstall die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/einstall-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -240,7 +241,7 @@ namespace test_cases
TestMessageSuffix suffix("keepdir die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/keepdir-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -249,7 +250,7 @@ namespace test_cases
TestMessageSuffix suffix("dobin fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/dobin-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -258,7 +259,7 @@ namespace test_cases
TestMessageSuffix suffix("dobin die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/dobin-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -267,7 +268,7 @@ namespace test_cases
TestMessageSuffix suffix("fperms fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/fperms-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -276,7 +277,7 @@ namespace test_cases
TestMessageSuffix suffix("fperms die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/fperms-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -285,7 +286,7 @@ namespace test_cases
TestMessageSuffix suffix("econf source 0", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-source-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "0");
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
@@ -295,7 +296,7 @@ namespace test_cases
TestMessageSuffix suffix("doman 0", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/doman-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "0");
id->perform_action(action);
@@ -305,7 +306,7 @@ namespace test_cases
TestMessageSuffix suffix("no src_prepare 0", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/src_prepare-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "0");
id->perform_action(action);
@@ -315,7 +316,7 @@ namespace test_cases
TestMessageSuffix suffix("no src_configure 0", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/src_configure-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "0");
id->perform_action(action);
@@ -325,7 +326,7 @@ namespace test_cases
TestMessageSuffix suffix("best version", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/best-version-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -334,7 +335,7 @@ namespace test_cases
TestMessageSuffix suffix("has version", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/has-version-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -343,7 +344,7 @@ namespace test_cases
TestMessageSuffix suffix("match", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/match-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -352,7 +353,7 @@ namespace test_cases
TestMessageSuffix suffix("vars", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/vars-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -361,7 +362,7 @@ namespace test_cases
TestMessageSuffix suffix("expand vars", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/expand-vars-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -370,7 +371,7 @@ namespace test_cases
TestMessageSuffix suffix("econf disable dependency tracking", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-disable-dependency-tracking-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "0");
id->perform_action(action);
diff --git a/paludis/repositories/e/e_repository_TEST_1.cc b/paludis/repositories/e/e_repository_TEST_1.cc
index c786c2024..45a7094b9 100644
--- a/paludis/repositories/e/e_repository_TEST_1.cc
+++ b/paludis/repositories/e/e_repository_TEST_1.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
@@ -30,6 +30,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_id.hh>
@@ -138,7 +139,7 @@ namespace test_cases
TestMessageSuffix suffix("econf source 1", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-source-1",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "1");
id->perform_action(action);
@@ -148,7 +149,7 @@ namespace test_cases
TestMessageSuffix suffix("dosym success 1", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/dosym-success-1",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "1");
id->perform_action(action);
@@ -158,7 +159,7 @@ namespace test_cases
TestMessageSuffix suffix("doman 1", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/doman-1",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "1");
id->perform_action(action);
@@ -168,7 +169,7 @@ namespace test_cases
TestMessageSuffix suffix("no src_prepare 1", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/src_prepare-1",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "1");
id->perform_action(action);
@@ -178,7 +179,7 @@ namespace test_cases
TestMessageSuffix suffix("no src_configure 1", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/src_configure-1",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "1");
id->perform_action(action);
diff --git a/paludis/repositories/e/e_repository_TEST_2.cc b/paludis/repositories/e/e_repository_TEST_2.cc
index 768ff8072..c3484d74c 100644
--- a/paludis/repositories/e/e_repository_TEST_2.cc
+++ b/paludis/repositories/e/e_repository_TEST_2.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
@@ -30,6 +30,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_id.hh>
@@ -138,7 +139,7 @@ namespace test_cases
TestMessageSuffix suffix("econf source 2", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-source-2",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
id->perform_action(action);
@@ -148,7 +149,7 @@ namespace test_cases
TestMessageSuffix suffix("doman 2", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/doman-2",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
id->perform_action(action);
@@ -158,7 +159,7 @@ namespace test_cases
TestMessageSuffix suffix("src_prepare 2", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/src_prepare-2",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
@@ -168,7 +169,7 @@ namespace test_cases
TestMessageSuffix suffix("src_configure 2", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/src_configure-2",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
@@ -178,7 +179,7 @@ namespace test_cases
TestMessageSuffix suffix("default src_configure 2", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/default-src_configure-2",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
id->perform_action(action);
@@ -188,7 +189,7 @@ namespace test_cases
TestMessageSuffix suffix("default src_compile 2", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/default-src_compile-2",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
id->perform_action(action);
@@ -198,7 +199,7 @@ namespace test_cases
TestMessageSuffix suffix("default_src_compile 2", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/default_src_compile-2",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
id->perform_action(action);
@@ -208,7 +209,7 @@ namespace test_cases
TestMessageSuffix suffix("src_compile via default function 2", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/src_compile-via-default-func-2",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
id->perform_action(action);
diff --git a/paludis/repositories/e/e_repository_TEST_3.cc b/paludis/repositories/e/e_repository_TEST_3.cc
index 46942563e..aae03fe74 100644
--- a/paludis/repositories/e/e_repository_TEST_3.cc
+++ b/paludis/repositories/e/e_repository_TEST_3.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
@@ -30,6 +30,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_id.hh>
@@ -138,7 +139,7 @@ namespace test_cases
TestMessageSuffix suffix("prefix", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/prefix-3",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
id->perform_action(action);
diff --git a/paludis/repositories/e/e_repository_TEST_4.cc b/paludis/repositories/e/e_repository_TEST_4.cc
index b720681a3..4606a4379 100644
--- a/paludis/repositories/e/e_repository_TEST_4.cc
+++ b/paludis/repositories/e/e_repository_TEST_4.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
@@ -31,6 +31,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_id.hh>
@@ -145,7 +146,7 @@ namespace test_cases
TestMessageSuffix suffix("pkg_pretend", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/pkg_pretend-4",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(pretend_action);
@@ -156,7 +157,7 @@ namespace test_cases
TestMessageSuffix suffix("pkg_pretend-failure", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/pkg_pretend-failure-4",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(pretend_action);
@@ -167,7 +168,7 @@ namespace test_cases
TestMessageSuffix suffix("default_src_install 4", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/default_src_install-4",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(action);
@@ -177,7 +178,7 @@ namespace test_cases
TestMessageSuffix suffix("docompress 4", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/docompress-4",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(action);
@@ -187,7 +188,7 @@ namespace test_cases
TestMessageSuffix suffix("dodoc -r", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/dodoc-r-4",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(action);
@@ -197,7 +198,7 @@ namespace test_cases
TestMessageSuffix suffix("doins symlink", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/doins-symlink-4",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(action);
@@ -207,7 +208,7 @@ namespace test_cases
TestMessageSuffix suffix("banned functions 4", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/banned-functions-4",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
@@ -217,7 +218,7 @@ namespace test_cases
TestMessageSuffix suffix("econf disable dependency tracking", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-disable-dependency-tracking-4",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(action);
@@ -227,7 +228,7 @@ namespace test_cases
TestMessageSuffix suffix("global scope use", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/global-scope-use-4",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(action);
@@ -237,7 +238,7 @@ namespace test_cases
TestMessageSuffix suffix("doman 4", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/doman-4",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(action);
@@ -303,7 +304,7 @@ namespace test_cases
TestMessageSuffix suffix("merge type source", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/merge-type-4::test-repo",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(action);
@@ -390,7 +391,7 @@ namespace test_cases
TestMessageSuffix suffix("merge type buildonly", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/merge-type-bin-4::test-repo",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(action);
@@ -409,7 +410,7 @@ namespace test_cases
TestMessageSuffix suffix("merge type binary", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/merge-type-bin-4::binrepo",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "pbin-1+4");
id->perform_action(action);
@@ -472,7 +473,7 @@ namespace test_cases
TestMessageSuffix suffix("all good", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-all-good-4::test-repo",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(pretend_action);
@@ -489,7 +490,7 @@ namespace test_cases
TestMessageSuffix suffix("all empty", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-all-empty-4::test-repo",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(pretend_action);
@@ -506,7 +507,7 @@ namespace test_cases
TestMessageSuffix suffix("all one not good", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-all-one-not-good-4::test-repo",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(pretend_action);
@@ -523,7 +524,7 @@ namespace test_cases
TestMessageSuffix suffix("any good", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-any-good-4::test-repo",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(pretend_action);
@@ -540,7 +541,7 @@ namespace test_cases
TestMessageSuffix suffix("any empty", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-any-empty-4::test-repo",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(pretend_action);
@@ -557,7 +558,7 @@ namespace test_cases
TestMessageSuffix suffix("any none", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-any-none-4::test-repo",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(pretend_action);
@@ -574,7 +575,7 @@ namespace test_cases
TestMessageSuffix suffix("one none", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-one-none-4::test-repo",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(pretend_action);
@@ -591,7 +592,7 @@ namespace test_cases
TestMessageSuffix suffix("one none", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-one-none-4::test-repo",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(pretend_action);
@@ -608,7 +609,7 @@ namespace test_cases
TestMessageSuffix suffix("one good", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-one-good-4::test-repo",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "4");
id->perform_action(pretend_action);
diff --git a/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
index b07f79ef9..5fd479cde 100644
--- a/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
+++ b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.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
@@ -31,6 +31,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_id.hh>
@@ -106,7 +107,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("category/package",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
UnformattedPrettyPrinter ff;
diff --git a/paludis/repositories/e/e_repository_TEST_ever.cc b/paludis/repositories/e/e_repository_TEST_ever.cc
index 1d0f418ee..40711ced3 100644
--- a/paludis/repositories/e/e_repository_TEST_ever.cc
+++ b/paludis/repositories/e/e_repository_TEST_ever.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/map.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/output_manager.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/package_id.hh>
@@ -158,7 +159,7 @@ namespace
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/" + test,
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
diff --git a/paludis/repositories/e/e_repository_TEST_exheres_0.cc b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
index 8025b46ed..0772d3b4d 100644
--- a/paludis/repositories/e/e_repository_TEST_exheres_0.cc
+++ b/paludis/repositories/e/e_repository_TEST_exheres_0.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
@@ -30,6 +30,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_id.hh>
@@ -157,7 +158,7 @@ namespace test_cases
TestMessageSuffix suffix("in-ebuild die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/in-ebuild-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -166,7 +167,7 @@ namespace test_cases
TestMessageSuffix suffix("in-subshell die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/in-subshell-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -175,7 +176,7 @@ namespace test_cases
TestMessageSuffix suffix("success", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/success",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -184,7 +185,7 @@ namespace test_cases
TestMessageSuffix suffix("expatch success", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/expatch-success",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -193,7 +194,7 @@ namespace test_cases
TestMessageSuffix suffix("expatch success-dir", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/expatch-success-dir",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -202,7 +203,7 @@ namespace test_cases
TestMessageSuffix suffix("expatch die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/expatch-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -211,7 +212,7 @@ namespace test_cases
TestMessageSuffix suffix("expatch unrecognised", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/expatch-unrecognised",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -220,7 +221,7 @@ namespace test_cases
TestMessageSuffix suffix("nonfatal expatch fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-expatch-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -229,7 +230,7 @@ namespace test_cases
TestMessageSuffix suffix("nonfatal expatch die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-expatch-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -238,7 +239,7 @@ namespace test_cases
TestMessageSuffix suffix("unpack die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/unpack-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -247,7 +248,7 @@ namespace test_cases
TestMessageSuffix suffix("nonfatal unpack fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-unpack-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -256,7 +257,7 @@ namespace test_cases
TestMessageSuffix suffix("nonfatal unpack die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-unpack-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -265,7 +266,7 @@ namespace test_cases
TestMessageSuffix suffix("econf fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/econf-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -274,7 +275,7 @@ namespace test_cases
TestMessageSuffix suffix("nonfatal econf", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-econf",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -283,7 +284,7 @@ namespace test_cases
TestMessageSuffix suffix("nonfatal econf die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-econf-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -292,7 +293,7 @@ namespace test_cases
TestMessageSuffix suffix("emake fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/emake-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -301,7 +302,7 @@ namespace test_cases
TestMessageSuffix suffix("nonfatal emake", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-emake",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -310,7 +311,7 @@ namespace test_cases
TestMessageSuffix suffix("nonfatal emake die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-emake-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -319,7 +320,7 @@ namespace test_cases
TestMessageSuffix suffix("einstall fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/einstall-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -328,7 +329,7 @@ namespace test_cases
TestMessageSuffix suffix("nonfatal einstall", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-einstall",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -337,7 +338,7 @@ namespace test_cases
TestMessageSuffix suffix("nonfatal einstall die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-einstall-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -346,7 +347,7 @@ namespace test_cases
TestMessageSuffix suffix("keepdir success", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/keepdir-success",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -355,7 +356,7 @@ namespace test_cases
TestMessageSuffix suffix("keepdir fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/keepdir-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -364,7 +365,7 @@ namespace test_cases
TestMessageSuffix suffix("nonfatal keepdir", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-keepdir",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -373,7 +374,7 @@ namespace test_cases
TestMessageSuffix suffix("nonfatal keepdir die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-keepdir-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -382,7 +383,7 @@ namespace test_cases
TestMessageSuffix suffix("dobin success", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/dobin-success",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -391,7 +392,7 @@ namespace test_cases
TestMessageSuffix suffix("dobin fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/dobin-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -400,7 +401,7 @@ namespace test_cases
TestMessageSuffix suffix("nonfatal dobin success", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-dobin-success",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -409,7 +410,7 @@ namespace test_cases
TestMessageSuffix suffix("nonfatal dobin fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-dobin-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -418,7 +419,7 @@ namespace test_cases
TestMessageSuffix suffix("nonfatal dobin die", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-dobin-die",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -427,7 +428,7 @@ namespace test_cases
TestMessageSuffix suffix("herebin success", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/herebin-success",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -436,7 +437,7 @@ namespace test_cases
TestMessageSuffix suffix("herebin fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/herebin-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -445,7 +446,7 @@ namespace test_cases
TestMessageSuffix suffix("hereconfd success", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/hereconfd-success",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -454,7 +455,7 @@ namespace test_cases
TestMessageSuffix suffix("hereconfd fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/hereconfd-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -463,7 +464,7 @@ namespace test_cases
TestMessageSuffix suffix("hereenvd success", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/hereenvd-success",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -472,7 +473,7 @@ namespace test_cases
TestMessageSuffix suffix("hereenvd fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/hereenvd-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -481,7 +482,7 @@ namespace test_cases
TestMessageSuffix suffix("hereinitd success", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/hereinitd-success",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -490,7 +491,7 @@ namespace test_cases
TestMessageSuffix suffix("hereinitd fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/hereinitd-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -499,7 +500,7 @@ namespace test_cases
TestMessageSuffix suffix("hereins success", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/hereins-success",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -508,7 +509,7 @@ namespace test_cases
TestMessageSuffix suffix("hereins fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/hereins-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -517,7 +518,7 @@ namespace test_cases
TestMessageSuffix suffix("heresbin success", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/heresbin-success",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -526,7 +527,7 @@ namespace test_cases
TestMessageSuffix suffix("heresbin fail", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/heresbin-fail",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -535,7 +536,7 @@ namespace test_cases
TestMessageSuffix suffix("best version", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/best-version-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -544,7 +545,7 @@ namespace test_cases
TestMessageSuffix suffix("has version", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/has-version-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -553,7 +554,7 @@ namespace test_cases
TestMessageSuffix suffix("match", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/match-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -562,7 +563,7 @@ namespace test_cases
TestMessageSuffix suffix("econf phase", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-phase-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -571,7 +572,7 @@ namespace test_cases
TestMessageSuffix suffix("econf vars", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-vars-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -580,7 +581,7 @@ namespace test_cases
TestMessageSuffix suffix("expand vars", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/expand-vars-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -589,7 +590,7 @@ namespace test_cases
TestMessageSuffix suffix("doman success", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/doman-success-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -598,7 +599,7 @@ namespace test_cases
TestMessageSuffix suffix("doman nofatal", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/doman-nonfatal-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -607,7 +608,7 @@ namespace test_cases
TestMessageSuffix suffix("doman failure", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/doman-failure-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -616,7 +617,7 @@ namespace test_cases
TestMessageSuffix suffix("change globals", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/change-globals-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -625,7 +626,7 @@ namespace test_cases
TestMessageSuffix suffix("install", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/install-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
}
@@ -634,7 +635,7 @@ namespace test_cases
TestMessageSuffix suffix("install s", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/install-s-0",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
@@ -643,7 +644,7 @@ namespace test_cases
TestMessageSuffix suffix("global optionq", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/global-optionq-1",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
}
diff --git a/paludis/repositories/e/e_repository_TEST_exlibs.cc b/paludis/repositories/e/e_repository_TEST_exlibs.cc
index 10ad171cf..1cc63723a 100644
--- a/paludis/repositories/e/e_repository_TEST_exlibs.cc
+++ b/paludis/repositories/e/e_repository_TEST_exlibs.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) 2009 Bo ├śrsted Andresen
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -31,6 +31,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
@@ -152,7 +153,7 @@ namespace
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/" + test,
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
switch (expected_result)
{
diff --git a/paludis/repositories/e/e_repository_TEST_pbin.cc b/paludis/repositories/e/e_repository_TEST_pbin.cc
index a940010cf..acd4cf9dc 100644
--- a/paludis/repositories/e/e_repository_TEST_pbin.cc
+++ b/paludis/repositories/e/e_repository_TEST_pbin.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
@@ -31,6 +31,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/util/fs_stat.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_id.hh>
@@ -169,7 +170,7 @@ namespace test_cases
TestMessageSuffix suffix("prefix", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/simple-1",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), base_eapi);
id->perform_action(bin_action);
@@ -190,7 +191,7 @@ namespace test_cases
TestMessageSuffix suffix("prefix", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/simple-1::binrepo" + base_eapi,
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(),
"pbin-1+" + base_eapi);
diff --git a/paludis/repositories/e/e_repository_TEST_phases.cc b/paludis/repositories/e/e_repository_TEST_phases.cc
index ef73cbc0b..b8cb0a43f 100644
--- a/paludis/repositories/e/e_repository_TEST_phases.cc
+++ b/paludis/repositories/e/e_repository_TEST_phases.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/map.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/output_manager.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/package_id.hh>
@@ -168,7 +169,7 @@ namespace
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/" + test,
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
TEST_CHECK_EQUAL(!! id->choices_key()->value()->find_by_name_with_prefix(
ChoiceNameWithPrefix("build_options:expensive_tests")), expect_expensive_test);
diff --git a/paludis/repositories/e/e_repository_TEST_replacing.cc b/paludis/repositories/e/e_repository_TEST_replacing.cc
index e873be448..53b4b12ce 100644
--- a/paludis/repositories/e/e_repository_TEST_replacing.cc
+++ b/paludis/repositories/e/e_repository_TEST_replacing.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
@@ -26,6 +26,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/util/map.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
@@ -143,7 +144,7 @@ namespace
const std::shared_ptr<const PackageIDSequence> rlist(env[selection::AllVersionsSorted(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(replacing, &env, { })),
- { }) |
+ make_null_shared_ptr(), { }) |
filter::InstalledAtRoot(env.preferred_root_key()->value()))]);
InstallAction action(make_named_values<InstallActionOptions>(
@@ -156,7 +157,7 @@ namespace
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/" + test,
- &env, { })), { }) |
+ &env, { })), make_null_shared_ptr(), { }) |
filter::SupportsAction<InstallAction>())]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
diff --git a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
index afec5f7c6..e92c754c3 100644
--- a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
+++ b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.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
@@ -32,6 +32,7 @@
#include <paludis/util/set.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
@@ -140,7 +141,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/pkg",
- &env, { })), { }))]->last());
+ &env, { })), make_null_shared_ptr(), { }))]->last());
TEST_CHECK(bool(id));
id->perform_action(action);
diff --git a/paludis/repositories/e/e_repository_news.cc b/paludis/repositories/e/e_repository_news.cc
index da7df1e91..d37d1fca6 100644
--- a/paludis/repositories/e/e_repository_news.cc
+++ b/paludis/repositories/e/e_repository_news.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/util/fs_path.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/environment.hh>
#include <paludis/distribution.hh>
@@ -177,7 +178,7 @@ ERepositoryNews::update_news() const
generator::Matches(PackageDepSpec(parse_elike_package_dep_spec(*i,
eapi.supported()->package_dep_spec_parse_options(),
eapi.supported()->version_spec_options(),
- std::shared_ptr<const PackageID>())), { }) |
+ std::shared_ptr<const PackageID>())), make_null_shared_ptr(), { }) |
filter::InstalledAtRoot(_imp->environment->preferred_root_key()->value()))]->empty())
local_show = true;
show &= local_show;
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc
index 8dd8ab614..7005da784 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.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
* Copyright (c) 2008 David Leverton
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -34,6 +34,7 @@
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/timestamp.hh>
#include <paludis/util/fs_stat.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <iterator>
@@ -77,7 +78,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "the-description-flat_list");
@@ -105,7 +106,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-stale-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id1->short_description_key()));
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Generated Description flat_list-stale");
@@ -134,7 +135,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-guessed-eapi-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id1->short_description_key()));
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Generated Description flat_list-guessed-eapi");
@@ -162,7 +163,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-eclass-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "the-description-flat_list-eclass");
@@ -193,7 +194,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-eclass-stale-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id1->short_description_key()));
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Generated Description flat_list-eclass-stale");
@@ -221,7 +222,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-eclass-wrong-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id1->short_description_key()));
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Generated Description flat_list-eclass-wrong");
@@ -249,7 +250,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-eclass-gone-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id1->short_description_key()));
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Generated Description flat_list-eclass-gone");
@@ -277,7 +278,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_list-detection-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "the-description-flat_list-detection");
@@ -305,7 +306,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "the-description-flat_hash");
@@ -334,7 +335,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-guessed-eapi-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id1->short_description_key()));
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Generated Description flat_hash-guessed-eapi");
@@ -362,7 +363,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-guessed-eapi-extension-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id1->short_description_key()));
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Generated Description flat_hash-guessed-eapi-extension");
@@ -390,7 +391,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-no-guessed-eapi-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "the-description-flat_hash-no-guessed-eapi");
@@ -418,7 +419,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-empty-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "");
@@ -447,7 +448,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-stale-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id1->short_description_key()));
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Generated Description flat_hash-stale");
@@ -475,7 +476,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-no-mtime-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id1->short_description_key()));
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "the-description-flat_hash-no-mtime");
@@ -503,7 +504,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-no-mtime-stale-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id1->short_description_key()));
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Generated Description flat_hash-no-mtime-stale");
@@ -531,7 +532,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-bad-mtime-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id1->short_description_key()));
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Generated Description flat_hash-bad-mtime");
@@ -559,7 +560,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-no-eapi-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id1->short_description_key()));
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Generated Description flat_hash-no-eapi");
@@ -587,7 +588,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-duplicate-key-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id1->short_description_key()));
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Generated Description flat_hash-duplicate-key");
@@ -615,7 +616,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclass-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "the-description-flat_hash-eclass");
@@ -646,7 +647,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclass-stale-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Generated Description flat_hash-eclass-stale");
@@ -674,7 +675,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclass-wrong-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Generated Description flat_hash-eclass-wrong");
@@ -701,7 +702,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclass-gone-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Generated Description flat_hash-eclass-gone");
@@ -729,7 +730,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-full-eclass-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "the-description-flat_hash-full-eclass");
@@ -760,7 +761,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-full-eclass-nonstandard-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "the-description-flat_hash-full-eclass-nonstandard");
@@ -791,7 +792,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-full-eclass-stale-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Generated Description flat_hash-full-eclass-stale");
@@ -819,7 +820,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-full-eclass-wrong-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Generated Description flat_hash-full-eclass-wrong");
@@ -847,7 +848,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-full-eclass-gone-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Generated Description flat_hash-full-eclass-gone");
@@ -875,14 +876,14 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclasses-truncated-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Generated Description flat_hash-eclasses-truncated");
std::shared_ptr<const PackageID> id2(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclasses-truncated-2",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id2->short_description_key()));
TEST_CHECK_EQUAL(id2->short_description_key()->value(), "The Generated Description flat_hash-eclasses-truncated-2");
@@ -910,7 +911,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclasses-bad-mtime-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Generated Description flat_hash-eclasses-bad-mtime");
@@ -938,7 +939,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclasses-spaces-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Generated Description flat_hash-eclasses-spaces");
@@ -967,7 +968,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlib-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "the-description-flat_hash-exlib");
@@ -999,7 +1000,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlib-percat-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "the-description-flat_hash-exlib-percat");
@@ -1031,7 +1032,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlib-stale-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Generated Description flat_hash-exlib-stale");
@@ -1060,7 +1061,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlib-wrong-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Generated Description flat_hash-exlib-wrong");
@@ -1089,7 +1090,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlib-gone-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Generated Description flat_hash-exlib-gone");
@@ -1118,14 +1119,14 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlibs-truncated-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Generated Description flat_hash-exlibs-truncated");
std::shared_ptr<const PackageID> id2(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlibs-truncated-2",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id2->short_description_key()));
TEST_CHECK_EQUAL(id2->short_description_key()->value(), "The Generated Description flat_hash-exlibs-truncated-2");
@@ -1154,7 +1155,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlibs-bad-mtime-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Generated Description flat_hash-exlibs-bad-mtime");
@@ -1183,7 +1184,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlibs-spaces-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Generated Description flat_hash-exlibs-spaces");
@@ -1218,7 +1219,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/write-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(contents("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-1"), contents("ebuild_flat_metadata_cache_TEST_dir/cache/expected/cat/write-1"));
@@ -1254,7 +1255,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/write-eapi1-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(contents("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-eapi1-1"), contents("ebuild_flat_metadata_cache_TEST_dir/cache/expected/cat/write-eapi1-1"));
@@ -1292,7 +1293,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/write-eclasses-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(contents("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-eclasses-1"), contents("ebuild_flat_metadata_cache_TEST_dir/cache/expected/cat/write-eclasses-1"));
@@ -1329,7 +1330,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/write-exlibs-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(contents("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-exlibs-1"), contents("ebuild_flat_metadata_cache_TEST_dir/cache/expected/cat/write-exlibs-1"));
diff --git a/paludis/repositories/e/exheres_profile.cc b/paludis/repositories/e/exheres_profile.cc
index 9020e62e5..beae1cc51 100644
--- a/paludis/repositories/e/exheres_profile.cc
+++ b/paludis/repositories/e/exheres_profile.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -367,7 +367,7 @@ ExheresProfile::profile_masked(const std::shared_ptr<const PackageID> & id) cons
{
for (std::list<std::pair<std::shared_ptr<const PackageDepSpec>, std::shared_ptr<const RepositoryMaskInfo> > >::const_iterator k(rr->second.begin()),
k_end(rr->second.end()) ; k != k_end ; ++k)
- if (match_package(*_imp->env, *k->first, id, { }))
+ if (match_package(*_imp->env, *k->first, id, make_null_shared_ptr(), { }))
return k->second;
}
diff --git a/paludis/repositories/e/exndbam_repository_TEST.cc b/paludis/repositories/e/exndbam_repository_TEST.cc
index ed804688a..c48ff4d27 100644
--- a/paludis/repositories/e/exndbam_repository_TEST.cc
+++ b/paludis/repositories/e/exndbam_repository_TEST.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/make_named_values.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/fs_path.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/action.hh>
#include <paludis/filtered_generator.hh>
@@ -109,7 +110,7 @@ namespace test_cases
if (! victim.empty())
replacing->push_back(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(victim,
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
InstallAction install_action(make_named_values<InstallActionOptions>(
n::destination() = exndbam_repo,
n::make_output_manager() = &make_standard_output_manager,
@@ -119,7 +120,7 @@ namespace test_cases
));
(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(chosen_one,
- &env, { })), { }))]->begin())->perform_action(install_action);
+ &env, { })), make_null_shared_ptr(), { }))]->begin())->perform_action(install_action);
}
void run()
diff --git a/paludis/repositories/e/fetch_visitor_TEST.cc b/paludis/repositories/e/fetch_visitor_TEST.cc
index 4c9d523f7..cc3d7f33a 100644
--- a/paludis/repositories/e/fetch_visitor_TEST.cc
+++ b/paludis/repositories/e/fetch_visitor_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -26,6 +26,7 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/fs_stat.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_database.hh>
@@ -78,7 +79,7 @@ namespace test_cases
const std::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string("exheres-0"));
FetchVisitor v(&env, *env[selection::RequireExactlyOne(
generator::Matches(parse_user_package_dep_spec("=cat/pkg-1",
- &env, { }), { }))]->begin(),
+ &env, { }), make_null_shared_ptr(), { }))]->begin(),
*eapi, FSPath("fetch_visitor_TEST_dir/out"),
false, false, "test", std::make_shared<URIListedThenMirrorsLabel>("listed-then-mirrors"), false,
std::make_shared<StandardOutputManager>(), get_mirrors_fn);
diff --git a/paludis/repositories/e/fix_locked_dependencies.cc b/paludis/repositories/e/fix_locked_dependencies.cc
index e6dc55358..a17a5d51a 100644
--- a/paludis/repositories/e/fix_locked_dependencies.cc
+++ b/paludis/repositories/e/fix_locked_dependencies.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
@@ -108,7 +108,7 @@ namespace
break;
std::shared_ptr<const PackageIDSequence> matches((*env)[selection::AllVersionsSorted(
- generator::Matches(*node.spec(), { }) | filter::InstalledAtRoot(env->system_root_key()->value()))]);
+ generator::Matches(*node.spec(), id, { }) | filter::InstalledAtRoot(env->system_root_key()->value()))]);
if (matches->empty())
break;
diff --git a/paludis/repositories/e/info_metadata_key.cc b/paludis/repositories/e/info_metadata_key.cc
index a14cfbd78..ec16cb699 100644
--- a/paludis/repositories/e/info_metadata_key.cc
+++ b/paludis/repositories/e/info_metadata_key.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
@@ -32,6 +32,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/join.hh>
#include <paludis/util/fs_stat.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/selection.hh>
@@ -189,7 +190,7 @@ InfoPkgsMetadataKey::need_keys_added() const
generator::Matches(parse_elike_package_dep_spec(i->first,
eapi->supported()->package_dep_spec_parse_options(),
eapi->supported()->version_spec_options(),
- std::shared_ptr<const PackageID>()), { }) |
+ std::shared_ptr<const PackageID>()), make_null_shared_ptr(), { }) |
filter::InstalledAtRoot(_imp->env->preferred_root_key()->value()))]);
if (q->empty())
diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc
index 0e839ebec..46e9bc8a9 100644
--- a/paludis/repositories/e/pipe_command_handler.cc
+++ b/paludis/repositories/e/pipe_command_handler.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
* Copyright (c) 2009 Ingmar Vanhassel
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -277,7 +277,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
eapi->supported()->package_dep_spec_parse_options(),
eapi->supported()->version_spec_options(), package_id));
std::shared_ptr<const PackageIDSequence> entries((*environment)[selection::AllVersionsSorted(
- generator::Matches(spec, { }) | root)]);
+ generator::Matches(spec, package_id, { }) | root)]);
if (eapi->supported()->pipe_commands()->rewrite_virtuals() && (! entries->empty()) &&
(*entries->last())->virtual_for_key())
{
@@ -326,7 +326,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
eapi->supported()->package_dep_spec_parse_options(),
eapi->supported()->version_spec_options(), package_id));
std::shared_ptr<const PackageIDSequence> entries((*environment)[selection::SomeArbitraryVersion(
- generator::Matches(spec, { }) | root)]);
+ generator::Matches(spec, package_id, { }) | root)]);
if (entries->empty())
return "O1;";
else
@@ -350,7 +350,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
eapi->supported()->package_dep_spec_parse_options(),
eapi->supported()->version_spec_options(), package_id));
std::shared_ptr<const PackageIDSequence> entries((*environment)[selection::AllVersionsSorted(
- generator::Matches(spec, { }) | filter::InstalledAtRoot(environment->preferred_root_key()->value()))]);
+ generator::Matches(spec, package_id, { }) | filter::InstalledAtRoot(environment->preferred_root_key()->value()))]);
if (eapi->supported()->pipe_commands()->rewrite_virtuals() && (! entries->empty()))
{
std::shared_ptr<PackageIDSequence> new_entries(std::make_shared<PackageIDSequence>());
diff --git a/paludis/repositories/e/traditional_profile.cc b/paludis/repositories/e/traditional_profile.cc
index ce8cee8d9..94aecd78c 100644
--- a/paludis/repositories/e/traditional_profile.cc
+++ b/paludis/repositories/e/traditional_profile.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -43,6 +43,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/fs_stat.hh>
#include <paludis/util/fs_error.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/choice.hh>
#include <paludis/dep_tag.hh>
@@ -872,7 +873,7 @@ TraditionalProfile::use_masked(
for (PackageFlagStatusMapList::const_iterator g(i->package_use_mask.begin()),
g_end(i->package_use_mask.end()) ; g != g_end ; ++g)
{
- if (! match_package(*_imp->env, *g->first, id, { }))
+ if (! match_package(*_imp->env, *g->first, id, make_null_shared_ptr(), { }))
continue;
FlagStatusMap::const_iterator h(g->second.find(value_prefixed));
@@ -908,7 +909,7 @@ TraditionalProfile::use_forced(
for (PackageFlagStatusMapList::const_iterator g(i->package_use_force.begin()),
g_end(i->package_use_force.end()) ; g != g_end ; ++g)
{
- if (! match_package(*_imp->env, *g->first, id, { }))
+ if (! match_package(*_imp->env, *g->first, id, make_null_shared_ptr(), { }))
continue;
FlagStatusMap::const_iterator h(g->second.find(value_prefixed));
@@ -937,7 +938,7 @@ TraditionalProfile::use_state_ignoring_masks(
for (PackageFlagStatusMapList::const_iterator g(i->package_use.begin()),
g_end(i->package_use.end()) ; g != g_end ; ++g)
{
- if (! match_package(*_imp->env, *g->first, id, { }))
+ if (! match_package(*_imp->env, *g->first, id, make_null_shared_ptr(), { }))
continue;
FlagStatusMap::const_iterator h(g->second.find(value_prefixed));
@@ -1046,7 +1047,7 @@ TraditionalProfile::profile_masked(const std::shared_ptr<const PackageID> & id)
{
for (std::list<std::pair<std::shared_ptr<const PackageDepSpec>, std::shared_ptr<const RepositoryMaskInfo> > >::const_iterator k(rr->second.begin()),
k_end(rr->second.end()) ; k != k_end ; ++k)
- if (match_package(*_imp->env, *k->first, id, { }))
+ if (match_package(*_imp->env, *k->first, id, make_null_shared_ptr(), { }))
return k->second;
}
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index f4901e86a..3318279ef 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.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
@@ -1443,7 +1443,7 @@ VDBRepository::perform_updates()
SlotName old_slot(tokens.at(2)), new_slot(tokens.at(3));
const std::shared_ptr<const PackageIDSequence> ids((*_imp->params.environment())[selection::AllVersionsSorted(
- (generator::Matches(old_spec, { }) & generator::InRepository(name())) |
+ (generator::Matches(old_spec, make_null_shared_ptr(), { }) & generator::InRepository(name())) |
filter::Slot(old_slot)
)]);
if (! ids->empty())
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index a0205b5ec..e28ba6f31 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.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
@@ -153,7 +153,7 @@ namespace test_cases
std::shared_ptr<const PackageID> e1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(e1->choices_key()));
TEST_CHECK(bool(e1->choices_key()->value()));
@@ -224,7 +224,7 @@ namespace test_cases
std::shared_ptr<const PackageID> e1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
ContentsGatherer gatherer;
std::for_each(indirect_iterator(e1->contents_key()->value()->begin()),
indirect_iterator(e1->contents_key()->value()->end()),
@@ -278,7 +278,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("category/package",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
UnformattedPrettyPrinter ff;
@@ -381,7 +381,7 @@ namespace test_cases
TestMessageSuffix suffix("install", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::srcrepo",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id));
id->perform_action(install_action);
}
@@ -392,7 +392,7 @@ namespace test_cases
TestMessageSuffix suffix("reinstall", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::srcrepo",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id));
id->perform_action(install_action);
}
@@ -403,7 +403,7 @@ namespace test_cases
TestMessageSuffix suffix("info", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id));
id->perform_action(info_action);
}
@@ -412,7 +412,7 @@ namespace test_cases
TestMessageSuffix suffix("config", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id));
id->perform_action(config_action);
}
@@ -421,7 +421,7 @@ namespace test_cases
TestMessageSuffix suffix("uninstall", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id));
id->perform_action(uninstall_action);
}
@@ -511,7 +511,7 @@ namespace test_cases
TestMessageSuffix suffix("vars", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::srcrepo",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id));
id->perform_action(install_action);
}
@@ -522,7 +522,7 @@ namespace test_cases
TestMessageSuffix suffix("reinstall", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::srcrepo",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id));
id->perform_action(install_action);
}
@@ -533,7 +533,7 @@ namespace test_cases
TestMessageSuffix suffix("info", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id));
id->perform_action(info_action);
}
@@ -542,7 +542,7 @@ namespace test_cases
TestMessageSuffix suffix("config", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id));
id->perform_action(config_action);
}
@@ -551,7 +551,7 @@ namespace test_cases
TestMessageSuffix suffix("uninstall", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(bool(id));
id->perform_action(uninstall_action);
}
@@ -588,7 +588,7 @@ namespace test_cases
if (! victim.empty())
replacing->push_back(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(victim,
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
InstallAction install_action(make_named_values<InstallActionOptions>(
n::destination() = vdb_repo,
n::make_output_manager() = &make_standard_output_manager,
@@ -598,7 +598,7 @@ namespace test_cases
));
(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(chosen_one,
- &env, { })), { }))]->begin())->perform_action(install_action);
+ &env, { })), make_null_shared_ptr(), { }))]->begin())->perform_action(install_action);
}
void run()
@@ -710,7 +710,7 @@ namespace test_cases
TestMessageSuffix suffix("remove other slot", true);
const std::shared_ptr<const PackageID> inst_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat1/pkg1-2::installed",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
inst_id->perform_action(uninstall_action);
vdb_repo->invalidate();
@@ -739,7 +739,7 @@ namespace test_cases
TestMessageSuffix suffix("remove other package", true);
const std::shared_ptr<const PackageID> inst_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat1/pkg2-1::installed",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
inst_id->perform_action(uninstall_action);
vdb_repo->invalidate();
@@ -766,7 +766,7 @@ namespace test_cases
TestMessageSuffix suffix("remove other category", true);
const std::shared_ptr<const PackageID> inst_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat2/pkg1-1::installed",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
inst_id->perform_action(uninstall_action);
vdb_repo->invalidate();
@@ -781,7 +781,7 @@ namespace test_cases
TestMessageSuffix suffix("uninstall", true);
const std::shared_ptr<const PackageID> inst_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat1/pkg1-1::installed",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
inst_id->perform_action(uninstall_action);
vdb_repo->invalidate();
@@ -955,7 +955,7 @@ namespace test_cases
if (! victim.empty())
replacing->push_back(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(victim,
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
InstallAction install_action(make_named_values<InstallActionOptions>(
n::destination() = vdb_repo,
n::make_output_manager() = &make_standard_output_manager,
@@ -965,7 +965,7 @@ namespace test_cases
));
(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(chosen_one,
- &env, { })), { }))]->begin())->perform_action(install_action);
+ &env, { })), make_null_shared_ptr(), { }))]->begin())->perform_action(install_action);
}
void run()
@@ -1085,7 +1085,7 @@ namespace test_cases
TestMessageSuffix suffix("remove other slot", true);
const std::shared_ptr<const PackageID> inst_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat1/pkg1-2::installed",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
inst_id->perform_action(uninstall_action);
vdb_repo->invalidate();
@@ -1104,7 +1104,7 @@ namespace test_cases
TestMessageSuffix suffix("remove other package", true);
const std::shared_ptr<const PackageID> inst_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat1/pkg2-1::installed",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
inst_id->perform_action(uninstall_action);
vdb_repo->invalidate();
@@ -1115,7 +1115,7 @@ namespace test_cases
TestMessageSuffix suffix("uninstall", true);
const std::shared_ptr<const PackageID> inst_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat1/pkg1-1::installed",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
inst_id->perform_action(uninstall_action);
vdb_repo->invalidate();
@@ -1224,7 +1224,7 @@ namespace test_cases
TestMessageSuffix suffix("install", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/pkg-1::reinstalltest_src1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
id->perform_action(install_action);
vdb_repo->invalidate();
@@ -1236,7 +1236,7 @@ namespace test_cases
TestMessageSuffix suffix("reinstall", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/pkg-1::reinstalltest_src1",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
id->perform_action(install_action);
vdb_repo->invalidate();
@@ -1248,7 +1248,7 @@ namespace test_cases
TestMessageSuffix suffix("reinstall equivalent", true);
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/pkg-1::reinstalltest_src2",
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
id->perform_action(install_action);
vdb_repo->invalidate();
@@ -1281,7 +1281,7 @@ namespace test_cases
if (! victim.empty())
replacing->push_back(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(victim,
- &env, { })), { }))]->begin());
+ &env, { })), make_null_shared_ptr(), { }))]->begin());
InstallAction install_action(make_named_values<InstallActionOptions>(
n::destination() = vdb_repo,
n::make_output_manager() = &make_standard_output_manager,
@@ -1291,7 +1291,7 @@ namespace test_cases
));
(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(chosen_one,
- &env, { })), { }))]->begin())->perform_action(install_action);
+ &env, { })), make_null_shared_ptr(), { }))]->begin())->perform_action(install_action);
}
void run()
diff --git a/paludis/repositories/e/vdb_unmerger_TEST.cc b/paludis/repositories/e/vdb_unmerger_TEST.cc
index 5610f3dbb..c7e96c543 100644
--- a/paludis/repositories/e/vdb_unmerger_TEST.cc
+++ b/paludis/repositories/e/vdb_unmerger_TEST.cc
@@ -26,6 +26,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/fs_stat.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/package_database.hh>
@@ -129,8 +130,7 @@ namespace
n::ignore() = &ignore_nothing,
n::output_manager() = std::make_shared<StandardOutputManager>(),
n::package_id() = *env[selection::RequireExactlyOne(generator::Matches(
- parse_user_package_dep_spec("cat/" + fix(what), &env, { }),
- { }))]->begin(),
+ parse_user_package_dep_spec("cat/" + fix(what), &env, { }), make_null_shared_ptr(), { }))]->begin(),
n::root() = root_dir
));
diff --git a/paludis/repositories/unpackaged/installed_repository_TEST.cc b/paludis/repositories/unpackaged/installed_repository_TEST.cc
index cd83a654b..ff554986f 100644
--- a/paludis/repositories/unpackaged/installed_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/installed_repository_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -138,7 +138,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(
generator::Matches(parse_user_package_dep_spec("cat-one/foo:0",
- &env, { }), { }))]->begin());
+ &env, { }), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK_EQUAL(id1->version(), VersionSpec("1", { }));
TEST_CHECK_EQUAL(id1->slot_key()->value(), SlotName("0"));
@@ -156,7 +156,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id2(*env[selection::RequireExactlyOne(
generator::Matches(parse_user_package_dep_spec("cat-one/foo:1",
- &env, { }), { }))]->begin());
+ &env, { }), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK_EQUAL(id2->version(), VersionSpec("2", { }));
TEST_CHECK_EQUAL(id2->slot_key()->value(), SlotName("1"));
@@ -192,13 +192,13 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(
generator::Matches(parse_user_package_dep_spec("cat-one/foo:0",
- &env, { }), { }))]->begin());
+ &env, { }), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(! id1->masked());
const std::shared_ptr<const PackageID> id2(*env[selection::RequireExactlyOne(
generator::Matches(parse_user_package_dep_spec("cat-one/foo:1",
- &env, { }), { }))]->begin());
+ &env, { }), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(! id2->masked());
}
@@ -228,7 +228,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(
generator::Matches(parse_user_package_dep_spec("cat-one/foo:1",
- &env, { }), { }))]->begin());
+ &env, { }), make_null_shared_ptr(), { }))]->begin());
TEST_CHECK(! id1->supports_action(SupportsActionTest<InstallAction>()));
TEST_CHECK(! id1->supports_action(SupportsActionTest<ConfigAction>()));
@@ -320,7 +320,7 @@ namespace test_cases
const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(
generator::Matches(parse_user_package_dep_spec("cat-one/foo:fred",
- &env, { }), { }))]->begin());
+ &env, { }), make_null_shared_ptr(), { }))]->begin());
UninstallAction action(make_named_values<UninstallActionOptions>(
n::config_protect() = "",
@@ -585,7 +585,7 @@ namespace test_cases
));
(*env[selection::RequireExactlyOne(generator::Matches(
parse_user_package_dep_spec("cat/pkg4a",
- &env, { }), { }))]->begin())->perform_action(action);
+ &env, { }), make_null_shared_ptr(), { }))]->begin())->perform_action(action);
TEST_CHECK(FSPath("installed_repository_TEST_dir/root4/dir").stat().is_directory());
TEST_CHECK(! FSPath("installed_repository_TEST_dir/root4/dir/4a").stat().is_regular_file());
@@ -631,7 +631,7 @@ namespace test_cases
));
(*env[selection::RequireExactlyOne(generator::Matches(
parse_user_package_dep_spec("cat/pkg4b",
- &env, { }), { }))]->begin())->perform_action(action);
+ &env, { }), make_null_shared_ptr(), { }))]->begin())->perform_action(action);
TEST_CHECK(! FSPath("installed_repository_TEST_dir/root4/dir").stat().is_directory());
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index a17dce361..c1af193d1 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.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
@@ -223,7 +223,7 @@ VirtualsRepository::need_ids() const
v(_imp->names.begin()), v_end(_imp->names.end()) ; v != v_end ; ++v)
{
std::shared_ptr<const PackageIDSequence> matches((*_imp->env)[selection::AllVersionsSorted(
- generator::Matches(*v->second, { }) |
+ generator::Matches(*v->second, make_null_shared_ptr(), { }) |
filter::SupportsAction<InstallAction>())]);
if (matches->empty())
diff --git a/paludis/resolver/allowed_to_remove_helper.cc b/paludis/resolver/allowed_to_remove_helper.cc
index 9272e749d..69c16383d 100644
--- a/paludis/resolver/allowed_to_remove_helper.cc
+++ b/paludis/resolver/allowed_to_remove_helper.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/resolver/resolvent.hh>
#include <paludis/resolver/resolution.hh>
#include <paludis/util/pimp-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_dep_spec_collection.hh>
@@ -38,7 +39,8 @@ namespace paludis
PackageDepSpecCollection allowed_to_remove_specs;
Imp(const Environment * const e) :
- env(e)
+ env(e),
+ allowed_to_remove_specs(make_null_shared_ptr())
{
}
};
diff --git a/paludis/resolver/always_via_binary_helper.cc b/paludis/resolver/always_via_binary_helper.cc
index 147b58c93..abe64db6f 100644
--- a/paludis/resolver/always_via_binary_helper.cc
+++ b/paludis/resolver/always_via_binary_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -26,6 +26,7 @@
#include <paludis/resolver/destination_utils.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
@@ -43,7 +44,8 @@ namespace paludis
PackageDepSpecCollection always_via_binary_specs;
Imp(const Environment * const e) :
- env(e)
+ env(e),
+ always_via_binary_specs(make_null_shared_ptr())
{
}
};
diff --git a/paludis/resolver/can_use_helper.cc b/paludis/resolver/can_use_helper.cc
index af5e1b046..0e4613090 100644
--- a/paludis/resolver/can_use_helper.cc
+++ b/paludis/resolver/can_use_helper.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
@@ -20,6 +20,7 @@
#include <paludis/resolver/can_use_helper.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_id.hh>
#include <paludis/package_dep_spec_collection.hh>
@@ -36,7 +37,8 @@ namespace paludis
PackageDepSpecCollection cannot_use_specs;
Imp(const Environment * const e) :
- env(e)
+ env(e),
+ cannot_use_specs(make_null_shared_ptr())
{
}
};
diff --git a/paludis/resolver/collect_depped_upon.cc b/paludis/resolver/collect_depped_upon.cc
index 67e1cf517..fdfd572c7 100644
--- a/paludis/resolver/collect_depped_upon.cc
+++ b/paludis/resolver/collect_depped_upon.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
@@ -53,6 +53,7 @@ namespace
const std::shared_ptr<const PackageID> best_eventual(
const Environment * const env,
const PackageDepSpec & spec,
+ const std::shared_ptr<const PackageID> & from_id,
const S_ & seq)
{
std::shared_ptr<const PackageID> result;
@@ -61,7 +62,7 @@ namespace
i != i_end ; ++i)
{
if ((! result) || dependent_checker_id(*i)->version() >= result->version())
- if (match_package(*env, spec, dependent_checker_id(*i), { }))
+ if (match_package(*env, spec, dependent_checker_id(*i), from_id, { }))
result = dependent_checker_id(*i);
}
@@ -108,9 +109,9 @@ namespace
if (s.spec()->slot_requirement_ptr() && simple_visitor_cast<const SlotAnyUnlockedRequirement>(
*s.spec()->slot_requirement_ptr()))
{
- auto best_eventual_id(best_eventual(env, *s.spec(), newly_available));
+ auto best_eventual_id(best_eventual(env, *s.spec(), id, newly_available));
if (! best_eventual_id)
- best_eventual_id = best_eventual(env, *s.spec(), not_changing_slots);
+ best_eventual_id = best_eventual(env, *s.spec(), id, not_changing_slots);
if (best_eventual_id && best_eventual_id->slot_key())
{
PartiallyMadePackageDepSpec part_spec(*s.spec());
@@ -119,14 +120,14 @@ namespace
}
}
- if (! match_package(*env, *spec, dependent_checker_id(*g), { }))
+ if (! match_package(*env, *spec, dependent_checker_id(*g), id, { }))
continue;
bool any(false);
for (typename C_::ConstIterator n(newly_available->begin()), n_end(newly_available->end()) ;
n != n_end ; ++n)
{
- if (match_package(*env, *spec, dependent_checker_id(*n), { }))
+ if (match_package(*env, *spec, dependent_checker_id(*n), id, { }))
{
any = true;
break;
diff --git a/paludis/resolver/collect_provided.cc b/paludis/resolver/collect_provided.cc
index 4fe17d535..a0d0235f8 100644
--- a/paludis/resolver/collect_provided.cc
+++ b/paludis/resolver/collect_provided.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
@@ -50,7 +50,7 @@ paludis::resolver::collect_provided(
v != v_end ; ++v)
{
const std::shared_ptr<const PackageIDSequence> virtuals((*env)[selection::AllVersionsUnsorted(
- generator::Matches(**v, { }))]);
+ generator::Matches(**v, id, { }))]);
std::copy(virtuals->begin(), virtuals->end(), result->inserter());
}
}
diff --git a/paludis/resolver/confirm_helper.cc b/paludis/resolver/confirm_helper.cc
index 3a531b58d..f9d646504 100644
--- a/paludis/resolver/confirm_helper.cc
+++ b/paludis/resolver/confirm_helper.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
@@ -47,6 +47,9 @@ namespace paludis
Imp(const Environment * const e) :
env(e),
+ permit_downgrade_specs(make_null_shared_ptr()),
+ permit_old_version_specs(make_null_shared_ptr()),
+ allowed_to_break_specs(make_null_shared_ptr()),
allowed_to_break_system(false)
{
}
diff --git a/paludis/resolver/constraint.cc b/paludis/resolver/constraint.cc
index f23e187e8..7d147c870 100644
--- a/paludis/resolver/constraint.cc
+++ b/paludis/resolver/constraint.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
@@ -147,6 +147,7 @@ Constraint::serialise(Serialiser & s) const
s.object("Constraint")
.member(SerialiserFlags<>(), "destination_type", stringify(destination_type()))
.member(SerialiserFlags<>(), "force_unable", stringify(force_unable()))
+ .member(SerialiserFlags<serialise::might_be_null>(), "from_id", from_id())
.member(SerialiserFlags<>(), "nothing_is_fine_too", nothing_is_fine_too())
.member(SerialiserFlags<serialise::might_be_null>(), "reason", reason())
.member(SerialiserFlags<>(), "spec", spec())
@@ -155,52 +156,6 @@ Constraint::serialise(Serialiser & s) const
;
}
-namespace
-{
- struct IDFinder
- {
- const std::shared_ptr<const PackageID> visit(const DependencyReason & r) const
- {
- return r.from_id();
- }
-
- const std::shared_ptr<const PackageID> visit(const SetReason &) const
- {
- return make_null_shared_ptr();
- }
-
- const std::shared_ptr<const PackageID> visit(const LikeOtherDestinationTypeReason &) const
- {
- return make_null_shared_ptr();
- }
-
- const std::shared_ptr<const PackageID> visit(const PresetReason &) const
- {
- return make_null_shared_ptr();
- }
-
- const std::shared_ptr<const PackageID> visit(const TargetReason &) const
- {
- return make_null_shared_ptr();
- }
-
- const std::shared_ptr<const PackageID> visit(const DependentReason &) const
- {
- return make_null_shared_ptr();
- }
-
- const std::shared_ptr<const PackageID> visit(const ViaBinaryReason &) const
- {
- return make_null_shared_ptr();
- }
-
- const std::shared_ptr<const PackageID> visit(const WasUsedByReason &) const
- {
- return make_null_shared_ptr();
- }
- };
-}
-
const std::shared_ptr<Constraint>
Constraint::deserialise(Deserialisation & d)
{
@@ -209,15 +164,15 @@ Constraint::deserialise(Deserialisation & d)
Deserialisator v(d, "Constraint");
const std::shared_ptr<Reason> reason(v.member<std::shared_ptr<Reason> >("reason"));
- IDFinder id_finder;
+ const std::shared_ptr<const PackageID> from_id(v.member<std::shared_ptr<const PackageID> >("from_id"));
return std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = destringify<DestinationType>(v.member<std::string>("destination_type")),
n::force_unable() = v.member<bool>("force_unable"),
+ n::from_id() = from_id,
n::nothing_is_fine_too() = v.member<bool>("nothing_is_fine_too"),
n::reason() = reason,
- n::spec() = PackageOrBlockDepSpec::deserialise(*v.find_remove_member("spec"),
- reason->accept_returning<std::shared_ptr<const PackageID> >(id_finder)),
+ n::spec() = PackageOrBlockDepSpec::deserialise(*v.find_remove_member("spec"), from_id),
n::untaken() = v.member<bool>("untaken"),
n::use_existing() = destringify<UseExisting>(v.member<std::string>("use_existing"))
));
diff --git a/paludis/resolver/constraint.hh b/paludis/resolver/constraint.hh
index 0e1aed443..7d27c7cc2 100644
--- a/paludis/resolver/constraint.hh
+++ b/paludis/resolver/constraint.hh
@@ -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
@@ -37,6 +37,7 @@ namespace paludis
{
typedef Name<struct name_destination_type> destination_type;
typedef Name<struct name_force_unable> force_unable;
+ typedef Name<struct name_from_id> from_id;
typedef Name<struct name_nothing_is_fine_too> nothing_is_fine_too;
typedef Name<struct name_reason> reason;
typedef Name<struct name_spec> spec;
@@ -50,6 +51,7 @@ namespace paludis
{
NamedValue<n::destination_type, DestinationType> destination_type;
NamedValue<n::force_unable, bool> force_unable;
+ NamedValue<n::from_id, std::shared_ptr<const PackageID> > from_id;
NamedValue<n::nothing_is_fine_too, bool> nothing_is_fine_too;
NamedValue<n::reason, std::shared_ptr<const Reason> > reason;
NamedValue<n::spec, PackageOrBlockDepSpec> spec;
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index 57a6b4b2b..c31d6671e 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.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
@@ -38,6 +38,7 @@
#include <paludis/resolver/accumulate_deps_and_provides.hh>
#include <paludis/resolver/why_changed_choices.hh>
#include <paludis/resolver/same_slot.hh>
+#include <paludis/resolver/reason_utils.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
@@ -577,6 +578,7 @@ Decider::_make_constraints_from_target(
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolution->resolvent().destination_type(),
n::force_unable() = false,
+ n::from_id() = make_null_shared_ptr(),
n::nothing_is_fine_too() = existing.second,
n::reason() = reason,
n::spec() = spec,
@@ -606,6 +608,7 @@ Decider::_make_constraints_from_dependency(
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolution->resolvent().destination_type(),
n::force_unable() = false,
+ n::from_id() = dep.from_id(),
n::nothing_is_fine_too() = existing.second,
n::reason() = reason,
n::spec() = *dep.spec().if_package(),
@@ -638,11 +641,11 @@ Decider::_make_constraints_from_blocker(
break;
case bk_manual:
- force_unable = ! _already_met(spec);
+ force_unable = ! _already_met(spec, maybe_from_package_id_from_reason(reason));
break;
case bk_upgrade_blocked_before:
- nothing_is_fine_too = ! _already_met(spec);
+ nothing_is_fine_too = ! _already_met(spec, maybe_from_package_id_from_reason(reason));
break;
case last_bk:
@@ -655,6 +658,7 @@ Decider::_make_constraints_from_blocker(
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = *t,
n::force_unable() = force_unable,
+ n::from_id() = maybe_from_package_id_from_reason(reason),
n::nothing_is_fine_too() = nothing_is_fine_too,
n::reason() = reason,
n::spec() = spec,
@@ -703,13 +707,13 @@ namespace
if (constraint.spec().if_package())
{
if (! match_package_with_maybe_changes(*env, *constraint.spec().if_package(),
- changed_choices_for_constraint.get(), chosen_id, changed_choices.get(), { }))
+ changed_choices_for_constraint.get(), chosen_id, constraint.from_id(), changed_choices.get(), { }))
return false;
}
else
{
if (match_package_with_maybe_changes(*env, constraint.spec().if_block()->blocking(),
- changed_choices_for_constraint.get(), chosen_id, changed_choices.get(), { }))
+ changed_choices_for_constraint.get(), chosen_id, constraint.from_id(), changed_choices.get(), { }))
return false;
}
@@ -1177,7 +1181,7 @@ Decider::_add_dependencies_if_necessary(
}
const std::shared_ptr<DependencyReason> reason(std::make_shared<DependencyReason>(
- package_id, changed_choices, our_resolution->resolvent(), *s, _already_met(s->spec())));
+ package_id, changed_choices, our_resolution->resolvent(), *s, _already_met(s->spec(), package_id)));
/* empty resolvents is always ok for blockers, since blocking on things
* that don't exist is fine */
@@ -1310,7 +1314,7 @@ Decider::find_any_score(
if (is_block)
{
const std::shared_ptr<const PackageIDSequence> ids((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(spec, { mpo_ignore_additional_requirements })
+ generator::Matches(spec, our_id, { mpo_ignore_additional_requirements })
| filter::SupportsAction<InstallAction>() | filter::NotMasked()
)]);
if (ids->empty())
@@ -1320,7 +1324,7 @@ Decider::find_any_score(
/* next: already installed */
{
const std::shared_ptr<const PackageIDSequence> installed_ids((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(spec, { }) |
+ generator::Matches(spec, our_id, { }) |
filter::InstalledAtRoot(_imp->env->system_root_key()->value()))]);
if (! installed_ids->empty() ^ is_block)
return std::make_pair(acs_already_installed, operator_bias);
@@ -1330,14 +1334,14 @@ Decider::find_any_score(
if (! is_block && spec.additional_requirements_ptr())
{
const std::shared_ptr<const PackageIDSequence> installed_ids((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(spec, { mpo_ignore_additional_requirements }) |
+ generator::Matches(spec, our_id, { mpo_ignore_additional_requirements }) |
filter::InstalledAtRoot(_imp->env->system_root_key()->value()))]);
if (! installed_ids->empty())
return std::make_pair(acs_wrong_options_installed, operator_bias);
}
const std::shared_ptr<DependencyReason> reason(std::make_shared<DependencyReason>(
- our_id, make_null_shared_ptr(), our_resolution->resolvent(), dep, _already_met(dep.spec())));
+ our_id, make_null_shared_ptr(), our_resolution->resolvent(), dep, _already_met(dep.spec(), our_id)));
const std::shared_ptr<const Resolvents> resolvents(_get_resolvents_for(spec, reason).first);
/* next: will already be installing */
@@ -1374,7 +1378,7 @@ Decider::find_any_score(
if (is_block)
{
const std::shared_ptr<const PackageIDSequence> installed_ids((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(spec, { }) |
+ generator::Matches(spec, our_id, { }) |
filter::InstalledAtRoot(_imp->env->system_root_key()->value()))]);
if (! installed_ids->empty())
return std::make_pair(acs_blocks_installed, operator_bias);
@@ -1384,7 +1388,7 @@ Decider::find_any_score(
if (! is_block)
{
const std::shared_ptr<const PackageIDSequence> ids((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(spec, { mpo_ignore_additional_requirements })
+ generator::Matches(spec, our_id, { mpo_ignore_additional_requirements })
)]);
if (! ids->empty())
return std::make_pair(acs_exists, operator_bias);
@@ -1473,7 +1477,7 @@ Decider::_get_resolvents_for(
exact_slot = spec.slot_requirement_ptr()->accept_returning<std::shared_ptr<SlotName> >(f);
}
- return _imp->fns.get_resolvents_for_fn()(spec, exact_slot, reason);
+ return _imp->fns.get_resolvents_for_fn()(spec, maybe_from_package_id_from_reason(reason), exact_slot, reason);
}
const DestinationTypes
@@ -1847,9 +1851,9 @@ Decider::_find_id_for_from(
c != c_end ; ++c)
{
if ((*c)->spec().if_package())
- ok = ok && match_package(*_imp->env, *(*c)->spec().if_package(), *i, opts);
+ ok = ok && match_package(*_imp->env, *(*c)->spec().if_package(), *i, (*c)->from_id(), opts);
else
- ok = ok && ! match_package(*_imp->env, (*c)->spec().if_block()->blocking(), *i, opts);
+ ok = ok && ! match_package(*_imp->env, (*c)->spec().if_block()->blocking(), *i, (*c)->from_id(), opts);
if (! ok)
break;
@@ -1915,10 +1919,10 @@ Decider::_find_id_for_from(
if ((*c)->spec().if_package())
ok = ok && match_package_with_maybe_changes(*_imp->env, *(*c)->spec().if_package(),
- get_changed_choices_for(*c).get(), *i, why_changed_choices->changed_choices().get(), { });
+ get_changed_choices_for(*c).get(), *i, (*c)->from_id(), why_changed_choices->changed_choices().get(), { });
else
ok = ok && ! match_package_with_maybe_changes(*_imp->env, (*c)->spec().if_block()->blocking(),
- get_changed_choices_for(*c).get(), *i, why_changed_choices->changed_choices().get(), { });
+ get_changed_choices_for(*c).get(), *i, (*c)->from_id(), why_changed_choices->changed_choices().get(), { });
}
if (ok)
@@ -2113,10 +2117,10 @@ Decider::resolve()
}
bool
-Decider::_already_met(const PackageOrBlockDepSpec & spec) const
+Decider::_already_met(const PackageOrBlockDepSpec & spec, const std::shared_ptr<const PackageID> & from_id) const
{
const std::shared_ptr<const PackageIDSequence> installed_ids((*_imp->env)[selection::AllVersionsUnsorted(
- generator::Matches(spec.if_package() ? *spec.if_package() : spec.if_block()->blocking(), { }) |
+ generator::Matches(spec.if_package() ? *spec.if_package() : spec.if_block()->blocking(), from_id, { }) |
filter::InstalledAtRoot(_imp->env->system_root_key()->value()))]);
if (installed_ids->empty())
return bool(spec.if_block());
@@ -2386,6 +2390,7 @@ namespace
result->push_back(make_shared_copy(make_named_values<Constraint>(
n::destination_type() = destination_type,
n::force_unable() = false,
+ n::from_id() = from_constraint->from_id(),
n::nothing_is_fine_too() = true,
n::reason() = std::make_shared<LikeOtherDestinationTypeReason>(
resolvent,
diff --git a/paludis/resolver/decider.hh b/paludis/resolver/decider.hh
index c3f1d9ce4..c040588e6 100644
--- a/paludis/resolver/decider.hh
+++ b/paludis/resolver/decider.hh
@@ -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
@@ -240,7 +240,9 @@ namespace paludis
const std::shared_ptr<const PackageID> &,
const bool existing) const;
- bool _already_met(const PackageOrBlockDepSpec &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ bool _already_met(
+ const PackageOrBlockDepSpec &,
+ const std::shared_ptr<const PackageID> &) const PALUDIS_ATTRIBUTE((warn_unused_result));
bool _installed_but_allowed_to_remove(
const std::shared_ptr<const Resolution> &) const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/resolver/get_constraints_for_dependent_helper.cc b/paludis/resolver/get_constraints_for_dependent_helper.cc
index d27f9a64e..1a5cfc351 100644
--- a/paludis/resolver/get_constraints_for_dependent_helper.cc
+++ b/paludis/resolver/get_constraints_for_dependent_helper.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
@@ -27,6 +27,7 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/stringify.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_id.hh>
@@ -47,7 +48,8 @@ namespace paludis
PackageDepSpecCollection less_restrictive_remove_blockers_specs;
Imp(const Environment * const e) :
- env(e)
+ env(e),
+ less_restrictive_remove_blockers_specs(make_null_shared_ptr())
{
}
};
@@ -94,6 +96,7 @@ GetConstraintsForDependentHelper::operator() (
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = dt_install_to_slash,
n::force_unable() = false,
+ n::from_id() = id,
n::nothing_is_fine_too() = true,
n::reason() = reason,
n::spec() = BlockDepSpec("!" + stringify(*spec), *spec, bk_weak),
diff --git a/paludis/resolver/get_constraints_for_purge_helper.cc b/paludis/resolver/get_constraints_for_purge_helper.cc
index 631a1e423..7c51fdedc 100644
--- a/paludis/resolver/get_constraints_for_purge_helper.cc
+++ b/paludis/resolver/get_constraints_for_purge_helper.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
@@ -27,6 +27,7 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/stringify.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_id.hh>
@@ -47,7 +48,8 @@ namespace paludis
PackageDepSpecCollection purge_specs;
Imp(const Environment * const e) :
- env(e)
+ env(e),
+ purge_specs(make_null_shared_ptr())
{
}
};
@@ -85,6 +87,7 @@ GetConstraintsForPurgeHelper::operator() (
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = dt_install_to_slash,
n::force_unable() = false,
+ n::from_id() = id,
n::nothing_is_fine_too() = true,
n::reason() = reason,
n::spec() = BlockDepSpec("!" + stringify(spec), spec, bk_weak),
diff --git a/paludis/resolver/get_constraints_for_via_binary_helper.cc b/paludis/resolver/get_constraints_for_via_binary_helper.cc
index ee7ea91ff..c8b6f74b6 100644
--- a/paludis/resolver/get_constraints_for_via_binary_helper.cc
+++ b/paludis/resolver/get_constraints_for_via_binary_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -28,6 +28,7 @@
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/partially_made_package_dep_spec.hh>
@@ -71,6 +72,7 @@ GetConstraintsForViaBinaryHelper::operator() (
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolution->resolvent().destination_type(),
n::force_unable() = false,
+ n::from_id() = make_null_shared_ptr(),
n::nothing_is_fine_too() = false,
n::reason() = reason,
n::spec() = spec,
diff --git a/paludis/resolver/get_initial_constraints_for_helper.cc b/paludis/resolver/get_initial_constraints_for_helper.cc
index 85b154072..a26fd1c7b 100644
--- a/paludis/resolver/get_initial_constraints_for_helper.cc
+++ b/paludis/resolver/get_initial_constraints_for_helper.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
@@ -87,11 +87,11 @@ GetInitialConstraintsForHelper::add_without_spec(const PackageDepSpec & spec)
}
void
-GetInitialConstraintsForHelper::add_preset_spec(const PackageDepSpec & spec)
+GetInitialConstraintsForHelper::add_preset_spec(const PackageDepSpec & spec, const std::shared_ptr<const PackageID> & from_id)
{
auto reason(std::make_shared<PresetReason>("preset", make_null_shared_ptr()));
- auto ids((*_imp->env)[selection::BestVersionInEachSlot(generator::Matches(spec, { }))]);
+ auto ids((*_imp->env)[selection::BestVersionInEachSlot(generator::Matches(spec, from_id, { }))]);
for (auto i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
@@ -101,6 +101,7 @@ GetInitialConstraintsForHelper::add_preset_spec(const PackageDepSpec & spec)
const std::shared_ptr<Constraint> constraint(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = r.destination_type(),
n::force_unable() = false,
+ n::from_id() = from_id,
n::nothing_is_fine_too() = true,
n::reason() = reason,
n::spec() = spec,
@@ -234,6 +235,7 @@ GetInitialConstraintsForHelper::_make_initial_constraints_for(
result->add(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolvent.destination_type(),
n::force_unable() = false,
+ n::from_id() = make_null_shared_ptr(),
n::nothing_is_fine_too() = true,
n::reason() = std::make_shared<PresetReason>("is scm", make_null_shared_ptr()),
n::spec() = make_package_dep_spec({ }).package(resolvent.package()),
diff --git a/paludis/resolver/get_initial_constraints_for_helper.hh b/paludis/resolver/get_initial_constraints_for_helper.hh
index cdc3b3cce..c42f01f15 100644
--- a/paludis/resolver/get_initial_constraints_for_helper.hh
+++ b/paludis/resolver/get_initial_constraints_for_helper.hh
@@ -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
@@ -47,7 +47,7 @@ namespace paludis
void add_without_spec(const PackageDepSpec &);
- void add_preset_spec(const PackageDepSpec &);
+ void add_preset_spec(const PackageDepSpec &, const std::shared_ptr<const PackageID> & from_id);
void add_suggested_restart(const SuggestRestart &);
diff --git a/paludis/resolver/get_resolvents_for_helper.cc b/paludis/resolver/get_resolvents_for_helper.cc
index 24a6f36c5..02f658deb 100644
--- a/paludis/resolver/get_resolvents_for_helper.cc
+++ b/paludis/resolver/get_resolvents_for_helper.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
@@ -264,6 +264,7 @@ namespace
std::pair<std::shared_ptr<Resolvents>, bool>
GetResolventsForHelper::operator() (
const PackageDepSpec & spec,
+ const std::shared_ptr<const PackageID> & from_id,
const std::shared_ptr<const SlotName> & maybe_slot,
const std::shared_ptr<const Reason> & reason) const
{
@@ -271,7 +272,7 @@ GetResolventsForHelper::operator() (
std::shared_ptr<const PackageID> best;
auto ids((*_imp->env)[selection::BestVersionOnly(
- generator::Matches(spec, { mpo_ignore_additional_requirements }) |
+ generator::Matches(spec, from_id, { mpo_ignore_additional_requirements }) |
filter::SupportsAction<InstallAction>() |
filter::NotMasked() |
(maybe_slot ? Filter(filter::Slot(*maybe_slot)) : Filter(filter::All())))]);
@@ -280,7 +281,7 @@ GetResolventsForHelper::operator() (
best = *ids->begin();
auto installed_ids((*_imp->env)[selection::BestVersionInEachSlot(
- generator::Matches(spec, { }) |
+ generator::Matches(spec, from_id, { }) |
(_imp->target_destination_type == dt_install_to_chroot ?
Filter(filter::InstalledNotAtRoot(_imp->env->system_root_key()->value())) :
Filter(filter::InstalledAtRoot(_imp->env->system_root_key()->value()))))]);
diff --git a/paludis/resolver/get_resolvents_for_helper.hh b/paludis/resolver/get_resolvents_for_helper.hh
index 03ebdef11..c310815bf 100644
--- a/paludis/resolver/get_resolvents_for_helper.hh
+++ b/paludis/resolver/get_resolvents_for_helper.hh
@@ -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
@@ -57,6 +57,7 @@ namespace paludis
std::pair<std::shared_ptr<Resolvents>, bool> operator() (
const PackageDepSpec &,
+ const std::shared_ptr<const PackageID> & from_id,
const std::shared_ptr<const SlotName> &,
const std::shared_ptr<const Reason> &) const;
};
diff --git a/paludis/resolver/interest_in_spec_helper.cc b/paludis/resolver/interest_in_spec_helper.cc
index 35f5fc9d1..2427cbe4a 100644
--- a/paludis/resolver/interest_in_spec_helper.cc
+++ b/paludis/resolver/interest_in_spec_helper.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -28,6 +28,7 @@
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/tribool.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
@@ -65,6 +66,8 @@ namespace paludis
Imp(const Environment * const e) :
env(e),
+ no_blockers_from_specs(make_null_shared_ptr()),
+ no_dependencies_from_specs(make_null_shared_ptr()),
follow_installed_build_dependencies(false),
follow_installed_dependencies(true),
take_suggestions(indeterminate),
@@ -201,7 +204,7 @@ namespace
const std::shared_ptr<const PackageIDSequence> installed_ids(
(*env)[selection::SomeArbitraryVersion(
- generator::Matches(*dep.spec().if_package(), { }) |
+ generator::Matches(*dep.spec().if_package(), dep.from_id(), { }) |
filter::InstalledAtRoot(env->system_root_key()->value()))]);
if (installed_ids->empty())
return false;
@@ -271,7 +274,7 @@ InterestInSpecHelper::operator() (
for (auto l(_imp->take_from_specs.begin()), l_end(_imp->take_from_specs.end()) ;
l != l_end ; ++l)
{
- if (match_package(*_imp->env, *l, id, { }))
+ if (match_package(*_imp->env, *l, id, make_null_shared_ptr(), { }))
return si_take;
}
@@ -300,7 +303,7 @@ InterestInSpecHelper::operator() (
for (auto l(_imp->ignore_from_specs.begin()), l_end(_imp->ignore_from_specs.end()) ;
l != l_end ; ++l)
{
- if (match_package(*_imp->env, *l, id, { }))
+ if (match_package(*_imp->env, *l, id, make_null_shared_ptr(), { }))
return si_ignore;
}
@@ -328,7 +331,7 @@ InterestInSpecHelper::operator() (
{
const std::shared_ptr<const PackageIDSequence> installed_ids(
(*_imp->env)[selection::SomeArbitraryVersion(
- generator::Matches(*dep.spec().if_package(), { }) |
+ generator::Matches(*dep.spec().if_package(), dep.from_id(), { }) |
filter::InstalledAtRoot(_imp->env->system_root_key()->value()))]);
if (! installed_ids->empty())
return si_take;
diff --git a/paludis/resolver/order_early_helper.cc b/paludis/resolver/order_early_helper.cc
index 2ea967ef0..11af1a767 100644
--- a/paludis/resolver/order_early_helper.cc
+++ b/paludis/resolver/order_early_helper.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/resolver/decision_utils.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/tribool.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_dep_spec_collection.hh>
@@ -40,7 +41,9 @@ namespace paludis
PackageDepSpecCollection late_specs;
Imp(const Environment * const e) :
- env(e)
+ env(e),
+ early_specs(make_null_shared_ptr()),
+ late_specs(make_null_shared_ptr())
{
}
};
diff --git a/paludis/resolver/reason_utils-fwd.hh b/paludis/resolver/reason_utils-fwd.hh
index 23cf6e593..b616b1e53 100644
--- a/paludis/resolver/reason_utils-fwd.hh
+++ b/paludis/resolver/reason_utils-fwd.hh
@@ -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
@@ -22,6 +22,7 @@
#include <paludis/util/attributes.hh>
#include <paludis/resolver/reason-fwd.hh>
+#include <paludis/package_id-fwd.hh>
#include <memory>
namespace paludis
@@ -29,6 +30,9 @@ namespace paludis
namespace resolver
{
bool is_target(const std::shared_ptr<const Reason> &) PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ const std::shared_ptr<const PackageID> maybe_from_package_id_from_reason(
+ const std::shared_ptr<const Reason> &) PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((warn_unused_result));
}
}
diff --git a/paludis/resolver/reason_utils.cc b/paludis/resolver/reason_utils.cc
index 063bd7703..724b23c77 100644
--- a/paludis/resolver/reason_utils.cc
+++ b/paludis/resolver/reason_utils.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -19,6 +19,7 @@
#include <paludis/resolver/reason_utils.hh>
#include <paludis/resolver/reason.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
using namespace paludis;
using namespace paludis::resolver;
@@ -67,6 +68,49 @@ namespace
return r.reason_for_set()->accept_returning<bool>(*this);
}
};
+
+ struct FromIDVisitor
+ {
+ std::shared_ptr<const PackageID> visit(const DependencyReason & r) const
+ {
+ return r.from_id();
+ }
+
+ std::shared_ptr<const PackageID> visit(const DependentReason &) const
+ {
+ return make_null_shared_ptr();
+ }
+
+ std::shared_ptr<const PackageID> visit(const WasUsedByReason &) const
+ {
+ return make_null_shared_ptr();
+ }
+
+ std::shared_ptr<const PackageID> visit(const PresetReason &) const
+ {
+ return make_null_shared_ptr();
+ }
+
+ std::shared_ptr<const PackageID> visit(const ViaBinaryReason &) const
+ {
+ return make_null_shared_ptr();
+ }
+
+ std::shared_ptr<const PackageID> visit(const TargetReason &) const
+ {
+ return make_null_shared_ptr();
+ }
+
+ std::shared_ptr<const PackageID> visit(const LikeOtherDestinationTypeReason & r) const
+ {
+ return r.reason_for_other()->accept_returning<std::shared_ptr<const PackageID> >(*this);
+ }
+
+ std::shared_ptr<const PackageID> visit(const SetReason & r) const
+ {
+ return r.reason_for_set()->accept_returning<std::shared_ptr<const PackageID> >(*this);
+ }
+ };
}
bool
@@ -76,3 +120,10 @@ paludis::resolver::is_target(const std::shared_ptr<const Reason> & reason)
return reason->accept_returning<bool>(v);
}
+const std::shared_ptr<const PackageID>
+paludis::resolver::maybe_from_package_id_from_reason(const std::shared_ptr<const Reason> & reason)
+{
+ FromIDVisitor v;
+ return reason->accept_returning<std::shared_ptr<const PackageID> >(v);
+}
+
diff --git a/paludis/resolver/remove_if_dependent_helper.cc b/paludis/resolver/remove_if_dependent_helper.cc
index 7a8baa0f9..4e6116d31 100644
--- a/paludis/resolver/remove_if_dependent_helper.cc
+++ b/paludis/resolver/remove_if_dependent_helper.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/resolver/resolvent.hh>
#include <paludis/resolver/resolution.hh>
#include <paludis/util/pimp-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/package_dep_spec_collection.hh>
@@ -38,7 +39,8 @@ namespace paludis
PackageDepSpecCollection remove_if_dependent_specs;
Imp(const Environment * const e) :
- env(e)
+ env(e),
+ remove_if_dependent_specs(make_null_shared_ptr())
{
}
};
diff --git a/paludis/resolver/resolver_functions.hh b/paludis/resolver/resolver_functions.hh
index 4074599e1..4a286e0ed 100644
--- a/paludis/resolver/resolver_functions.hh
+++ b/paludis/resolver/resolver_functions.hh
@@ -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
@@ -137,6 +137,7 @@ namespace paludis
typedef std::function<std::pair<std::shared_ptr<Resolvents>, bool> (
const PackageDepSpec &,
+ const std::shared_ptr<const PackageID> &,
const std::shared_ptr<const SlotName> &,
const std::shared_ptr<const Reason> &
)> GetResolventsForFunction;
diff --git a/paludis/resolver/sanitised_dependencies.cc b/paludis/resolver/sanitised_dependencies.cc
index 02a8b6f2c..87419b2c4 100644
--- a/paludis/resolver/sanitised_dependencies.cc
+++ b/paludis/resolver/sanitised_dependencies.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
@@ -378,6 +378,7 @@ namespace
n::active_dependency_labels() = *labels_stack.begin(),
n::active_dependency_labels_as_string() = adl.str(),
n::active_dependency_labels_classifier() = classifier,
+ n::from_id() = our_id,
n::metadata_key_human_name() = human_name,
n::metadata_key_raw_name() = raw_name,
n::original_specs_as_string() = original_specs_as_string,
@@ -542,6 +543,7 @@ SanitisedDependency::serialise(Serialiser & s) const
.member(SerialiserFlags<>(), "active_conditions_as_string", active_conditions_as_string())
.member(SerialiserFlags<>(), "active_dependency_labels_as_string", active_dependency_labels_as_string())
.member(SerialiserFlags<serialise::might_be_null>(), "active_dependency_labels_classifier", active_dependency_labels_classifier())
+ .member(SerialiserFlags<serialise::might_be_null>(), "from_id", from_id())
.member(SerialiserFlags<>(), "metadata_key_human_name", metadata_key_human_name())
.member(SerialiserFlags<>(), "metadata_key_raw_name", metadata_key_raw_name())
.member(SerialiserFlags<>(), "original_specs_as_string", original_specs_as_string())
@@ -561,6 +563,7 @@ SanitisedDependency::deserialise(Deserialisation & d, const std::shared_ptr<cons
n::active_dependency_labels() = make_null_shared_ptr(),
n::active_dependency_labels_as_string() = v.member<std::string>("active_dependency_labels_as_string"),
n::active_dependency_labels_classifier() = v.member<std::shared_ptr<LabelsClassifier> >("active_dependency_labels_classifier"),
+ n::from_id() = v.member<std::shared_ptr<const PackageID> >("from_id"),
n::metadata_key_human_name() = v.member<std::string>("metadata_key_human_name"),
n::metadata_key_raw_name() = v.member<std::string>("metadata_key_raw_name"),
n::original_specs_as_string() = v.member<std::string>("original_specs_as_string"),
diff --git a/paludis/resolver/sanitised_dependencies.hh b/paludis/resolver/sanitised_dependencies.hh
index cbfa4e0a9..dd270391b 100644
--- a/paludis/resolver/sanitised_dependencies.hh
+++ b/paludis/resolver/sanitised_dependencies.hh
@@ -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
@@ -40,6 +40,7 @@ namespace paludis
typedef Name<struct name_active_dependency_labels> active_dependency_labels;
typedef Name<struct name_active_dependency_labels_as_string> active_dependency_labels_as_string;
typedef Name<struct name_active_dependency_labels_classifier> active_dependency_labels_classifier;
+ typedef Name<struct name_from_id> from_id;
typedef Name<struct name_metadata_key_human_name> metadata_key_human_name;
typedef Name<struct name_metadata_key_raw_name> metadata_key_raw_name;
typedef Name<struct name_original_specs_as_string> original_specs_as_string;
@@ -54,6 +55,7 @@ namespace paludis
NamedValue<n::active_dependency_labels, std::shared_ptr<const DependenciesLabelSequence> > active_dependency_labels;
NamedValue<n::active_dependency_labels_as_string, std::string> active_dependency_labels_as_string;
NamedValue<n::active_dependency_labels_classifier, std::shared_ptr<const LabelsClassifier> > active_dependency_labels_classifier;
+ NamedValue<n::from_id, std::shared_ptr<const PackageID> > from_id;
NamedValue<n::metadata_key_human_name, std::string> metadata_key_human_name;
NamedValue<n::metadata_key_raw_name, std::string> metadata_key_raw_name;
NamedValue<n::original_specs_as_string, std::string> original_specs_as_string;
diff --git a/paludis/selection_TEST.cc b/paludis/selection_TEST.cc
index 928d2d4da..4d5c82049 100644
--- a/paludis/selection_TEST.cc
+++ b/paludis/selection_TEST.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/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <test/test_concepts.hh>
@@ -69,41 +70,41 @@ namespace test_cases
TEST_CHECK(true);
PackageDepSpec d1(parse_user_package_dep_spec("r1c1/r1c1p1", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q1(env[selection::AllVersionsSorted(generator::Matches(d1, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q1(env[selection::AllVersionsSorted(generator::Matches(d1, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(std::distance(q1->begin(), q1->end()), 1);
PackageDepSpec d2(parse_user_package_dep_spec("r1c1/r1c1p2", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q2(env[selection::AllVersionsSorted(generator::Matches(d2, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q2(env[selection::AllVersionsSorted(generator::Matches(d2, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(std::distance(q2->begin(), q2->end()), 2);
PackageDepSpec d3(parse_user_package_dep_spec(">=r1c1/r1c1p2-1", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q3(env[selection::AllVersionsSorted(generator::Matches(d3, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q3(env[selection::AllVersionsSorted(generator::Matches(d3, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(std::distance(q3->begin(), q3->end()), 2);
PackageDepSpec d4(parse_user_package_dep_spec(">=r1c1/r1c1p2-2", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q4(env[selection::AllVersionsSorted(generator::Matches(d4, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q4(env[selection::AllVersionsSorted(generator::Matches(d4, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q4->begin()), indirect_iterator(q4->end()), " "),
"r1c1/r1c1p2-2:0::repo1");
TEST_CHECK_EQUAL(std::distance(q4->begin(), q4->end()), 1);
PackageDepSpec d5(parse_user_package_dep_spec(">=r1c1/r1c1p2-3", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q5(env[selection::AllVersionsSorted(generator::Matches(d5, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q5(env[selection::AllVersionsSorted(generator::Matches(d5, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(std::distance(q5->begin(), q5->end()), 0);
PackageDepSpec d6(parse_user_package_dep_spec("<r1c1/r1c1p2-3", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q6(env[selection::AllVersionsSorted(generator::Matches(d6, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q6(env[selection::AllVersionsSorted(generator::Matches(d6, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(std::distance(q6->begin(), q6->end()), 2);
PackageDepSpec d7(parse_user_package_dep_spec("rac1/rac1pa", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q7(env[selection::AllVersionsSorted(generator::Matches(d7, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q7(env[selection::AllVersionsSorted(generator::Matches(d7, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(std::distance(q7->begin(), q7->end()), 4);
PackageDepSpec d8(parse_user_package_dep_spec("foo/bar", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q8(env[selection::AllVersionsSorted(generator::Matches(d8, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q8(env[selection::AllVersionsSorted(generator::Matches(d8, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(std::distance(q8->begin(), q8->end()), 0);
PackageDepSpec d9(parse_user_package_dep_spec("r1c1/r1c1p1", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q9(env[selection::AllVersionsSorted(generator::Matches(d9, { })
+ const std::shared_ptr<const PackageIDSequence> q9(env[selection::AllVersionsSorted(generator::Matches(d9, make_null_shared_ptr(), { })
| filter::SupportsAction<InstallAction>())]);
TEST_CHECK_EQUAL(std::distance(q9->begin(), q9->end()), 1);
}
@@ -137,19 +138,19 @@ namespace test_cases
PackageDepSpec d(parse_user_package_dep_spec("cat/pkg", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q1(env[selection::AllVersionsSorted(generator::Matches(d, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q1(env[selection::AllVersionsSorted(generator::Matches(d, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q1->begin()), indirect_iterator(q1->end()), " "),
"cat/pkg-1:a::repo2 cat/pkg-1:a::repo1 cat/pkg-2:c::repo1 cat/pkg-3:b::repo2 cat/pkg-3:c::repo1 cat/pkg-4:a::repo1");
- const std::shared_ptr<const PackageIDSequence> q2(env[selection::AllVersionsGroupedBySlot(generator::Matches(d, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q2(env[selection::AllVersionsGroupedBySlot(generator::Matches(d, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q2->begin()), indirect_iterator(q2->end()), " "),
"cat/pkg-3:b::repo2 cat/pkg-2:c::repo1 cat/pkg-3:c::repo1 cat/pkg-1:a::repo2 cat/pkg-1:a::repo1 cat/pkg-4:a::repo1");
- const std::shared_ptr<const PackageIDSequence> q3(env[selection::BestVersionOnly(generator::Matches(d, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q3(env[selection::BestVersionOnly(generator::Matches(d, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q3->begin()), indirect_iterator(q3->end()), " "),
"cat/pkg-4:a::repo1");
- const std::shared_ptr<const PackageIDSequence> q4(env[selection::BestVersionInEachSlot(generator::Matches(d, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q4(env[selection::BestVersionInEachSlot(generator::Matches(d, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q4->begin()), indirect_iterator(q4->end()), " "),
"cat/pkg-3:b::repo2 cat/pkg-3:c::repo1 cat/pkg-4:a::repo1");
@@ -162,31 +163,31 @@ namespace test_cases
PackageDepSpec c(parse_user_package_dep_spec("cat/*", &env, { updso_allow_wildcards }));
- const std::shared_ptr<const PackageIDSequence> q5(env[selection::AllVersionsSorted(generator::Matches(c, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q5(env[selection::AllVersionsSorted(generator::Matches(c, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q5->begin()), indirect_iterator(q5->end()), " "),
"cat/other-1:a::repo3 cat/pkg-1:a::repo2 cat/pkg-1:a::repo1 cat/pkg-2:c::repo1 "
"cat/pkg-3:b::repo2 cat/pkg-3:c::repo1 cat/pkg-4:a::repo1");
- const std::shared_ptr<const PackageIDSequence> q6(env[selection::AllVersionsGroupedBySlot(generator::Matches(c, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q6(env[selection::AllVersionsGroupedBySlot(generator::Matches(c, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q6->begin()), indirect_iterator(q6->end()), " "),
"cat/other-1:a::repo3 cat/pkg-3:b::repo2 cat/pkg-2:c::repo1 cat/pkg-3:c::repo1 "
"cat/pkg-1:a::repo2 cat/pkg-1:a::repo1 cat/pkg-4:a::repo1");
- const std::shared_ptr<const PackageIDSequence> q7(env[selection::BestVersionOnly(generator::Matches(c, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q7(env[selection::BestVersionOnly(generator::Matches(c, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q7->begin()), indirect_iterator(q7->end()), " "),
"cat/other-1:a::repo3 cat/pkg-4:a::repo1");
- const std::shared_ptr<const PackageIDSequence> q8(env[selection::BestVersionInEachSlot(generator::Matches(c, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q8(env[selection::BestVersionInEachSlot(generator::Matches(c, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q8->begin()), indirect_iterator(q8->end()), " "),
"cat/other-1:a::repo3 cat/pkg-3:b::repo2 cat/pkg-3:c::repo1 cat/pkg-4:a::repo1");
PackageDepSpec b(parse_user_package_dep_spec("cat/pkg:a", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q9(env[selection::AllVersionsGroupedBySlot(generator::Matches(b, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q9(env[selection::AllVersionsGroupedBySlot(generator::Matches(b, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q9->begin()), indirect_iterator(q9->end()), " "),
"cat/pkg-1:a::repo2 cat/pkg-1:a::repo1 cat/pkg-4:a::repo1");
PackageDepSpec a(parse_user_package_dep_spec("cat/pkg[=1|=3]", &env, { }));
- const std::shared_ptr<const PackageIDSequence> q10(env[selection::AllVersionsGroupedBySlot(generator::Matches(a, { }))]);
+ const std::shared_ptr<const PackageIDSequence> q10(env[selection::AllVersionsGroupedBySlot(generator::Matches(a, make_null_shared_ptr(), { }))]);
TEST_CHECK_EQUAL(join(indirect_iterator(q10->begin()), indirect_iterator(q10->end()), " "),
"cat/pkg-1:a::repo2 cat/pkg-1:a::repo1 cat/pkg-3:b::repo2 cat/pkg-3:c::repo1");
}
diff --git a/paludis/serialise.cc b/paludis/serialise.cc
index bb8c249b0..43f256700 100644
--- a/paludis/serialise.cc
+++ b/paludis/serialise.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
@@ -378,7 +378,7 @@ DeserialisatorHandler<std::shared_ptr<const PackageID> >::handle(Deserialisation
epdso_allow_use_dep_question_defaults },
{ vso_flexible_dashes, vso_flexible_dots, vso_ignore_case,
vso_letters_anywhere, vso_dotted_suffixes },
- make_null_shared_ptr()), { }))]->begin();
+ make_null_shared_ptr()), make_null_shared_ptr(), { }))]->begin();
}
template class Pimp<Deserialiser>;
diff --git a/paludis/set_file.cc b/paludis/set_file.cc
index f6a36bca4..aef0dfe2d 100644
--- a/paludis/set_file.cc
+++ b/paludis/set_file.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
@@ -28,6 +28,7 @@
#include <paludis/util/system.hh>
#include <paludis/util/safe_ofstream.hh>
#include <paludis/util/process.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
#include <paludis/selection.hh>
@@ -275,7 +276,7 @@ namespace
make_package_dep_spec({ })
.package(*spec->package_ptr())
.slot_requirement(spec->slot_requirement_ptr()),
- { }) |
+ make_null_shared_ptr(), { }) |
filter::InstalledAtRoot(params.environment()->preferred_root_key()->value()))]->empty())
result->top()->append(spec);
}
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index c07b5f88d..2ecdd3cef 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -41,6 +41,7 @@
#include <paludis/util/destringify.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/tribool.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <algorithm>
using namespace paludis;
@@ -77,7 +78,7 @@ namespace
if (options[updso_no_disambiguation])
throw PackageDepSpecError("Need an explicit category specified");
result.package(env->package_database()->fetch_unique_qualified_package_name(PackageNamePart(s),
- filter::And(filter, filter::Matches(result, { }))));
+ filter::And(filter, filter::Matches(result, make_null_shared_ptr(), { }))));
}
}
diff --git a/paludis/user_dep_spec_TEST.cc b/paludis/user_dep_spec_TEST.cc
index 79522355c..8a2d21d23 100644
--- a/paludis/user_dep_spec_TEST.cc
+++ b/paludis/user_dep_spec_TEST.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
@@ -28,6 +28,7 @@
#include <paludis/util/options.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/version_requirements.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
@@ -430,75 +431,75 @@ namespace test_cases
pkg3->keywords_key()->set_from_string("~d");
PackageDepSpec a(parse_user_package_dep_spec("cat/pkg1[.KEYWORDS<~a]", &env, { }));
- TEST_CHECK(match_package(env, a, pkg1, { }));
- TEST_CHECK(match_package(env, a, pkg2, { }));
- TEST_CHECK(! match_package(env, a, pkg3, { }));
+ TEST_CHECK(match_package(env, a, pkg1, make_null_shared_ptr(), { }));
+ TEST_CHECK(match_package(env, a, pkg2, make_null_shared_ptr(), { }));
+ TEST_CHECK(! match_package(env, a, pkg3, make_null_shared_ptr(), { }));
PackageDepSpec b(parse_user_package_dep_spec("cat/pkg1[.KEYWORDS<~b]", &env, { }));
- TEST_CHECK(match_package(env, b, pkg1, { }));
- TEST_CHECK(! match_package(env, b, pkg2, { }));
- TEST_CHECK(! match_package(env, b, pkg3, { }));
+ TEST_CHECK(match_package(env, b, pkg1, make_null_shared_ptr(), { }));
+ TEST_CHECK(! match_package(env, b, pkg2, make_null_shared_ptr(), { }));
+ TEST_CHECK(! match_package(env, b, pkg3, make_null_shared_ptr(), { }));
PackageDepSpec c(parse_user_package_dep_spec("cat/pkg1[.KEYWORDS<~c]", &env, { }));
- TEST_CHECK(! match_package(env, c, pkg1, { }));
- TEST_CHECK(match_package(env, c, pkg2, { }));
- TEST_CHECK(! match_package(env, c, pkg3, { }));
+ TEST_CHECK(! match_package(env, c, pkg1, make_null_shared_ptr(), { }));
+ TEST_CHECK(match_package(env, c, pkg2, make_null_shared_ptr(), { }));
+ TEST_CHECK(! match_package(env, c, pkg3, make_null_shared_ptr(), { }));
PackageDepSpec d(parse_user_package_dep_spec("cat/pkg1[.KEYWORDS>~a]", &env, { }));
- TEST_CHECK(! match_package(env, d, pkg1, { }));
- TEST_CHECK(! match_package(env, d, pkg2, { }));
- TEST_CHECK(! match_package(env, d, pkg3, { }));
+ TEST_CHECK(! match_package(env, d, pkg1, make_null_shared_ptr(), { }));
+ TEST_CHECK(! match_package(env, d, pkg2, make_null_shared_ptr(), { }));
+ TEST_CHECK(! match_package(env, d, pkg3, make_null_shared_ptr(), { }));
PackageDepSpec e(parse_user_package_dep_spec("cat/pkg1[.KEYWORDS=~d]", &env, { }));
- TEST_CHECK(! match_package(env, e, pkg1, { }));
- TEST_CHECK(! match_package(env, e, pkg2, { }));
- TEST_CHECK(match_package(env, e, pkg3, { }));
+ TEST_CHECK(! match_package(env, e, pkg1, make_null_shared_ptr(), { }));
+ TEST_CHECK(! match_package(env, e, pkg2, make_null_shared_ptr(), { }));
+ TEST_CHECK(match_package(env, e, pkg3, make_null_shared_ptr(), { }));
PackageDepSpec f(parse_user_package_dep_spec("cat/pkg1[.KEYWORDS=~a ~c]", &env, { }));
- TEST_CHECK(! match_package(env, f, pkg1, { }));
- TEST_CHECK(match_package(env, f, pkg2, { }));
- TEST_CHECK(! match_package(env, f, pkg3, { }));
+ TEST_CHECK(! match_package(env, f, pkg1, make_null_shared_ptr(), { }));
+ TEST_CHECK(match_package(env, f, pkg2, make_null_shared_ptr(), { }));
+ TEST_CHECK(! match_package(env, f, pkg3, make_null_shared_ptr(), { }));
PackageDepSpec g(parse_user_package_dep_spec("cat/pkg1[.HITCHHIKER=42]", &env, { }));
- TEST_CHECK(match_package(env, g, pkg1, { }));
+ TEST_CHECK(match_package(env, g, pkg1, make_null_shared_ptr(), { }));
PackageDepSpec h(parse_user_package_dep_spec("cat/pkg1[.HITCHHIKER<41]", &env, { }));
- TEST_CHECK(! match_package(env, h, pkg1, { }));
+ TEST_CHECK(! match_package(env, h, pkg1, make_null_shared_ptr(), { }));
PackageDepSpec i(parse_user_package_dep_spec("cat/pkg1[.HITCHHIKER<42]", &env, { }));
- TEST_CHECK(! match_package(env, i, pkg1, { }));
+ TEST_CHECK(! match_package(env, i, pkg1, make_null_shared_ptr(), { }));
PackageDepSpec j(parse_user_package_dep_spec("cat/pkg1[.HITCHHIKER<43]", &env, { }));
- TEST_CHECK(match_package(env, j, pkg1, { }));
+ TEST_CHECK(match_package(env, j, pkg1, make_null_shared_ptr(), { }));
PackageDepSpec k(parse_user_package_dep_spec("cat/pkg1[.HITCHHIKER>42]", &env, { }));
- TEST_CHECK(! match_package(env, k, pkg1, { }));
+ TEST_CHECK(! match_package(env, k, pkg1, make_null_shared_ptr(), { }));
PackageDepSpec l(parse_user_package_dep_spec("cat/pkg1[.HITCHHIKER>41]", &env, { }));
- TEST_CHECK(match_package(env, l, pkg1, { }));
+ TEST_CHECK(match_package(env, l, pkg1, make_null_shared_ptr(), { }));
PackageDepSpec m(parse_user_package_dep_spec("cat/pkg1[.HITCHHIKER?]", &env, { }));
- TEST_CHECK(match_package(env, m, pkg1, { }));
+ TEST_CHECK(match_package(env, m, pkg1, make_null_shared_ptr(), { }));
PackageDepSpec n(parse_user_package_dep_spec("cat/pkg1[.SPOON?]", &env, { }));
- TEST_CHECK(! match_package(env, n, pkg1, { }));
+ TEST_CHECK(! match_package(env, n, pkg1, make_null_shared_ptr(), { }));
PackageDepSpec o(parse_user_package_dep_spec("cat/pkg1[.$keywords<~a]", &env, { }));
- TEST_CHECK(match_package(env, o, pkg1, { }));
- TEST_CHECK(match_package(env, o, pkg2, { }));
- TEST_CHECK(! match_package(env, o, pkg3, { }));
+ TEST_CHECK(match_package(env, o, pkg1, make_null_shared_ptr(), { }));
+ TEST_CHECK(match_package(env, o, pkg2, make_null_shared_ptr(), { }));
+ TEST_CHECK(! match_package(env, o, pkg3, make_null_shared_ptr(), { }));
PackageDepSpec p(parse_user_package_dep_spec("cat/pkg1[.::$format=fake]", &env, { }));
- TEST_CHECK(match_package(env, p, pkg1, { }));
+ TEST_CHECK(match_package(env, p, pkg1, make_null_shared_ptr(), { }));
PackageDepSpec q(parse_user_package_dep_spec("cat/pkg1[.::$format=e]", &env, { }));
- TEST_CHECK(! match_package(env, q, pkg1, { }));
+ TEST_CHECK(! match_package(env, q, pkg1, make_null_shared_ptr(), { }));
PackageDepSpec r(parse_user_package_dep_spec("cat/pkg1[.::format=fake]", &env, { }));
- TEST_CHECK(match_package(env, r, pkg1, { }));
+ TEST_CHECK(match_package(env, r, pkg1, make_null_shared_ptr(), { }));
PackageDepSpec s(parse_user_package_dep_spec("cat/pkg1[.::format=e]", &env, { }));
- TEST_CHECK(! match_package(env, s, pkg1, { }));
+ TEST_CHECK(! match_package(env, s, pkg1, make_null_shared_ptr(), { }));
}
} test_user_package_dep_spec_user_key_req;
}