aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2012-08-07 12:14:19 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2012-08-07 14:51:14 +0100
commitb00bd24f7323151ece932b902ec48b867aaaa16b (patch)
treeda2aeffbdeb93a0cf372b0f400e4b34cd6404f23
parentc949a7ca5fce8c386f0c5f34750c24e1f1c284b4 (diff)
downloadpaludis-b00bd24f7323151ece932b902ec48b867aaaa16b.tar.gz
paludis-b00bd24f7323151ece932b902ec48b867aaaa16b.tar.xz
Make presumed logic work
-rw-r--r--paludis/changed_choices.cc4
-rw-r--r--paludis/elike_package_dep_spec-fwd.hh6
-rw-r--r--paludis/elike_package_dep_spec.cc14
-rw-r--r--paludis/elike_use_requirement-fwd.hh6
-rw-r--r--paludis/elike_use_requirement.cc59
-rw-r--r--paludis/elike_use_requirement_TEST.cc262
-rw-r--r--paludis/repositories/e/dep_parser.cc5
-rw-r--r--paludis/repositories/e/e_choices_key.cc2
-rw-r--r--paludis/user_dep_spec.cc2
9 files changed, 204 insertions, 156 deletions
diff --git a/paludis/changed_choices.cc b/paludis/changed_choices.cc
index 4c6bcae..9a0b172 100644
--- a/paludis/changed_choices.cc
+++ b/paludis/changed_choices.cc
@@ -66,10 +66,10 @@ ChangedChoices::add_additional_requirements_to(PartiallyMadePackageDepSpec & spe
{
if (o->second)
spec.additional_requirement(parse_elike_use_requirement("" + stringify(o->first) + "(-)",
- { euro_allow_default_values }));
+ { euro_allow_default_values }, make_null_shared_ptr()));
else
spec.additional_requirement(parse_elike_use_requirement("-" + stringify(o->first) + "(-)",
- { euro_allow_default_values }));
+ { euro_allow_default_values }, make_null_shared_ptr()));
}
}
diff --git a/paludis/elike_package_dep_spec-fwd.hh b/paludis/elike_package_dep_spec-fwd.hh
index c1d2226..9f85247 100644
--- a/paludis/elike_package_dep_spec-fwd.hh
+++ b/paludis/elike_package_dep_spec-fwd.hh
@@ -52,7 +52,8 @@ namespace paludis
PartiallyMadePackageDepSpec partial_parse_elike_package_dep_spec(const std::string & ss,
const ELikePackageDepSpecOptions &,
- const VersionSpecOptions &)
+ const VersionSpecOptions &,
+ const std::shared_ptr<Set<std::string> > & maybe_accumulate_mentioned)
PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE;
void elike_check_sanity(const std::string & s) PALUDIS_VISIBLE;
@@ -61,7 +62,8 @@ namespace paludis
const ELikePackageDepSpecOptions & options,
const VersionSpecOptions & version_options,
bool & had_bracket_version_requirements,
- bool & had_use_requirements) PALUDIS_VISIBLE;
+ bool & had_use_requirements,
+ const std::shared_ptr<Set<std::string> > & maybe_accumulate_mentioned) PALUDIS_VISIBLE;
void elike_remove_trailing_repo_if_exists(std::string & s, PartiallyMadePackageDepSpec & result,
const ELikePackageDepSpecOptions & options) PALUDIS_VISIBLE;
diff --git a/paludis/elike_package_dep_spec.cc b/paludis/elike_package_dep_spec.cc
index 91433ef..a253ff3 100644
--- a/paludis/elike_package_dep_spec.cc
+++ b/paludis/elike_package_dep_spec.cc
@@ -23,6 +23,7 @@
#include <paludis/util/options.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/version_operator.hh>
#include <paludis/version_spec.hh>
@@ -90,7 +91,8 @@ paludis::elike_remove_trailing_square_bracket_if_exists(std::string & s, Partial
const ELikePackageDepSpecOptions & options,
const VersionSpecOptions & version_options,
bool & had_bracket_version_requirements,
- bool & had_use_requirements)
+ bool & had_use_requirements,
+ const std::shared_ptr<Set<std::string> > & maybe_accumulate_mentioned)
{
std::string::size_type use_group_p;
if (std::string::npos == ((use_group_p = s.rfind('['))))
@@ -238,7 +240,7 @@ paludis::elike_remove_trailing_square_bracket_if_exists(std::string & s, Partial
if (options[epdso_strict_parsing])
euro += euro_strict_parsing;
- std::shared_ptr<const AdditionalPackageDepSpecRequirement> req(parse_elike_use_requirement(flag, euro));
+ std::shared_ptr<const AdditionalPackageDepSpecRequirement> req(parse_elike_use_requirement(flag, euro, maybe_accumulate_mentioned));
result.additional_requirement(req);
break;
@@ -470,7 +472,8 @@ namespace
PartiallyMadePackageDepSpec
paludis::partial_parse_elike_package_dep_spec(
const std::string & ss, const ELikePackageDepSpecOptions & options,
- const VersionSpecOptions & version_options)
+ const VersionSpecOptions & version_options,
+ const std::shared_ptr<Set<std::string> > & maybe_accumulate_mentioned)
{
using namespace std::placeholders;
@@ -494,7 +497,8 @@ paludis::partial_parse_elike_package_dep_spec(
n::remove_trailing_repo_if_exists() = std::bind(&elike_remove_trailing_repo_if_exists, _1, _2, options),
n::remove_trailing_slot_if_exists() = std::bind(&elike_remove_trailing_slot_if_exists, _1, _2, options),
n::remove_trailing_square_bracket_if_exists() = std::bind(&elike_remove_trailing_square_bracket_if_exists,
- _1, _2, options, version_options, std::ref(had_bracket_version_requirements), std::ref(had_use_requirements))
+ _1, _2, options, version_options, std::ref(had_bracket_version_requirements), std::ref(had_use_requirements),
+ std::ref(maybe_accumulate_mentioned))
));
}
@@ -502,6 +506,6 @@ PackageDepSpec
paludis::parse_elike_package_dep_spec(const std::string & ss, const ELikePackageDepSpecOptions & options,
const VersionSpecOptions & version_options)
{
- return partial_parse_elike_package_dep_spec(ss, options, version_options);
+ return partial_parse_elike_package_dep_spec(ss, options, version_options, make_null_shared_ptr());
}
diff --git a/paludis/elike_use_requirement-fwd.hh b/paludis/elike_use_requirement-fwd.hh
index 89c8f1c..c05545e 100644
--- a/paludis/elike_use_requirement-fwd.hh
+++ b/paludis/elike_use_requirement-fwd.hh
@@ -38,10 +38,12 @@ namespace paludis
typedef Options<ELikeUseRequirementOption> ELikeUseRequirementOptions;
std::shared_ptr<const AdditionalPackageDepSpecRequirement> parse_elike_use_requirement(
- const std::string &, const ELikeUseRequirementOptions &)
+ const std::string &, const ELikeUseRequirementOptions &,
+ const std::shared_ptr<Set<std::string> > & maybe_accumulate_mentioned)
PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE;
- std::shared_ptr<const AdditionalPackageDepSpecRequirement> make_elike_presumed_choices_requirement()
+ std::shared_ptr<const AdditionalPackageDepSpecRequirement> make_elike_presumed_choices_requirement(
+ const std::shared_ptr<const Set<std::string> > mentioned)
PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE;
}
diff --git a/paludis/elike_use_requirement.cc b/paludis/elike_use_requirement.cc
index 61a7d9b..3100af6 100644
--- a/paludis/elike_use_requirement.cc
+++ b/paludis/elike_use_requirement.cc
@@ -602,16 +602,20 @@ namespace
const std::string & c,
Tribool d,
const bool i,
- const ELikeUseRequirementOptions & options)
+ const ELikeUseRequirementOptions & options,
+ const std::shared_ptr<Set<std::string> > & maybe_accumulate_mentioned)
{
result->add_requirement(factory(c, options, d, i));
+ if (maybe_accumulate_mentioned)
+ maybe_accumulate_mentioned->insert(c);
}
void
parse_one_use_requirement(
const std::shared_ptr<UseRequirements> & result,
const std::string & s, std::string & flag,
- const ELikeUseRequirementOptions & options)
+ const ELikeUseRequirementOptions & options,
+ const std::shared_ptr<Set<std::string> > & maybe_accumulate_mentioned)
{
Factory factory;
@@ -774,7 +778,7 @@ namespace
}
flag.erase(flag.length() - 3, 3);
- parse_flag(result, factory, flag, Tribool(true), false, options);
+ parse_flag(result, factory, flag, Tribool(true), false, options, maybe_accumulate_mentioned);
}
else if ('-' == flag.at(flag.length() - 2))
{
@@ -788,7 +792,7 @@ namespace
}
flag.erase(flag.length() - 3, 3);
- parse_flag(result, factory, flag, Tribool(false), false, options);
+ parse_flag(result, factory, flag, Tribool(false), false, options, maybe_accumulate_mentioned);
}
else if ('?' == flag.at(flag.length() - 2))
{
@@ -802,13 +806,13 @@ namespace
}
flag.erase(flag.length() - 3, 3);
- parse_flag(result, factory, flag, Tribool(false), true, options);
+ parse_flag(result, factory, flag, Tribool(false), true, options, maybe_accumulate_mentioned);
}
else
throw ELikeUseRequirementError(s, "Invalid [] contents");
}
else
- parse_flag(result, factory, flag, Tribool(indeterminate), false, options);
+ parse_flag(result, factory, flag, Tribool(indeterminate), false, options, maybe_accumulate_mentioned);
}
}
@@ -819,7 +823,8 @@ ELikeUseRequirementError::ELikeUseRequirementError(const std::string & s, const
std::shared_ptr<const AdditionalPackageDepSpecRequirement>
paludis::parse_elike_use_requirement(const std::string & s,
- const ELikeUseRequirementOptions & options)
+ const ELikeUseRequirementOptions & options,
+ const std::shared_ptr<Set<std::string> > & maybe_accumulate_mentioned)
{
Context context("When parsing use requirement '" + s + "':");
@@ -829,7 +834,7 @@ paludis::parse_elike_use_requirement(const std::string & s,
{
std::string::size_type comma(s.find(',', pos));
std::string flag(s.substr(pos, std::string::npos == comma ? comma : comma - pos));
- parse_one_use_requirement(result, s, flag, options);
+ parse_one_use_requirement(result, s, flag, options, maybe_accumulate_mentioned);
if (std::string::npos == comma)
break;
@@ -853,7 +858,16 @@ namespace
class ELikePresumedChoicesRequirement :
public AdditionalPackageDepSpecRequirement
{
+ private:
+ const std::shared_ptr<const Set<std::string> > _mentioned;
+
public:
+ ELikePresumedChoicesRequirement(
+ const std::shared_ptr<const Set<std::string> > m) :
+ _mentioned(m)
+ {
+ }
+
virtual const std::pair<bool, std::string> requirement_met(
const Environment * const,
const ChangedChoices * const,
@@ -865,14 +879,32 @@ namespace
return std::make_pair(true, "");
auto choices(id->choices_key()->parse_value());
+ std::string p;
+ int n(0);
for (auto c(choices->begin()), c_end(choices->end()) ; c != c_end ; ++c)
+ {
+ if (_mentioned->end() != _mentioned->find(stringify((*c)->prefix()) + ":*"))
+ continue;
+
for (auto v((*c)->begin()), v_end((*c)->end()) ; v != v_end ; ++v)
if ((*v)->presumed())
{
- return std::make_pair(false, as_human_string(id));
+ if (_mentioned->end() != _mentioned->find(stringify((*v)->name_with_prefix())))
+ continue;
+
+ ++n;
+ if (! p.empty())
+ p.append("', '");
+ p.append(stringify((*v)->name_with_prefix()));
}
+ }
- return std::make_pair(true, as_human_string(id));
+ if (n > 1)
+ return std::make_pair(false, "Flags '" + p + "' enabled (presumed)");
+ else if (n == 1)
+ return std::make_pair(false, "Flag '" + p + "' enabled (presumed)");
+ else
+ return std::make_pair(true, as_human_string(id));
}
virtual Tribool accumulate_changes_to_make_met(
@@ -891,7 +923,7 @@ namespace
virtual const std::string as_human_string(
const std::shared_ptr<const PackageID> &) const PALUDIS_ATTRIBUTE((warn_unused_result))
{
- return "Remaining explicit flags enabled";
+ return "Remaining presumed flags enabled";
}
virtual const std::string as_raw_string() const PALUDIS_ATTRIBUTE((warn_unused_result))
@@ -902,8 +934,9 @@ namespace
}
std::shared_ptr<const AdditionalPackageDepSpecRequirement>
-paludis::make_elike_presumed_choices_requirement()
+paludis::make_elike_presumed_choices_requirement(
+ const std::shared_ptr<const Set<std::string> > mentioned)
{
- return std::make_shared<ELikePresumedChoicesRequirement>();
+ return std::make_shared<ELikePresumedChoicesRequirement>(mentioned);
}
diff --git a/paludis/elike_use_requirement_TEST.cc b/paludis/elike_use_requirement_TEST.cc
index f0872dd..a0cde68 100644
--- a/paludis/elike_use_requirement_TEST.cc
+++ b/paludis/elike_use_requirement_TEST.cc
@@ -55,6 +55,12 @@ namespace
id->choices_key()->add(t->substr(0, p), t->substr(p + 1));
}
}
+
+ std::shared_ptr<const AdditionalPackageDepSpecRequirement> parse_elike_use_requirement_no_accumulate(
+ const std::string & s, const ELikeUseRequirementOptions & o)
+ {
+ return parse_elike_use_requirement(s, o, make_null_shared_ptr());
+ }
}
TEST(ELikeUseRequirements, Simple)
@@ -69,25 +75,25 @@ TEST(ELikeUseRequirements, Simple)
set_conditionals(id, "enabled disabled");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("enabled", { euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("enabled", { euro_strict_parsing }));
EXPECT_EQ("[enabled]", req1->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled", req1->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("disabled", { euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("disabled", { euro_strict_parsing }));
EXPECT_EQ("[disabled]", req2->as_raw_string());
EXPECT_EQ("Flag 'disabled' enabled", req2->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
- parse_elike_use_requirement("-enabled", { euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("-enabled", { euro_strict_parsing }));
EXPECT_EQ("[-enabled]", req3->as_raw_string());
EXPECT_EQ("Flag 'enabled' disabled", req3->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
- parse_elike_use_requirement("-disabled", { euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("-disabled", { euro_strict_parsing }));
EXPECT_EQ("[-disabled]", req4->as_raw_string());
EXPECT_EQ("Flag 'disabled' disabled", req4->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
@@ -105,25 +111,25 @@ TEST(ELikeUseRequirements, Portage)
set_conditionals(id, "enabled disabled");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("enabled", { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("enabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[enabled]", req1->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled", req1->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("disabled", { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("disabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[disabled]", req2->as_raw_string());
EXPECT_EQ("Flag 'disabled' enabled", req2->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
- parse_elike_use_requirement("-enabled", { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("-enabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[-enabled]", req3->as_raw_string());
EXPECT_EQ("Flag 'enabled' disabled", req3->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
- parse_elike_use_requirement("-disabled", { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("-disabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[-disabled]", req4->as_raw_string());
EXPECT_EQ("Flag 'disabled' disabled", req4->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
@@ -141,31 +147,31 @@ TEST(ELikeUseRequirements, Multiple)
set_conditionals(id, "enabled disabled");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("enabled,-disabled", { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("enabled,-disabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[enabled,-disabled]", req1->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled; Flag 'disabled' disabled", req1->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("enabled,disabled", { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("enabled,disabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[enabled,disabled]", req2->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled; Flag 'disabled' enabled", req2->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
- parse_elike_use_requirement("-enabled,-disabled", { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("-enabled,-disabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[-enabled,-disabled]", req3->as_raw_string());
EXPECT_EQ("Flag 'enabled' disabled; Flag 'disabled' disabled", req3->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! 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", { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("enabled,-disabled,-enabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[enabled,-disabled,-enabled]", req4->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled; Flag 'disabled' disabled; Flag 'enabled' disabled", req4->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! 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", { euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("enabled,-disabled,enabled", { euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[enabled,-disabled,enabled]", req5->as_raw_string());
EXPECT_EQ("Flag 'enabled' enabled; Flag 'disabled' disabled; Flag 'enabled' enabled", req5->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(req5->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
@@ -185,84 +191,84 @@ TEST(ELikeUseRequirements, Complex)
set_conditionals(id2, "pkgname");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req1->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'", req1->as_human_string(id));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req2->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'", req2->as_human_string(id2));
EXPECT_TRUE(req2->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
- parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[-pkgname?]", req3->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'", req3->as_human_string(id));
EXPECT_TRUE(! req3->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req3->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
- parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[-pkgname?]", req4->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'", req4->as_human_string(id2));
EXPECT_TRUE(req4->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req4->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req5(
- parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname!?]", req5->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'", req5->as_human_string(id));
EXPECT_TRUE(req5->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req5->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req6(
- parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname!?]", req6->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'", req6->as_human_string(id2));
EXPECT_TRUE(req6->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(! req6->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
- parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[-pkgname!?]", req7->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req7->as_human_string(id));
EXPECT_TRUE(req7->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
- parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[-pkgname!?]", req8->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req8->as_human_string(id2));
EXPECT_TRUE(! req8->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
- parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req9->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'", req9->as_human_string(id));
EXPECT_TRUE(req9->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
- parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req10->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'", req10->as_human_string(id2));
EXPECT_TRUE(! req10->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
- parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname!=]", req11->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req11->as_human_string(id));
EXPECT_TRUE(! req11->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
- parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps, euro_strict_parsing }));
EXPECT_EQ("[pkgname!=]", req12->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req12->as_human_string(id2));
EXPECT_TRUE(req12->requirement_met(&env, 0, id, id2, 0).first);
@@ -283,56 +289,56 @@ TEST(ELikeUseRequirements, ComplexPortage)
set_conditionals(id2, "pkgname");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req1->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'", req1->as_human_string(id));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req2->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'", req2->as_human_string(id2));
EXPECT_TRUE(req2->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
- parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[!pkgname?]", req7->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req7->as_human_string(id));
EXPECT_TRUE(req7->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
- parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[!pkgname?]", req8->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req8->as_human_string(id2));
EXPECT_TRUE(! req8->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
- parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req9->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'", req9->as_human_string(id));
EXPECT_TRUE(req9->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
- parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req10->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'", req10->as_human_string(id2));
EXPECT_TRUE(! req10->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
- parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[!pkgname=]", req11->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req11->as_human_string(id));
EXPECT_TRUE(! req11->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
- parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }));
EXPECT_EQ("[!pkgname=]", req12->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req12->as_human_string(id2));
EXPECT_TRUE(req12->requirement_met(&env, 0, id, id2, 0).first);
@@ -353,112 +359,112 @@ TEST(ELikeUseRequirements, Both)
set_conditionals(id2, "pkgname");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req1->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'", req1->as_human_string(id));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname?]", req2->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'", req2->as_human_string(id2));
EXPECT_TRUE(req2->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
- parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[!pkgname?]", req7->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req7->as_human_string(id));
EXPECT_TRUE(req7->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
- parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[!pkgname?]", req8->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req8->as_human_string(id2));
EXPECT_TRUE(! req8->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
- parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req9->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'", req9->as_human_string(id));
EXPECT_TRUE(req9->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
- parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname=]", req10->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'", req10->as_human_string(id2));
EXPECT_TRUE(! req10->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
- parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[!pkgname=]", req11->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req11->as_human_string(id));
EXPECT_TRUE(! req11->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
- parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[!pkgname=]", req12->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req12->as_human_string(id2));
EXPECT_TRUE(req12->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(! req12->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
- parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[-pkgname?]", req13->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'", req13->as_human_string(id));
EXPECT_TRUE(! req13->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req13->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
- parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[-pkgname?]", req14->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'", req14->as_human_string(id2));
EXPECT_TRUE(req14->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req14->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
- parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname!?]", req15->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'", req15->as_human_string(id));
EXPECT_TRUE(req15->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req15->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
- parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname!?]", req16->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'", req16->as_human_string(id2));
EXPECT_TRUE(req16->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(! req16->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
- parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[-pkgname!?]", req17->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req17->as_human_string(id));
EXPECT_TRUE(req17->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req17->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
- parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[-pkgname!?]", req18->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req18->as_human_string(id2));
EXPECT_TRUE(! req18->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req18->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
- parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname!=]", req19->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req19->as_human_string(id));
EXPECT_TRUE(! req19->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req19->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
- parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }));
EXPECT_EQ("[pkgname!=]", req20->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req20->as_human_string(id2));
EXPECT_TRUE(req20->requirement_met(&env, 0, id, id2, 0).first);
@@ -476,18 +482,18 @@ TEST(ELikeUseRequirements, Malformed)
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
- EXPECT_THROW(parse_elike_use_requirement("", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("-", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("?", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("-?", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("!?", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("-!?", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("=", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("!=", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
-
- EXPECT_THROW(parse_elike_use_requirement("!test?", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("!test=", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("test1,test2", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("-", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("?", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("-?", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("!?", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("-!?", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("=", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("!=", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("!test?", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("!test=", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("test1,test2", { euro_allow_self_deps, euro_strict_parsing }), ELikeUseRequirementError);
}
TEST(ELikeUseRequirements, MalformedPortage)
@@ -501,22 +507,22 @@ TEST(ELikeUseRequirements, MalformedPortage)
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
- EXPECT_THROW(parse_elike_use_requirement("", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("-", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("!?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("!=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
-
- EXPECT_THROW(parse_elike_use_requirement(",", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("test,", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement(",test", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("test,,test", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
-
- EXPECT_THROW(parse_elike_use_requirement("test!?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("-test?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("-test!?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("test!=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("-", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("!?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("!=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate(",", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("test,", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate(",test", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("test,,test", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("test!?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("-test?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("-test!?", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("test!=", { euro_allow_self_deps, euro_portage_syntax, euro_strict_parsing }), ELikeUseRequirementError);
}
TEST(ELikeUseRequirements, MalformedBoth)
@@ -530,17 +536,17 @@ TEST(ELikeUseRequirements, MalformedBoth)
std::shared_ptr<FakePackageID> id(fake->add_version("cat", "enabled", "1"));
set_conditionals(id, "pkgname");
- EXPECT_THROW(parse_elike_use_requirement("", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("-", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("!=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
-
- EXPECT_THROW(parse_elike_use_requirement(",", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("test,", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement(",test", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
- EXPECT_THROW(parse_elike_use_requirement("test,,test", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("-", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("!?", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("!=", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate(",", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("test,", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate(",test", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
+ EXPECT_THROW(parse_elike_use_requirement_no_accumulate("test,,test", { euro_allow_self_deps, euro_both_syntaxes, euro_strict_parsing }), ELikeUseRequirementError);
}
TEST(ELikeUseRequirements, ComplexNonStrict)
@@ -557,112 +563,112 @@ TEST(ELikeUseRequirements, ComplexNonStrict)
set_conditionals(id2, "pkgname");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("pkgname?", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname?]", req1->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'", req1->as_human_string(id));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("pkgname?", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname?]", req2->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'", req2->as_human_string(id2));
EXPECT_TRUE(req2->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
- parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[!pkgname?]", req7->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req7->as_human_string(id));
EXPECT_TRUE(req7->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
- parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[!pkgname?]", req8->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req8->as_human_string(id2));
EXPECT_TRUE(! req8->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
- parse_elike_use_requirement("pkgname=", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname=]", req9->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'", req9->as_human_string(id));
EXPECT_TRUE(req9->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
- parse_elike_use_requirement("pkgname=", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname=]", req10->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'", req10->as_human_string(id2));
EXPECT_TRUE(! req10->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
- parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps }));
EXPECT_EQ("[!pkgname=]", req11->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req11->as_human_string(id));
EXPECT_TRUE(! req11->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
- parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps }));
EXPECT_EQ("[!pkgname=]", req12->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req12->as_human_string(id2));
EXPECT_TRUE(req12->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(! req12->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
- parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[-pkgname?]", req13->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'", req13->as_human_string(id));
EXPECT_TRUE(! req13->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req13->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
- parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps }));
EXPECT_EQ("[-pkgname?]", req14->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'", req14->as_human_string(id2));
EXPECT_TRUE(req14->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req14->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
- parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname!?]", req15->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'", req15->as_human_string(id));
EXPECT_TRUE(req15->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req15->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
- parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname!?]", req16->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'", req16->as_human_string(id2));
EXPECT_TRUE(req16->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(! req16->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
- parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps }));
EXPECT_EQ("[-pkgname!?]", req17->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req17->as_human_string(id));
EXPECT_TRUE(req17->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req17->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
- parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps }));
EXPECT_EQ("[-pkgname!?]", req18->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req18->as_human_string(id2));
EXPECT_TRUE(! req18->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req18->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
- parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname!=]", req19->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req19->as_human_string(id));
EXPECT_TRUE(! req19->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req19->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
- parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps }));
EXPECT_EQ("[pkgname!=]", req20->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req20->as_human_string(id2));
EXPECT_TRUE(req20->requirement_met(&env, 0, id, id2, 0).first);
@@ -683,112 +689,112 @@ TEST(ELikeUseRequirements, PortageNonStrict)
set_conditionals(id2, "pkgname");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname?]", req1->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/enabled-1:0::fake'", req1->as_human_string(id));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req1->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname?]", req2->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is enabled for 'cat/disabled-1:0::fake'", req2->as_human_string(id2));
EXPECT_TRUE(req2->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req7(
- parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[!pkgname?]", req7->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req7->as_human_string(id));
EXPECT_TRUE(req7->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req7->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req8(
- parse_elike_use_requirement("!pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("!pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[!pkgname?]", req8->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req8->as_human_string(id2));
EXPECT_TRUE(! req8->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req8->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req9(
- parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname=]", req9->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/enabled-1:0::fake'", req9->as_human_string(id));
EXPECT_TRUE(req9->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(! req9->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req10(
- parse_elike_use_requirement("pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname=]", req10->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled like it is for 'cat/disabled-1:0::fake'", req10->as_human_string(id2));
EXPECT_TRUE(! req10->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req10->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req11(
- parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[!pkgname=]", req11->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req11->as_human_string(id));
EXPECT_TRUE(! req11->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req11->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req12(
- parse_elike_use_requirement("!pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("!pkgname=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[!pkgname=]", req12->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req12->as_human_string(id2));
EXPECT_TRUE(req12->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(! req12->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req13(
- parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[-pkgname?]", req13->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/enabled-1:0::fake'", req13->as_human_string(id));
EXPECT_TRUE(! req13->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req13->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req14(
- parse_elike_use_requirement("-pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("-pkgname?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[-pkgname?]", req14->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is enabled for 'cat/disabled-1:0::fake'", req14->as_human_string(id2));
EXPECT_TRUE(req14->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req14->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req15(
- parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname!?]", req15->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/enabled-1:0::fake'", req15->as_human_string(id));
EXPECT_TRUE(req15->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req15->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req16(
- parse_elike_use_requirement("pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname!?]", req16->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled if it is disabled for 'cat/disabled-1:0::fake'", req16->as_human_string(id2));
EXPECT_TRUE(req16->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(! req16->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req17(
- parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[-pkgname!?]", req17->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/enabled-1:0::fake'", req17->as_human_string(id));
EXPECT_TRUE(req17->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req17->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req18(
- parse_elike_use_requirement("-pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("-pkgname!?", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[-pkgname!?]", req18->as_raw_string());
EXPECT_EQ("Flag 'pkgname' disabled if it is disabled for 'cat/disabled-1:0::fake'", req18->as_human_string(id2));
EXPECT_TRUE(! req18->requirement_met(&env, 0, id, id2, 0).first);
EXPECT_TRUE(req18->requirement_met(&env, 0, id2, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req19(
- parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname!=]", req19->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/enabled-1:0::fake'", req19->as_human_string(id));
EXPECT_TRUE(! req19->requirement_met(&env, 0, id, id, 0).first);
EXPECT_TRUE(req19->requirement_met(&env, 0, id2, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req20(
- parse_elike_use_requirement("pkgname!=", { euro_allow_self_deps, euro_portage_syntax }));
+ parse_elike_use_requirement_no_accumulate("pkgname!=", { euro_allow_self_deps, euro_portage_syntax }));
EXPECT_EQ("[pkgname!=]", req20->as_raw_string());
EXPECT_EQ("Flag 'pkgname' enabled or disabled opposite to how it is for 'cat/disabled-1:0::fake'", req20->as_human_string(id2));
EXPECT_TRUE(req20->requirement_met(&env, 0, id, id2, 0).first);
@@ -807,25 +813,25 @@ TEST(ELikeUseRequirements, Defaults)
set_conditionals(id, "enabled disabled");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("missing(+)", { euro_allow_default_values, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("missing(+)", { euro_allow_default_values, euro_strict_parsing }));
EXPECT_EQ("[missing(+)]", req1->as_raw_string());
EXPECT_EQ("Flag 'missing' enabled, assuming enabled if missing", req1->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(req1->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("missing(-)", { euro_allow_default_values, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("missing(-)", { euro_allow_default_values, euro_strict_parsing }));
EXPECT_EQ("[missing(-)]", req2->as_raw_string());
EXPECT_EQ("Flag 'missing' enabled, assuming disabled if missing", req2->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req2->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req3(
- parse_elike_use_requirement("-missing(+)", { euro_allow_default_values, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("-missing(+)", { euro_allow_default_values, euro_strict_parsing }));
EXPECT_EQ("[-missing(+)]", req3->as_raw_string());
EXPECT_EQ("Flag 'missing' disabled, assuming enabled if missing", req3->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(! req3->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req4(
- parse_elike_use_requirement("-missing(-)", { euro_allow_default_values, euro_strict_parsing }));
+ parse_elike_use_requirement_no_accumulate("-missing(-)", { euro_allow_default_values, euro_strict_parsing }));
EXPECT_EQ("[-missing(-)]", req4->as_raw_string());
EXPECT_EQ("Flag 'missing' disabled, assuming disabled if missing", req4->as_human_string(make_null_shared_ptr()));
EXPECT_TRUE(req4->requirement_met(&env, 0, id, make_null_shared_ptr(), 0).first);
@@ -843,12 +849,12 @@ TEST(ELikeUseRequirements, PrefixStar)
set_conditionals(id, "foo:enabled foo:disabled");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("foo:*", { euro_allow_default_values, euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("foo:*", { euro_allow_default_values, euro_allow_self_deps }));
EXPECT_EQ("[foo:*]", req1->as_raw_string());
EXPECT_TRUE(! req1->requirement_met(&env, 0, id, id, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("foo:*=", { euro_allow_default_values, euro_allow_self_deps }));
+ parse_elike_use_requirement_no_accumulate("foo:*=", { euro_allow_default_values, euro_allow_self_deps }));
EXPECT_EQ("[foo:*=]", req2->as_raw_string());
EXPECT_TRUE(req2->requirement_met(&env, 0, id, id, 0).first);
}
@@ -869,13 +875,13 @@ TEST(ELikeUseRequirements, QuestionDefaults)
set_conditionals(id2, "foo:enabled foo:disabled bar:enabled bar:disabled");
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req1(
- parse_elike_use_requirement("foo:*(?)=", { euro_allow_default_values, euro_allow_self_deps, euro_allow_default_question_values }));
+ parse_elike_use_requirement_no_accumulate("foo:*(?)=", { euro_allow_default_values, euro_allow_self_deps, euro_allow_default_question_values }));
EXPECT_EQ("[foo:*(?)=]", req1->as_raw_string());
EXPECT_TRUE(req1->requirement_met(&env, 0, id2, id2, 0).first);
EXPECT_TRUE(req1->requirement_met(&env, 0, id1, id2, 0).first);
std::shared_ptr<const AdditionalPackageDepSpecRequirement> req2(
- parse_elike_use_requirement("bar:*(?)=", { euro_allow_default_values, euro_allow_self_deps, euro_allow_default_question_values }));
+ parse_elike_use_requirement_no_accumulate("bar:*(?)=", { euro_allow_default_values, euro_allow_self_deps, euro_allow_default_question_values }));
EXPECT_EQ("[bar:*(?)=]", req2->as_raw_string());
EXPECT_TRUE(req2->requirement_met(&env, 0, id2, id2, 0).first);
EXPECT_TRUE(req2->requirement_met(&env, 0, id1, id2, 0).first);
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index d423c9a..0d1728a 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -111,10 +111,11 @@ namespace
const EAPI & eapi,
bool add_explicit_choices_requirement)
{
+ auto mentioned(std::make_shared<Set<std::string> >());
auto data(partial_parse_elike_package_dep_spec(s, eapi.supported()->package_dep_spec_parse_options(),
- eapi.supported()->version_spec_options()));
+ eapi.supported()->version_spec_options(), mentioned));
if (add_explicit_choices_requirement)
- data.additional_requirement(make_elike_presumed_choices_requirement());
+ data.additional_requirement(make_elike_presumed_choices_requirement(mentioned));
std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(data));
h.begin()->item()->append(spec);
h.begin()->children().push_back(spec);
diff --git a/paludis/repositories/e/e_choices_key.cc b/paludis/repositories/e/e_choices_key.cc
index 62ec649..e250f11 100644
--- a/paludis/repositories/e/e_choices_key.cc
+++ b/paludis/repositories/e/e_choices_key.cc
@@ -163,7 +163,7 @@ namespace
if (m_role != node.spec()->maybe_annotations()->end())
p->second.insert(std::make_pair(n, MyOptionsInfo{ m_role->value(), false })).first->second.description = m_role->value();
else
- p->second.insert(std::make_pair(n, MyOptionsInfo{ m_role->value(), false }));
+ p->second.insert(std::make_pair(n, MyOptionsInfo{ "", false }));
auto n_role(node.spec()->maybe_annotations()->find(dsar_myoptions_presumed));
if (n_role != node.spec()->maybe_annotations()->end())
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index f810e4c..7089d14 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -229,7 +229,7 @@ namespace
default:
{
- std::shared_ptr<const AdditionalPackageDepSpecRequirement> req(parse_elike_use_requirement(flag, { }));
+ std::shared_ptr<const AdditionalPackageDepSpecRequirement> req(parse_elike_use_requirement(flag, { }, make_null_shared_ptr()));
result.additional_requirement(req);
}
break;