aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-07 19:57:37 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-07 19:57:37 +0000
commitb34b54ebdbde67b1923243fc192c5cead44a9f89 (patch)
treed71cf616b710113c6feb9ab8d79b4305ce165588
parentcedb92ca1b428747aa81712198ba1f93cbdab5c2 (diff)
parent2d45cc140b71ba02a9e2bb01a532488d51ac5910 (diff)
downloadpaludis-b34b54ebdbde67b1923243fc192c5cead44a9f89.tar.gz
paludis-b34b54ebdbde67b1923243fc192c5cead44a9f89.tar.xz
Merge branch 'better-additional-requirement-errors'
-rw-r--r--paludis/dep_list.cc12
-rw-r--r--paludis/dep_list_exceptions.cc10
-rw-r--r--paludis/dep_list_exceptions.hh17
-rw-r--r--paludis/dep_spec.cc48
-rw-r--r--paludis/dep_spec.hh18
-rw-r--r--paludis/elike_use_requirement.cc47
-rw-r--r--paludis/elike_use_requirement_TEST.cc310
-rw-r--r--paludis/match_package.cc4
-rw-r--r--paludis/range_rewriter.cc7
-rw-r--r--paludis/user_dep_spec.cc8
-rw-r--r--paludis/user_dep_spec.hh5
-rw-r--r--python/dep_spec.cc13
-rw-r--r--python/dep_spec.hh1
-rwxr-xr-xpython/dep_spec_TEST.py6
-rw-r--r--ruby/dep_spec.cc18
-rw-r--r--ruby/dep_spec_TEST.rb10
-rw-r--r--src/clients/cave/cmd_display_resolution.cc34
-rw-r--r--src/output/console_install_task.cc11
18 files changed, 279 insertions, 300 deletions
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index aa2552a..9bd4150 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 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
@@ -583,13 +583,13 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::T
if (! node.spec()->additional_requirements_ptr())
throw AllMaskedError(*node.spec());
- std::tr1::shared_ptr<const PackageIDSequence> match_except_reqs((*d->_imp->env)[selection::AllVersionsUnsorted(
- generator::Matches(*node.spec()->without_additional_requirements(), d->_imp->opts->match_package_options()))]);
+ std::tr1::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))]);
- for (PackageIDSequence::ConstIterator i(match_except_reqs->begin()),
- i_end(match_except_reqs->end()) ; i != i_end ; ++i)
+ 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());
+ throw AdditionalRequirementsNotMetError(*node.spec(), *i);
throw AllMaskedError(*node.spec());
}
diff --git a/paludis/dep_list_exceptions.cc b/paludis/dep_list_exceptions.cc
index 44b934d..71e5e60 100644
--- a/paludis/dep_list_exceptions.cc
+++ b/paludis/dep_list_exceptions.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2010 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,9 +34,11 @@ AllMaskedError::AllMaskedError(const PackageDepSpec & q) throw () :
{
}
-AdditionalRequirementsNotMetError::AdditionalRequirementsNotMetError(const PackageDepSpec & q) throw () :
- DepListError("Error searching for '" + stringify(q) + "': additional requirements are not met"),
- _query(q)
+AdditionalRequirementsNotMetError::AdditionalRequirementsNotMetError(const PackageDepSpec & q,
+ const std::tr1::shared_ptr<const PackageID> & i) throw () :
+ DepListError("Error searching for '" + stringify(q) + "': additional requirements are not met on '" + stringify(*i) + "'"),
+ _query(q),
+ _id(i)
{
}
diff --git a/paludis/dep_list_exceptions.hh b/paludis/dep_list_exceptions.hh
index a8a3abd..33a5a18 100644
--- a/paludis/dep_list_exceptions.hh
+++ b/paludis/dep_list_exceptions.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2010 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
@@ -99,12 +99,15 @@ namespace paludis
{
private:
PackageDepSpec _query;
+ const std::tr1::shared_ptr<const PackageID> _id;
public:
///\name Basic operations
///\{
- AdditionalRequirementsNotMetError(const PackageDepSpec & query) throw ();
+ AdditionalRequirementsNotMetError(
+ const PackageDepSpec & query,
+ const std::tr1::shared_ptr<const PackageID> & id) throw ();
virtual ~AdditionalRequirementsNotMetError() throw ();
@@ -117,6 +120,16 @@ namespace paludis
{
return _query;
}
+
+ /**
+ * Our ID of choice.
+ *
+ * \since 0.44
+ */
+ const std::tr1::shared_ptr<const PackageID> package_id() const
+ {
+ return _id;
+ }
};
/**
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 189969e..7eed373 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 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
@@ -735,52 +735,6 @@ PackageDepSpec::additional_requirements_ptr() const
return _imp->data->additional_requirements_ptr();
}
-std::tr1::shared_ptr<PackageDepSpec>
-PackageDepSpec::without_additional_requirements() const
-{
- using namespace std::tr1::placeholders;
-
- PartiallyMadePackageDepSpec result(data()->options_for_partially_made_package_dep_spec());
-
- if (package_ptr())
- result.package(*package_ptr());
-
- if (package_name_part_ptr())
- result.package_name_part(*package_name_part_ptr());
-
- if (category_name_part_ptr())
- result.category_name_part(*category_name_part_ptr());
-
- if (version_requirements_ptr())
- std::for_each(version_requirements_ptr()->begin(), version_requirements_ptr()->end(),
- std::tr1::bind(&PartiallyMadePackageDepSpec::version_requirement, &result, _1));
-
- result.version_requirements_mode(version_requirements_mode());
-
- if (slot_requirement_ptr())
- result.slot_requirement(slot_requirement_ptr());
-
- if (in_repository_ptr())
- result.in_repository(*in_repository_ptr());
-
- if (from_repository_ptr())
- result.from_repository(*from_repository_ptr());
-
- if (installed_at_path_ptr())
- result.installed_at_path(*installed_at_path_ptr());
-
- if (installable_to_path_ptr())
- result.installable_to_path(*installable_to_path_ptr());
-
- if (installable_to_repository_ptr())
- result.installable_to_repository(*installable_to_repository_ptr());
-
- if (annotations_key())
- result.annotations(annotations_key());
-
- return make_shared_ptr(new PackageDepSpec(result));
-}
-
std::tr1::shared_ptr<const DepTag>
PackageDepSpec::tag() const
{
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index 071b706..b06c50d 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 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
@@ -301,8 +301,17 @@ namespace paludis
/**
* Is our requirement met for a given PackageID?
+ *
+ * The string in the return type might be a description of why the
+ * requirement was not met. Sometimes better messages can be given
+ * than simply the return value of as_human_string() when the ID to
+ * be matched is known. If the bool is false, the string is
+ * meaningless.
+ *
+ * \since 0.44 returns pair<bool, std::string>
*/
- virtual bool requirement_met(const Environment * const, const PackageID &) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual const std::pair<bool, std::string> requirement_met(
+ const Environment * const, const PackageID &) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
* Return a human readable string representation of ourself.
@@ -590,11 +599,6 @@ namespace paludis
void set_tag(const std::tr1::shared_ptr<const DepTag> & s);
/**
- * Fetch a copy of ourself without additional requirements.
- */
- std::tr1::shared_ptr<PackageDepSpec> without_additional_requirements() const;
-
- /**
* Access to our data.
*/
std::tr1::shared_ptr<const PackageDepSpecData> data() const;
diff --git a/paludis/elike_use_requirement.cc b/paludis/elike_use_requirement.cc
index 07a292a..3b58ae6 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 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 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
@@ -98,7 +98,7 @@ namespace
return _id;
}
- bool requirement_met(const Environment * const env, const PackageID & i) const
+ const std::pair<bool, std::string> requirement_met(const Environment * const env, const PackageID & i) const
{
if (_flags.length() >= 2 && ":*" == _flags.substr(_flags.length() - 2))
{
@@ -120,17 +120,29 @@ namespace
"ID '" << *_id << "' uses requirement '" << _flags << "' but has no choice prefix '" << prefix << "'";
else
{
+ std::pair<bool, std::string> result(true, "");
for (Choice::ConstIterator v((*cc)->begin()), v_end((*cc)->end()) ;
v != v_end ; ++v)
if (! one_requirement_met(env, (*v)->name_with_prefix(), i))
- return false;
+ {
+ if (! result.first)
+ result.second.append(", ");
+ result.second.append(stringify((*v)->name_with_prefix()));
+ result.first = false;
+ }
+
+ if (! result.first)
+ {
+ result.second = as_human_string() + " (unmet: " + result.second + ")";
+ return result;
+ }
}
}
else
if (! one_requirement_met(env, ChoiceNameWithPrefix(_flags), i))
- return false;
+ return std::make_pair(false, as_human_string());
- return true;
+ return std::make_pair(true, as_human_string());
}
const Tribool default_value() const PALUDIS_ATTRIBUTE((warn_unused_result))
@@ -365,8 +377,10 @@ namespace
public AdditionalPackageDepSpecRequirement
{
private:
+ typedef std::vector<std::tr1::shared_ptr<const UseRequirement> > Reqs;
+
std::string _raw;
- std::vector<std::tr1::shared_ptr<const UseRequirement> > _reqs;
+ Reqs _reqs;
public:
UseRequirements(const std::string & r) :
@@ -374,12 +388,25 @@ namespace
{
}
- virtual bool requirement_met(const Environment * const env, const PackageID & id) const
+ virtual const std::pair<bool, std::string> requirement_met(const Environment * const env, const PackageID & id) const
{
using namespace std::tr1::placeholders;
- return _reqs.end() == std::find_if(_reqs.begin(), _reqs.end(), std::tr1::bind(
- std::logical_not<bool>(), std::tr1::bind(
- &UseRequirement::requirement_met, _1, env, std::tr1::cref(id))));
+
+ std::pair<bool, std::string> result(true, "");
+ for (Reqs::const_iterator r(_reqs.begin()), r_end(_reqs.end()) ;
+ r != r_end ; ++r)
+ {
+ std::pair<bool, std::string> r_result((*r)->requirement_met(env, id));
+ if (! r_result.first)
+ {
+ if (! result.first)
+ result.second.append("; ");
+ result.second.append(r_result.second);
+ result.first = false;
+ }
+ }
+
+ return result;
}
virtual const std::string as_human_string() const
diff --git a/paludis/elike_use_requirement_TEST.cc b/paludis/elike_use_requirement_TEST.cc
index a646ca6..6a493fc 100644
--- a/paludis/elike_use_requirement_TEST.cc
+++ b/paludis/elike_use_requirement_TEST.cc
@@ -73,25 +73,25 @@ namespace test_cases
parse_elike_use_requirement("enabled", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(req1->requirement_met(&env, *id).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("disabled", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(! req2->requirement_met(&env, *id).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement("-enabled", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(! req3->requirement_met(&env, *id).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement("-disabled", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(req4->requirement_met(&env, *id).first);
}
} test_simple_use_requirements;
@@ -114,25 +114,25 @@ namespace test_cases
parse_elike_use_requirement("enabled", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(req1->requirement_met(&env, *id).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("disabled", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(! req2->requirement_met(&env, *id).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement("-enabled", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(! req3->requirement_met(&env, *id).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement("-disabled", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(req4->requirement_met(&env, *id).first);
}
} test_simple_use_requirements_portage_syntax;
@@ -155,31 +155,31 @@ namespace test_cases
parse_elike_use_requirement("enabled,-disabled", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(req1->requirement_met(&env, *id).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("enabled,disabled", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(! req2->requirement_met(&env, *id).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement("-enabled,-disabled", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(! req3->requirement_met(&env, *id).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement("enabled,-disabled,-enabled", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(! req4->requirement_met(&env, *id).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req5(
parse_elike_use_requirement("enabled,-disabled,enabled", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(req5->requirement_met(&env, *id).first);
}
} test_multiple_use_requirements_portage_syntax;
@@ -204,85 +204,85 @@ namespace test_cases
parse_elike_use_requirement("pkgname?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req1->requirement_met(&env, *id2));
+ TEST_CHECK(req1->requirement_met(&env, *id).first);
+ TEST_CHECK(! req1->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("pkgname?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req2->requirement_met(&env, *id2));
+ TEST_CHECK(req2->requirement_met(&env, *id).first);
+ TEST_CHECK(req2->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement("-pkgname?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req3->requirement_met(&env, *id2));
+ TEST_CHECK(! req3->requirement_met(&env, *id).first);
+ TEST_CHECK(req3->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement("-pkgname?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req4->requirement_met(&env, *id2));
+ TEST_CHECK(req4->requirement_met(&env, *id).first);
+ TEST_CHECK(req4->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req5(
parse_elike_use_requirement("pkgname!?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req5->requirement_met(&env, *id2));
+ TEST_CHECK(req5->requirement_met(&env, *id).first);
+ TEST_CHECK(req5->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req6(
parse_elike_use_requirement("pkgname!?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req6->requirement_met(&env, *id2));
+ TEST_CHECK(req6->requirement_met(&env, *id).first);
+ TEST_CHECK(! req6->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement("-pkgname!?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req7->requirement_met(&env, *id2));
+ TEST_CHECK(req7->requirement_met(&env, *id).first);
+ TEST_CHECK(req7->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement("-pkgname!?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req8->requirement_met(&env, *id2));
+ TEST_CHECK(! req8->requirement_met(&env, *id).first);
+ TEST_CHECK(req8->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement("pkgname=", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req9->requirement_met(&env, *id2));
+ TEST_CHECK(req9->requirement_met(&env, *id).first);
+ TEST_CHECK(! req9->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement("pkgname=", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req10->requirement_met(&env, *id2));
+ TEST_CHECK(! req10->requirement_met(&env, *id).first);
+ TEST_CHECK(req10->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement("pkgname!=", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req11->requirement_met(&env, *id2));
+ TEST_CHECK(! req11->requirement_met(&env, *id).first);
+ TEST_CHECK(req11->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement("pkgname!=", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req12->requirement_met(&env, *id2));
+ TEST_CHECK(req12->requirement_met(&env, *id).first);
+ TEST_CHECK(! req12->requirement_met(&env, *id2).first);
}
} test_complex_use_requirements;
@@ -307,57 +307,57 @@ namespace test_cases
parse_elike_use_requirement("pkgname?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req1->requirement_met(&env, *id2));
+ TEST_CHECK(req1->requirement_met(&env, *id).first);
+ TEST_CHECK(! req1->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("pkgname?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req2->requirement_met(&env, *id2));
+ TEST_CHECK(req2->requirement_met(&env, *id).first);
+ TEST_CHECK(req2->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement("!pkgname?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req7->requirement_met(&env, *id2));
+ TEST_CHECK(req7->requirement_met(&env, *id).first);
+ TEST_CHECK(req7->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement("!pkgname?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req8->requirement_met(&env, *id2));
+ TEST_CHECK(! req8->requirement_met(&env, *id).first);
+ TEST_CHECK(req8->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement("pkgname=", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req9->requirement_met(&env, *id2));
+ TEST_CHECK(req9->requirement_met(&env, *id).first);
+ TEST_CHECK(! req9->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement("pkgname=", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req10->requirement_met(&env, *id2));
+ TEST_CHECK(! req10->requirement_met(&env, *id).first);
+ TEST_CHECK(req10->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement("!pkgname=", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req11->requirement_met(&env, *id2));
+ TEST_CHECK(! req11->requirement_met(&env, *id).first);
+ TEST_CHECK(req11->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement("!pkgname=", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req12->requirement_met(&env, *id2));
+ TEST_CHECK(req12->requirement_met(&env, *id).first);
+ TEST_CHECK(! req12->requirement_met(&env, *id2).first);
}
} test_complex_use_requirements_portage_syntax;
@@ -382,113 +382,113 @@ namespace test_cases
parse_elike_use_requirement("pkgname?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req1->requirement_met(&env, *id2));
+ TEST_CHECK(req1->requirement_met(&env, *id).first);
+ TEST_CHECK(! req1->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("pkgname?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req2->requirement_met(&env, *id2));
+ TEST_CHECK(req2->requirement_met(&env, *id).first);
+ TEST_CHECK(req2->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement("!pkgname?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req7->requirement_met(&env, *id2));
+ TEST_CHECK(req7->requirement_met(&env, *id).first);
+ TEST_CHECK(req7->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement("!pkgname?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req8->requirement_met(&env, *id2));
+ TEST_CHECK(! req8->requirement_met(&env, *id).first);
+ TEST_CHECK(req8->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement("pkgname=", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req9->requirement_met(&env, *id2));
+ TEST_CHECK(req9->requirement_met(&env, *id).first);
+ TEST_CHECK(! req9->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement("pkgname=", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req10->requirement_met(&env, *id2));
+ TEST_CHECK(! req10->requirement_met(&env, *id).first);
+ TEST_CHECK(req10->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement("!pkgname=", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req11->requirement_met(&env, *id2));
+ TEST_CHECK(! req11->requirement_met(&env, *id).first);
+ TEST_CHECK(req11->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement("!pkgname=", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req12->requirement_met(&env, *id2));
+ TEST_CHECK(req12->requirement_met(&env, *id).first);
+ TEST_CHECK(! req12->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
parse_elike_use_requirement("-pkgname?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req13->requirement_met(&env, *id2));
+ TEST_CHECK(! req13->requirement_met(&env, *id).first);
+ TEST_CHECK(req13->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
parse_elike_use_requirement("-pkgname?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req14->requirement_met(&env, *id2));
+ TEST_CHECK(req14->requirement_met(&env, *id).first);
+ TEST_CHECK(req14->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
parse_elike_use_requirement("pkgname!?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req15->requirement_met(&env, *id2));
+ TEST_CHECK(req15->requirement_met(&env, *id).first);
+ TEST_CHECK(req15->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
parse_elike_use_requirement("pkgname!?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req16->requirement_met(&env, *id2));
+ TEST_CHECK(req16->requirement_met(&env, *id).first);
+ TEST_CHECK(! req16->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
parse_elike_use_requirement("-pkgname!?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req17->requirement_met(&env, *id2));
+ TEST_CHECK(req17->requirement_met(&env, *id).first);
+ TEST_CHECK(req17->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
parse_elike_use_requirement("-pkgname!?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req18->requirement_met(&env, *id2));
+ TEST_CHECK(! req18->requirement_met(&env, *id).first);
+ TEST_CHECK(req18->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
parse_elike_use_requirement("pkgname!=", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req19->requirement_met(&env, *id2));
+ TEST_CHECK(! req19->requirement_met(&env, *id).first);
+ TEST_CHECK(req19->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
parse_elike_use_requirement("pkgname!=", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req20->requirement_met(&env, *id2));
+ TEST_CHECK(req20->requirement_met(&env, *id).first);
+ TEST_CHECK(! req20->requirement_met(&env, *id2).first);
}
} test_complex_use_requirements_both_syntaxes;
@@ -606,113 +606,113 @@ namespace test_cases
parse_elike_use_requirement("pkgname?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req1->requirement_met(&env, *id2));
+ TEST_CHECK(req1->requirement_met(&env, *id).first);
+ TEST_CHECK(! req1->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("pkgname?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req2->requirement_met(&env, *id2));
+ TEST_CHECK(req2->requirement_met(&env, *id).first);
+ TEST_CHECK(req2->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement("!pkgname?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req7->requirement_met(&env, *id2));
+ TEST_CHECK(req7->requirement_met(&env, *id).first);
+ TEST_CHECK(req7->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement("!pkgname?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req8->requirement_met(&env, *id2));
+ TEST_CHECK(! req8->requirement_met(&env, *id).first);
+ TEST_CHECK(req8->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement("pkgname=", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req9->requirement_met(&env, *id2));
+ TEST_CHECK(req9->requirement_met(&env, *id).first);
+ TEST_CHECK(! req9->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement("pkgname=", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req10->requirement_met(&env, *id2));
+ TEST_CHECK(! req10->requirement_met(&env, *id).first);
+ TEST_CHECK(req10->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement("!pkgname=", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req11->requirement_met(&env, *id2));
+ TEST_CHECK(! req11->requirement_met(&env, *id).first);
+ TEST_CHECK(req11->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement("!pkgname=", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req12->requirement_met(&env, *id2));
+ TEST_CHECK(req12->requirement_met(&env, *id).first);
+ TEST_CHECK(! req12->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
parse_elike_use_requirement("-pkgname?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req13->requirement_met(&env, *id2));
+ TEST_CHECK(! req13->requirement_met(&env, *id).first);
+ TEST_CHECK(req13->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
parse_elike_use_requirement("-pkgname?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req14->requirement_met(&env, *id2));
+ TEST_CHECK(req14->requirement_met(&env, *id).first);
+ TEST_CHECK(req14->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
parse_elike_use_requirement("pkgname!?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req15->requirement_met(&env, *id2));
+ TEST_CHECK(req15->requirement_met(&env, *id).first);
+ TEST_CHECK(req15->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
parse_elike_use_requirement("pkgname!?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req16->requirement_met(&env, *id2));
+ TEST_CHECK(req16->requirement_met(&env, *id).first);
+ TEST_CHECK(! req16->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
parse_elike_use_requirement("-pkgname!?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req17->requirement_met(&env, *id2));
+ TEST_CHECK(req17->requirement_met(&env, *id).first);
+ TEST_CHECK(req17->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
parse_elike_use_requirement("-pkgname!?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req18->requirement_met(&env, *id2));
+ TEST_CHECK(! req18->requirement_met(&env, *id).first);
+ TEST_CHECK(req18->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
parse_elike_use_requirement("pkgname!=", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req19->requirement_met(&env, *id2));
+ TEST_CHECK(! req19->requirement_met(&env, *id).first);
+ TEST_CHECK(req19->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
parse_elike_use_requirement("pkgname!=", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req20->requirement_met(&env, *id2));
+ TEST_CHECK(req20->requirement_met(&env, *id).first);
+ TEST_CHECK(! req20->requirement_met(&env, *id2).first);
}
} test_complex_use_requirements_nonstrict;
@@ -737,113 +737,113 @@ namespace test_cases
parse_elike_use_requirement("pkgname?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req1->requirement_met(&env, *id2));
+ TEST_CHECK(req1->requirement_met(&env, *id).first);
+ TEST_CHECK(! req1->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("pkgname?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req2->requirement_met(&env, *id2));
+ TEST_CHECK(req2->requirement_met(&env, *id).first);
+ TEST_CHECK(req2->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
parse_elike_use_requirement("!pkgname?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req7->requirement_met(&env, *id2));
+ TEST_CHECK(req7->requirement_met(&env, *id).first);
+ TEST_CHECK(req7->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
parse_elike_use_requirement("!pkgname?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req8->requirement_met(&env, *id2));
+ TEST_CHECK(! req8->requirement_met(&env, *id).first);
+ TEST_CHECK(req8->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
parse_elike_use_requirement("pkgname=", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req9->requirement_met(&env, *id2));
+ TEST_CHECK(req9->requirement_met(&env, *id).first);
+ TEST_CHECK(! req9->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
parse_elike_use_requirement("pkgname=", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req10->requirement_met(&env, *id2));
+ TEST_CHECK(! req10->requirement_met(&env, *id).first);
+ TEST_CHECK(req10->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
parse_elike_use_requirement("!pkgname=", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req11->requirement_met(&env, *id2));
+ TEST_CHECK(! req11->requirement_met(&env, *id).first);
+ TEST_CHECK(req11->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
parse_elike_use_requirement("!pkgname=", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req12->requirement_met(&env, *id2));
+ TEST_CHECK(req12->requirement_met(&env, *id).first);
+ TEST_CHECK(! req12->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
parse_elike_use_requirement("-pkgname?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req13->requirement_met(&env, *id2));
+ TEST_CHECK(! req13->requirement_met(&env, *id).first);
+ TEST_CHECK(req13->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
parse_elike_use_requirement("-pkgname?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req14->requirement_met(&env, *id2));
+ TEST_CHECK(req14->requirement_met(&env, *id).first);
+ TEST_CHECK(req14->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
parse_elike_use_requirement("pkgname!?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req15->requirement_met(&env, *id2));
+ TEST_CHECK(req15->requirement_met(&env, *id).first);
+ TEST_CHECK(req15->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
parse_elike_use_requirement("pkgname!?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req16->requirement_met(&env, *id2));
+ TEST_CHECK(req16->requirement_met(&env, *id).first);
+ TEST_CHECK(! req16->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
parse_elike_use_requirement("-pkgname!?", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req17->requirement_met(&env, *id2));
+ TEST_CHECK(req17->requirement_met(&env, *id).first);
+ TEST_CHECK(req17->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
parse_elike_use_requirement("-pkgname!?", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req18->requirement_met(&env, *id2));
+ TEST_CHECK(! req18->requirement_met(&env, *id).first);
+ TEST_CHECK(req18->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
parse_elike_use_requirement("pkgname!=", id, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(req19->requirement_met(&env, *id2));
+ TEST_CHECK(! req19->requirement_met(&env, *id).first);
+ TEST_CHECK(req19->requirement_met(&env, *id2).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
parse_elike_use_requirement("pkgname!=", id2, ELikeUseRequirementOptions() + 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, *id));
- TEST_CHECK(! req20->requirement_met(&env, *id2));
+ TEST_CHECK(req20->requirement_met(&env, *id).first);
+ TEST_CHECK(! req20->requirement_met(&env, *id2).first);
}
} test_complex_use_requirements_portage_syntax_nonstrict;
@@ -866,25 +866,25 @@ namespace test_cases
parse_elike_use_requirement("missing(+)", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(req1->requirement_met(&env, *id).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("missing(-)", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(! req2->requirement_met(&env, *id).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
parse_elike_use_requirement("-missing(+)", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(! req3->requirement_met(&env, *id).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
parse_elike_use_requirement("-missing(-)", std::tr1::shared_ptr<const PackageID>(), ELikeUseRequirementOptions() + 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, *id));
+ TEST_CHECK(req4->requirement_met(&env, *id).first);
}
} test_use_requirements_with_defaults;
@@ -907,13 +907,13 @@ namespace test_cases
parse_elike_use_requirement("foo:*", id,
ELikeUseRequirementOptions() + euro_allow_default_values + euro_allow_self_deps));
TEST_CHECK_EQUAL(req1->as_raw_string(), "[foo:*]");
- TEST_CHECK(! req1->requirement_met(&env, *id));
+ TEST_CHECK(! req1->requirement_met(&env, *id).first);
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
parse_elike_use_requirement("foo:*=", id,
ELikeUseRequirementOptions() + euro_allow_default_values + euro_allow_self_deps));
TEST_CHECK_EQUAL(req2->as_raw_string(), "[foo:*=]");
- TEST_CHECK(req2->requirement_met(&env, *id));
+ TEST_CHECK(req2->requirement_met(&env, *id).first);
}
} test_prefix_star_use_requirements;
}
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index b15983b..ee44379 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 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 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
@@ -204,7 +204,7 @@ paludis::match_package(
{
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, entry))
+ if (! (*u)->requirement_met(&env, entry).first)
return false;
}
}
diff --git a/paludis/range_rewriter.cc b/paludis/range_rewriter.cc
index c4ab5e8..0ce918c 100644
--- a/paludis/range_rewriter.cc
+++ b/paludis/range_rewriter.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -154,11 +154,6 @@ namespace
version_requirements->back_inserter());
}
- std::tr1::shared_ptr<const PackageDepSpecData> without_additional_requirements() const
- {
- return make_shared_ptr(new RangeRewrittenPackageDepSpecData(*this));
- }
-
std::tr1::shared_ptr<const PackageDepSpecData> without_slot_requirements() const
{
return make_shared_ptr(new RangeRewrittenPackageDepSpecData(*this));
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index 7c95b70..bbef7a2 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 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 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
@@ -744,17 +744,17 @@ namespace
};
}
-bool
+const std::pair<bool, std::string>
UserKeyRequirement::requirement_met(const Environment * const, const PackageID & id) const
{
Context context("When working out whether '" + stringify(id) + "' matches " + as_raw_string() + ":");
PackageID::MetadataConstIterator m(id.find_metadata(_imp->key));
if (m == id.end_metadata())
- return false;
+ return std::make_pair(false, as_human_string());
KeyComparator c(_imp->value, _imp->op);
- return (*m)->accept_returning<bool>(c);
+ return std::make_pair((*m)->accept_returning<bool>(c), as_human_string());
}
const std::string
diff --git a/paludis/user_dep_spec.hh b/paludis/user_dep_spec.hh
index 4433a5f..5ff57fd 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 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 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
@@ -77,7 +77,8 @@ namespace paludis
///\}
- virtual bool requirement_met(const Environment * const, const PackageID &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const std::pair<bool, std::string> requirement_met(
+ const Environment * const, const PackageID &) 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));
};
diff --git a/python/dep_spec.cc b/python/dep_spec.cc
index 3b1b409..ea6f4f8 100644
--- a/python/dep_spec.cc
+++ b/python/dep_spec.cc
@@ -329,14 +329,6 @@ PythonPackageDepSpec::as_package_dep_spec() const
return this;
}
-const std::tr1::shared_ptr<const PythonPackageDepSpec>
-PythonPackageDepSpec::without_additional_requirements() const
-{
- PackageDepSpec p(*this);
-
- return make_shared_ptr(new PythonPackageDepSpec(*p.without_additional_requirements()));
-}
-
std::tr1::shared_ptr<const QualifiedPackageName>
PythonPackageDepSpec::package_ptr() const
{
@@ -1263,11 +1255,6 @@ void expose_dep_spec()
)
#endif
- .def("without_additional_requirements", &PythonPackageDepSpec::without_additional_requirements,
- "without_additional_requirements() -> PackageDepSpec\n"
- "Fetch a copy of ourself without additional requirements."
- )
-
.def("__str__", &PythonPackageDepSpec::py_str)
;
diff --git a/python/dep_spec.hh b/python/dep_spec.hh
index 57cbefc..f726a02 100644
--- a/python/dep_spec.hh
+++ b/python/dep_spec.hh
@@ -175,7 +175,6 @@ namespace paludis
std::tr1::shared_ptr<const AdditionalPackageDepSpecRequirements> additional_requirements_ptr() const;
std::tr1::shared_ptr<const DepTag> tag() const;
void set_tag(const std::tr1::shared_ptr<const DepTag> & s);
- const std::tr1::shared_ptr<const PythonPackageDepSpec> without_additional_requirements() const;
std::string py_str() const;
diff --git a/python/dep_spec_TEST.py b/python/dep_spec_TEST.py
index 5254f36..556f24b 100755
--- a/python/dep_spec_TEST.py
+++ b/python/dep_spec_TEST.py
@@ -88,12 +88,6 @@ class TestCase_1_DepSpecs(unittest.TestCase):
### ur = iter(spec.additional_requirements).next()
### self.assert_(isinstance(ur, EnabledUseRequirement))
- def test_10_without_additional_requirements(self):
- spec = parse_user_package_dep_spec("foo/monkey[foo]", TestEnvironment(), UserPackageDepSpecOptions())
- pds = spec.without_additional_requirements()
-### self.assertEquals(pds.additional_requirements, None)
-### self.assertEquals(str(pds), "foo/monkey")
-
def test_11_name(self):
self.get_depspecs()
self.assertEqual(str(self.nds.text), "system")
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index d5205b0..12cc845 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
* Copyright (c) 2006, 2007, 2008 Richard Brown
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -595,21 +595,6 @@ namespace
/*
* call-seq:
- * without_additional_requirements -> PackageDepSpec
- *
- * Fetch us without our use requirements.
- */
- VALUE
- package_dep_spec_without_additional_requirements(VALUE self)
- {
- std::tr1::shared_ptr<WrappedSpecBase> * ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<WrappedSpecBase>, ptr);
- return package_dep_spec_to_value(std::tr1::static_pointer_cast<const WrappedSpec<PackageDepSpec> >(
- *ptr)->spec()->without_additional_requirements());
- }
-
- /*
- * call-seq:
* package -> QualifiedPackageName or Nil
*
* Fetch the package name.
@@ -1237,7 +1222,6 @@ namespace
#endif
rb_define_method(c_package_dep_spec, "tag", RUBY_FUNC_CAST(&package_dep_spec_tag), 0);
rb_define_method(c_package_dep_spec, "tag=", RUBY_FUNC_CAST(&package_dep_spec_set_tag), 1);
- rb_define_method(c_package_dep_spec, "without_additional_requirements", RUBY_FUNC_CAST(&package_dep_spec_without_additional_requirements), 0);
VALUE (* package_dep_spec_to_s) (VALUE) = &dep_spec_to_s<PackageDepSpec>;
rb_define_method(c_package_dep_spec, "to_s", RUBY_FUNC_CAST(package_dep_spec_to_s), 0);
diff --git a/ruby/dep_spec_TEST.rb b/ruby/dep_spec_TEST.rb
index 968e9a7..1ded865 100644
--- a/ruby/dep_spec_TEST.rb
+++ b/ruby/dep_spec_TEST.rb
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# vim: set sw=4 sts=4 et tw=80 :
#
-# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
# Copyright (c) 2007 Richard Brown
#
# This file is part of the Paludis package manager. Paludis is free software;
@@ -234,14 +234,6 @@ module Paludis
### assert_equal false, pda.use_requirements[1][:state]
### end
- def test_without_additional_requirements
- assert_equal ">=foo/bar-1:100::testrepo", pda.without_additional_requirements.to_s
- assert_equal "*/bar", pdb.without_additional_requirements.to_s
- assert_equal "foo/bar::installed?", pdc.without_additional_requirements.to_s
- assert_equal "foo/*::/??", pdd.without_additional_requirements.to_s
- assert_equal "foo/bar::testrepo->/mychroot", pde.without_additional_requirements.to_s
- end
-
def test_tag
assert_nil pda.tag
assert_nil pdb.tag
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index a5a63f8..cc1d8b0 100644
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 2009, 2010 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
@@ -619,6 +619,7 @@ namespace
}
void display_unable_to_make_decision(
+ const std::tr1::shared_ptr<Environment> & env,
const std::tr1::shared_ptr<const Resolution> & resolution,
const UnableToMakeDecision & d)
{
@@ -645,9 +646,26 @@ namespace
{
cout << " Did not meet ";
display_one_constraint(**c);
+
ReasonNameGetter g(false);
cout << " from " << (*c)->reason()->accept_returning<std::pair<std::string, bool> >(g).first;
cout << endl;
+
+ if ((*c)->spec().if_package() && (*c)->spec().if_package()->additional_requirements_ptr() &&
+ (! match_package(*env, *(*c)->spec().if_package(), *u->package_id(), MatchPackageOptions())) &&
+ match_package(*env, *(*c)->spec().if_package(), *u->package_id(), MatchPackageOptions() + mpo_ignore_additional_requirements))
+ {
+ for (AdditionalPackageDepSpecRequirements::ConstIterator a((*c)->spec().if_package()->additional_requirements_ptr()->begin()),
+ a_end((*c)->spec().if_package()->additional_requirements_ptr()->end()) ;
+ a != a_end ; ++a)
+ {
+ const std::pair<bool, std::string> p((*a)->requirement_met(env.get(), *u->package_id()));
+ if (p.first)
+ continue;
+
+ cout << " " << p.second << endl;
+ }
+ }
}
}
}
@@ -685,7 +703,7 @@ namespace
bool visit(const UnableToMakeDecision & d) const
{
- display_unable_to_make_decision(resolution, d);
+ display_unable_to_make_decision(env, resolution, d);
return true;
}
};
@@ -822,9 +840,13 @@ namespace
struct DisplayOneDecisionVisitor
{
+ const std::tr1::shared_ptr<Environment> env;
const std::tr1::shared_ptr<const Resolution> resolution;
- DisplayOneDecisionVisitor(const std::tr1::shared_ptr<const Resolution> & r) :
+ DisplayOneDecisionVisitor(
+ const std::tr1::shared_ptr<Environment> & e,
+ const std::tr1::shared_ptr<const Resolution> & r) :
+ env(e),
resolution(r)
{
}
@@ -846,17 +868,17 @@ namespace
void visit(const UnableToMakeDecision & d) const
{
- display_unable_to_make_decision(resolution, d);
+ display_unable_to_make_decision(env, resolution, d);
}
};
void display_one_decision(
- const std::tr1::shared_ptr<Environment> &,
+ const std::tr1::shared_ptr<Environment> & env,
const DisplayResolutionCommandLine &,
const std::tr1::shared_ptr<const Resolution> & resolution,
const Decision & decision)
{
- decision.accept(DisplayOneDecisionVisitor(resolution));
+ decision.accept(DisplayOneDecisionVisitor(env, resolution));
}
void display_errors(
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index aea0964..8f48795 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 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
@@ -1758,11 +1758,16 @@ ConsoleInstallTask::on_additional_requirements_not_met_error(const AdditionalReq
output_stream() << endl;
if (e.query().additional_requirements_ptr())
{
- output_stream() << "Additional requirements are as follows:" << endl;
+ output_stream() << "Unmet additional requirements are as follows:" << endl;
for (AdditionalPackageDepSpecRequirements::ConstIterator i(e.query().additional_requirements_ptr()->begin()),
i_end(e.query().additional_requirements_ptr()->end()) ;
i != i_end ; ++i)
- output_stream() << " * " << (*i)->as_human_string() << endl;
+ {
+ const std::pair<bool, std::string> r((*i)->requirement_met(environment(), *e.package_id()));
+ if (r.first)
+ continue;
+ output_stream() << " * " << r.second << endl;
+ }
output_stream() << endl;
}
output_stream() << "This error usually indicates that one of the packages you are trying to" << endl;