diff options
author | 2011-01-06 17:40:34 +0000 | |
---|---|---|
committer | 2011-01-07 11:32:56 +0000 | |
commit | bd35e31901131753ecaf7a9e58a4aea650000de2 (patch) | |
tree | e8be51bf37dd5fe706a43509ee908bd7934e2a55 | |
parent | 7e84ced26e054fd9293fc21a874245adc2ce2199 (diff) | |
download | paludis-bd35e31901131753ecaf7a9e58a4aea650000de2.tar.gz paludis-bd35e31901131753ecaf7a9e58a4aea650000de2.tar.xz |
Don't need IDs
-rw-r--r-- | paludis/repositories/e/aa_visitor_TEST.cc | 2 | ||||
-rw-r--r-- | paludis/repositories/e/dep_parser.cc | 30 | ||||
-rw-r--r-- | paludis/repositories/e/dep_parser.hh | 19 | ||||
-rw-r--r-- | paludis/repositories/e/dep_parser_TEST.cc | 90 | ||||
-rw-r--r-- | paludis/repositories/e/e_installed_repository_id.cc | 3 | ||||
-rw-r--r-- | paludis/repositories/e/e_key.cc | 18 | ||||
-rw-r--r-- | paludis/repositories/e/ebuild.cc | 2 | ||||
-rw-r--r-- | paludis/repositories/e/ebuild_flat_metadata_cache.cc | 4 | ||||
-rw-r--r-- | paludis/repositories/e/fetch_visitor_TEST.cc | 2 | ||||
-rw-r--r-- | paludis/repositories/e/fix_locked_dependencies_TEST.cc | 6 | ||||
-rw-r--r-- | paludis/repositories/fake/dep_parser.cc | 15 | ||||
-rw-r--r-- | paludis/repositories/fake/dep_parser.hh | 12 | ||||
-rw-r--r-- | paludis/repositories/fake/dep_parser_TEST.cc | 5 | ||||
-rw-r--r-- | paludis/repositories/fake/fake_package_id.cc | 26 |
14 files changed, 104 insertions, 130 deletions
diff --git a/paludis/repositories/e/aa_visitor_TEST.cc b/paludis/repositories/e/aa_visitor_TEST.cc index 4ad722c3e..9af179248 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, id, *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"))->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 80f3b701a..3cc8f8586 100644 --- a/paludis/repositories/e/dep_parser.cc +++ b/paludis/repositories/e/dep_parser.cc @@ -250,11 +250,10 @@ namespace const Environment * const env, const typename ParseStackTypes<T_>::Stack & h, const typename ParseStackTypes<T_>::AnnotationsGoHere & annotations_go_here, - const std::shared_ptr<const PackageID> & id, const std::string & s, const EAPI & eapi) { - std::shared_ptr<DependenciesLabelsDepSpec> spec(parse_dependency_label(env, id, s, eapi)); + std::shared_ptr<DependenciesLabelsDepSpec> spec(parse_dependency_label(env, s, eapi)); h.begin()->item()->append(spec); annotations_go_here(spec, make_null_shared_ptr()); } @@ -469,8 +468,7 @@ namespace } std::shared_ptr<DependencySpecTree> -paludis::erepository::parse_depend(const std::string & s, - const Environment * const env, const std::shared_ptr<const PackageID> & id, const EAPI & eapi) +paludis::erepository::parse_depend(const std::string & s, const Environment * const env, const EAPI & eapi) { using namespace std::placeholders; @@ -497,7 +495,7 @@ paludis::erepository::parse_depend(const std::string & s, 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)), - id, _1, std::cref(eapi)), + _1, std::cref(eapi)), n::on_pop() = std::bind(&pop_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)), s), @@ -515,8 +513,7 @@ paludis::erepository::parse_depend(const std::string & s, } std::shared_ptr<ProvideSpecTree> -paludis::erepository::parse_provide(const std::string & s, - const Environment * const env, const std::shared_ptr<const PackageID> &, const EAPI & eapi) +paludis::erepository::parse_provide(const std::string & s, const Environment * const env, const EAPI & eapi) { using namespace std::placeholders; @@ -555,8 +552,7 @@ paludis::erepository::parse_provide(const std::string & s, } std::shared_ptr<FetchableURISpecTree> -paludis::erepository::parse_fetchable_uri(const std::string & s, - const Environment * const env, const std::shared_ptr<const PackageID> &, const EAPI & eapi) +paludis::erepository::parse_fetchable_uri(const std::string & s, const Environment * const env, const EAPI & eapi) { using namespace std::placeholders; @@ -599,8 +595,7 @@ paludis::erepository::parse_fetchable_uri(const std::string & s, } std::shared_ptr<SimpleURISpecTree> -paludis::erepository::parse_simple_uri(const std::string & s, - const Environment * const env, const std::shared_ptr<const PackageID> &, const EAPI & eapi) +paludis::erepository::parse_simple_uri(const std::string & s, const Environment * const env, const EAPI & eapi) { using namespace std::placeholders; @@ -639,8 +634,7 @@ paludis::erepository::parse_simple_uri(const std::string & s, } std::shared_ptr<LicenseSpecTree> -paludis::erepository::parse_license(const std::string & s, - const Environment * const env, const std::shared_ptr<const PackageID> &, const EAPI & eapi) +paludis::erepository::parse_license(const std::string & s, const Environment * const env, const EAPI & eapi) { using namespace std::placeholders; @@ -679,8 +673,7 @@ paludis::erepository::parse_license(const std::string & s, } std::shared_ptr<PlainTextSpecTree> -paludis::erepository::parse_plain_text(const std::string & s, - const Environment * const env, const std::shared_ptr<const PackageID> &, const EAPI & eapi) +paludis::erepository::parse_plain_text(const std::string & s, const Environment * const env, const EAPI & eapi) { using namespace std::placeholders; @@ -719,8 +712,7 @@ paludis::erepository::parse_plain_text(const std::string & s, } std::shared_ptr<PlainTextSpecTree> -paludis::erepository::parse_myoptions(const std::string & s, - const Environment * const env, const std::shared_ptr<const PackageID> &, const EAPI & eapi) +paludis::erepository::parse_myoptions(const std::string & s, const Environment * const env, const EAPI & eapi) { using namespace std::placeholders; @@ -761,8 +753,7 @@ paludis::erepository::parse_myoptions(const std::string & s, } std::shared_ptr<RequiredUseSpecTree> -paludis::erepository::parse_required_use(const std::string & s, - const Environment * const env, const std::shared_ptr<const PackageID> &, const EAPI & eapi) +paludis::erepository::parse_required_use(const std::string & s, const Environment * const env, const EAPI & eapi) { using namespace std::placeholders; @@ -1000,7 +991,6 @@ namespace std::shared_ptr<DependenciesLabelsDepSpec> paludis::erepository::parse_dependency_label( const Environment * const, - const std::shared_ptr<const PackageID> &, const std::string & s, const EAPI & e) { diff --git a/paludis/repositories/e/dep_parser.hh b/paludis/repositories/e/dep_parser.hh index 64f5356b6..ee9591f53 100644 --- a/paludis/repositories/e/dep_parser.hh +++ b/paludis/repositories/e/dep_parser.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh + * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -53,14 +53,13 @@ namespace paludis * Parse a dependency heirarchy. */ std::shared_ptr<DependencySpecTree> parse_depend(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &, const EAPI &) PALUDIS_VISIBLE; + const Environment * const, const EAPI &) PALUDIS_VISIBLE; /** * Parse a dep spec label. */ std::shared_ptr<DependenciesLabelsDepSpec> parse_dependency_label( const Environment * const, - const std::shared_ptr<const PackageID> &, const std::string & s, const EAPI &) PALUDIS_VISIBLE; @@ -68,43 +67,43 @@ namespace paludis * Parse a provide heirarchy. */ std::shared_ptr<ProvideSpecTree> parse_provide(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &, const EAPI &) PALUDIS_VISIBLE; + const Environment * const, const EAPI &) PALUDIS_VISIBLE; /** * Parse a restrict or plain text heirarchy. */ std::shared_ptr<PlainTextSpecTree> parse_plain_text(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &, const EAPI &) PALUDIS_VISIBLE; + const Environment * const, const EAPI &) PALUDIS_VISIBLE; /** * Parse a myoptions heirarchy. */ std::shared_ptr<PlainTextSpecTree> parse_myoptions(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &, const EAPI &) PALUDIS_VISIBLE; + const Environment * const, const EAPI &) PALUDIS_VISIBLE; /** * Parse a required_use heirarchy. */ std::shared_ptr<RequiredUseSpecTree> parse_required_use(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &, const EAPI &) PALUDIS_VISIBLE; + const Environment * const, const EAPI &) PALUDIS_VISIBLE; /** * Parse a fetchable uri heirarchy. */ std::shared_ptr<FetchableURISpecTree> parse_fetchable_uri(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &, const EAPI &) PALUDIS_VISIBLE; + const Environment * const, const EAPI &) PALUDIS_VISIBLE; /** * Parse a simple uri heirarchy. */ std::shared_ptr<SimpleURISpecTree> parse_simple_uri(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &, const EAPI &) PALUDIS_VISIBLE; + const Environment * const, const EAPI &) PALUDIS_VISIBLE; /** * Parse a license heirarchy. */ std::shared_ptr<LicenseSpecTree> parse_license(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &, const EAPI &) PALUDIS_VISIBLE; + const Environment * const, const EAPI &) 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 c27a5f3bb..36616e16f 100644 --- a/paludis/repositories/e/dep_parser_TEST.cc +++ b/paludis/repositories/e/dep_parser_TEST.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh + * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -62,7 +62,7 @@ namespace test_cases UnformattedPrettyPrinter ff; SpecTreePrettyPrinter d(ff, { }); parse_depend("", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->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, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->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, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->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, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d1); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->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, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d2); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->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, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d3); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->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, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->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, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->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, id, *EAPIData::get_instance()->eapi_from_string("0"))->top()->accept(d); + &env, *EAPIData::get_instance()->eapi_from_string("0"))->top()->accept(d); TEST_CHECK_EQUAL(stringify(d), "|| ( one/one foo? ( two/two ) )"); TEST_CHECK_THROWS(parse_depend("|| ( one/one foo? ( two/two ) )", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); SpecTreePrettyPrinter e(ff, { }); parse_depend("|| ( one/one ( foo? ( two/two ) ) )", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(e); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->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, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->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, id, *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"))->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, id, *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"))->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, id, *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"))->top()->accept(d); TEST_CHECK_EQUAL(stringify(d), "a -> b\n"); SpecTreePrettyPrinter e(ff, { ppo_multiline_allowed }); - parse_fetchable_uri("a-> b", &env, id, *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"))->top()->accept(e); TEST_CHECK_EQUAL(stringify(e), "a->\nb\n"); TEST_CHECK_THROWS(parse_fetchable_uri("a -> b", - &env, id, *EAPIData::get_instance()->eapi_from_string("0"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("0"))->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, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_depend("!foo? ( one/one ) )", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_depend("( ( ( ) )", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_depend("( ( ( ) ) ) )", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_depend(")", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->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, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_depend("|| ", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_depend("foo?", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_depend("!? ( )", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_depend("!foo? ||", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_depend("(((", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_depend(")", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_depend("(foo/bar)", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_license("a -> b", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_fetchable_uri("( -> )", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_fetchable_uri("( -> )", - &env, id, *EAPIData::get_instance()->eapi_from_string("0"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("0"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_fetchable_uri("foo? -> bar", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_fetchable_uri("a ->", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_fetchable_uri("a -> ( )", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_fetchable_uri("a -> )", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); TEST_CHECK_THROWS(parse_fetchable_uri("a -> || ( )", - &env, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d), Exception); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->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, id, *EAPIData::get_instance()->eapi_from_string("exheres-0"))->top()->accept(d); + &env, *EAPIData::get_instance()->eapi_from_string("exheres-0"))->top()->accept(d); TEST_CHECK_EQUAL(stringify(d), "build: one/one"); TEST_CHECK_THROWS(parse_depend("build: one/one", - &env, id, *EAPIData::get_instance()->eapi_from_string("0"))->top()->accept(d), EDepParseError); + &env, *EAPIData::get_instance()->eapi_from_string("0"))->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, id, *EAPIData::get_instance()->eapi_from_string("exheres-0"))->top()->accept(d); + &env, *EAPIData::get_instance()->eapi_from_string("exheres-0"))->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, id, *EAPIData::get_instance()->eapi_from_string("exheres-0"))->top()->accept(d), EDepParseError); + &env, *EAPIData::get_instance()->eapi_from_string("exheres-0"))->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, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(d); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->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, id, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->top()->accept(e); + &env, *EAPIData::get_instance()->eapi_from_string("paludis-1"))->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 9cd94a8db..9756dc74b 100644 --- a/paludis/repositories/e/e_installed_repository_id.cc +++ b/paludis/repositories/e/e_installed_repository_id.cc @@ -332,8 +332,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, shared_from_this(), *eapi())); + std::shared_ptr<DependencySpecTree> raw_deps(parse_depend(raw_deps_str, _imp->environment, *eapi())); raw_deps->top()->accept(rewriter); _imp->keys->raw_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), vars->dependencies()->name(), diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc index 6bd34a807..3aee4c0fd 100644 --- a/paludis/repositories/e/e_key.cc +++ b/paludis/repositories/e/e_key.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh + * Copyright (c) 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -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, *_imp->id->eapi()); + _imp->value = parse_depend(_imp->string_value, _imp->env, *_imp->id->eapi()); return _imp->value; } @@ -242,7 +242,7 @@ ELicenseKey::value() const return _imp->value; Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':"); - _imp->value = parse_license(_imp->string_value, _imp->env, _imp->id, *_imp->id->eapi()); + _imp->value = parse_license(_imp->string_value, _imp->env, *_imp->id->eapi()); return _imp->value; } @@ -322,7 +322,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, *_imp->id->eapi()); + _imp->value = parse_fetchable_uri(_imp->string_value, _imp->env, *_imp->id->eapi()); return _imp->value; } @@ -439,7 +439,7 @@ ESimpleURIKey::value() const return _imp->value; Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':"); - _imp->value = parse_simple_uri(_imp->string_value, _imp->env, _imp->id, *_imp->id->eapi()); + _imp->value = parse_simple_uri(_imp->string_value, _imp->env, *_imp->id->eapi()); return _imp->value; } @@ -518,7 +518,7 @@ EPlainTextSpecKey::value() const return _imp->value; Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':"); - _imp->value = parse_plain_text(_imp->string_value, _imp->env, _imp->id, *_imp->id->eapi()); + _imp->value = parse_plain_text(_imp->string_value, _imp->env, *_imp->id->eapi()); return _imp->value; } @@ -598,7 +598,7 @@ EMyOptionsKey::value() const return _imp->value; Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':"); - _imp->value = parse_myoptions(_imp->string_value, _imp->env, _imp->id, *_imp->id->eapi()); + _imp->value = parse_myoptions(_imp->string_value, _imp->env, *_imp->id->eapi()); return _imp->value; } @@ -678,7 +678,7 @@ ERequiredUseKey::value() const return _imp->value; Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':"); - _imp->value = parse_required_use(_imp->string_value, _imp->env, _imp->id, *_imp->id->eapi()); + _imp->value = parse_required_use(_imp->string_value, _imp->env, *_imp->id->eapi()); return _imp->value; } @@ -757,7 +757,7 @@ EProvideKey::value() const return _imp->value; Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':"); - _imp->value = parse_provide(_imp->string_value, _imp->env, _imp->id, *_imp->id->eapi()); + _imp->value = parse_provide(_imp->string_value, _imp->env, *_imp->id->eapi()); return _imp->value; } diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc index 96f486c96..631650ec6 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, *id->eapi())->top()->accept(rewriter); + parse_depend(dep_s, params.environment(), *id->eapi())->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 5284dbc8b..36c79da56 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, *id->eapi())->top()->accept(rewriter); + parse_depend(lines.at(m.dependencies()->flat_list_index()), _imp->env, *id->eapi())->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); @@ -527,7 +527,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, *id->eapi())->top()->accept(rewriter); + parse_depend(keys[m.dependencies()->name()], _imp->env, *id->eapi())->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/fetch_visitor_TEST.cc b/paludis/repositories/e/fetch_visitor_TEST.cc index cc3d7f33a..766f5f94f 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, id, *eapi)->top()->accept(v); + parse_fetchable_uri("file:///" + stringify(FSPath("fetch_visitor_TEST_dir/in/input1").realpath()), &env, *eapi)->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 ca6ffb9c8..e1cc1e8a0 100644 --- a/paludis/repositories/e/fix_locked_dependencies_TEST.cc +++ b/paludis/repositories/e/fix_locked_dependencies_TEST.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh + * Copyright (c) 2008, 2009, 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -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, id, *eapi)), + "|| ( foo/bar ( bar/baz oink/squeak ) ) blah/blah", &env, *eapi)), 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, id, *eapi)), + "foo/bar:= cat/installed:= >=cat/installed-1.2:= <=cat/installed-1.2:=", &env, *eapi)), dd(fix_locked_dependencies(&env, *eapi, id, cc)); SpecTreePrettyPrinter diff --git a/paludis/repositories/fake/dep_parser.cc b/paludis/repositories/fake/dep_parser.cc index 8d30ba0fc..c59934c8c 100644 --- a/paludis/repositories/fake/dep_parser.cc +++ b/paludis/repositories/fake/dep_parser.cc @@ -166,8 +166,7 @@ namespace } std::shared_ptr<DependencySpecTree> -paludis::fakerepository::parse_depend(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &) +paludis::fakerepository::parse_depend(const std::string & s, const Environment * const) { using namespace std::placeholders; @@ -197,8 +196,7 @@ paludis::fakerepository::parse_depend(const std::string & s, } std::shared_ptr<ProvideSpecTree> -paludis::fakerepository::parse_provide(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &) +paludis::fakerepository::parse_provide(const std::string & s, const Environment * const) { using namespace std::placeholders; @@ -228,8 +226,7 @@ paludis::fakerepository::parse_provide(const std::string & s, } std::shared_ptr<FetchableURISpecTree> -paludis::fakerepository::parse_fetchable_uri(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &) +paludis::fakerepository::parse_fetchable_uri(const std::string & s, const Environment * const) { using namespace std::placeholders; @@ -259,8 +256,7 @@ paludis::fakerepository::parse_fetchable_uri(const std::string & s, } std::shared_ptr<SimpleURISpecTree> -paludis::fakerepository::parse_simple_uri(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &) +paludis::fakerepository::parse_simple_uri(const std::string & s, const Environment * const) { using namespace std::placeholders; @@ -290,8 +286,7 @@ paludis::fakerepository::parse_simple_uri(const std::string & s, } std::shared_ptr<LicenseSpecTree> -paludis::fakerepository::parse_license(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &) +paludis::fakerepository::parse_license(const std::string & s, const Environment * const) { using namespace std::placeholders; diff --git a/paludis/repositories/fake/dep_parser.hh b/paludis/repositories/fake/dep_parser.hh index a28daf8dc..0dd47fb12 100644 --- a/paludis/repositories/fake/dep_parser.hh +++ b/paludis/repositories/fake/dep_parser.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008 Ciaran McCreesh + * Copyright (c) 2008, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -46,31 +46,31 @@ namespace paludis * Parse a dependency heirarchy. */ std::shared_ptr<DependencySpecTree> parse_depend(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &) PALUDIS_VISIBLE; + const Environment * const) PALUDIS_VISIBLE; /** * Parse a provide heirarchy. */ std::shared_ptr<ProvideSpecTree> parse_provide(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &) PALUDIS_VISIBLE; + const Environment * const) PALUDIS_VISIBLE; /** * Parse a fetchable uri heirarchy. */ std::shared_ptr<FetchableURISpecTree> parse_fetchable_uri(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &) PALUDIS_VISIBLE; + const Environment * const) PALUDIS_VISIBLE; /** * Parse a simple uri heirarchy. */ std::shared_ptr<SimpleURISpecTree> parse_simple_uri(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &) PALUDIS_VISIBLE; + const Environment * const) PALUDIS_VISIBLE; /** * Parse a license heirarchy. */ std::shared_ptr<LicenseSpecTree> parse_license(const std::string & s, - const Environment * const, const std::shared_ptr<const PackageID> &) PALUDIS_VISIBLE; + const Environment * const) PALUDIS_VISIBLE; } } diff --git a/paludis/repositories/fake/dep_parser_TEST.cc b/paludis/repositories/fake/dep_parser_TEST.cc index 89b6ee1d8..2d216df53 100644 --- a/paludis/repositories/fake/dep_parser_TEST.cc +++ b/paludis/repositories/fake/dep_parser_TEST.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh + * Copyright (c) 2008, 2009, 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -87,8 +87,7 @@ namespace test_cases void run() { TestEnvironment env; - std::shared_ptr<DependencySpecTree> d(fakerepository::parse_depend( - "( ( a/a b/b ) )", &env, std::shared_ptr<const PackageID>())); + std::shared_ptr<DependencySpecTree> d(fakerepository::parse_depend("( ( a/a b/b ) )", &env)); QuickPrinter p; d->top()->accept(p); diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc index eb6258c1d..15d72236f 100644 --- a/paludis/repositories/fake/fake_package_id.cc +++ b/paludis/repositories/fake/fake_package_id.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh + * Copyright (c) 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -921,40 +921,32 @@ FakePackageID::need_keys_added() const using namespace std::placeholders; _imp->build_dependencies = std::make_shared<FakeMetadataSpecTreeKey<DependencySpecTree>>("DEPEND", "Build dependencies", - "", std::bind(&parse_depend, _1, _imp->env, - shared_from_this()), + "", std::bind(&parse_depend, _1, _imp->env), FakePackageIDData::get_instance()->build_dependencies_labels, mkt_dependencies); _imp->run_dependencies = std::make_shared<FakeMetadataSpecTreeKey<DependencySpecTree>>("RDEPEND", "Run dependencies", - "", std::bind(&parse_depend, _1, _imp->env, - shared_from_this()), + "", std::bind(&parse_depend, _1, _imp->env), FakePackageIDData::get_instance()->run_dependencies_labels, mkt_dependencies); _imp->post_dependencies = std::make_shared<FakeMetadataSpecTreeKey<DependencySpecTree>>("PDEPEND", "Post dependencies", - "", std::bind(&parse_depend, _1, _imp->env, - shared_from_this()), + "", std::bind(&parse_depend, _1, _imp->env), FakePackageIDData::get_instance()->post_dependencies_labels, mkt_dependencies); _imp->suggested_dependencies = std::make_shared<FakeMetadataSpecTreeKey<DependencySpecTree>>("SDEPEND", "Suggested dependencies", - "", std::bind(&parse_depend, _1, _imp->env, - shared_from_this()), + "", std::bind(&parse_depend, _1, _imp->env), FakePackageIDData::get_instance()->suggested_dependencies_labels, mkt_dependencies); _imp->src_uri = std::make_shared<FakeMetadataSpecTreeKey<FetchableURISpecTree>>("SRC_URI", "Source URI", - "", std::bind(&parse_fetchable_uri, _1, _imp->env, - shared_from_this()), mkt_normal); + "", std::bind(&parse_fetchable_uri, _1, _imp->env), mkt_normal); _imp->homepage = std::make_shared<FakeMetadataSpecTreeKey<SimpleURISpecTree>>("HOMEPAGE", "Homepage", - "", std::bind(&parse_simple_uri, _1, _imp->env, - shared_from_this()), mkt_normal); + "", std::bind(&parse_simple_uri, _1, _imp->env), mkt_normal); _imp->license = std::make_shared<FakeMetadataSpecTreeKey<LicenseSpecTree>>("LICENSE", "License", - "", std::bind(&parse_license, _1, _imp->env, - shared_from_this()), mkt_normal); + "", std::bind(&parse_license, _1, _imp->env), mkt_normal); _imp->provide = std::make_shared<FakeMetadataSpecTreeKey<ProvideSpecTree>>("PROVIDE", "Provide", - "", std::bind(&parse_provide, _1, _imp->env, - shared_from_this()), mkt_normal); + "", std::bind(&parse_provide, _1, _imp->env), mkt_normal); _imp->choices = std::make_shared<FakeMetadataChoicesKey>(_imp->env, shared_from_this()); |