aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-04 17:03:30 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-04 17:03:30 +0000
commitc054c6d7c9be6df0f99a3876f4fbe7608deb023f (patch)
tree219ecaa6bc7a06b5709db5bb261e7363a5350ce9
parent665e52b96262359e26f2a2c52b81183b41e109aa (diff)
downloadpaludis-c054c6d7c9be6df0f99a3876f4fbe7608deb023f.tar.gz
paludis-c054c6d7c9be6df0f99a3876f4fbe7608deb023f.tar.xz
Work around shoddy Gentoo QA
-rw-r--r--paludis/repositories/e/aa_visitor_TEST.cc2
-rw-r--r--paludis/repositories/e/dep_parser.cc37
-rw-r--r--paludis/repositories/e/dep_parser.hh16
-rw-r--r--paludis/repositories/e/dep_parser_TEST.cc88
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc32
-rw-r--r--paludis/repositories/e/e_installed_repository_id.hh1
-rw-r--r--paludis/repositories/e/e_key.cc82
-rw-r--r--paludis/repositories/e/e_key.hh18
-rw-r--r--paludis/repositories/e/e_repository_id.hh2
-rw-r--r--paludis/repositories/e/ebuild.cc2
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc4
-rw-r--r--paludis/repositories/e/ebuild_id.cc30
-rw-r--r--paludis/repositories/e/ebuild_id.hh1
-rw-r--r--paludis/repositories/e/fetch_visitor_TEST.cc2
-rw-r--r--paludis/repositories/e/fix_locked_dependencies_TEST.cc4
15 files changed, 181 insertions, 140 deletions
diff --git a/paludis/repositories/e/aa_visitor_TEST.cc b/paludis/repositories/e/aa_visitor_TEST.cc
index 9af1792..4d47e41 100644
--- a/paludis/repositories/e/aa_visitor_TEST.cc
+++ b/paludis/repositories/e/aa_visitor_TEST.cc
@@ -49,7 +49,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
AAVisitor p1;
- parse_fetchable_uri("( a -> b c x? ( d e ) )", &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(p1);
+ parse_fetchable_uri("( a -> b c x? ( d e ) )", &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(p1);
TEST_CHECK_EQUAL(join(p1.begin(), p1.end(), " "), "b c d e");
}
} test_aa_visitor;
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index 3cc8f85..5a3c707 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -296,10 +296,11 @@ namespace
typename ParseStackTypes<T_>::Stack & stack,
const std::string & u,
const Environment * const,
- const EAPI & eapi)
+ const EAPI & eapi,
+ bool is_installed)
{
std::shared_ptr<ConditionalDepSpec> spec(std::make_shared<ConditionalDepSpec>(parse_elike_conditional_dep_spec(
- u, ! eapi.supported()->package_dep_spec_parse_options()[epdso_missing_use_deps_is_qa])));
+ u, is_installed || ! eapi.supported()->package_dep_spec_parse_options()[epdso_missing_use_deps_is_qa])));
stack.push_front(make_named_values<typename ParseStackTypes<T_>::Item>(
n::item() = stack.begin()->item()->append(spec),
n::spec() = spec
@@ -468,7 +469,7 @@ namespace
}
std::shared_ptr<DependencySpecTree>
-paludis::erepository::parse_depend(const std::string & s, const Environment * const env, const EAPI & eapi)
+paludis::erepository::parse_depend(const std::string & s, const Environment * const env, const EAPI & eapi, const bool is_installed)
{
using namespace std::placeholders;
@@ -503,7 +504,7 @@ paludis::erepository::parse_depend(const std::string & s, const Environment * co
n::on_string() = std::bind(&package_or_block_dep_spec_string_handler<DependencySpecTree>, std::ref(stack),
ParseStackTypes<DependencySpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate_maybe_block, std::ref(thing_to_annotate), _1, std::ref(thing_to_annotate_if_block), _2)), _1, eapi),
- n::on_use() = std::bind(&use_handler<DependencySpecTree>, std::ref(stack), _1, env, std::cref(eapi)),
+ n::on_use() = std::bind(&use_handler<DependencySpecTree>, std::ref(stack), _1, env, std::cref(eapi), is_installed),
n::on_use_under_any() = std::bind(&use_under_any_handler, s, std::cref(eapi))
));
@@ -513,7 +514,7 @@ paludis::erepository::parse_depend(const std::string & s, const Environment * co
}
std::shared_ptr<ProvideSpecTree>
-paludis::erepository::parse_provide(const std::string & s, const Environment * const env, const EAPI & eapi)
+paludis::erepository::parse_provide(const std::string & s, const Environment * const env, const EAPI & eapi, const bool is_installed)
{
using namespace std::placeholders;
@@ -542,7 +543,7 @@ paludis::erepository::parse_provide(const std::string & s, const Environment * c
n::on_string() = std::bind(&package_dep_spec_string_handler<ProvideSpecTree>, std::ref(stack),
ParseStackTypes<ProvideSpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1, std::cref(eapi)),
- n::on_use() = std::bind(&use_handler<ProvideSpecTree>, std::ref(stack), _1, env, std::cref(eapi)),
+ n::on_use() = std::bind(&use_handler<ProvideSpecTree>, std::ref(stack), _1, env, std::cref(eapi), is_installed),
n::on_use_under_any() = std::bind(&use_under_any_handler, s, std::cref(eapi))
));
@@ -552,7 +553,7 @@ paludis::erepository::parse_provide(const std::string & s, const Environment * c
}
std::shared_ptr<FetchableURISpecTree>
-paludis::erepository::parse_fetchable_uri(const std::string & s, const Environment * const env, const EAPI & eapi)
+paludis::erepository::parse_fetchable_uri(const std::string & s, const Environment * const env, const EAPI & eapi, const bool is_installed)
{
using namespace std::placeholders;
@@ -585,7 +586,7 @@ paludis::erepository::parse_fetchable_uri(const std::string & s, const Environme
n::on_string() = std::bind(&arrow_handler<FetchableURISpecTree>, std::ref(stack),
ParseStackTypes<FetchableURISpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), s, _1, "", std::cref(eapi)),
- n::on_use() = std::bind(&use_handler<FetchableURISpecTree>, std::ref(stack), _1, env, std::cref(eapi)),
+ n::on_use() = std::bind(&use_handler<FetchableURISpecTree>, std::ref(stack), _1, env, std::cref(eapi), is_installed),
n::on_use_under_any() = std::bind(&use_under_any_handler, s, std::cref(eapi))
));
@@ -595,7 +596,7 @@ paludis::erepository::parse_fetchable_uri(const std::string & s, const Environme
}
std::shared_ptr<SimpleURISpecTree>
-paludis::erepository::parse_simple_uri(const std::string & s, const Environment * const env, const EAPI & eapi)
+paludis::erepository::parse_simple_uri(const std::string & s, const Environment * const env, const EAPI & eapi, const bool is_installed)
{
using namespace std::placeholders;
@@ -624,7 +625,7 @@ paludis::erepository::parse_simple_uri(const std::string & s, const Environment
n::on_string() = std::bind(&simple_uri_handler<SimpleURISpecTree>, std::ref(stack),
ParseStackTypes<SimpleURISpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1),
- n::on_use() = std::bind(&use_handler<SimpleURISpecTree>, std::ref(stack), _1, env, std::cref(eapi)),
+ n::on_use() = std::bind(&use_handler<SimpleURISpecTree>, std::ref(stack), _1, env, std::cref(eapi), is_installed),
n::on_use_under_any() = &do_nothing
));
@@ -634,7 +635,7 @@ paludis::erepository::parse_simple_uri(const std::string & s, const Environment
}
std::shared_ptr<LicenseSpecTree>
-paludis::erepository::parse_license(const std::string & s, const Environment * const env, const EAPI & eapi)
+paludis::erepository::parse_license(const std::string & s, const Environment * const env, const EAPI & eapi, const bool is_installed)
{
using namespace std::placeholders;
@@ -663,7 +664,7 @@ paludis::erepository::parse_license(const std::string & s, const Environment * c
n::on_string() = std::bind(&license_handler<LicenseSpecTree>, std::ref(stack),
ParseStackTypes<LicenseSpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1),
- n::on_use() = std::bind(&use_handler<LicenseSpecTree>, std::ref(stack), _1, env, std::cref(eapi)),
+ n::on_use() = std::bind(&use_handler<LicenseSpecTree>, std::ref(stack), _1, env, std::cref(eapi), is_installed),
n::on_use_under_any() = std::bind(&use_under_any_handler, s, std::cref(eapi))
));
@@ -673,7 +674,7 @@ paludis::erepository::parse_license(const std::string & s, const Environment * c
}
std::shared_ptr<PlainTextSpecTree>
-paludis::erepository::parse_plain_text(const std::string & s, const Environment * const env, const EAPI & eapi)
+paludis::erepository::parse_plain_text(const std::string & s, const Environment * const env, const EAPI & eapi, const bool is_installed)
{
using namespace std::placeholders;
@@ -702,7 +703,7 @@ paludis::erepository::parse_plain_text(const std::string & s, const Environment
n::on_string() = std::bind(&plain_text_handler<PlainTextSpecTree>, std::ref(stack),
ParseStackTypes<PlainTextSpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1),
- n::on_use() = std::bind(&use_handler<PlainTextSpecTree>, std::ref(stack), _1, env, std::cref(eapi)),
+ n::on_use() = std::bind(&use_handler<PlainTextSpecTree>, std::ref(stack), _1, env, std::cref(eapi), is_installed),
n::on_use_under_any() = &do_nothing
));
@@ -712,7 +713,7 @@ paludis::erepository::parse_plain_text(const std::string & s, const Environment
}
std::shared_ptr<PlainTextSpecTree>
-paludis::erepository::parse_myoptions(const std::string & s, const Environment * const env, const EAPI & eapi)
+paludis::erepository::parse_myoptions(const std::string & s, const Environment * const env, const EAPI & eapi, const bool is_installed)
{
using namespace std::placeholders;
@@ -743,7 +744,7 @@ paludis::erepository::parse_myoptions(const std::string & s, const Environment *
n::on_string() = std::bind(&plain_text_handler<PlainTextSpecTree>, std::ref(stack),
ParseStackTypes<PlainTextSpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1),
- n::on_use() = std::bind(&use_handler<PlainTextSpecTree>, std::ref(stack), _1, env, std::cref(eapi)),
+ n::on_use() = std::bind(&use_handler<PlainTextSpecTree>, std::ref(stack), _1, env, std::cref(eapi), is_installed),
n::on_use_under_any() = &do_nothing
));
@@ -753,7 +754,7 @@ paludis::erepository::parse_myoptions(const std::string & s, const Environment *
}
std::shared_ptr<RequiredUseSpecTree>
-paludis::erepository::parse_required_use(const std::string & s, const Environment * const env, const EAPI & eapi)
+paludis::erepository::parse_required_use(const std::string & s, const Environment * const env, const EAPI & eapi, const bool is_installed)
{
using namespace std::placeholders;
@@ -782,7 +783,7 @@ paludis::erepository::parse_required_use(const std::string & s, const Environmen
n::on_string() = std::bind(&plain_text_handler<RequiredUseSpecTree>, std::ref(stack),
ParseStackTypes<RequiredUseSpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1),
- n::on_use() = std::bind(&use_handler<RequiredUseSpecTree>, std::ref(stack), _1, env, std::cref(eapi)),
+ n::on_use() = std::bind(&use_handler<RequiredUseSpecTree>, std::ref(stack), _1, env, std::cref(eapi), is_installed),
n::on_use_under_any() = &do_nothing
));
diff --git a/paludis/repositories/e/dep_parser.hh b/paludis/repositories/e/dep_parser.hh
index ee9591f..1d7439a 100644
--- a/paludis/repositories/e/dep_parser.hh
+++ b/paludis/repositories/e/dep_parser.hh
@@ -53,7 +53,7 @@ namespace paludis
* Parse a dependency heirarchy.
*/
std::shared_ptr<DependencySpecTree> parse_depend(const std::string & s,
- const Environment * const, const EAPI &) PALUDIS_VISIBLE;
+ const Environment * const, const EAPI &, const bool is_installed) PALUDIS_VISIBLE;
/**
* Parse a dep spec label.
@@ -67,43 +67,43 @@ namespace paludis
* Parse a provide heirarchy.
*/
std::shared_ptr<ProvideSpecTree> parse_provide(const std::string & s,
- const Environment * const, const EAPI &) PALUDIS_VISIBLE;
+ const Environment * const, const EAPI &, const bool is_installed) PALUDIS_VISIBLE;
/**
* Parse a restrict or plain text heirarchy.
*/
std::shared_ptr<PlainTextSpecTree> parse_plain_text(const std::string & s,
- const Environment * const, const EAPI &) PALUDIS_VISIBLE;
+ const Environment * const, const EAPI &, const bool is_installed) PALUDIS_VISIBLE;
/**
* Parse a myoptions heirarchy.
*/
std::shared_ptr<PlainTextSpecTree> parse_myoptions(const std::string & s,
- const Environment * const, const EAPI &) PALUDIS_VISIBLE;
+ const Environment * const, const EAPI &, const bool is_installed) PALUDIS_VISIBLE;
/**
* Parse a required_use heirarchy.
*/
std::shared_ptr<RequiredUseSpecTree> parse_required_use(const std::string & s,
- const Environment * const, const EAPI &) PALUDIS_VISIBLE;
+ const Environment * const, const EAPI &, const bool is_installed) PALUDIS_VISIBLE;
/**
* Parse a fetchable uri heirarchy.
*/
std::shared_ptr<FetchableURISpecTree> parse_fetchable_uri(const std::string & s,
- const Environment * const, const EAPI &) PALUDIS_VISIBLE;
+ const Environment * const, const EAPI &, const bool is_installed) PALUDIS_VISIBLE;
/**
* Parse a simple uri heirarchy.
*/
std::shared_ptr<SimpleURISpecTree> parse_simple_uri(const std::string & s,
- const Environment * const, const EAPI &) PALUDIS_VISIBLE;
+ const Environment * const, const EAPI &, const bool is_installed) PALUDIS_VISIBLE;
/**
* Parse a license heirarchy.
*/
std::shared_ptr<LicenseSpecTree> parse_license(const std::string & s,
- const Environment * const, const EAPI &) PALUDIS_VISIBLE;
+ const Environment * const, const EAPI &, const bool is_installed) PALUDIS_VISIBLE;
/**
* Parse a URI label.
diff --git a/paludis/repositories/e/dep_parser_TEST.cc b/paludis/repositories/e/dep_parser_TEST.cc
index 36616e1..abd8155 100644
--- a/paludis/repositories/e/dep_parser_TEST.cc
+++ b/paludis/repositories/e/dep_parser_TEST.cc
@@ -62,7 +62,7 @@ namespace test_cases
UnformattedPrettyPrinter ff;
SpecTreePrettyPrinter d(ff, { });
parse_depend("",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "");
}
} test_dep_spec_parser_empty;
@@ -88,7 +88,7 @@ namespace test_cases
UnformattedPrettyPrinter ff;
SpecTreePrettyPrinter d(ff, { });
parse_depend(" \n \t",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "");
}
} test_dep_spec_parser_blank;
@@ -114,7 +114,7 @@ namespace test_cases
UnformattedPrettyPrinter ff;
SpecTreePrettyPrinter d(ff, { });
parse_depend("app-editors/vim",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "app-editors/vim");
}
} test_dep_spec_parser_package;
@@ -140,17 +140,17 @@ namespace test_cases
SpecTreePrettyPrinter d1(ff, { });
parse_depend(">=app-editors/vim-6.4_alpha",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d1);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d1);
TEST_CHECK_EQUAL(stringify(d1), ">=app-editors/vim-6.4_alpha");
SpecTreePrettyPrinter d2(ff, { });
parse_depend("=app-editors/vim-6.4_alpha-r1",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d2);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d2);
TEST_CHECK_EQUAL(stringify(d2), "=app-editors/vim-6.4_alpha-r1");
SpecTreePrettyPrinter d3(ff, { });
parse_depend(">=app-editors/vim-6.4_alpha:one",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d3);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d3);
TEST_CHECK_EQUAL(stringify(d3), ">=app-editors/vim-6.4_alpha:one");
}
} test_dep_spec_parser_decorated_package;
@@ -176,7 +176,7 @@ namespace test_cases
SpecTreePrettyPrinter d(ff, { });
parse_depend("app-editors/vim app-misc/hilite \nsys-apps/findutils",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "app-editors/vim app-misc/hilite sys-apps/findutils");
}
} test_dep_spec_parser_packages;
@@ -198,7 +198,7 @@ namespace test_cases
SpecTreePrettyPrinter d(ff, { });
parse_depend("|| ( one/one two/two )",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "|| ( one/one two/two )");
}
} test_dep_spec_parser_any;
@@ -220,15 +220,15 @@ namespace test_cases
SpecTreePrettyPrinter d(ff, { });
parse_depend("|| ( one/one foo? ( two/two ) )",
- &env, *EAPIData::get_instance()->eapi_from_string("0"))->top()->accept(d);
+ &env, *EAPIData::get_instance()->eapi_from_string("0"), false)->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "|| ( one/one foo? ( two/two ) )");
TEST_CHECK_THROWS(parse_depend("|| ( one/one foo? ( two/two ) )",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
SpecTreePrettyPrinter e(ff, { });
parse_depend("|| ( one/one ( foo? ( two/two ) ) )",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(e);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(e);
TEST_CHECK_EQUAL(stringify(e), "|| ( one/one ( foo? ( two/two ) ) )");
}
} test_dep_spec_parser_any_use;
@@ -254,7 +254,7 @@ namespace test_cases
SpecTreePrettyPrinter d(ff, { });
parse_depend(" ( one/one two/two ) ",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "one/one two/two");
}
} test_dep_spec_parser_all;
@@ -279,7 +279,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
SpecTreePrettyPrinter d(ff, { });
- parse_depend("foo? ( one/one )", &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
+ parse_depend("foo? ( one/one )", &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "foo? ( one/one )");
}
} test_dep_spec_parser_use;
@@ -304,7 +304,7 @@ namespace test_cases
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
SpecTreePrettyPrinter d(ff, { });
- parse_depend("!foo? ( one/one )", &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
+ parse_depend("!foo? ( one/one )", &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "!foo? ( one/one )");
}
} test_dep_spec_parser_inv_use;
@@ -325,15 +325,15 @@ namespace test_cases
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
SpecTreePrettyPrinter d(ff, { ppo_multiline_allowed });
- parse_fetchable_uri("a\n->\tb", &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
+ parse_fetchable_uri("a\n->\tb", &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "a -> b\n");
SpecTreePrettyPrinter e(ff, { ppo_multiline_allowed });
- parse_fetchable_uri("a-> b", &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(e);
+ parse_fetchable_uri("a-> b", &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(e);
TEST_CHECK_EQUAL(stringify(e), "a->\nb\n");
TEST_CHECK_THROWS(parse_fetchable_uri("a -> b",
- &env, *EAPIData::get_instance()->eapi_from_string("0"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("0"), false)->top()->accept(d), Exception);
}
} test_dep_spec_parser_uri;
@@ -358,15 +358,15 @@ namespace test_cases
SpecTreePrettyPrinter d(ff, { });
TEST_CHECK_THROWS(parse_depend("!foo? ( one/one",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_depend("!foo? ( one/one ) )",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_depend("( ( ( ) )",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_depend("( ( ( ) ) ) )",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_depend(")",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
}
} test_dep_spec_parser_bad_nesting;
@@ -391,38 +391,38 @@ namespace test_cases
SpecTreePrettyPrinter d(ff, { });
TEST_CHECK_THROWS(parse_depend("||",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_depend("|| ",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_depend("foo?",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_depend("!? ( )",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_depend("!foo? ||",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_depend("(((",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_depend(")",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_depend("(foo/bar)",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_license("a -> b",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_fetchable_uri("( -> )",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_fetchable_uri("( -> )",
- &env, *EAPIData::get_instance()->eapi_from_string("0"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("0"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_fetchable_uri("foo? -> bar",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_fetchable_uri("a ->",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_fetchable_uri("a -> ( )",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_fetchable_uri("a -> )",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
TEST_CHECK_THROWS(parse_fetchable_uri("a -> || ( )",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d), Exception);
}
} test_dep_spec_parser_bad_values;
@@ -446,10 +446,10 @@ namespace test_cases
SpecTreePrettyPrinter d(ff, { });
parse_depend("build: one/one",
- &env, *EAPIData::get_instance()->eapi_from_string("exheres-0"))->top()->accept(d);
+ &env, *EAPIData::get_instance()->eapi_from_string("exheres-0"), false)->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "build: one/one");
TEST_CHECK_THROWS(parse_depend("build: one/one",
- &env, *EAPIData::get_instance()->eapi_from_string("0"))->top()->accept(d), EDepParseError);
+ &env, *EAPIData::get_instance()->eapi_from_string("0"), false)->top()->accept(d), EDepParseError);
}
} test_dep_spec_parser_labels;
@@ -470,10 +470,10 @@ namespace test_cases
SpecTreePrettyPrinter d(ff, { });
parse_fetchable_uri("http://foo/bar manual: two",
- &env, *EAPIData::get_instance()->eapi_from_string("exheres-0"))->top()->accept(d);
+ &env, *EAPIData::get_instance()->eapi_from_string("exheres-0"), false)->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "http://foo/bar manual: two");
TEST_CHECK_THROWS(parse_fetchable_uri("http://foo/bar monkey: two",
- &env, *EAPIData::get_instance()->eapi_from_string("exheres-0"))->top()->accept(d), EDepParseError);
+ &env, *EAPIData::get_instance()->eapi_from_string("exheres-0"), false)->top()->accept(d), EDepParseError);
}
} test_dep_spec_parser_exheres_0_uri_labels;
@@ -494,12 +494,12 @@ namespace test_cases
UnformattedPrettyPrinter ff;
SpecTreePrettyPrinter d(ff, { });
parse_depend("cat/first [[ foo = bar bar = baz ]] cat/second cat/third [[ moo = oink ]]",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(d);
TEST_CHECK_EQUAL(stringify(d), "cat/first [[ bar = [ baz ] foo = [ bar ] ]] cat/second cat/third [[ moo = [ oink ] ]]");
SpecTreePrettyPrinter e(ff, { });
parse_depend("bar? ( foo? ( cat/first [[ for = first ]] ) [[ for = foo ]] baz? ( ) [[ for = baz ]] ) [[ for = bar ]]",
- &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(e);
+ &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"), false)->top()->accept(e);
TEST_CHECK_EQUAL(stringify(e), "bar? ( foo? ( cat/first [[ for = [ first ] ]] ) "
"[[ for = [ foo ] ]] baz? ( ) [[ for = [ baz ] ]] ) [[ for = [ bar ] ]]");
}
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index d2e7bb6..e522598 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -281,7 +281,7 @@ EInstalledRepositoryID::need_keys_added() const
if ((_imp->dir / vars->myoptions()->name()).stat().exists())
{
_imp->keys->raw_myoptions = std::make_shared<EMyOptionsKey>(_imp->environment, vars->myoptions(),
- eapi(), file_contents(_imp->dir / vars->myoptions()->name()), mkt_internal);
+ eapi(), file_contents(_imp->dir / vars->myoptions()->name()), mkt_internal, is_installed());
add_metadata_key(_imp->keys->raw_myoptions);
}
@@ -289,7 +289,7 @@ EInstalledRepositoryID::need_keys_added() const
if ((_imp->dir / vars->required_use()->name()).stat().exists())
{
_imp->keys->required_use = std::make_shared<ERequiredUseKey>(_imp->environment, vars->required_use(),
- eapi(), file_contents(_imp->dir / vars->required_use()->name()), mkt_internal);
+ eapi(), file_contents(_imp->dir / vars->required_use()->name()), mkt_internal, is_installed());
add_metadata_key(_imp->keys->required_use);
}
@@ -313,7 +313,7 @@ EInstalledRepositoryID::need_keys_added() const
if ((_imp->dir / vars->license()->name()).stat().exists())
{
_imp->keys->license = std::make_shared<ELicenseKey>(_imp->environment, vars->license(), eapi(),
- file_contents(_imp->dir / vars->license()->name()), mkt_normal);
+ file_contents(_imp->dir / vars->license()->name()), mkt_normal, is_installed());
add_metadata_key(_imp->keys->license);
}
@@ -321,7 +321,7 @@ EInstalledRepositoryID::need_keys_added() const
if ((_imp->dir / vars->provide()->name()).stat().exists())
{
_imp->keys->provide = std::make_shared<EProvideKey>(_imp->environment, vars->provide(), eapi(),
- file_contents(_imp->dir / vars->provide()->name()), mkt_internal);
+ file_contents(_imp->dir / vars->provide()->name()), mkt_internal, is_installed());
add_metadata_key(_imp->keys->provide);
}
@@ -331,7 +331,7 @@ EInstalledRepositoryID::need_keys_added() const
{
DependenciesRewriter rewriter;
std::string raw_deps_str(file_contents(_imp->dir / vars->dependencies()->name()));
- std::shared_ptr<DependencySpecTree> raw_deps(parse_depend(raw_deps_str, _imp->environment, *eapi()));
+ std::shared_ptr<DependencySpecTree> raw_deps(parse_depend(raw_deps_str, _imp->environment, *eapi(), false));
raw_deps->top()->accept(rewriter);
_imp->keys->raw_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), vars->dependencies()->name(),
@@ -389,7 +389,7 @@ EInstalledRepositoryID::need_keys_added() const
if ((_imp->dir / vars->restrictions()->name()).stat().exists())
{
_imp->keys->restrictions = std::make_shared<EPlainTextSpecKey>(_imp->environment, vars->restrictions(),
- eapi(), file_contents(_imp->dir / vars->restrictions()->name()), mkt_internal);
+ eapi(), file_contents(_imp->dir / vars->restrictions()->name()), mkt_internal, is_installed());
add_metadata_key(_imp->keys->restrictions);
}
@@ -397,7 +397,7 @@ EInstalledRepositoryID::need_keys_added() const
if ((_imp->dir / vars->properties()->name()).stat().exists())
{
_imp->keys->properties = std::make_shared<EPlainTextSpecKey>(_imp->environment, vars->properties(),
- eapi(), file_contents(_imp->dir / vars->properties()->name()), mkt_internal);
+ eapi(), file_contents(_imp->dir / vars->properties()->name()), mkt_internal, is_installed());
add_metadata_key(_imp->keys->properties);
}
@@ -436,7 +436,7 @@ EInstalledRepositoryID::need_keys_added() const
if (! value.empty())
{
_imp->keys->upstream_changelog = std::make_shared<ESimpleURIKey>(_imp->environment,
- vars->upstream_changelog(), eapi(), value, mkt_normal);
+ vars->upstream_changelog(), eapi(), value, mkt_normal, is_installed());
add_metadata_key(_imp->keys->upstream_changelog);
}
}
@@ -448,7 +448,7 @@ EInstalledRepositoryID::need_keys_added() const
if (! value.empty())
{
_imp->keys->upstream_release_notes = std::make_shared<ESimpleURIKey>(_imp->environment,
- vars->upstream_release_notes(), eapi(), value, mkt_normal);
+ vars->upstream_release_notes(), eapi(), value, mkt_normal, is_installed());
add_metadata_key(_imp->keys->upstream_release_notes);
}
}
@@ -460,7 +460,7 @@ EInstalledRepositoryID::need_keys_added() const
if (! value.empty())
{
_imp->keys->upstream_documentation = std::make_shared<ESimpleURIKey>(_imp->environment,
- vars->upstream_documentation(), eapi(), value, mkt_normal);
+ vars->upstream_documentation(), eapi(), value, mkt_normal, is_installed());
add_metadata_key(_imp->keys->upstream_documentation);
}
}
@@ -471,7 +471,7 @@ EInstalledRepositoryID::need_keys_added() const
std::string value(file_contents(_imp->dir / vars->bugs_to()->name()));
if (! value.empty())
{
- _imp->keys->bugs_to = std::make_shared<EPlainTextSpecKey>(_imp->environment, vars->bugs_to(), eapi(), value, mkt_normal);
+ _imp->keys->bugs_to = std::make_shared<EPlainTextSpecKey>(_imp->environment, vars->bugs_to(), eapi(), value, mkt_normal, is_installed());
add_metadata_key(_imp->keys->bugs_to);
}
}
@@ -483,7 +483,7 @@ EInstalledRepositoryID::need_keys_added() const
if (! value.empty())
{
_imp->keys->remote_ids = std::make_shared<EPlainTextSpecKey>(_imp->environment,
- vars->remote_ids(), eapi(), value, mkt_internal);
+ vars->remote_ids(), eapi(), value, mkt_internal, is_installed());
add_metadata_key(_imp->keys->remote_ids);
}
}
@@ -492,7 +492,7 @@ EInstalledRepositoryID::need_keys_added() const
if ((_imp->dir / vars->homepage()->name()).stat().exists())
{
_imp->keys->homepage = std::make_shared<ESimpleURIKey>(_imp->environment, vars->homepage(), eapi(),
- file_contents(_imp->dir / vars->homepage()->name()), mkt_significant);
+ file_contents(_imp->dir / vars->homepage()->name()), mkt_significant, is_installed());
add_metadata_key(_imp->keys->homepage);
}
@@ -1112,3 +1112,9 @@ EInstalledRepositoryID::can_drop_in_memory_cache() const
_imp->keys.reset();
}
+bool
+EInstalledRepositoryID::is_installed() const
+{
+ return true;
+}
+
diff --git a/paludis/repositories/e/e_installed_repository_id.hh b/paludis/repositories/e/e_installed_repository_id.hh
index 954187d..980db0a 100644
--- a/paludis/repositories/e/e_installed_repository_id.hh
+++ b/paludis/repositories/e/e_installed_repository_id.hh
@@ -55,6 +55,7 @@ namespace paludis
virtual const VersionSpec version() const;
virtual const RepositoryName repository_name() const;
virtual const std::shared_ptr<const EAPI> eapi() const;
+ virtual bool is_installed() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::shared_ptr<const MetadataValueKey<SlotName> > slot_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const PackageID> > > virtual_for_key() const;
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 23cc453..84733cf 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -157,7 +157,7 @@ EDependenciesKey::value() const
return _imp->value;
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
- _imp->value = parse_depend(_imp->string_value, _imp->env, *_imp->id->eapi());
+ _imp->value = parse_depend(_imp->string_value, _imp->env, *_imp->id->eapi(), _imp->id->is_installed());
return _imp->value;
}
@@ -208,17 +208,20 @@ namespace paludis
const std::shared_ptr<const EAPIMetadataVariable> variable;
const std::shared_ptr<const EAPI> eapi;
const MetadataKeyType type;
+ const bool is_installed;
Imp(const Environment * const e,
const std::string & v,
const std::shared_ptr<const EAPIMetadataVariable> & m,
const std::shared_ptr<const EAPI> & p,
- const MetadataKeyType t) :
+ const MetadataKeyType t,
+ bool i) :
env(e),
string_value(v),
variable(m),
eapi(p),
- type(t)
+ type(t),
+ is_installed(i)
{
}
};
@@ -228,8 +231,9 @@ ELicenseKey::ELicenseKey(
const Environment * const e,
const std::shared_ptr<const EAPIMetadataVariable> & m,
const std::shared_ptr<const EAPI> & p,
- const std::string & v, const MetadataKeyType t) :
- _imp(e, v, m, p, t)
+ const std::string & v, const MetadataKeyType t,
+ const bool i) :
+ _imp(e, v, m, p, t, i)
{
}
@@ -245,7 +249,7 @@ ELicenseKey::value() const
return _imp->value;
Context context("When parsing metadata key '" + raw_name() + "':");
- _imp->value = parse_license(_imp->string_value, _imp->env, *_imp->eapi);
+ _imp->value = parse_license(_imp->string_value, _imp->env, *_imp->eapi, _imp->is_installed);
return _imp->value;
}
@@ -325,7 +329,7 @@ EFetchableURIKey::value() const
return _imp->value;
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
- _imp->value = parse_fetchable_uri(_imp->string_value, _imp->env, *_imp->id->eapi());
+ _imp->value = parse_fetchable_uri(_imp->string_value, _imp->env, *_imp->id->eapi(), _imp->id->is_installed());
return _imp->value;
}
@@ -406,16 +410,18 @@ namespace paludis
const std::shared_ptr<const EAPIMetadataVariable> variable;
const std::shared_ptr<const EAPI> eapi;
const MetadataKeyType type;
+ const bool is_installed;
Imp(const Environment * const e, const std::string & v,
const std::shared_ptr<const EAPIMetadataVariable> & m,
const std::shared_ptr<const EAPI> & p,
- const MetadataKeyType t) :
+ const MetadataKeyType t, bool i) :
env(e),
string_value(v),
variable(m),
eapi(p),
- type(t)
+ type(t),
+ is_installed(i)
{
}
};
@@ -424,8 +430,9 @@ namespace paludis
ESimpleURIKey::ESimpleURIKey(const Environment * const e,
const std::shared_ptr<const EAPIMetadataVariable> & m,
const std::shared_ptr<const EAPI> & p,
- const std::string & v, const MetadataKeyType t) :
- _imp(e, v, m, p, t)
+ const std::string & v, const MetadataKeyType t,
+ const bool i) :
+ _imp(e, v, m, p, t, i)
{
}
@@ -442,7 +449,7 @@ ESimpleURIKey::value() const
return _imp->value;
Context context("When parsing metadata key '" + raw_name() + "':");
- _imp->value = parse_simple_uri(_imp->string_value, _imp->env, *_imp->eapi);
+ _imp->value = parse_simple_uri(_imp->string_value, _imp->env, *_imp->eapi, _imp->is_installed);
return _imp->value;
}
@@ -487,16 +494,18 @@ namespace paludis
const std::shared_ptr<const EAPIMetadataVariable> variable;
const std::shared_ptr<const EAPI> eapi;
const MetadataKeyType type;
+ const bool is_installed;
Imp(const Environment * const e, const std::string & v,
const std::shared_ptr<const EAPIMetadataVariable> & m,
const std::shared_ptr<const EAPI> & p,
- const MetadataKeyType t) :
+ const MetadataKeyType t, bool i) :
env(e),
string_value(v),
variable(m),
eapi(p),
- type(t)
+ type(t),
+ is_installed(i)
{
}
};
@@ -505,8 +514,8 @@ namespace paludis
EPlainTextSpecKey::EPlainTextSpecKey(const Environment * const e,
const std::shared_ptr<const EAPIMetadataVariable> & m,
const std::shared_ptr<const EAPI> & p,
- const std::string & v, const MetadataKeyType t) :
- _imp(e, v, m, p, t)
+ const std::string & v, const MetadataKeyType t, bool i) :
+ _imp(e, v, m, p, t, i)
{
}
@@ -523,7 +532,7 @@ EPlainTextSpecKey::value() const
return _imp->value;
Context context("When parsing metadata key '" + raw_name() + "':");
- _imp->value = parse_plain_text(_imp->string_value, _imp->env, *_imp->eapi);
+ _imp->value = parse_plain_text(_imp->string_value, _imp->env, *_imp->eapi, _imp->is_installed);
return _imp->value;
}
@@ -568,17 +577,19 @@ namespace paludis
const std::shared_ptr<const EAPIMetadataVariable> variable;
const std::shared_ptr<const EAPI> eapi;
const MetadataKeyType type;
+ const bool is_installed;
Imp(const Environment * const e,
const std::string & v,
const std::shared_ptr<const EAPIMetadataVariable> & m,
const std::shared_ptr<const EAPI> & p,
- const MetadataKeyType t) :
+ const MetadataKeyType t, const bool i) :
env(e),
string_value(v),
variable(m),
eapi(p),
- type(t)
+ type(t),
+ is_installed(i)
{
}
};
@@ -588,8 +599,9 @@ EMyOptionsKey::EMyOptionsKey(
const Environment * const e,
const std::shared_ptr<const EAPIMetadataVariable> & m,
const std::shared_ptr<const EAPI> & p,
- const std::string & v, const MetadataKeyType t) :
- _imp(e, v, m, p, t)
+ const std::string & v, const MetadataKeyType t,
+ const bool i) :
+ _imp(e, v, m, p, t, i)
{
}
@@ -605,7 +617,7 @@ EMyOptionsKey::value() const
return _imp->value;
Context context("When parsing metadata key '" + raw_name() + "':");
- _imp->value = parse_myoptions(_imp->string_value, _imp->env, *_imp->eapi);
+ _imp->value = parse_myoptions(_imp->string_value, _imp->env, *_imp->eapi, _imp->is_installed);
return _imp->value;
}
@@ -650,17 +662,20 @@ namespace paludis
const std::shared_ptr<const EAPIMetadataVariable> variable;
const std::shared_ptr<const EAPI> eapi;
const MetadataKeyType type;
+ const bool is_installed;
Imp(const Environment * const e,
const std::string & v,
const std::shared_ptr<const EAPIMetadataVariable> & m,
const std::shared_ptr<const EAPI> & p,
- const MetadataKeyType t) :
+ const MetadataKeyType t,
+ bool i) :
env(e),
string_value(v),
variable(m),
eapi(p),
- type(t)
+ type(t),
+ is_installed(i)
{
}
};
@@ -670,8 +685,9 @@ ERequiredUseKey::ERequiredUseKey(
const Environment * const e,
const std::shared_ptr<const EAPIMetadataVariable> & m,
const std::shared_ptr<const EAPI> & p,
- const std::string & v, const MetadataKeyType t) :
- _imp(e, v, m, p, t)
+ const std::string & v, const MetadataKeyType t,
+ const bool i) :
+ _imp(e, v, m, p, t, i)
{
}
@@ -687,7 +703,7 @@ ERequiredUseKey::value() const
return _imp->value;
Context context("When parsing metadata key '" + raw_name() + "':");
- _imp->value = parse_required_use(_imp->string_value, _imp->env, *_imp->eapi);
+ _imp->value = parse_required_use(_imp->string_value, _imp->env, *_imp->eapi, _imp->is_installed);
return _imp->value;
}
@@ -732,17 +748,19 @@ namespace paludis
const std::shared_ptr<const EAPIMetadataVariable> variable;
const std::shared_ptr<const EAPI> eapi;
const MetadataKeyType type;
+ const bool is_installed;
Imp(const Environment * const e,
const std::string & v,
const std::shared_ptr<const EAPIMetadataVariable> & m,
const std::shared_ptr<const EAPI> & p,
- const MetadataKeyType t) :
+ const MetadataKeyType t, bool i) :
env(e),
string_value(v),
variable(m),
eapi(p),
- type(t)
+ type(t),
+ is_installed(i)
{
}
};
@@ -752,8 +770,8 @@ EProvideKey::EProvideKey(
const Environment * const e,
const std::shared_ptr<const EAPIMetadataVariable> & m,
const std::shared_ptr<const EAPI> & p,
- const std::string & v, const MetadataKeyType t) :
- _imp(e, v, m, p, t)
+ const std::string & v, const MetadataKeyType t, const bool i) :
+ _imp(e, v, m, p, t, i)
{
}
@@ -769,7 +787,7 @@ EProvideKey::value() const
return _imp->value;
Context context("When parsing metadata key '" + raw_name() + "':");
- _imp->value = parse_provide(_imp->string_value, _imp->env, *_imp->eapi);
+ _imp->value = parse_provide(_imp->string_value, _imp->env, *_imp->eapi, _imp->is_installed);
return _imp->value;
}
diff --git a/paludis/repositories/e/e_key.hh b/paludis/repositories/e/e_key.hh
index 13a7265..b727504 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -126,7 +126,8 @@ namespace paludis
ESimpleURIKey(const Environment * const,
const std::shared_ptr<const EAPIMetadataVariable> &,
const std::shared_ptr<const EAPI> &,
- const std::string &, const MetadataKeyType);
+ const std::string &, const MetadataKeyType,
+ const bool is_installed);
~ESimpleURIKey();
virtual const std::shared_ptr<const SimpleURISpecTree> value() const
@@ -151,7 +152,8 @@ namespace paludis
EPlainTextSpecKey(const Environment * const,
const std::shared_ptr<const EAPIMetadataVariable> &,
const std::shared_ptr<const EAPI> &,
- const std::string &, const MetadataKeyType);
+ const std::string &, const MetadataKeyType,
+ bool is_installed);
~EPlainTextSpecKey();
virtual const std::shared_ptr<const PlainTextSpecTree> value() const
@@ -176,7 +178,8 @@ namespace paludis
EMyOptionsKey(const Environment * const,
const std::shared_ptr<const EAPIMetadataVariable> &,
const std::shared_ptr<const EAPI> &,
- const std::string &, const MetadataKeyType);
+ const std::string &, const MetadataKeyType,
+ bool);
~EMyOptionsKey();
virtual const std::shared_ptr<const PlainTextSpecTree> value() const
@@ -201,7 +204,8 @@ namespace paludis
ERequiredUseKey(const Environment * const,
const std::shared_ptr<const EAPIMetadataVariable> &,
const std::shared_ptr<const EAPI> &,
- const std::string &, const MetadataKeyType);
+ const std::string &, const MetadataKeyType,
+ bool i);
~ERequiredUseKey();
virtual const std::shared_ptr<const RequiredUseSpecTree> value() const
@@ -226,7 +230,8 @@ namespace paludis
EProvideKey(const Environment * const,
const std::shared_ptr<const EAPIMetadataVariable> &,
const std::shared_ptr<const EAPI> &,
- const std::string &, const MetadataKeyType);
+ const std::string &, const MetadataKeyType,
+ const bool is_installed);
~EProvideKey();
virtual const std::shared_ptr<const ProvideSpecTree> value() const
@@ -252,7 +257,8 @@ namespace paludis
const Environment * const,
const std::shared_ptr<const EAPIMetadataVariable> &,
const std::shared_ptr<const EAPI> &,
- const std::string &, const MetadataKeyType);
+ const std::string &, const MetadataKeyType,
+ bool is_installed);
~ELicenseKey();
virtual const std::shared_ptr<const LicenseSpecTree> value() const
diff --git a/paludis/repositories/e/e_repository_id.hh b/paludis/repositories/e/e_repository_id.hh
index 27129f4..a030811 100644
--- a/paludis/repositories/e/e_repository_id.hh
+++ b/paludis/repositories/e/e_repository_id.hh
@@ -32,6 +32,8 @@ namespace paludis
public PackageID
{
public:
+ virtual bool is_installed() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
virtual const std::shared_ptr<const EAPI> eapi() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > inherited_key() const = 0;
virtual const std::shared_ptr<const MetadataSpecTreeKey<LicenseSpecTree> > license_key() const = 0;
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 256c024..13d802a 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -552,7 +552,7 @@ EbuildMetadataCommand::load(const std::shared_ptr<const EbuildID> & id)
{
DependenciesRewriter rewriter;
std::string dep_s(get(keys, m.dependencies()->name()));
- parse_depend(dep_s, params.environment(), *id->eapi())->top()->accept(rewriter);
+ parse_depend(dep_s, params.environment(), *id->eapi(), id->is_installed())->top()->accept(rewriter);
id->load_raw_depend(m.dependencies()->name(), m.dependencies()->description(), dep_s);
id->load_build_depend(m.dependencies()->name() + ".DEPEND", m.dependencies()->description() + " (build)", rewriter.depend(), true);
id->load_run_depend(m.dependencies()->name() + ".RDEPEND", m.dependencies()->description() + " (run)", rewriter.rdepend(), true);
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index f840a1d..9d40bec 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -181,7 +181,7 @@ namespace
if (-1 != m.dependencies()->flat_list_index() && ! m.dependencies()->name().empty())
{
DependenciesRewriter rewriter;
- parse_depend(lines.at(m.dependencies()->flat_list_index()), _imp->env, *id->eapi())->top()->accept(rewriter);
+ parse_depend(lines.at(m.dependencies()->flat_list_index()), _imp->env, *id->eapi(), false)->top()->accept(rewriter);
id->load_raw_depend(m.dependencies()->name(), m.dependencies()->description(),
lines.at(m.dependencies()->flat_list_index()));
id->load_build_depend(m.dependencies()->name() + ".DEPEND", m.dependencies()->description() + " (build)", rewriter.depend(), true);
@@ -524,7 +524,7 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
if (! m.dependencies()->name().empty())
{
DependenciesRewriter rewriter;
- parse_depend(keys[m.dependencies()->name()], _imp->env, *id->eapi())->top()->accept(rewriter);
+ parse_depend(keys[m.dependencies()->name()], _imp->env, *id->eapi(), false)->top()->accept(rewriter);
id->load_raw_depend(m.dependencies()->name(), m.dependencies()->description(),
keys[m.dependencies()->name()]);
id->load_build_depend(m.dependencies()->name() + ".DEPEND", m.dependencies()->description() + " (build)", rewriter.depend(), true);
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index c34d07f..d0dc8a6 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1018,7 +1018,7 @@ void
EbuildID::load_homepage(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->homepage = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_significant);
+ _imp->homepage = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_significant, is_installed());
add_metadata_key(_imp->homepage);
}
@@ -1026,7 +1026,7 @@ void
EbuildID::load_license(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->license = std::make_shared<ELicenseKey>(_imp->environment, m, eapi(), v, mkt_internal);
+ _imp->license = std::make_shared<ELicenseKey>(_imp->environment, m, eapi(), v, mkt_internal, is_installed());
add_metadata_key(_imp->license);
}
@@ -1034,7 +1034,7 @@ void
EbuildID::load_restrict(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->restrictions = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_internal);
+ _imp->restrictions = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_internal, is_installed());
add_metadata_key(_imp->restrictions);
}
@@ -1042,7 +1042,7 @@ void
EbuildID::load_properties(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->properties = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_internal);
+ _imp->properties = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_internal, is_installed());
add_metadata_key(_imp->properties);
}
@@ -1050,7 +1050,7 @@ void
EbuildID::load_provide(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->provide = std::make_shared<EProvideKey>(_imp->environment, m, eapi(), v, mkt_internal);
+ _imp->provide = std::make_shared<EProvideKey>(_imp->environment, m, eapi(), v, mkt_internal, is_installed());
add_metadata_key(_imp->provide);
}
@@ -1066,7 +1066,7 @@ void
EbuildID::load_myoptions(const std::shared_ptr<const EAPIMetadataVariable> & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->raw_myoptions = std::make_shared<EMyOptionsKey>(_imp->environment, h, eapi(), v, mkt_internal);
+ _imp->raw_myoptions = std::make_shared<EMyOptionsKey>(_imp->environment, h, eapi(), v, mkt_internal, is_installed());
add_metadata_key(_imp->raw_myoptions);
}
@@ -1074,7 +1074,7 @@ void
EbuildID::load_required_use(const std::shared_ptr<const EAPIMetadataVariable> & k, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->required_use = std::make_shared<ERequiredUseKey>(_imp->environment, k, eapi(), v, mkt_internal);
+ _imp->required_use = std::make_shared<ERequiredUseKey>(_imp->environment, k, eapi(), v, mkt_internal, is_installed());
add_metadata_key(_imp->required_use);
}
@@ -1117,7 +1117,7 @@ void
EbuildID::load_upstream_changelog(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->upstream_changelog = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_normal);
+ _imp->upstream_changelog = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_normal, is_installed());
add_metadata_key(_imp->upstream_changelog);
}
@@ -1125,7 +1125,7 @@ void
EbuildID::load_upstream_documentation(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->upstream_documentation = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_normal);
+ _imp->upstream_documentation = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_normal, is_installed());
add_metadata_key(_imp->upstream_documentation);
}
@@ -1133,7 +1133,7 @@ void
EbuildID::load_upstream_release_notes(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->upstream_release_notes = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_normal);
+ _imp->upstream_release_notes = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_normal, is_installed());
add_metadata_key(_imp->upstream_release_notes);
}
@@ -1141,7 +1141,7 @@ void
EbuildID::load_bugs_to(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->bugs_to = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_normal);
+ _imp->bugs_to = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_normal, is_installed());
add_metadata_key(_imp->bugs_to);
}
@@ -1149,7 +1149,7 @@ void
EbuildID::load_remote_ids(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->remote_ids = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_internal);
+ _imp->remote_ids = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_internal, is_installed());
add_metadata_key(_imp->remote_ids);
}
@@ -1666,3 +1666,9 @@ EbuildID::might_be_binary() const
return false;
}
+bool
+EbuildID::is_installed() const
+{
+ return false;
+}
+
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index 21af840..2558371 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -61,6 +61,7 @@ namespace paludis
virtual const QualifiedPackageName name() const;
virtual const VersionSpec version() const;
virtual const RepositoryName repository_name() const;
+ virtual bool is_installed() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::shared_ptr<const MetadataValueKey<SlotName> > slot_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const PackageID> > > virtual_for_key() const;
diff --git a/paludis/repositories/e/fetch_visitor_TEST.cc b/paludis/repositories/e/fetch_visitor_TEST.cc
index 766f5f9..16d4790 100644
--- a/paludis/repositories/e/fetch_visitor_TEST.cc
+++ b/paludis/repositories/e/fetch_visitor_TEST.cc
@@ -83,7 +83,7 @@ namespace test_cases
*eapi, FSPath("fetch_visitor_TEST_dir/out"),
false, false, "test", std::make_shared<URIListedThenMirrorsLabel>("listed-then-mirrors"), false,
std::make_shared<StandardOutputManager>(), get_mirrors_fn);
- parse_fetchable_uri("file:///" + stringify(FSPath("fetch_visitor_TEST_dir/in/input1").realpath()), &env, *eapi)->top()->accept(v);
+ parse_fetchable_uri("file:///" + stringify(FSPath("fetch_visitor_TEST_dir/in/input1").realpath()), &env, *eapi, false)->top()->accept(v);
TEST_CHECK(FSPath("fetch_visitor_TEST_dir/out/input1").stat().is_regular_file());
SafeIFStream f(FSPath("fetch_visitor_TEST_dir/out/input1"));
diff --git a/paludis/repositories/e/fix_locked_dependencies_TEST.cc b/paludis/repositories/e/fix_locked_dependencies_TEST.cc
index e1cc1e8..4c1ed3e 100644
--- a/paludis/repositories/e/fix_locked_dependencies_TEST.cc
+++ b/paludis/repositories/e/fix_locked_dependencies_TEST.cc
@@ -64,7 +64,7 @@ namespace test_cases
std::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string("paludis-1"));
std::shared_ptr<const DependencySpecTree> bb(parse_depend(
- "|| ( foo/bar ( bar/baz oink/squeak ) ) blah/blah", &env, *eapi)),
+ "|| ( foo/bar ( bar/baz oink/squeak ) ) blah/blah", &env, *eapi, false)),
aa(fix_locked_dependencies(&env, *eapi, id, bb));
UnformattedPrettyPrinter ff;
@@ -77,7 +77,7 @@ namespace test_cases
TEST_CHECK_STRINGIFY_EQUAL(a, b);
std::shared_ptr<const DependencySpecTree> cc(parse_depend(
- "foo/bar:= cat/installed:= >=cat/installed-1.2:= <=cat/installed-1.2:=", &env, *eapi)),
+ "foo/bar:= cat/installed:= >=cat/installed-1.2:= <=cat/installed-1.2:=", &env, *eapi, false)),
dd(fix_locked_dependencies(&env, *eapi, id, cc));
SpecTreePrettyPrinter