aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-06 14:20:20 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-07 11:32:56 +0000
commit069c40621c0f9612b689448993f113d5f7ec96dd (patch)
tree1687f78c36a3fea39f60de7be42e0d7dda7be09c
parent81ef7b0468950cade215c889d47143db21720695 (diff)
downloadpaludis-069c40621c0f9612b689448993f113d5f7ec96dd.tar.gz
paludis-069c40621c0f9612b689448993f113d5f7ec96dd.tar.xz
Pass ID to additional reqs
-rw-r--r--paludis/additional_package_dep_spec_requirement.hh14
-rw-r--r--paludis/elike_use_requirement.cc4
-rw-r--r--paludis/elike_use_requirement_TEST.cc319
-rw-r--r--paludis/legacy/dep_list.cc2
-rw-r--r--paludis/legacy/dep_list_exceptions.cc2
-rw-r--r--paludis/legacy/dep_list_exceptions.hh7
-rw-r--r--paludis/match_package.cc4
-rw-r--r--paludis/resolver/decider.cc3
-rw-r--r--paludis/user_dep_spec.cc2
-rw-r--r--paludis/user_dep_spec.hh7
-rwxr-xr-xsrc/clients/cave/cmd_display_resolution.cc2
-rw-r--r--src/output/console_install_task.cc2
12 files changed, 198 insertions, 170 deletions
diff --git a/paludis/additional_package_dep_spec_requirement.hh b/paludis/additional_package_dep_spec_requirement.hh
index c469bed..da8321d 100644
--- a/paludis/additional_package_dep_spec_requirement.hh
+++ b/paludis/additional_package_dep_spec_requirement.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
@@ -55,14 +55,19 @@ namespace paludis
* be matched is known. If the bool is false, the string is
* meaningless.
*
+ * \param spec_id The PackageID the spec comes from. May be null. Used for
+ * [use=] style dependencies.
+ *
* \since 0.44 returns pair<bool, std::string>
* \since 0.51 takes optional ChangedChoices arguments
* \since 0.58 takes id by shared_ptr
+ * \since 0.58 takes spec_id
*/
virtual const std::pair<bool, std::string> requirement_met(
const Environment * const,
const ChangedChoices * const maybe_changes_to_owner,
- const std::shared_ptr<const PackageID> &,
+ const std::shared_ptr<const PackageID> & target_id,
+ const std::shared_ptr<const PackageID> & spec_id,
const ChangedChoices * const maybe_changes_to_target) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
@@ -75,13 +80,18 @@ namespace paludis
* Returns true for changes made, false for not possible,
* indeterminate for nothing needs changing.
*
+ * \param spec_id The PackageID the spec comes from. May be null. Used for
+ * [use=] style dependencies.
+ *
* \since 0.51
* \since 0.55 returns Tribool
+ * \since 0.58 takes spec_id
*/
virtual Tribool accumulate_changes_to_make_met(
const Environment * const,
const ChangedChoices * const maybe_changes_to_owner,
const std::shared_ptr<const PackageID> &,
+ const std::shared_ptr<const PackageID> & spec_id,
ChangedChoices &) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
diff --git a/paludis/elike_use_requirement.cc b/paludis/elike_use_requirement.cc
index e63a198..df196b1 100644
--- a/paludis/elike_use_requirement.cc
+++ b/paludis/elike_use_requirement.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
@@ -518,6 +518,7 @@ namespace
const Environment * const env,
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
{
using namespace std::placeholders;
@@ -558,6 +559,7 @@ namespace
const Environment * const env,
const ChangedChoices * const maybe_changes_to_owner,
const std::shared_ptr<const PackageID> & id,
+ const std::shared_ptr<const PackageID> &,
ChangedChoices & changed_choices) const
{
Tribool result(indeterminate);
diff --git a/paludis/elike_use_requirement_TEST.cc b/paludis/elike_use_requirement_TEST.cc
index c4e5a22..9c0fab6 100644
--- a/paludis/elike_use_requirement_TEST.cc
+++ b/paludis/elike_use_requirement_TEST.cc
@@ -25,6 +25,7 @@
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/choice.hh>
#include <paludis/additional_package_dep_spec_requirement.hh>
#include <test/test_framework.hh>
@@ -74,25 +75,25 @@ namespace test_cases
parse_elike_use_requirement("enabled", std::shared_ptr<const PackageID>(), { euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[enabled]");
TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'enabled' enabled");
- TEST_CHECK(req1->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("disabled", std::shared_ptr<const PackageID>(), { euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[disabled]");
TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'disabled' enabled");
- TEST_CHECK(! req2->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement("-enabled", std::shared_ptr<const PackageID>(), { euro_strict_parsing }));
TEST_CHECK_EQUAL(req3->as_raw_string(), "[-enabled]");
TEST_CHECK_EQUAL(req3->as_human_string(), "Flag 'enabled' disabled");
- TEST_CHECK(! req3->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement("-disabled", std::shared_ptr<const PackageID>(), { euro_strict_parsing }));
TEST_CHECK_EQUAL(req4->as_raw_string(), "[-disabled]");
TEST_CHECK_EQUAL(req4->as_human_string(), "Flag 'disabled' disabled");
- TEST_CHECK(req4->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
}
} test_simple_use_requirements;
@@ -115,25 +116,25 @@ namespace test_cases
parse_elike_use_requirement("enabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[enabled]");
TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'enabled' enabled");
- TEST_CHECK(req1->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("disabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[disabled]");
TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'disabled' enabled");
- TEST_CHECK(! req2->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement("-enabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req3->as_raw_string(), "[-enabled]");
TEST_CHECK_EQUAL(req3->as_human_string(), "Flag 'enabled' disabled");
- TEST_CHECK(! req3->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement("-disabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req4->as_raw_string(), "[-disabled]");
TEST_CHECK_EQUAL(req4->as_human_string(), "Flag 'disabled' disabled");
- TEST_CHECK(req4->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
}
} test_simple_use_requirements_portage_syntax;
@@ -156,31 +157,31 @@ namespace test_cases
parse_elike_use_requirement("enabled,-disabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[enabled,-disabled]");
TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'enabled' enabled; Flag 'disabled' disabled");
- TEST_CHECK(req1->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("enabled,disabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[enabled,disabled]");
TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'enabled' enabled; Flag 'disabled' enabled");
- TEST_CHECK(! req2->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement("-enabled,-disabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req3->as_raw_string(), "[-enabled,-disabled]");
TEST_CHECK_EQUAL(req3->as_human_string(), "Flag 'enabled' disabled; Flag 'disabled' disabled");
- TEST_CHECK(! req3->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement("enabled,-disabled,-enabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req4->as_raw_string(), "[enabled,-disabled,-enabled]");
TEST_CHECK_EQUAL(req4->as_human_string(), "Flag 'enabled' enabled; Flag 'disabled' disabled; Flag 'enabled' disabled");
- TEST_CHECK(! req4->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(! req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req5(
parse_elike_use_requirement("enabled,-disabled,enabled", std::shared_ptr<const PackageID>(), { euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req5->as_raw_string(), "[enabled,-disabled,enabled]");
TEST_CHECK_EQUAL(req5->as_human_string(), "Flag 'enabled' enabled; Flag 'disabled' disabled; Flag 'enabled' enabled");
- TEST_CHECK(req5->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(req5->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
}
} test_multiple_use_requirements_portage_syntax;
@@ -205,85 +206,85 @@ namespace test_cases
parse_elike_use_requirement("pkgname?", id, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req1->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req1->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req1->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("pkgname?", id2, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req2->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req2->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req2->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement("-pkgname?", id, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req3->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req3->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(! req3->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req3->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req3->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req3->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement("-pkgname?", id2, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req4->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req4->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req4->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req4->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req4->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req4->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req5(
parse_elike_use_requirement("pkgname!?", id, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req5->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req5->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req5->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req5->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req5->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req5->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req6(
parse_elike_use_requirement("pkgname!?", id2, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req6->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req6->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req6->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req6->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req6->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(! req6->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement("-pkgname!?", id, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req7->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req7->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req7->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req7->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req7->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement("-pkgname!?", id2, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req8->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req8->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(! req8->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req8->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req8->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement("pkgname=", id, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req9->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req9->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req9->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req9->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req9->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement("pkgname=", id2, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req10->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req10->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
- TEST_CHECK(! req10->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req10->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req10->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement("pkgname!=", id, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req11->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req11->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
- TEST_CHECK(! req11->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req11->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req11->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement("pkgname!=", id2, { euro_allow_self_deps, euro_strict_parsing }));
TEST_CHECK_EQUAL(req12->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req12->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req12->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req12->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req12->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(! req12->requirement_met(&env, 0, id2, id2, 0).first);
}
} test_complex_use_requirements;
@@ -308,57 +309,57 @@ namespace test_cases
parse_elike_use_requirement("pkgname?", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req1->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req1->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req1->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("pkgname?", id2, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req2->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req2->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req2->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement("!pkgname?", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req7->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req7->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req7->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req7->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req7->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement("!pkgname?", id2, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req8->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req8->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(! req8->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req8->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req8->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement("pkgname=", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req9->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req9->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req9->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req9->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req9->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement("pkgname=", id2, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req10->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req10->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
- TEST_CHECK(! req10->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req10->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req10->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement("!pkgname=", id, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req11->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req11->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
- TEST_CHECK(! req11->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req11->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req11->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement("!pkgname=", id2, { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
TEST_CHECK_EQUAL(req12->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req12->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req12->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req12->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req12->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(! req12->requirement_met(&env, 0, id2, id2, 0).first);
}
} test_complex_use_requirements_portage_syntax;
@@ -383,113 +384,113 @@ namespace test_cases
parse_elike_use_requirement("pkgname?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req1->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req1->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req1->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("pkgname?", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req2->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req2->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req2->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement("!pkgname?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req7->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req7->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req7->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req7->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req7->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement("!pkgname?", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req8->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req8->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(! req8->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req8->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req8->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement("pkgname=", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req9->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req9->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req9->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req9->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req9->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement("pkgname=", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req10->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req10->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
- TEST_CHECK(! req10->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req10->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req10->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement("!pkgname=", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req11->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req11->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
- TEST_CHECK(! req11->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req11->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req11->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement("!pkgname=", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req12->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req12->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req12->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req12->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req12->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(! req12->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
parse_elike_use_requirement("-pkgname?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req13->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req13->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(! req13->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req13->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req13->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req13->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
parse_elike_use_requirement("-pkgname?", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req14->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req14->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req14->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req14->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req14->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req14->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
parse_elike_use_requirement("pkgname!?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req15->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req15->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req15->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req15->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req15->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req15->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
parse_elike_use_requirement("pkgname!?", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req16->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req16->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req16->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req16->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req16->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(! req16->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
parse_elike_use_requirement("-pkgname!?", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req17->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req17->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req17->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req17->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req17->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req17->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
parse_elike_use_requirement("-pkgname!?", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req18->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req18->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(! req18->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req18->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req18->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req18->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
parse_elike_use_requirement("pkgname!=", id, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req19->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req19->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
- TEST_CHECK(! req19->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req19->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req19->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req19->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
parse_elike_use_requirement("pkgname!=", id2, { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
TEST_CHECK_EQUAL(req20->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req20->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req20->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req20->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req20->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(! req20->requirement_met(&env, 0, id2, id2, 0).first);
}
} test_complex_use_requirements_both_syntaxes;
@@ -607,113 +608,113 @@ namespace test_cases
parse_elike_use_requirement("pkgname?", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req1->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req1->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req1->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("pkgname?", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req2->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req2->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req2->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement("!pkgname?", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req7->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req7->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req7->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req7->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req7->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement("!pkgname?", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req8->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req8->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(! req8->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req8->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req8->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement("pkgname=", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req9->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req9->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req9->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req9->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req9->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement("pkgname=", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req10->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req10->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
- TEST_CHECK(! req10->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req10->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req10->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement("!pkgname=", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req11->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req11->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
- TEST_CHECK(! req11->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req11->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req11->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement("!pkgname=", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req12->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req12->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req12->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req12->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req12->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(! req12->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
parse_elike_use_requirement("-pkgname?", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req13->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req13->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(! req13->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req13->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req13->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req13->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
parse_elike_use_requirement("-pkgname?", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req14->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req14->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req14->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req14->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req14->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req14->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
parse_elike_use_requirement("pkgname!?", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req15->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req15->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req15->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req15->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req15->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req15->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
parse_elike_use_requirement("pkgname!?", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req16->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req16->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req16->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req16->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req16->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(! req16->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
parse_elike_use_requirement("-pkgname!?", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req17->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req17->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req17->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req17->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req17->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req17->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
parse_elike_use_requirement("-pkgname!?", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req18->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req18->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(! req18->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req18->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req18->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req18->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
parse_elike_use_requirement("pkgname!=", id, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req19->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req19->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
- TEST_CHECK(! req19->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req19->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req19->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req19->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
parse_elike_use_requirement("pkgname!=", id2, { euro_allow_self_deps }));
TEST_CHECK_EQUAL(req20->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req20->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req20->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req20->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req20->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(! req20->requirement_met(&env, 0, id2, id2, 0).first);
}
} test_complex_use_requirements_nonstrict;
@@ -738,113 +739,113 @@ namespace test_cases
parse_elike_use_requirement("pkgname?", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req1->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req1->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req1->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("pkgname?", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[pkgname?]");
TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req2->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req2->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req2->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement("!pkgname?", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req7->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req7->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req7->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req7->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req7->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement("!pkgname?", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req8->as_raw_string(), "[!pkgname?]");
TEST_CHECK_EQUAL(req8->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(! req8->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req8->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req8->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement("pkgname=", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req9->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req9->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req9->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req9->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req9->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement("pkgname=", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req10->as_raw_string(), "[pkgname=]");
TEST_CHECK_EQUAL(req10->as_human_string(), "Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'");
- TEST_CHECK(! req10->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req10->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req10->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement("!pkgname=", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req11->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req11->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
- TEST_CHECK(! req11->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req11->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req11->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement("!pkgname=", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req12->as_raw_string(), "[!pkgname=]");
TEST_CHECK_EQUAL(req12->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req12->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req12->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req12->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(! req12->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
parse_elike_use_requirement("-pkgname?", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req13->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req13->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(! req13->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req13->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req13->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req13->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
parse_elike_use_requirement("-pkgname?", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req14->as_raw_string(), "[-pkgname?]");
TEST_CHECK_EQUAL(req14->as_human_string(), "Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req14->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req14->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req14->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req14->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
parse_elike_use_requirement("pkgname!?", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req15->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req15->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req15->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req15->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req15->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req15->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
parse_elike_use_requirement("pkgname!?", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req16->as_raw_string(), "[pkgname!?]");
TEST_CHECK_EQUAL(req16->as_human_string(), "Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req16->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req16->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req16->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(! req16->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
parse_elike_use_requirement("-pkgname!?", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req17->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req17->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'");
- TEST_CHECK(req17->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req17->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req17->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req17->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
parse_elike_use_requirement("-pkgname!?", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req18->as_raw_string(), "[-pkgname!?]");
TEST_CHECK_EQUAL(req18->as_human_string(), "Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'");
- TEST_CHECK(! req18->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req18->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req18->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(req18->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
parse_elike_use_requirement("pkgname!=", id, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req19->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req19->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'");
- TEST_CHECK(! req19->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(req19->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(! req19->requirement_met(&env, 0, id, id, 0).first);
+ TEST_CHECK(req19->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
parse_elike_use_requirement("pkgname!=", id2, { euro_allow_self_deps, euro_portage_syntax }));
TEST_CHECK_EQUAL(req20->as_raw_string(), "[pkgname!=]");
TEST_CHECK_EQUAL(req20->as_human_string(), "Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'");
- TEST_CHECK(req20->requirement_met(&env, 0, id, 0).first);
- TEST_CHECK(! req20->requirement_met(&env, 0, id2, 0).first);
+ TEST_CHECK(req20->requirement_met(&env, 0, id, id2, 0).first);
+ TEST_CHECK(! req20->requirement_met(&env, 0, id2, id2, 0).first);
}
} test_complex_use_requirements_portage_syntax_nonstrict;
@@ -867,25 +868,25 @@ namespace test_cases
parse_elike_use_requirement("missing(+)", std::shared_ptr<const PackageID>(), { euro_allow_default_values, euro_strict_parsing }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[missing(+)]");
TEST_CHECK_EQUAL(req1->as_human_string(), "Flag 'missing' enabled, assuming enabled if missing");
- TEST_CHECK(req1->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("missing(-)", std::shared_ptr<const PackageID>(), { euro_allow_default_values, euro_strict_parsing }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[missing(-)]");
TEST_CHECK_EQUAL(req2->as_human_string(), "Flag 'missing' enabled, assuming disabled if missing");
- TEST_CHECK(! req2->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement("-missing(+)", std::shared_ptr<const PackageID>(), { euro_allow_default_values, euro_strict_parsing }));
TEST_CHECK_EQUAL(req3->as_raw_string(), "[-missing(+)]");
TEST_CHECK_EQUAL(req3->as_human_string(), "Flag 'missing' disabled, assuming enabled if missing");
- TEST_CHECK(! req3->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement("-missing(-)", std::shared_ptr<const PackageID>(), { euro_allow_default_values, euro_strict_parsing }));
TEST_CHECK_EQUAL(req4->as_raw_string(), "[-missing(-)]");
TEST_CHECK_EQUAL(req4->as_human_string(), "Flag 'missing' disabled, assuming disabled if missing");
- TEST_CHECK(req4->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
}
} test_use_requirements_with_defaults;
@@ -908,13 +909,13 @@ namespace test_cases
parse_elike_use_requirement("foo:*", id,
{ euro_allow_default_values, euro_allow_self_deps }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[foo:*]");
- TEST_CHECK(! req1->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(! req1->requirement_met(&env, 0, id, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("foo:*=", id,
{ euro_allow_default_values, euro_allow_self_deps }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[foo:*=]");
- TEST_CHECK(req2->requirement_met(&env, 0, id, 0).first);
+ TEST_CHECK(req2->requirement_met(&env, 0, id, id, 0).first);
}
} test_prefix_star_use_requirements;
@@ -942,16 +943,16 @@ namespace test_cases
{ euro_allow_default_values, euro_allow_self_deps,
euro_allow_default_question_values }));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[foo:*(?)=]");
- TEST_CHECK(req1->requirement_met(&env, 0, id2, 0).first);
- TEST_CHECK(req1->requirement_met(&env, 0, id1, 0).first);
+ TEST_CHECK(req1->requirement_met(&env, 0, id2, id2, 0).first);
+ TEST_CHECK(req1->requirement_met(&env, 0, id1, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("bar:*(?)=", id2,
{ euro_allow_default_values, euro_allow_self_deps,
euro_allow_default_question_values }));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[bar:*(?)=]");
- TEST_CHECK(req2->requirement_met(&env, 0, id2, 0).first);
- TEST_CHECK(req2->requirement_met(&env, 0, id1, 0).first);
+ TEST_CHECK(req2->requirement_met(&env, 0, id2, id2, 0).first);
+ TEST_CHECK(req2->requirement_met(&env, 0, id1, id2, 0).first);
}
} test_question_default_requirements;
}
diff --git a/paludis/legacy/dep_list.cc b/paludis/legacy/dep_list.cc
index ebfc010..6fed80f 100644
--- a/paludis/legacy/dep_list.cc
+++ b/paludis/legacy/dep_list.cc
@@ -595,7 +595,7 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::T
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 AdditionalRequirementsNotMetError(*node.spec(), d->_imp->current_package_id(), *i);
throw AllMaskedError(*node.spec(), d->_imp->current_package_id());
}
diff --git a/paludis/legacy/dep_list_exceptions.cc b/paludis/legacy/dep_list_exceptions.cc
index 55af89d..688a67f 100644
--- a/paludis/legacy/dep_list_exceptions.cc
+++ b/paludis/legacy/dep_list_exceptions.cc
@@ -36,9 +36,11 @@ AllMaskedError::AllMaskedError(const PackageDepSpec & q, const std::shared_ptr<c
}
AdditionalRequirementsNotMetError::AdditionalRequirementsNotMetError(const PackageDepSpec & q,
+ const std::shared_ptr<const PackageID> & f,
const std::shared_ptr<const PackageID> & i) throw () :
DepListError("Error searching for '" + stringify(q) + "': additional requirements are not met on '" + stringify(*i) + "'"),
_query(q),
+ _from_id(f),
_id(i)
{
}
diff --git a/paludis/legacy/dep_list_exceptions.hh b/paludis/legacy/dep_list_exceptions.hh
index 7552602..510a6db 100644
--- a/paludis/legacy/dep_list_exceptions.hh
+++ b/paludis/legacy/dep_list_exceptions.hh
@@ -105,6 +105,7 @@ namespace paludis
{
private:
PackageDepSpec _query;
+ const std::shared_ptr<const PackageID> _from_id;
const std::shared_ptr<const PackageID> _id;
public:
@@ -113,6 +114,7 @@ namespace paludis
AdditionalRequirementsNotMetError(
const PackageDepSpec & query,
+ const std::shared_ptr<const PackageID> & from_id,
const std::shared_ptr<const PackageID> & id) throw ();
virtual ~AdditionalRequirementsNotMetError() throw ();
@@ -136,6 +138,11 @@ namespace paludis
{
return _id;
}
+
+ const std::shared_ptr<const PackageID> from_package_id() const
+ {
+ return _from_id;
+ }
};
/**
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index ef01413..c80b29c 100644
--- a/paludis/match_package.cc
+++ b/paludis/match_package.cc
@@ -82,7 +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 std::shared_ptr<const PackageID> & from_id,
const ChangedChoices * const maybe_changes_to_target,
const MatchPackageOptions & options)
{
@@ -208,7 +208,7 @@ paludis::match_package_with_maybe_changes(
{
for (AdditionalPackageDepSpecRequirements::ConstIterator u(spec.additional_requirements_ptr()->begin()),
u_end(spec.additional_requirements_ptr()->end()) ; u != u_end ; ++u)
- if (! (*u)->requirement_met(&env, maybe_changes_to_owner, id, maybe_changes_to_target).first)
+ if (! (*u)->requirement_met(&env, maybe_changes_to_owner, id, from_id, maybe_changes_to_target).first)
return false;
}
}
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index c31d667..5b9ed83 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -1896,7 +1896,8 @@ Decider::_find_id_for_from(
a != a_end ; ++a)
{
auto b((*a)->accumulate_changes_to_make_met(_imp->env,
- get_changed_choices_for(*c).get(), *i, *why_changed_choices->changed_choices()));
+ get_changed_choices_for(*c).get(), *i, (*c)->from_id(),
+ *why_changed_choices->changed_choices()));
if (b.is_false())
{
ok = false;
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index 2ecdd3c..988ed8a 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -793,6 +793,7 @@ UserKeyRequirement::requirement_met(
const Environment * const env,
const ChangedChoices * const,
const std::shared_ptr<const PackageID> & id,
+ const std::shared_ptr<const PackageID> &,
const ChangedChoices * const) const
{
Context context("When working out whether '" + stringify(*id) + "' matches " + as_raw_string() + ":");
@@ -918,6 +919,7 @@ UserKeyRequirement::accumulate_changes_to_make_met(
const Environment * const,
const ChangedChoices * const,
const std::shared_ptr<const PackageID> &,
+ const std::shared_ptr<const PackageID> &,
ChangedChoices &) const
{
return false;
diff --git a/paludis/user_dep_spec.hh b/paludis/user_dep_spec.hh
index cdfc65f..18b148b 100644
--- a/paludis/user_dep_spec.hh
+++ b/paludis/user_dep_spec.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
@@ -80,7 +80,9 @@ namespace paludis
virtual const std::pair<bool, std::string> requirement_met(
const Environment * const, const ChangedChoices *,
- const std::shared_ptr<const PackageID> &, const ChangedChoices * const) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const std::shared_ptr<const PackageID> &,
+ const std::shared_ptr<const PackageID> &,
+ const ChangedChoices * const) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string as_human_string() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string as_raw_string() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -88,6 +90,7 @@ namespace paludis
const Environment * const,
const ChangedChoices * const,
const std::shared_ptr<const PackageID> &,
+ const std::shared_ptr<const PackageID> &,
ChangedChoices &) const PALUDIS_ATTRIBUTE((warn_unused_result));
};
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index b5aebc5..3103238 100755
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -1424,7 +1424,7 @@ namespace
a_end((*c)->spec().if_package()->additional_requirements_ptr()->end()) ;
a != a_end ; ++a)
{
- const std::pair<bool, std::string> p((*a)->requirement_met(env.get(), 0, u->package_id(), 0));
+ const std::pair<bool, std::string> p((*a)->requirement_met(env.get(), 0, u->package_id(), (*c)->from_id(), 0));
if (p.first)
continue;
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index f6d922a..d64030f 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -1755,7 +1755,7 @@ ConsoleInstallTask::on_additional_requirements_not_met_error(const AdditionalReq
i_end(e.query().additional_requirements_ptr()->end()) ;
i != i_end ; ++i)
{
- const std::pair<bool, std::string> r((*i)->requirement_met(environment(), 0, e.package_id(), 0));
+ const std::pair<bool, std::string> r((*i)->requirement_met(environment(), 0, e.package_id(), e.from_package_id(), 0));
if (r.first)
continue;
output_stream() << " * " << r.second << endl;