aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-31 05:04:12 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-31 05:04:12 +0000
commita221f18987d6981b85f060390e5b36502ae9468a (patch)
tree2aa4f1c7ed47eb5f28ead5512fd1d46acd1fd52b
parentc88f7a39a906db747a42c9d9f4ca0cda7c9bbb01 (diff)
downloadpaludis-a221f18987d6981b85f060390e5b36502ae9468a.tar.gz
paludis-a221f18987d6981b85f060390e5b36502ae9468a.tar.xz
Ebuild definable call sequences. Fixes: ticket:264
-rw-r--r--paludis/dep_list/dep_list-fwd.hh8
-rw-r--r--paludis/dep_list/dep_list.cc66
-rw-r--r--paludis/dep_list/dep_list.sr25
-rw-r--r--paludis/dep_spec.cc3
-rw-r--r--paludis/dep_spec.hh11
-rw-r--r--paludis/dep_spec_TEST.cc1
-rw-r--r--paludis/dep_spec_pretty_printer_TEST.cc18
-rw-r--r--paludis/dep_tag-fwd.hh51
-rw-r--r--paludis/dep_tag.hh41
-rw-r--r--paludis/distribution.cc2
-rw-r--r--paludis/distribution.sr3
-rw-r--r--paludis/distributions/gentoo.conf3
-rw-r--r--paludis/eapi-fwd.hh2
-rw-r--r--paludis/eapi.cc110
-rw-r--r--paludis/eapi.hh4
-rw-r--r--paludis/eapi.sr45
-rw-r--r--paludis/eapis/0.conf50
-rw-r--r--paludis/eapis/CRAN-1.conf16
-rw-r--r--paludis/eapis/Makefile.am1
-rw-r--r--paludis/eapis/exheres-0.conf53
-rw-r--r--paludis/eapis/paludis-1.conf52
-rw-r--r--paludis/environment_implementation.cc6
-rw-r--r--paludis/environments/paludis/paludis_environment.cc1
-rw-r--r--paludis/files.m46
-rw-r--r--paludis/match_package.cc1
-rw-r--r--paludis/portage_dep_parser_TEST.cc76
-rw-r--r--paludis/qa/create_metadata_check.cc3
-rw-r--r--paludis/qa/parse_deps_check.cc7
-rw-r--r--paludis/repositories/cran/cran_dep_parser.cc20
-rw-r--r--paludis/repositories/cran/cran_dep_parser_TEST.cc7
-rw-r--r--paludis/repositories/cran/cran_description.cc1
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc1
-rw-r--r--paludis/repositories/cran/cran_repository.cc46
-rw-r--r--paludis/repositories/cran/cran_version_metadata.cc1
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc6
-rw-r--r--paludis/repositories/gentoo/Makefile.am18
-rw-r--r--paludis/repositories/gentoo/eapi_phase.cc114
-rw-r--r--paludis/repositories/gentoo/eapi_phase.hh59
-rw-r--r--paludis/repositories/gentoo/ebin.cc1
-rw-r--r--paludis/repositories/gentoo/ebin_entries.cc73
-rw-r--r--paludis/repositories/gentoo/ebuild.cc85
-rw-r--r--paludis/repositories/gentoo/ebuild.hh6
-rw-r--r--paludis/repositories/gentoo/ebuild.se43
-rw-r--r--paludis/repositories/gentoo/ebuild.sr10
-rw-r--r--paludis/repositories/gentoo/ebuild_entries.cc340
-rw-r--r--paludis/repositories/gentoo/ebuild_flat_metadata_cache.cc3
-rw-r--r--paludis/repositories/gentoo/portage_repository_TEST.cc13
-rw-r--r--paludis/repositories/gentoo/portage_repository_profile.cc1
-rw-r--r--paludis/repositories/gentoo/portage_repository_sets.cc3
-rw-r--r--paludis/repositories/gentoo/portage_virtual_version_metadata.cc4
-rw-r--r--paludis/repositories/gentoo/vdb_repository.cc167
-rw-r--r--paludis/repositories/gentoo/vdb_repository.hh2
-rw-r--r--paludis/repositories/gentoo/vdb_version_metadata.cc4
-rw-r--r--paludis/repository.sr2
-rw-r--r--paludis/tasks/install_task.cc47
-rw-r--r--paludis/version_metadata.cc37
-rw-r--r--paludis/version_metadata.hh4
-rw-r--r--paludis/version_metadata.sr4
-rw-r--r--paludis/version_operator-fwd.hh41
-rw-r--r--paludis/version_operator.hh17
-rw-r--r--paludis/version_requirements-fwd.hh63
-rw-r--r--paludis/version_requirements.hh31
-rw-r--r--python/eapi.cc3
-rw-r--r--ruby/dep_list.cc19
-rw-r--r--ruby/dep_spec.cc2
-rw-r--r--ruby/eapi.cc20
-rw-r--r--ruby/paludis_ruby.hh2
-rw-r--r--ruby/version_metadata.cc2
-rw-r--r--src/clients/adjutrix/find_insecure_packages.cc1
-rw-r--r--src/clients/contrarius/install.cc2
-rw-r--r--src/clients/paludis/applets.cc4
-rw-r--r--src/clients/paludis/install.cc2
-rwxr-xr-xsrc/clients/paludis/upgrade_TEST16
-rwxr-xr-xsrc/clients/paludis/upgrade_TEST_setup.sh6
-rw-r--r--src/output/console_install_task.cc21
-rw-r--r--src/output/console_query_task.cc2
-rw-r--r--src/output/console_query_task.hh1
77 files changed, 1229 insertions, 813 deletions
diff --git a/paludis/dep_list/dep_list-fwd.hh b/paludis/dep_list/dep_list-fwd.hh
index 8421ea8..65005ac 100644
--- a/paludis/dep_list/dep_list-fwd.hh
+++ b/paludis/dep_list/dep_list-fwd.hh
@@ -34,14 +34,6 @@ namespace paludis
class DepList;
class PackageDatabaseEntry;
- /**
- * Extract the destinations from a DepListEntry destinations member.
- *
- * \ingroup grpdepresolver
- */
- tr1::shared_ptr<DestinationsCollection> extract_dep_list_entry_destinations(
- tr1::shared_ptr<SortedCollection<DepListEntryDestination> >) PALUDIS_VISIBLE;
-
bool is_viable_any_child(const Environment & env, const PackageDatabaseEntry * const pde,
const DependencySpecTree::ConstItem & i);
}
diff --git a/paludis/dep_list/dep_list.cc b/paludis/dep_list/dep_list.cc
index e91aa93..ecea461 100644
--- a/paludis/dep_list/dep_list.cc
+++ b/paludis/dep_list/dep_list.cc
@@ -17,28 +17,32 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_spec.hh>
-#include <paludis/dep_spec_flattener.hh>
-#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/dep_list/dep_list.hh>
#include <paludis/dep_list/exceptions.hh>
-#include <paludis/dep_list/range_rewriter.hh>
#include <paludis/dep_list/query_visitor.hh>
+#include <paludis/dep_list/range_rewriter.hh>
#include <paludis/dep_list/show_suggest_visitor.hh>
+
+#include <paludis/dep_spec.hh>
+#include <paludis/dep_spec_flattener.hh>
+#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/distribution.hh>
+#include <paludis/eapi.hh>
+#include <paludis/hashed_containers.hh>
#include <paludis/match_package.hh>
#include <paludis/query.hh>
-#include <paludis/hashed_containers.hh>
+#include <paludis/version_requirements.hh>
+
#include <paludis/util/collection_concrete.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/save.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/visitor-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/visitor-impl.hh>
#include <algorithm>
#include <functional>
@@ -139,7 +143,7 @@ namespace
.origins_interface(0)
.ebin_interface(0)
.license_interface(0)),
- VersionMetadataVirtualInterface(e)
+ VersionMetadataVirtualInterface(make_shared_ptr(new PackageDatabaseEntry(e)))
{
}
@@ -514,7 +518,7 @@ DepList::AddVisitor::visit_leaf(const PackageDepSpec & a)
std::string best_visible_candidate_as_string(stringify(*best_visible_candidate));
if (best_visible_candidate_metadata->virtual_interface)
best_visible_candidate_as_string.append(" (for " + stringify(
- best_visible_candidate_metadata->virtual_interface->virtual_for) + ")");
+ *best_visible_candidate_metadata->virtual_interface->virtual_for) + ")");
tr1::shared_ptr<PackageDatabaseEntryCollection> already_installed_in_same_slot(
new PackageDatabaseEntryCollection::Concrete);
@@ -596,7 +600,7 @@ DepList::AddVisitor::visit_leaf(const PackageDepSpec & a)
std::string are_we_downgrading_last_as_string(stringify(*are_we_downgrading->last()));
if (are_we_downgrading_last_metadata->virtual_interface)
are_we_downgrading_last_as_string.append(" (for " + stringify(
- are_we_downgrading_last_metadata->virtual_interface->virtual_for) + ")");
+ *are_we_downgrading_last_metadata->virtual_interface->virtual_for) + ")");
if (d->_imp->opts->downgrade == dl_downgrade_error)
throw DowngradeNotAllowedError(best_visible_candidate_as_string,
@@ -803,7 +807,7 @@ DepList::AddVisitor::visit_leaf(const BlockDepSpec & a)
/* if it's a virtual, it only replaces if it's the same package. */
if ((*r)->metadata->virtual_interface)
{
- if ((*r)->metadata->virtual_interface->virtual_for.name == aa->name)
+ if ((*r)->metadata->virtual_interface->virtual_for->name == aa->name)
replaced = true;
}
else
@@ -823,7 +827,7 @@ DepList::AddVisitor::visit_leaf(const BlockDepSpec & a)
continue;
if (metadata->virtual_interface &&
- metadata->virtual_interface->virtual_for.name == d->_imp->current_pde()->name)
+ metadata->virtual_interface->virtual_for->name == d->_imp->current_pde()->name)
continue;
}
@@ -865,7 +869,7 @@ DepList::AddVisitor::visit_leaf(const BlockDepSpec & a)
continue;
if ((*r)->metadata->virtual_interface &&
- (*r)->metadata->virtual_interface->virtual_for.name == d->_imp->current_pde()->name)
+ (*r)->metadata->virtual_interface->virtual_for->name == d->_imp->current_pde()->name)
continue;
}
@@ -890,7 +894,7 @@ DepList::AddVisitor::visit_leaf(const BlockDepSpec & a)
continue;
if (r->metadata->virtual_interface &&
- r->metadata->virtual_interface->virtual_for.name == d->_imp->current_pde()->name)
+ r->metadata->virtual_interface->virtual_for->name == d->_imp->current_pde()->name)
continue;
}
@@ -979,12 +983,6 @@ DepList::add_package(const PackageDatabaseEntry & p, tr1::shared_ptr<const DepTa
/* create our merge list entry. insert pre deps before ourself in the list. insert
* post deps after ourself, and after any provides. */
- tr1::shared_ptr<SortedCollection<DepListEntryDestination> > our_merge_entry_destinations(
- new SortedCollection<DepListEntryDestination>::Concrete);
- if (! metadata->virtual_interface)
- our_merge_entry_destinations->insert(
- DepListEntryDestination(find_destination(p, destinations), _imp->merge_list_generation));
-
MergeList::iterator our_merge_entry_position(
_imp->merge_list.insert(_imp->merge_list_insert_position,
DepListEntry::create()
@@ -993,7 +991,7 @@ DepList::add_package(const PackageDatabaseEntry & p, tr1::shared_ptr<const DepTa
.generation(_imp->merge_list_generation)
.state(dle_no_deps)
.tags(tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags::Concrete))
- .destinations(our_merge_entry_destinations)
+ .destination(find_destination(p, destinations))
.associated_entry(0)
.kind(metadata->virtual_interface ? dlk_virtual : dlk_package))),
our_merge_entry_post_position(our_merge_entry_position);
@@ -1067,8 +1065,7 @@ DepList::add_package(const PackageDatabaseEntry & p, tr1::shared_ptr<const DepTa
.generation(_imp->merge_list_generation)
.state(dle_has_all_deps)
.tags(tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags::Concrete))
- .destinations(tr1::shared_ptr<SortedCollection<DepListEntryDestination> >(
- new SortedCollection<DepListEntryDestination>::Concrete))
+ .destination(tr1::shared_ptr<Repository>())
.associated_entry(&*_imp->current_merge_list_entry)
.kind(dlk_provided)));
_imp->merge_list_index.insert(std::make_pair((*i)->text(), our_merge_entry_post_position));
@@ -1139,8 +1136,7 @@ DepList::add_error_package(const PackageDatabaseEntry & p, const DepListEntryKin
.generation(_imp->merge_list_generation)
.state(dle_has_all_deps)
.tags(tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags::Concrete))
- .destinations(tr1::shared_ptr<SortedCollection<DepListEntryDestination> >(
- new SortedCollection<DepListEntryDestination>::Concrete))
+ .destination(tr1::shared_ptr<Repository>())
.associated_entry(&*_imp->current_merge_list_entry)
.kind(kind)));
@@ -1167,11 +1163,6 @@ DepList::add_suggested_package(const PackageDatabaseEntry & p,
return;
}
- tr1::shared_ptr<SortedCollection<DepListEntryDestination> > our_merge_entry_destinations(
- new SortedCollection<DepListEntryDestination>::Concrete);
- our_merge_entry_destinations->insert(DepListEntryDestination(find_destination(p, destinations),
- _imp->merge_list_generation));
-
MergeList::iterator our_merge_entry_position(
_imp->merge_list.insert(_imp->merge_list_insert_position,
DepListEntry::create()
@@ -1181,7 +1172,7 @@ DepList::add_suggested_package(const PackageDatabaseEntry & p,
.generation(_imp->merge_list_generation)
.state(dle_has_all_deps)
.tags(tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags::Concrete))
- .destinations(our_merge_entry_destinations)
+ .destination(find_destination(p, destinations))
.associated_entry(&*_imp->current_merge_list_entry)
.kind(dlk_suggested)));
@@ -1264,8 +1255,7 @@ DepList::add_already_installed_package(const PackageDatabaseEntry & p, tr1::shar
.generation(_imp->merge_list_generation)
.tags(tr1::shared_ptr<DepListEntryTags>(new DepListEntryTags::Concrete))
.state(dle_has_pre_deps)
- .destinations(tr1::shared_ptr<SortedCollection<DepListEntryDestination> >(
- new SortedCollection<DepListEntryDestination>::Concrete))
+ .destination(tr1::shared_ptr<Repository>())
.associated_entry(0)
.kind(dlk_already_installed)));
_imp->merge_list_index.insert(std::make_pair(p.name, our_merge_entry));
@@ -1544,16 +1534,6 @@ DepList::match_on_list(const PackageDepSpec & a) const
MatchDepListEntryAgainstPackageDepSpec(_imp->env, a));
}
-tr1::shared_ptr<DestinationsCollection>
-paludis::extract_dep_list_entry_destinations(tr1::shared_ptr<SortedCollection<DepListEntryDestination> > d)
-{
- tr1::shared_ptr<DestinationsCollection> result(new DestinationsCollection::Concrete);
- for (SortedCollection<DepListEntryDestination>::Iterator i(d->begin()), i_end(d->end()) ;
- i != i_end ; ++i)
- result->insert(i->destination);
- return result;
-}
-
bool
paludis::is_viable_any_child(const Environment & env, const PackageDatabaseEntry * const pde,
const DependencySpecTree::ConstItem & i)
diff --git a/paludis/dep_list/dep_list.sr b/paludis/dep_list/dep_list.sr
index 1b43d23..69dc05a 100644
--- a/paludis/dep_list/dep_list.sr
+++ b/paludis/dep_list/dep_list.sr
@@ -47,29 +47,6 @@ END
END
}
-make_class_DepListEntryDestination()
-{
- visible
-
- key destination "tr1::shared_ptr<Repository>"
- key generation long
-
- allow_named_args
- comparison_operators "all" "destination"
-
- doxygen_comment << "END"
- /**
- * A destination for a DepListEntry. Only the .destination key is of use outside
- * of DepList.
- *
- * \see DepList
- * \see DepListEntry
- * \ingroup grpdepresolver
- * \nosubgrouping
- */
-END
-}
-
make_class_DepListEntry()
{
visible
@@ -80,7 +57,7 @@ make_class_DepListEntry()
key associated_entry "const DepListEntry *"
key metadata "tr1::shared_ptr<const VersionMetadata>"
key tags "tr1::shared_ptr<DepListEntryTags>"
- key destinations "tr1::shared_ptr<SortedCollection<DepListEntryDestination> >"
+ key destination "tr1::shared_ptr<Repository>"
key generation long
key state DepListEntryState
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 79f4e7b..1d68c44 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -18,6 +18,9 @@
*/
#include <paludis/dep_spec.hh>
+#include <paludis/version_operator.hh>
+#include <paludis/version_spec.hh>
+#include <paludis/version_requirements.hh>
#include <paludis/util/clone-impl.hh>
#include <paludis/util/log.hh>
#include <paludis/util/collection_concrete.hh>
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index 7f50c56..5392e6b 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -21,15 +21,16 @@
#define PALUDIS_GUARD_PALUDIS_DEP_SPEC_HH 1
#include <paludis/dep_spec-fwd.hh>
-#include <paludis/dep_tag.hh>
+#include <paludis/dep_tag-fwd.hh>
#include <paludis/name.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/clone.hh>
#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/visitor.hh>
-#include <paludis/version_requirements.hh>
-#include <paludis/version_operator.hh>
-#include <paludis/version_spec.hh>
+#include <paludis/util/visitor-fwd.hh>
+#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/version_requirements-fwd.hh>
+#include <paludis/version_operator-fwd.hh>
+#include <paludis/version_spec-fwd.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
diff --git a/paludis/dep_spec_TEST.cc b/paludis/dep_spec_TEST.cc
index 9e6862a..b642e1d 100644
--- a/paludis/dep_spec_TEST.cc
+++ b/paludis/dep_spec_TEST.cc
@@ -19,6 +19,7 @@
#include <paludis/dep_spec.hh>
#include <paludis/util/iterator.hh>
+#include <paludis/version_requirements.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
diff --git a/paludis/dep_spec_pretty_printer_TEST.cc b/paludis/dep_spec_pretty_printer_TEST.cc
index 23b29cd..c267c71 100644
--- a/paludis/dep_spec_pretty_printer_TEST.cc
+++ b/paludis/dep_spec_pretty_printer_TEST.cc
@@ -36,23 +36,23 @@ namespace test_cases
void run()
{
DepSpecPrettyPrinter p1(0, false);
- PortageDepParser::parse_depend("foo/bar bar/baz", EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p1);
+ PortageDepParser::parse_depend("foo/bar bar/baz", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p1);
TEST_CHECK_STRINGIFY_EQUAL(p1, "foo/bar bar/baz");
DepSpecPrettyPrinter p2(0, false);
- PortageDepParser::parse_depend("foo/bar moo? ( bar/baz )", EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p2);
+ PortageDepParser::parse_depend("foo/bar moo? ( bar/baz )", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p2);
TEST_CHECK_STRINGIFY_EQUAL(p2, "foo/bar moo? ( bar/baz )");
DepSpecPrettyPrinter p3(0, false);
- PortageDepParser::parse_depend("|| ( a/b ( c/d e/f ) )", EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p3);
+ PortageDepParser::parse_depend("|| ( a/b ( c/d e/f ) )", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p3);
TEST_CHECK_STRINGIFY_EQUAL(p3, "|| ( a/b ( c/d e/f ) )");
DepSpecPrettyPrinter p4(0, false);
- PortageDepParser::parse_license("( ( ( ) a ) b )", EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p4);
+ PortageDepParser::parse_license("( ( ( ) a ) b )", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p4);
TEST_CHECK_STRINGIFY_EQUAL(p4, "a b");
DepSpecPrettyPrinter p5(0, false);
- PortageDepParser::parse_uri("( a -> b c x? ( d e ) )", EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p5);
+ PortageDepParser::parse_uri("( a -> b c x? ( d e ) )", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p5);
TEST_CHECK_STRINGIFY_EQUAL(p5, "a -> b c x? ( d e )");
}
} test_pretty_printer_no_indent;
@@ -64,20 +64,20 @@ namespace test_cases
void run()
{
DepSpecPrettyPrinter p1(4);
- PortageDepParser::parse_depend("foo/bar bar/baz", EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p1);
+ PortageDepParser::parse_depend("foo/bar bar/baz", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p1);
TEST_CHECK_STRINGIFY_EQUAL(p1, " foo/bar\n bar/baz\n");
DepSpecPrettyPrinter p2(4);
- PortageDepParser::parse_depend("foo/bar moo? ( bar/baz )", EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p2);
+ PortageDepParser::parse_depend("foo/bar moo? ( bar/baz )", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p2);
TEST_CHECK_STRINGIFY_EQUAL(p2, " foo/bar\n moo? (\n bar/baz\n )\n");
DepSpecPrettyPrinter p3(4);
- PortageDepParser::parse_depend("|| ( a/b ( c/d e/f ) )", EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p3);
+ PortageDepParser::parse_depend("|| ( a/b ( c/d e/f ) )", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p3);
TEST_CHECK_STRINGIFY_EQUAL(p3, " || (\n a/b\n (\n c/d\n"
" e/f\n )\n )\n");
DepSpecPrettyPrinter p4(4);
- PortageDepParser::parse_license("( ( ( ) a ) b )", EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p4);
+ PortageDepParser::parse_license("( ( ( ) a ) b )", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(p4);
TEST_CHECK_STRINGIFY_EQUAL(p4, " a\n b\n");
}
} test_pretty_printer_indent;
diff --git a/paludis/dep_tag-fwd.hh b/paludis/dep_tag-fwd.hh
new file mode 100644
index 0000000..be5697c
--- /dev/null
+++ b/paludis/dep_tag-fwd.hh
@@ -0,0 +1,51 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_DEP_TAG_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_DEP_TAG_FWD_HH 1
+
+#include <paludis/util/visitor-fwd.hh>
+#include <paludis/util/collection-fwd.hh>
+#include <paludis/util/attributes.hh>
+
+namespace paludis
+{
+ class DepTagCategory;
+ class NoSuchDepTagCategory;
+
+ class DepTagCategoryMaker;
+
+ class DepTag;
+ class GLSADepTag;
+ class GeneralSetDepTag;
+ class DependencyDepTag;
+
+ class DepTagVisitorTypes;
+
+ class DepTagEntry;
+
+ /**
+ * Tags attached to a DepListEntry.
+ *
+ * \ingroup grpdeptag
+ */
+ typedef SortedCollection<DepTagEntry> DepListEntryTags;
+}
+
+#endif
diff --git a/paludis/dep_tag.hh b/paludis/dep_tag.hh
index 9fc793c..c5304bd 100644
--- a/paludis/dep_tag.hh
+++ b/paludis/dep_tag.hh
@@ -26,6 +26,7 @@
* \ingroup grpdeptag
*/
+#include <paludis/dep_tag-fwd.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/visitor.hh>
@@ -41,6 +42,23 @@
namespace paludis
{
/**
+ * Visitor class for visiting the different DepTag subclasses.
+ *
+ * \ingroup grpdeptag
+ * \see DepTag
+ */
+ struct DepTagVisitorTypes :
+ VisitorTypes<
+ DepTagVisitorTypes,
+ DepTag,
+ GLSADepTag,
+ GeneralSetDepTag,
+ DependencyDepTag
+ >
+ {
+ };
+
+ /**
* A DepTagCategory is identified by its name and has associated display
* information for a DepTag's category.
*
@@ -143,23 +161,6 @@ namespace paludis
class DependencyDepTag;
/**
- * Visitor class for visiting the different DepTag subclasses.
- *
- * \ingroup grpdeptag
- * \see DepTag
- */
- struct DepTagVisitorTypes :
- VisitorTypes<
- DepTagVisitorTypes,
- DepTag,
- GLSADepTag,
- GeneralSetDepTag,
- DependencyDepTag
- >
- {
- };
-
- /**
* A DepTag can be associated with a PackageDepSpec, and is transferred
* onto any associated DepListEntry instances.
*
@@ -298,12 +299,6 @@ namespace paludis
#include <paludis/dep_tag-sr.hh>
- /**
- * Tags attached to a DepListEntry.
- *
- * \ingroup grpdeptag
- */
- typedef SortedCollection<DepTagEntry> DepListEntryTags;
}
#endif
diff --git a/paludis/distribution.cc b/paludis/distribution.cc
index 8d7b62b..689df04 100644
--- a/paludis/distribution.cc
+++ b/paludis/distribution.cc
@@ -69,6 +69,8 @@ namespace paludis
.default_ebuild_names_cache(k.get("default_ebuild_names_cache"))
.default_ebuild_build_root(k.get("default_ebuild_build_root"))
.default_ebuild_layout(k.get("default_ebuild_layout"))
+ .eapi_when_unknown(k.get("eapi_when_unknown"))
+ .eapi_when_unspecified(k.get("eapi_when_unspecified"))
))));
}
}
diff --git a/paludis/distribution.sr b/paludis/distribution.sr
index 215b357..8221e26 100644
--- a/paludis/distribution.sr
+++ b/paludis/distribution.sr
@@ -13,6 +13,9 @@ make_class_Distribution()
key default_ebuild_build_root std::string
key default_ebuild_layout std::string
+ key eapi_when_unknown std::string
+ key eapi_when_unspecified std::string
+
allow_named_args
doxygen_comment << "END"
diff --git a/paludis/distributions/gentoo.conf b/paludis/distributions/gentoo.conf
index 211d60a..1779d2d 100644
--- a/paludis/distributions/gentoo.conf
+++ b/paludis/distributions/gentoo.conf
@@ -10,3 +10,6 @@ default_ebuild_names_cache =
default_ebuild_build_root = /var/tmp/paludis
default_ebuild_layout = traditional
+eapi_when_unknown = 0
+eapi_when_unspecified = 0
+
diff --git a/paludis/eapi-fwd.hh b/paludis/eapi-fwd.hh
index 4d94b61..7523fa3 100644
--- a/paludis/eapi-fwd.hh
+++ b/paludis/eapi-fwd.hh
@@ -26,6 +26,8 @@ namespace paludis
class SupportedEAPI;
class EAPIData;
class EAPIConfigurationError;
+ class EAPIEbuildPhases;
+ class EAPIEbuildMetadataVariables;
}
#endif
diff --git a/paludis/eapi.cc b/paludis/eapi.cc
index 8e59aef..7caaf40 100644
--- a/paludis/eapi.cc
+++ b/paludis/eapi.cc
@@ -27,16 +27,20 @@
#include <paludis/util/strip.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/collection_concrete.hh>
+#include <paludis/util/tokeniser.hh>
#include <paludis/config_file.hh>
using namespace paludis;
+#include <paludis/eapi-sr.cc>
+
namespace paludis
{
template<>
struct Implementation<EAPIData>
{
- MakeHashedMap<std::string, EAPI>::Type values;
+ MakeHashedMap<std::string, tr1::shared_ptr<const EAPI> >::Type values;
Implementation()
{
@@ -53,39 +57,87 @@ namespace paludis
KeyValueConfigFile k(*d, KeyValueConfigFileOptions());
values.insert(std::make_pair(strip_trailing_string(d->basename(), ".conf"),
- EAPI(strip_trailing_string(d->basename(), ".conf"), make_shared_ptr(new SupportedEAPI(
- SupportedEAPI::create()
- .package_dep_spec_parse_mode(destringify<PackageDepSpecParseMode>(
- k.get("package_dep_spec_parse_mode")))
- .strict_package_dep_spec_parse_mode(destringify<PackageDepSpecParseMode>(
- k.get("strict_package_dep_spec_parse_mode")))
- .dependency_spec_tree_parse_mode(destringify<DependencySpecTreeParseMode>(
- k.get("dependency_spec_tree_parse_mode")))
- .iuse_flag_parse_mode(destringify<IUseFlagParseMode>(
- k.get("iuse_flag_parse_mode")))
- .strict_iuse_flag_parse_mode(destringify<IUseFlagParseMode>(
- k.get("strict_iuse_flag_parse_mode")))
- .breaks_portage(destringify<bool>(k.get("breaks_portage")))
- .has_pkg_pretend(destringify<bool>(k.get("has_pkg_pretend")))
- .uri_supports_arrow(destringify<bool>(k.get("uri_supports_arrow")))
- .want_aa_var(destringify<bool>(k.get("want_aa_var")))
- .want_arch_var(destringify<bool>(k.get("want_arch_var")))
- .want_portage_emulation_vars(destringify<bool>(k.get("want_portage_emulation_vars")))
- .require_use_expand_in_iuse(destringify<bool>(k.get("require_use_expand_in_iuse")))
- )))));
+ make_shared_ptr(new EAPI(strip_trailing_string(d->basename(), ".conf"), make_shared_ptr(new SupportedEAPI(
+ SupportedEAPI::create()
+ .package_dep_spec_parse_mode(destringify<PackageDepSpecParseMode>(
+ k.get("package_dep_spec_parse_mode")))
+ .strict_package_dep_spec_parse_mode(destringify<PackageDepSpecParseMode>(
+ k.get("strict_package_dep_spec_parse_mode").empty() ?
+ k.get("package_dep_spec_parse_mode") :
+ k.get("strict_package_dep_spec_parse_mode")))
+ .dependency_spec_tree_parse_mode(destringify<DependencySpecTreeParseMode>(
+ k.get("dependency_spec_tree_parse_mode")))
+ .iuse_flag_parse_mode(destringify<IUseFlagParseMode>(
+ k.get("iuse_flag_parse_mode")))
+ .strict_iuse_flag_parse_mode(destringify<IUseFlagParseMode>(
+ k.get("strict_iuse_flag_parse_mode").empty() ?
+ k.get("iuse_flag_parse_mode") :
+ k.get("strict_iuse_flag_parse_mode")))
+ .breaks_portage(destringify<bool>(k.get("breaks_portage")))
+ .uri_supports_arrow(destringify<bool>(k.get("uri_supports_arrow")))
+ .want_aa_var(destringify<bool>(k.get("want_aa_var")))
+ .want_arch_var(destringify<bool>(k.get("want_arch_var")))
+ .want_portage_emulation_vars(destringify<bool>(k.get("want_portage_emulation_vars")))
+ .require_use_expand_in_iuse(destringify<bool>(k.get("require_use_expand_in_iuse")))
+
+ .ebuild_phases(make_shared_ptr(new EAPIEbuildPhases(
+ EAPIEbuildPhases::create()
+ .ebuild_install(k.get("ebuild_install"))
+ .ebuild_uninstall(k.get("ebuild_uninstall"))
+ .ebuild_pretend(k.get("ebuild_pretend"))
+ .ebuild_metadata(k.get("ebuild_metadata"))
+ .ebuild_fetch(k.get("ebuild_fetch"))
+ .ebuild_nofetch(k.get("ebuild_nofetch"))
+ .ebuild_variable(k.get("ebuild_variable"))
+ .ebuild_config(k.get("ebuild_config")))))
+
+ .ebuild_metadata_variables(make_shared_ptr(new EAPIEbuildMetadataVariables(
+ EAPIEbuildMetadataVariables::create()
+ .metadata_build_depend(k.get("metadata_build_depend"))
+ .metadata_run_depend(k.get("metadata_run_depend"))
+ .metadata_slot(k.get("metadata_slot"))
+ .metadata_src_uri(k.get("metadata_src_uri"))
+ .metadata_restrict(k.get("metadata_restrict"))
+ .metadata_homepage(k.get("metadata_homepage"))
+ .metadata_license(k.get("metadata_license"))
+ .metadata_description(k.get("metadata_description"))
+ .metadata_keywords(k.get("metadata_keywords"))
+ .metadata_eclass_keywords(k.get("metadata_eclass_keywords"))
+ .metadata_inherited(k.get("metadata_inherited"))
+ .metadata_iuse(k.get("metadata_iuse"))
+ .metadata_pdepend(k.get("metadata_pdepend"))
+ .metadata_provide(k.get("metadata_provide"))
+ .metadata_eapi(k.get("metadata_eapi")))))
+ ))))));
}
- MakeHashedMap<std::string, EAPI>::Type::const_iterator i(values.find("0"));
+ MakeHashedMap<std::string, tr1::shared_ptr<const EAPI> >::Type::const_iterator i(values.find("0"));
if (i == values.end())
throw EAPIConfigurationError("No EAPI configuration found for EAPI 0");
else
values.insert(std::make_pair("", i->second));
+
+ values.insert(std::make_pair("CRAN-1",
+ make_shared_ptr(new EAPI("CRAN-1", make_shared_ptr(new SupportedEAPI(
+ SupportedEAPI::create()
+ .package_dep_spec_parse_mode(pds_pm_permissive)
+ .strict_package_dep_spec_parse_mode(pds_pm_permissive)
+ .dependency_spec_tree_parse_mode(dst_pm_eapi_0)
+ .iuse_flag_parse_mode(iuse_pm_permissive)
+ .strict_iuse_flag_parse_mode(iuse_pm_permissive)
+ .breaks_portage(true)
+ .uri_supports_arrow(false)
+ .want_aa_var(false)
+ .want_arch_var(false)
+ .want_portage_emulation_vars(false)
+ .require_use_expand_in_iuse(false)
+ .ebuild_metadata_variables(tr1::shared_ptr<EAPIEbuildMetadataVariables>())
+ .ebuild_phases(tr1::shared_ptr<EAPIEbuildPhases>())
+ ))))));
}
};
}
-#include <paludis/eapi-sr.cc>
-
EAPIConfigurationError::EAPIConfigurationError(const std::string & s) throw () :
ConfigurationError("EAPI configuration error: " + s)
{
@@ -100,19 +152,19 @@ EAPIData::~EAPIData()
{
}
-EAPI
+tr1::shared_ptr<const EAPI>
EAPIData::eapi_from_string(const std::string & s) const
{
- MakeHashedMap<std::string, EAPI>::Type::const_iterator i(_imp->values.find(s));
+ MakeHashedMap<std::string, tr1::shared_ptr<const EAPI> >::Type::const_iterator i(_imp->values.find(s));
if (i != _imp->values.end())
return i->second;
- return EAPI(s, tr1::shared_ptr<SupportedEAPI>());
+ return make_shared_ptr(new EAPI(s, tr1::shared_ptr<SupportedEAPI>()));
}
-EAPI
+tr1::shared_ptr<const EAPI>
EAPIData::unknown_eapi() const
{
- return EAPI("UNKNOWN", tr1::shared_ptr<SupportedEAPI>());
+ return make_shared_ptr(new EAPI("UNKNOWN", tr1::shared_ptr<SupportedEAPI>()));
}
diff --git a/paludis/eapi.hh b/paludis/eapi.hh
index 1057214..2169288 100644
--- a/paludis/eapi.hh
+++ b/paludis/eapi.hh
@@ -69,12 +69,12 @@ namespace paludis
/**
* Make an EAPI.
*/
- EAPI eapi_from_string(const std::string &) const;
+ tr1::shared_ptr<const EAPI> eapi_from_string(const std::string &) const;
/**
* Make the unknown EAPI.
*/
- EAPI unknown_eapi() const;
+ tr1::shared_ptr<const EAPI> unknown_eapi() const;
};
}
diff --git a/paludis/eapi.sr b/paludis/eapi.sr
index 97735e4..3473375 100644
--- a/paludis/eapi.sr
+++ b/paludis/eapi.sr
@@ -1,6 +1,47 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et ft=sh :
+
+make_class_EAPIEbuildPhases()
+{
+ visible
+ allow_named_args cc
+
+ key ebuild_install std::string
+ key ebuild_uninstall std::string
+ key ebuild_pretend std::string
+ key ebuild_metadata std::string
+ key ebuild_fetch std::string
+ key ebuild_nofetch std::string
+ key ebuild_variable std::string
+ key ebuild_config std::string
+}
+
+make_class_EAPIEbuildMetadataVariables()
+{
+ visible
+ allow_named_args cc
+
+ key metadata_build_depend std::string
+ key metadata_run_depend std::string
+ key metadata_slot std::string
+ key metadata_src_uri std::string
+ key metadata_restrict std::string
+ key metadata_homepage std::string
+ key metadata_license std::string
+ key metadata_description std::string
+ key metadata_keywords std::string
+ key metadata_eclass_keywords std::string
+ key metadata_inherited std::string
+ key metadata_iuse std::string
+ key metadata_pdepend std::string
+ key metadata_provide std::string
+ key metadata_eapi std::string
+}
+
make_class_SupportedEAPI()
{
visible
+ allow_named_args cc
key package_dep_spec_parse_mode PackageDepSpecParseMode
key strict_package_dep_spec_parse_mode PackageDepSpecParseMode
@@ -11,13 +52,13 @@ make_class_SupportedEAPI()
key breaks_portage bool
- key has_pkg_pretend bool
key want_aa_var bool
key want_arch_var bool
key want_portage_emulation_vars bool
key require_use_expand_in_iuse bool
- allow_named_args
+ key ebuild_phases "tr1::shared_ptr<const EAPIEbuildPhases>"
+ key ebuild_metadata_variables "tr1::shared_ptr<const EAPIEbuildMetadataVariables>"
doxygen_comment << "END"
/**
diff --git a/paludis/eapis/0.conf b/paludis/eapis/0.conf
index 2a82485..34007c2 100644
--- a/paludis/eapis/0.conf
+++ b/paludis/eapis/0.conf
@@ -7,10 +7,58 @@ dependency_spec_tree_parse_mode = eapi_0
iuse_flag_parse_mode = eapi_0
strict_iuse_flag_parse_mode = eapi_0_strict
breaks_portage = false
-has_pkg_pretend = false
uri_supports_arrow = false
want_aa_var = true
want_arch_var = true
want_portage_emulation_vars = true
require_use_expand_in_iuse = false
+ebuild_install = \
+ : prepare ; \
+ userpriv : init saveenv ; \
+ userpriv : loadenv setup saveenv ; \
+ sandbox userpriv : loadenv unpack compile test saveenv ; \
+ sandbox : loadenv install saveenv ; \
+ prepost : loadenv strip preinst saveenv ; \
+ merge : ; \
+ prepost : loadenv postinst saveenv ; \
+ : tidyup
+
+ebuild_uninstall = \
+ : prerm saveenv ; \
+ unmerge : ; \
+ : loadenv postrm ;
+
+ebuild_pretend =
+
+ebuild_metadata = \
+ sandbox userpriv noexec : metadata
+
+ebuild_fetch = \
+ sandbox userpriv : fetch
+
+ebuild_nofetch = \
+ sandbox userpriv : nofetch
+
+ebuild_variable = \
+ sandbox userpriv : variable
+
+ebuild_config = \
+ sandbox : config
+
+metadata_build_depend = DEPEND
+metadata_run_depend = RDEPEND
+metadata_slot = SLOT
+metadata_src_uri = SRC_URI
+metadata_restrict = RESTRICT
+metadata_homepage = HOMEPAGE
+metadata_license = LICENSE
+metadata_description = DESCRIPTION
+metadata_keywords = KEYWORDS
+metadata_eclass_keywords = E_KEYWORDS
+metadata_inherited = INHERITED
+metadata_iuse = IUSE
+metadata_pdepend = PDEPEND
+metadata_provide = PROVIDE
+metadata_eapi = EAPI
+
diff --git a/paludis/eapis/CRAN-1.conf b/paludis/eapis/CRAN-1.conf
deleted file mode 100644
index 512661e..0000000
--- a/paludis/eapis/CRAN-1.conf
+++ /dev/null
@@ -1,16 +0,0 @@
-# Configuration for EAPI CRAN-1
-# This isn't a real EAPI. It's used by Paludis internally for CRAN packages.
-
-package_dep_spec_parse_mode = permissive
-strict_package_dep_spec_parse_mode = permissive
-dependency_spec_tree_parse_mode = eapi_0
-iuse_flag_parse_mode = permissive
-strict_iuse_flag_parse_mode = permissive
-breaks_portage = true
-has_pkg_pretend = false
-want_aa_var = false
-want_arch_var = false
-want_portage_emulation_vars = false
-uri_supports_arrow = true
-require_use_expand_in_iuse = false
-
diff --git a/paludis/eapis/Makefile.am b/paludis/eapis/Makefile.am
index 702aca0..2f5513d 100644
--- a/paludis/eapis/Makefile.am
+++ b/paludis/eapis/Makefile.am
@@ -4,7 +4,6 @@ SUBDIRS =
eapis = \
0.conf \
- CRAN-1.conf \
exheres-0.conf \
paludis-1.conf
diff --git a/paludis/eapis/exheres-0.conf b/paludis/eapis/exheres-0.conf
index 4f4d90f..16b53e0 100644
--- a/paludis/eapis/exheres-0.conf
+++ b/paludis/eapis/exheres-0.conf
@@ -3,15 +3,62 @@
# version is available, it will be snapshotted as exheres-1.
package_dep_spec_parse_mode = exheres_0
-strict_package_dep_spec_parse_mode = exheres_0
dependency_spec_tree_parse_mode = exheres_0
iuse_flag_parse_mode = exheres_0
-strict_iuse_flag_parse_mode = exheres_0
breaks_portage = true
-has_pkg_pretend = true
want_aa_var = false
want_arch_var = false
want_portage_emulation_vars = false
uri_supports_arrow = true
require_use_expand_in_iuse = true
+ebuild_install = \
+ : prepare ; \
+ userpriv : init saveenv ; \
+ sandbox userpriv : loadenv setup saveenv ; \
+ sandbox userpriv : loadenv unpack compile test saveenv ; \
+ sandbox : loadenv install saveenv ; \
+ sandbox : loadenv strip preinst saveenv ; \
+ merge : ; \
+ sandbox : loadenv postinst saveenv ; \
+ : tidyup
+
+ebuild_uninstall = \
+ sandbox : prerm saveenv ; \
+ unmerge : ; \
+ sandbox : loadenv postrm
+
+ebuild_pretend = \
+ sandbox userpriv : pretend
+
+ebuild_metadata = \
+ sandbox userpriv noexec : metadata
+
+ebuild_fetch = \
+ sandbox userpriv : fetch
+
+ebuild_nofetch = \
+ sandbox userpriv : nofetch
+
+ebuild_variable = \
+ sandbox userpriv : variable
+
+ebuild_config = \
+ sandbox : config
+
+metadata_build_depend = DEPEND
+metadata_run_depend = RDEPEND
+metadata_slot = SLOT
+metadata_src_uri = SRC_URI
+metadata_restrict = RESTRICT
+metadata_homepage = HOMEPAGE
+metadata_license = LICENSE
+metadata_description = DESCRIPTION
+metadata_keywords = KEYWORDS
+metadata_eclass_keywords = E_KEYWORDS
+metadata_inherited = INHERITED
+metadata_iuse = IUSE
+metadata_pdepend = PDEPEND
+metadata_provide = PROVIDE
+metadata_eapi = EAPI
+
diff --git a/paludis/eapis/paludis-1.conf b/paludis/eapis/paludis-1.conf
index 316cd75..1e556e2 100644
--- a/paludis/eapis/paludis-1.conf
+++ b/paludis/eapis/paludis-1.conf
@@ -3,10 +3,8 @@
# particularly stable or ideal for third party use.
package_dep_spec_parse_mode = permissive
-strict_package_dep_spec_parse_mode = permissive
dependency_spec_tree_parse_mode = paludis_1
iuse_flag_parse_mode = permissive
-strict_iuse_flag_parse_mode = permissive
breaks_portage = true
has_pkg_pretend = true
want_aa_var = false
@@ -15,3 +13,53 @@ uri_supports_arrow = true
want_portage_emulation_vars = false
require_use_expand_in_iuse = false
+ebuild_install = \
+ : prepare ; \
+ userpriv : init saveenv ; \
+ sandbox userpriv : loadenv setup saveenv ; \
+ sandbox userpriv : loadenv unpack compile test saveenv ; \
+ sandbox : loadenv install saveenv ; \
+ sandbox : loadenv strip preinst saveenv ; \
+ merge : ; \
+ sandbox : loadenv postinst saveenv ; \
+ : tidyup
+
+ebuild_uninstall = \
+ sandbox : prerm saveenv ; \
+ unmerge : ; \
+ sandbox : loadenv postrm
+
+ebuild_pretend = \
+ sandbox userpriv : pretend
+
+ebuild_metadata = \
+ sandbox userpriv noexec : metadata
+
+ebuild_fetch = \
+ sandbox userpriv : fetch
+
+ebuild_nofetch = \
+ sandbox userpriv : nofetch
+
+ebuild_variable = \
+ sandbox userpriv : variable
+
+ebuild_config = \
+ sandbox : config
+
+metadata_build_depend = DEPEND
+metadata_run_depend = RDEPEND
+metadata_slot = SLOT
+metadata_src_uri = SRC_URI
+metadata_restrict = RESTRICT
+metadata_homepage = HOMEPAGE
+metadata_license = LICENSE
+metadata_description = DESCRIPTION
+metadata_keywords = KEYWORDS
+metadata_eclass_keywords = E_KEYWORDS
+metadata_inherited = INHERITED
+metadata_iuse = IUSE
+metadata_pdepend = PDEPEND
+metadata_provide = PROVIDE
+metadata_eapi = EAPI
+
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index 643702d..e685b33 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -136,7 +136,7 @@ bool
EnvironmentImplementation::breaks_portage(const PackageDatabaseEntry & e, const VersionMetadata & m) const
{
return (e.version.has_try_part() || e.version.has_scm_part()
- || (! m.eapi.supported) || (m.eapi.supported->breaks_portage));
+ || (! m.eapi->supported) || (m.eapi->supported->breaks_portage));
}
EnvironmentImplementation::~EnvironmentImplementation()
@@ -245,7 +245,7 @@ EnvironmentImplementation::mask_reasons(const PackageDatabaseEntry & e, const Ma
tr1::shared_ptr<const VersionMetadata> metadata(package_database()->fetch_repository(
e.repository)->version_metadata(e.name, e.version));
- if (! accept_eapi(metadata->eapi, e))
+ if (! accept_eapi(*metadata->eapi, e))
{
result += mr_eapi;
return result;
@@ -259,7 +259,7 @@ EnvironmentImplementation::mask_reasons(const PackageDatabaseEntry & e, const Ma
if (metadata->virtual_interface)
{
- result |= mask_reasons(metadata->virtual_interface->virtual_for);
+ result |= mask_reasons(*metadata->virtual_interface->virtual_for);
if (result.any())
result += mr_by_association;
}
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 0b083e8..068ba89 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -31,6 +31,7 @@
#include <paludis/hooker.hh>
#include <paludis/set_file.hh>
#include <paludis/distribution.hh>
+#include <paludis/dep_tag.hh>
#include <paludis/util/collection_concrete.hh>
#include <paludis/util/log.hh>
diff --git a/paludis/files.m4 b/paludis/files.m4
index f10a125..e4b186a 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -14,7 +14,7 @@ add(`contents', `hh', `cc')
add(`dep_spec', `hh', `cc', `se', `test', `fwd')
add(`dep_spec_flattener', `hh', `cc')
add(`dep_spec_pretty_printer', `hh', `cc', `test')
-add(`dep_tag', `hh', `cc', `sr')
+add(`dep_tag', `hh', `cc', `fwd', `sr')
add(`distribution', `hh', `cc', `fwd', `sr')
add(`eapi', `hh', `cc', `fwd', `sr')
add(`environment', `hh', `cc', `se')
@@ -37,7 +37,7 @@ add(`repository_name_cache', `hh', `cc', `test', `testscript')
add(`set_file', `hh', `cc', `se', `sr', `test', `testscript')
add(`syncer', `hh', `cc', `sr')
add(`version_metadata', `hh', `cc', `sr')
-add(`version_operator', `hh', `cc', `se', `test')
-add(`version_requirements', `hh', `cc', `sr')
+add(`version_operator', `hh', `cc', `fwd', `se', `test')
+add(`version_requirements', `hh', `cc', `fwd', `sr')
add(`version_spec', `hh', `cc', `sr', `fwd', `test')
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index fc6047f..eb6c5ad 100644
--- a/paludis/match_package.cc
+++ b/paludis/match_package.cc
@@ -21,6 +21,7 @@
#include <paludis/dep_spec.hh>
#include <paludis/environment.hh>
#include <paludis/version_metadata.hh>
+#include <paludis/version_requirements.hh>
#include <paludis/package_database.hh>
#include <paludis/util/visitor-impl.hh>
#include <algorithm>
diff --git a/paludis/portage_dep_parser_TEST.cc b/paludis/portage_dep_parser_TEST.cc
index 0164242..474110c 100644
--- a/paludis/portage_dep_parser_TEST.cc
+++ b/paludis/portage_dep_parser_TEST.cc
@@ -45,7 +45,7 @@ namespace test_cases
{
DepSpecPrettyPrinter d(0, false);
PortageDepParser::parse_depend("",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "");
}
} test_dep_spec_parser_empty;
@@ -62,7 +62,7 @@ namespace test_cases
{
DepSpecPrettyPrinter d(0, false);
PortageDepParser::parse_depend(" \n \t",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "");
}
} test_dep_spec_parser_blank;
@@ -79,7 +79,7 @@ namespace test_cases
{
DepSpecPrettyPrinter d(0, false);
PortageDepParser::parse_depend("app-editors/vim",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "app-editors/vim");
}
} test_dep_spec_parser_package;
@@ -96,17 +96,17 @@ namespace test_cases
{
DepSpecPrettyPrinter d1(0, false);
PortageDepParser::parse_depend(">=app-editors/vim-6.4_alpha",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d1);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d1);
TEST_CHECK_EQUAL(stringify(d1), ">=app-editors/vim-6.4_alpha");
DepSpecPrettyPrinter d2(0, false);
PortageDepParser::parse_depend("=app-editors/vim-6.4_alpha-r1",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d2);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d2);
TEST_CHECK_EQUAL(stringify(d2), "=app-editors/vim-6.4_alpha-r1");
DepSpecPrettyPrinter d3(0, false);
PortageDepParser::parse_depend(">=app-editors/vim-6.4_alpha:one",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d3);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d3);
TEST_CHECK_EQUAL(stringify(d3), ">=app-editors/vim-6.4_alpha:one");
}
} test_dep_spec_parser_decorated_package;
@@ -123,7 +123,7 @@ namespace test_cases
{
DepSpecPrettyPrinter d(0, false);
PortageDepParser::parse_depend("app-editors/vim app-misc/hilite \nsys-apps/findutils",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "app-editors/vim app-misc/hilite sys-apps/findutils");
}
} test_dep_spec_parser_packages;
@@ -136,7 +136,7 @@ namespace test_cases
{
DepSpecPrettyPrinter d(0, false);
PortageDepParser::parse_depend("|| ( one/one two/two )",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "|| ( one/one two/two )");
}
} test_dep_spec_parser_any;
@@ -149,15 +149,15 @@ namespace test_cases
{
DepSpecPrettyPrinter d(0, false);
PortageDepParser::parse_depend("|| ( one/one foo? ( two/two ) )",
- EAPIData::get_instance()->eapi_from_string("0"))->accept(d);
+ *EAPIData::get_instance()->eapi_from_string("0"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "|| ( one/one foo? ( two/two ) )");
TEST_CHECK_THROWS(PortageDepParser::parse_depend("|| ( one/one foo? ( two/two ) )",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
DepSpecPrettyPrinter e(0, false);
PortageDepParser::parse_depend("|| ( one/one ( foo? ( two/two ) ) )",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(e);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(e);
TEST_CHECK_EQUAL(stringify(e), "|| ( one/one ( foo? ( two/two ) ) )");
}
} test_dep_spec_parser_any_use;
@@ -174,7 +174,7 @@ namespace test_cases
{
DepSpecPrettyPrinter d(0, false);
PortageDepParser::parse_depend(" ( one/one two/two ) ",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "one/one two/two");
}
} test_dep_spec_parser_all;
@@ -190,7 +190,7 @@ namespace test_cases
void run()
{
DepSpecPrettyPrinter d(0, false);
- PortageDepParser::parse_depend("foo? ( one/one )", EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
+ PortageDepParser::parse_depend("foo? ( one/one )", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "foo? ( one/one )");
}
} test_dep_spec_parser_use;
@@ -206,7 +206,7 @@ namespace test_cases
void run()
{
DepSpecPrettyPrinter d(0, false);
- PortageDepParser::parse_depend("!foo? ( one/one )", EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
+ PortageDepParser::parse_depend("!foo? ( one/one )", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "!foo? ( one/one )");
}
} test_dep_spec_parser_inv_use;
@@ -218,15 +218,15 @@ namespace test_cases
void run()
{
DepSpecPrettyPrinter d(0, true);
- PortageDepParser::parse_uri("a\n->\tb", EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
+ PortageDepParser::parse_uri("a\n->\tb", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "a -> b\n");
DepSpecPrettyPrinter e(0, true);
- PortageDepParser::parse_uri("a-> b", EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(e);
+ PortageDepParser::parse_uri("a-> b", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(e);
TEST_CHECK_EQUAL(stringify(e), "a->\nb\n");
TEST_CHECK_THROWS(PortageDepParser::parse_uri("a -> b",
- EAPIData::get_instance()->eapi_from_string("0"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("0"))->accept(d), DepStringError);
}
} test_dep_spec_parser_uri;
@@ -242,15 +242,15 @@ namespace test_cases
{
DepSpecPrettyPrinter d(0, false);
TEST_CHECK_THROWS(PortageDepParser::parse_depend("!foo? ( one/one",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_depend("!foo? ( one/one ) )",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_depend("( ( ( ) )",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_depend("( ( ( ) ) ) )",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_depend(")",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
}
} test_dep_spec_parser_bad_nesting;
@@ -266,38 +266,38 @@ namespace test_cases
{
DepSpecPrettyPrinter d(0, false);
TEST_CHECK_THROWS(PortageDepParser::parse_depend("||",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_depend("|| ",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_depend("foo?",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_depend("!foo? ||",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_depend("(((",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_depend(")",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_depend("(foo/bar)",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_license("a -> b",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_uri("( -> )",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_uri("( -> )",
- EAPIData::get_instance()->eapi_from_string("0"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("0"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_uri("foo? -> bar",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_uri("a ->",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_uri("a -> ( )",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_uri("a -> )",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_uri("a -> || ( )",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
TEST_CHECK_THROWS(PortageDepParser::parse_uri("a -> foo? ( )",
- EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
}
} test_dep_spec_parser_bad_values;
}
diff --git a/paludis/qa/create_metadata_check.cc b/paludis/qa/create_metadata_check.cc
index 2d164ff..7156a46 100644
--- a/paludis/qa/create_metadata_check.cc
+++ b/paludis/qa/create_metadata_check.cc
@@ -21,6 +21,7 @@
#include <paludis/portage_dep_parser.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/qa/qa_environment.hh>
+#include <paludis/eapi.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -42,7 +43,7 @@ CreateMetadataCheck::operator() (const EbuildCheckData & e) const
tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
- if (! metadata->eapi.supported)
+ if (! metadata->eapi->supported)
result << Message(qal_fatal, "Couldn't generate metadata");
}
catch (const InternalError &)
diff --git a/paludis/qa/parse_deps_check.cc b/paludis/qa/parse_deps_check.cc
index 6582715..ab0fbab 100644
--- a/paludis/qa/parse_deps_check.cc
+++ b/paludis/qa/parse_deps_check.cc
@@ -19,6 +19,7 @@
#include <paludis/portage_dep_parser.hh>
#include <paludis/package_database_entry.hh>
+#include <paludis/eapi.hh>
#include <paludis/environment.hh>
#include <paludis/qa/parse_deps_check.hh>
#include <paludis/qa/qa_environment.hh>
@@ -46,7 +47,7 @@ ParseDepsCheck::operator() (const EbuildCheckData & e) const
try
{
std::string depend(metadata->deps_interface->get_raw_build_depend());
- PortageDepParser::parse_depend(depend, metadata->eapi);
+ PortageDepParser::parse_depend(depend, *metadata->eapi);
}
catch (const Exception & err)
{
@@ -57,7 +58,7 @@ ParseDepsCheck::operator() (const EbuildCheckData & e) const
try
{
std::string rdepend(metadata->deps_interface->get_raw_run_depend());
- PortageDepParser::parse_depend(rdepend, metadata->eapi);
+ PortageDepParser::parse_depend(rdepend, *metadata->eapi);
}
catch (const Exception & err)
{
@@ -68,7 +69,7 @@ ParseDepsCheck::operator() (const EbuildCheckData & e) const
try
{
std::string pdepend(metadata->deps_interface->get_raw_post_depend());
- PortageDepParser::parse_depend(pdepend, metadata->eapi);
+ PortageDepParser::parse_depend(pdepend, *metadata->eapi);
}
catch (const Exception & err)
{
diff --git a/paludis/repositories/cran/cran_dep_parser.cc b/paludis/repositories/cran/cran_dep_parser.cc
index 505c4a6..48149f1 100644
--- a/paludis/repositories/cran/cran_dep_parser.cc
+++ b/paludis/repositories/cran/cran_dep_parser.cc
@@ -1,4 +1,24 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006, 2007 Danny van Dyk <kugelfang@gentoo.org>
+ *
+ * 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
#include <paludis/dep_spec.hh>
+#include <paludis/eapi.hh>
#include <paludis/repositories/cran/cran_dep_parser.hh>
#include <paludis/repositories/cran/cran_description.hh>
#include <paludis/util/visitor-impl.hh>
diff --git a/paludis/repositories/cran/cran_dep_parser_TEST.cc b/paludis/repositories/cran/cran_dep_parser_TEST.cc
index 5de4ab1..8c2ef88 100644
--- a/paludis/repositories/cran/cran_dep_parser_TEST.cc
+++ b/paludis/repositories/cran/cran_dep_parser_TEST.cc
@@ -24,6 +24,7 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/system.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/eapi.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -50,15 +51,15 @@ namespace test_cases
DepSpecPrettyPrinter d1(0, false), d2(0, false), d3(0, false);
// test R dependency
std::string dep1("R (>= 2.0.0)");
- CRANDepParser::parse(dep1, EAPIData::get_instance()->eapi_from_string("CRAN-1"))->accept(d1);
+ CRANDepParser::parse(dep1, *EAPIData::get_instance()->eapi_from_string("CRAN-1"))->accept(d1);
TEST_CHECK_EQUAL(stringify(d1), ">=dev-lang/R-2.0.0");
// test varying whitespaces
std::string dep2("testpackage1 \t(<1.9)");
- CRANDepParser::parse(dep2, EAPIData::get_instance()->eapi_from_string("CRAN-1"))->accept(d2);
+ CRANDepParser::parse(dep2, *EAPIData::get_instance()->eapi_from_string("CRAN-1"))->accept(d2);
TEST_CHECK_EQUAL(stringify(d2), "<cran/testpackage1-1.9");
// test for package-name and version normalisation
std::string dep3("R.matlab (>= 2.3-1)");
- CRANDepParser::parse(dep3, EAPIData::get_instance()->eapi_from_string("CRAN-1"))->accept(d3);
+ CRANDepParser::parse(dep3, *EAPIData::get_instance()->eapi_from_string("CRAN-1"))->accept(d3);
TEST_CHECK_EQUAL(stringify(d3), ">=cran/R-matlab-2.3.1");
}
} test_cran_dep_parser;
diff --git a/paludis/repositories/cran/cran_description.cc b/paludis/repositories/cran/cran_description.cc
index 7e7ad23..5e86faf 100644
--- a/paludis/repositories/cran/cran_description.cc
+++ b/paludis/repositories/cran/cran_description.cc
@@ -22,6 +22,7 @@
#include <paludis/repositories/cran/cran_dep_parser.hh>
#include <paludis/repositories/cran/cran_version_metadata.hh>
#include <paludis/config_file.hh>
+#include <paludis/eapi.hh>
#include <paludis/util/log.hh>
#include <paludis/util/strip.hh>
#include <string>
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 0813660..a3e5cd7 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -22,6 +22,7 @@
#include <paludis/match_package.hh>
#include <paludis/package_database.hh>
#include <paludis/environment.hh>
+#include <paludis/eapi.hh>
#include <paludis/repositories/cran/cran_description.hh>
#include <paludis/repositories/cran/cran_dep_parser.hh>
#include <paludis/repositories/cran/cran_installed_repository.hh>
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index e497b8b..f72bda0 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006,2007 Danny van Dyk <kugelfang@gentoo.org>
+ * Copyright (c) 2006, 2007 Danny van Dyk <kugelfang@gentoo.org>
*
* 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
@@ -26,6 +26,7 @@
#include <paludis/match_package.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/package_database.hh>
+#include <paludis/eapi.hh>
#include <paludis/repositories/cran/cran_dep_parser.hh>
#include <paludis/repositories/cran/cran_description.hh>
#include <paludis/repositories/cran/cran_repository.hh>
@@ -470,21 +471,6 @@ CRANRepositoryConfigurationError::CRANRepositoryConfigurationError(
{
}
-namespace
-{
- FSEntry
- get_root(tr1::shared_ptr<const DestinationsCollection> destinations)
- {
- if (destinations)
- for (DestinationsCollection::Iterator d(destinations->begin()), d_end(destinations->end()) ;
- d != d_end ; ++d)
- if ((*d)->installed_interface)
- return (*d)->installed_interface->root();
-
- return FSEntry("/");
- }
-}
-
void
CRANRepository::do_install(const QualifiedPackageName &q, const VersionSpec &vn,
const InstallOptions &o) const
@@ -522,6 +508,11 @@ CRANRepository::do_install(const QualifiedPackageName &q, const VersionSpec &vn,
FSEntry image(_imp->buildroot / stringify(q) / "image");
FSEntry workdir(_imp->buildroot / stringify(q) / "work");
+ if (! o.destination)
+ throw PackageInstallActionError("Can't merge '" + stringify(q) + "-" + stringify(vn) +
+ "' because no destination was provided.");
+
+
cmd = Command(LIBEXECDIR "/paludis/cran.bash clean install")
.with_sandbox()
.with_setenv("CATEGORY", "cran")
@@ -536,31 +527,24 @@ CRANRepository::do_install(const QualifiedPackageName &q, const VersionSpec &vn,
.with_setenv("PALUDIS_EBUILD_DIR", std::string(LIBEXECDIR "/paludis/"))
.with_setenv("PALUDIS_EBUILD_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
.with_setenv("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "))
- .with_setenv("ROOT", stringify(get_root(o.destinations)))
+ .with_setenv("ROOT", stringify(o.destination->installed_interface->root()))
.with_setenv("WORKDIR", stringify(workdir));
-
if (0 != run_command(cmd))
throw PackageInstallActionError("Couldn't install '" + stringify(q) + "-" + stringify(vn) + "' to '" +
stringify(image) + "'");
- if (! o.destinations)
- throw PackageInstallActionError("Can't merge '" + stringify(q) + "-" + stringify(vn) +
- "' because no destinations were provided.");
-
MergeOptions m(PackageDatabaseEntry(q, vn, name()),
image,
FSEntry("/dev/null"));
- for (DestinationsCollection::Iterator d(o.destinations->begin()),
- d_end(o.destinations->end()) ; d != d_end ; ++d)
- {
- if (! (*d)->destination_interface)
- throw PackageInstallActionError("Couldn't install '" + stringify(q) + "-" + stringify(vn) + "' to '" +
- stringify((*d)->name()) + "' because it does not provide destination_interface");
+ if (! o.destination->destination_interface)
+ throw PackageInstallActionError("Couldn't install '" + stringify(q) + "-" + stringify(vn) + "' to '" +
+ stringify(o.destination->name()) + "' because it does not provide destination_interface");
- (*d)->destination_interface->merge(m);
- }
+ if (! o.destination->installed_interface)
+ throw PackageInstallActionError("Couldn't install '" + stringify(q) + "-" + stringify(vn) + "' to '" +
+ stringify(o.destination->name()) + "' because it does not provide installed_interface");
cmd = Command(LIBEXECDIR "/paludis/cran.bash clean")
.with_setenv("IMAGE", stringify(image))
@@ -570,7 +554,7 @@ CRANRepository::do_install(const QualifiedPackageName &q, const VersionSpec &vn,
.with_setenv("PALUDIS_EBUILD_DIR", std::string(LIBEXECDIR "/paludis/"))
.with_setenv("PALUDIS_EBUILD_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
.with_setenv("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "))
- .with_setenv("ROOT", stringify(get_root(o.destinations)))
+ .with_setenv("ROOT", stringify(o.destination->installed_interface->root()))
.with_setenv("WORKDIR", stringify(workdir))
.with_setenv("REPOSITORY", stringify(name()));
diff --git a/paludis/repositories/cran/cran_version_metadata.cc b/paludis/repositories/cran/cran_version_metadata.cc
index 7cd1baf..d8ed2b3 100644
--- a/paludis/repositories/cran/cran_version_metadata.cc
+++ b/paludis/repositories/cran/cran_version_metadata.cc
@@ -19,6 +19,7 @@
#include "cran_version_metadata.hh"
#include "cran_dep_parser.hh"
+#include <paludis/eapi.hh>
using namespace paludis;
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index 005ff6b..c49af55 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -17,13 +17,15 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <map>
#include <paludis/repositories/fake/fake_repository_base.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/collection_concrete.hh>
#include <paludis/util/iterator.hh>
+#include <paludis/util/make_shared_ptr.hh>
#include <paludis/version_metadata.hh>
#include <paludis/portage_dep_parser.hh>
+#include <paludis/eapi.hh>
+#include <map>
/** \file
* Implementation for FakeRepositoryBase.
@@ -330,7 +332,7 @@ FakeVirtualVersionMetadata::FakeVirtualVersionMetadata(const SlotName & s, const
.ebin_interface(0)
),
VersionMetadataDepsInterface(&PortageDepParser::parse_depend),
- VersionMetadataVirtualInterface(p)
+ VersionMetadataVirtualInterface(make_shared_ptr(new PackageDatabaseEntry(p)))
{
}
diff --git a/paludis/repositories/gentoo/Makefile.am b/paludis/repositories/gentoo/Makefile.am
index 97436bc..5051e07 100644
--- a/paludis/repositories/gentoo/Makefile.am
+++ b/paludis/repositories/gentoo/Makefile.am
@@ -4,7 +4,7 @@ DISTCLEANFILES = \
glsa-sr.hh glsa-sr.cc \
portage_repository_params-sr.hh portage_repository_params-sr.cc \
vdb_repository-sr.hh vdb_repository-sr.cc \
- ebuild-sr.hh ebuild-sr.cc ebuild-se.hh ebuild-se.cc \
+ ebuild-sr.hh ebuild-sr.cc \
ebin-sr.hh ebin-sr.cc ebin-se.hh ebin-se.cc \
vdb_merger-sr.hh vdb_merger-sr.cc \
vdb_unmerger-sr.hh vdb_unmerger-sr.cc
@@ -34,7 +34,6 @@ libpaludisgentoorepository_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@VER
paludis_repositories_gentoo_include_HEADERS = \
ebuild.hh \
ebuild-sr.hh \
- ebuild-se.hh \
ebin.hh \
ebin-se.hh \
ebin-sr.hh \
@@ -65,7 +64,8 @@ paludis_repositories_gentoo_include_HEADERS = \
vdb_unmerger-sr.hh \
vdb_unmerger.hh \
layout.hh \
- traditional_layout.hh
+ traditional_layout.hh \
+ eapi_phase.hh
libpaludisgentoorepository_la_SOURCES = \
ebuild.cc \
@@ -94,6 +94,7 @@ libpaludisgentoorepository_la_SOURCES = \
vdb_unmerger.cc \
layout.cc \
traditional_layout.cc \
+ eapi_phase.cc \
$(paludis_repositories_gentoo_include_HEADERS)
libpaludisgentoorepository_la_LIBADD = \
@@ -148,9 +149,6 @@ EXTRA_DIST = \
ebuild.sr \
ebuild-sr.hh \
ebuild-sr.cc \
- ebuild.se \
- ebuild-se.hh \
- ebuild-se.cc \
ebin.sr \
ebin-sr.hh \
ebin-sr.cc \
@@ -194,8 +192,6 @@ BUILT_SOURCES = \
vdb_repository-sr.cc \
ebuild-sr.hh \
ebuild-sr.cc \
- ebuild-se.hh \
- ebuild-se.cc \
ebin-sr.hh \
ebin-sr.cc \
ebin-se.hh \
@@ -265,12 +261,6 @@ vdb_repository-sr.hh : vdb_repository.sr $(top_srcdir)/misc/make_sr.bash
vdb_repository-sr.cc : vdb_repository.sr $(top_srcdir)/misc/make_sr.bash
$(top_srcdir)/misc/make_sr.bash --source $(srcdir)/vdb_repository.sr > $@
-ebuild-se.hh : ebuild.se $(top_srcdir)/misc/make_se.bash
- if ! $(top_srcdir)/misc/make_se.bash --header $(srcdir)/ebuild.se > $@ ; then rm -f $@ ; exit 1 ; fi
-
-ebuild-se.cc : ebuild.se $(top_srcdir)/misc/make_se.bash
- if ! $(top_srcdir)/misc/make_se.bash --source $(srcdir)/ebuild.se > $@ ; then rm -f $@ ; exit 1 ; fi
-
ebin-se.hh : ebin.se $(top_srcdir)/misc/make_se.bash
if ! $(top_srcdir)/misc/make_se.bash --header $(srcdir)/ebin.se > $@ ; then rm -f $@ ; exit 1 ; fi
diff --git a/paludis/repositories/gentoo/eapi_phase.cc b/paludis/repositories/gentoo/eapi_phase.cc
new file mode 100644
index 0000000..158e1f6
--- /dev/null
+++ b/paludis/repositories/gentoo/eapi_phase.cc
@@ -0,0 +1,114 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "eapi_phase.hh"
+#include <paludis/util/tokeniser.hh>
+#include <paludis/util/iterator.hh>
+#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/eapi.hh>
+#include <set>
+#include <algorithm>
+#include <list>
+
+using namespace paludis;
+using namespace paludis::erepository;
+
+namespace paludis
+{
+ template <>
+ struct Implementation<EAPIPhase>
+ {
+ std::set<std::string> options;
+ std::list<std::string> commands;
+ };
+
+ template <>
+ struct Implementation<EAPIPhases>
+ {
+ std::list<tr1::shared_ptr<const EAPIPhase> > phases;
+ };
+}
+
+EAPIPhase::EAPIPhase(const std::string & s) :
+ PrivateImplementationPattern<EAPIPhase>(new Implementation<EAPIPhase>)
+{
+ Context c("When parsing EAPI phase '" + s + "'");
+
+ std::list<std::string> tokens;
+ WhitespaceTokeniser::get_instance()->tokenise(s, std::back_inserter(tokens));
+
+ std::list<std::string>::iterator t(std::find(tokens.begin(), tokens.end(), ":"));
+ if (t == tokens.end())
+ throw EAPIConfigurationError("EAPI phase '" + s + "' contains no ':'");
+
+ std::copy(tokens.begin(), t, std::inserter(_imp->options, _imp->options.begin()));
+ std::copy(next(t), tokens.end(), std::back_inserter(_imp->commands));
+}
+
+EAPIPhase::~EAPIPhase()
+{
+}
+
+bool
+EAPIPhase::option(const std::string & s) const
+{
+ return _imp->options.count(s);
+}
+
+EAPIPhase::Iterator
+EAPIPhase::begin_commands() const
+{
+ return Iterator(_imp->commands.begin());
+}
+
+EAPIPhase::Iterator
+EAPIPhase::end_commands() const
+{
+ return Iterator(_imp->commands.end());
+}
+
+EAPIPhases::EAPIPhases(const std::string & s) :
+ PrivateImplementationPattern<EAPIPhases>(new Implementation<EAPIPhases>)
+{
+ Context c("When parsing EAPI phases '" + s + "'");
+
+ std::list<std::string> tokens;
+ Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> tok(";");
+ tok.tokenise(s, std::back_inserter(tokens));
+ for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
+ t != t_end ; ++t)
+ _imp->phases.push_back(make_shared_ptr(new EAPIPhase(*t)));
+}
+
+EAPIPhases::~EAPIPhases()
+{
+}
+
+EAPIPhases::Iterator
+EAPIPhases::begin_phases() const
+{
+ return Iterator(indirect_iterator(_imp->phases.begin()));
+}
+
+EAPIPhases::Iterator
+EAPIPhases::end_phases() const
+{
+ return Iterator(indirect_iterator(_imp->phases.end()));
+}
+
diff --git a/paludis/repositories/gentoo/eapi_phase.hh b/paludis/repositories/gentoo/eapi_phase.hh
new file mode 100644
index 0000000..c350ec5
--- /dev/null
+++ b/paludis/repositories/gentoo/eapi_phase.hh
@@ -0,0 +1,59 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_EAPI_PHASE_HH
+#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_EAPI_PHASE_HH 1
+
+#include <paludis/util/private_implementation_pattern.hh>
+#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <string>
+
+namespace paludis
+{
+ namespace erepository
+ {
+ class EAPIPhase :
+ private PrivateImplementationPattern<EAPIPhase>
+ {
+ public:
+ explicit EAPIPhase(const std::string &);
+ ~EAPIPhase();
+
+ bool option(const std::string &) const;
+
+ typedef libwrapiter::ForwardIterator<EAPIPhase, const std::string> Iterator;
+ Iterator begin_commands() const;
+ Iterator end_commands() const;
+ };
+
+ class EAPIPhases :
+ private PrivateImplementationPattern<EAPIPhases>
+ {
+ public:
+ explicit EAPIPhases(const std::string &);
+ ~EAPIPhases();
+
+ typedef libwrapiter::ForwardIterator<EAPIPhases, const EAPIPhase> Iterator;
+ Iterator begin_phases() const;
+ Iterator end_phases() const;
+ };
+ }
+}
+
+#endif
diff --git a/paludis/repositories/gentoo/ebin.cc b/paludis/repositories/gentoo/ebin.cc
index 70aa00c..b9ba6f3 100644
--- a/paludis/repositories/gentoo/ebin.cc
+++ b/paludis/repositories/gentoo/ebin.cc
@@ -23,6 +23,7 @@
#include <paludis/util/system.hh>
#include <paludis/util/log.hh>
#include <paludis/util/strip.hh>
+#include <paludis/eapi.hh>
#include <paludis/about.hh>
#include <sys/resource.h>
#include <sys/time.h>
diff --git a/paludis/repositories/gentoo/ebin_entries.cc b/paludis/repositories/gentoo/ebin_entries.cc
index c83f19d..eb78be2 100644
--- a/paludis/repositories/gentoo/ebin_entries.cc
+++ b/paludis/repositories/gentoo/ebin_entries.cc
@@ -24,6 +24,7 @@
#include <paludis/portage_dep_parser.hh>
#include <paludis/dep_spec_flattener.hh>
#include <paludis/environment.hh>
+#include <paludis/eapi.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/log.hh>
#include <paludis/util/system.hh>
@@ -245,11 +246,15 @@ EbinEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
}
}
+ if (! o.destination)
+ throw PackageInstallActionError("Can't install '" + stringify(q) + "-"
+ + stringify(v) + "' because no destination was provided");
+
EbinFetchCommand fetch_cmd(command_params,
EbinFetchCommandParams::create()
.b(binaries)
.flat_bin_uri(flat_bin_uri)
- .root(stringify(get_root(o.destinations)))
+ .root(o.destination->installed_interface ? stringify(o.destination->installed_interface->root()) : "/")
.safe_resume(o.safe_resume)
.userpriv(false));
@@ -258,14 +263,10 @@ EbinEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
if (o.fetch_only)
return;
- if (! o.destinations)
- throw PackageInstallActionError("Can't install '" + stringify(q) + "-"
- + stringify(v) + "' because no destination was provided");
-
EbinInstallCommandParams install_params(
EbinInstallCommandParams::create()
.b(binaries)
- .root(stringify(get_root(o.destinations)))
+ .root(o.destination->installed_interface ? stringify(o.destination->installed_interface->root()) : "/")
.debug_build(o.debug_build)
.phase(ebin_ip_prepare)
.disable_cfgpro(o.no_config_protect)
@@ -290,40 +291,36 @@ EbinEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
EbinInstallCommand unpackbin_cmd(command_params, install_params);
unpackbin_cmd();
- for (DestinationsCollection::Iterator d(o.destinations->begin()),
- d_end(o.destinations->end()) ; d != d_end ; ++d)
- {
- if (! (*d)->destination_interface)
- throw PackageInstallActionError("Can't install '" + stringify(q) + "-"
- + stringify(v) + "' to destination '" + stringify((*d)->name())
- + "' because destination does not provide destination_interface");
+ if (! o.destination->destination_interface)
+ throw PackageInstallActionError("Can't install '" + stringify(q) + "-"
+ + stringify(v) + "' to destination '" + stringify(o.destination->name())
+ + "' because destination does not provide destination_interface");
- if ((*d)->destination_interface->want_pre_post_phases())
- {
- install_params.phase = ebin_ip_preinstall;
- install_params.root = (*d)->installed_interface ?
- stringify((*d)->installed_interface->root()) : "/";
- EbinInstallCommand preinst_cmd(command_params, install_params);
- preinst_cmd();
- }
+ if (o.destination->destination_interface->want_pre_post_phases())
+ {
+ install_params.phase = ebin_ip_preinstall;
+ install_params.root = o.destination->installed_interface ?
+ stringify(o.destination->installed_interface->root()) : "/";
+ EbinInstallCommand preinst_cmd(command_params, install_params);
+ preinst_cmd();
+ }
- (*d)->destination_interface->merge(
- MergeOptions::create()
- .package(PackageDatabaseEntry(q, v, _imp->portage_repository->name()))
- .image_dir(command_params.buildroot / stringify(q.category) / (stringify(q.package) + "-"
- + stringify(v)) / "image")
- .environment_file(command_params.buildroot / stringify(q.category) / (stringify(q.package) + "-"
- + stringify(v)) / "temp" / "loadsaveenv")
- );
+ o.destination->destination_interface->merge(
+ MergeOptions::create()
+ .package(PackageDatabaseEntry(q, v, _imp->portage_repository->name()))
+ .image_dir(command_params.buildroot / stringify(q.category) / (stringify(q.package) + "-"
+ + stringify(v)) / "image")
+ .environment_file(command_params.buildroot / stringify(q.category) / (stringify(q.package) + "-"
+ + stringify(v)) / "temp" / "loadsaveenv")
+ );
- if ((*d)->destination_interface->want_pre_post_phases())
- {
- install_params.phase = ebin_ip_postinstall;
- install_params.root = (*d)->installed_interface ?
- stringify((*d)->installed_interface->root()) : "/";
- EbinInstallCommand postinst_cmd(command_params, install_params);
- postinst_cmd();
- }
+ if (o.destination->destination_interface->want_pre_post_phases())
+ {
+ install_params.phase = ebin_ip_postinstall;
+ install_params.root = o.destination->installed_interface ?
+ stringify(o.destination->installed_interface->root()) : "/";
+ EbinInstallCommand postinst_cmd(command_params, install_params);
+ postinst_cmd();
}
install_params.phase = ebin_ip_tidyup;
@@ -395,7 +392,7 @@ EbinEntries::merge(const MergeOptions & m)
metadata->homepage()->accept(h);
ebin_file << "HOMEPAGE=" << h << std::endl;
ebin_file << "DESCRIPTION=" << metadata->description << std::endl;
- ebin_file << "EAPI=" << metadata->eapi.name << std::endl;
+ ebin_file << "EAPI=" << metadata->eapi->name << std::endl;
if (metadata->ebuild_interface)
{
diff --git a/paludis/repositories/gentoo/ebuild.cc b/paludis/repositories/gentoo/ebuild.cc
index e450717..c885285 100644
--- a/paludis/repositories/gentoo/ebuild.cc
+++ b/paludis/repositories/gentoo/ebuild.cc
@@ -25,6 +25,7 @@
#include <paludis/util/log.hh>
#include <paludis/environment.hh>
#include <paludis/config_file.hh>
+#include <paludis/eapi.hh>
#include <paludis/portage_dep_parser.hh>
#include <sys/resource.h>
#include <sys/time.h>
@@ -39,7 +40,6 @@
using namespace paludis;
-#include <paludis/repositories/gentoo/ebuild-se.cc>
#include <paludis/repositories/gentoo/ebuild-sr.cc>
EbuildCommand::EbuildCommand(const EbuildCommandParams & p) :
@@ -58,12 +58,6 @@ EbuildCommand::success()
}
bool
-EbuildCommand::use_sandbox() const
-{
- return true;
-}
-
-bool
EbuildCommand::failure()
{
return false;
@@ -75,9 +69,13 @@ EbuildCommand::operator() ()
Command cmd(getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis") +
"/ebuild.bash '" + ebuild_file() + "' " + commands());
- if (use_sandbox())
+ if (params.sandbox)
cmd.with_sandbox();
+ if (params.userpriv)
+ cmd.with_uid_gid(params.environment->reduced_uid(), params.environment->reduced_gid());
+
+
tr1::shared_ptr<const FSEntryCollection> syncers_dirs(params.environment->syncers_dirs());
tr1::shared_ptr<const FSEntryCollection> bashrc_files(params.environment->bashrc_files());
tr1::shared_ptr<const FSEntryCollection> fetchers_dirs(params.environment->fetchers_dirs());
@@ -118,7 +116,7 @@ EbuildCommand::operator() ()
.with_setenv("PALUDIS_EBUILD_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
.with_setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis")));
- if (params.want_portage_emulation_vars)
+ if (params.eapi->supported->want_portage_emulation_vars)
cmd = add_portage_vars(cmd);
if (do_run_command(cmd))
@@ -169,7 +167,7 @@ EbuildMetadataCommand::EbuildMetadataCommand(const EbuildCommandParams & p) :
std::string
EbuildMetadataCommand::commands() const
{
- return "metadata";
+ return params.commands;
}
bool
@@ -245,7 +243,7 @@ EbuildVariableCommand::EbuildVariableCommand(const EbuildCommandParams & p,
std::string
EbuildVariableCommand::commands() const
{
- return "variable";
+ return params.commands;
}
bool
@@ -276,10 +274,7 @@ EbuildVariableCommand::do_run_command(const Command & cmd)
std::string
EbuildFetchCommand::commands() const
{
- if (fetch_params.no_fetch)
- return "nofetch";
- else
- return "fetch";
+ return params.commands;
}
bool
@@ -304,9 +299,6 @@ EbuildFetchCommand::extend_command(const Command & cmd)
.with_setenv("PALUDIS_PROFILE_DIRS", join(fetch_params.profiles->begin(),
fetch_params.profiles->end(), " ")));
- if (fetch_params.userpriv)
- result.with_uid_gid(params.environment->reduced_uid(), params.environment->reduced_gid());
-
for (AssociativeCollection<std::string, std::string>::Iterator
i(fetch_params.expand_vars->begin()),
j(fetch_params.expand_vars->end()) ; i != j ; ++i)
@@ -325,37 +317,7 @@ EbuildFetchCommand::EbuildFetchCommand(const EbuildCommandParams & p,
std::string
EbuildInstallCommand::commands() const
{
- switch (install_params.phase)
- {
- case ebuild_ip_prepare:
- return "prepare";
-
- case ebuild_ip_init:
- return "init saveenv";
-
- case ebuild_ip_setup:
- return "loadenv setup saveenv";
-
- case ebuild_ip_build:
- return "loadenv unpack compile test saveenv";
-
- case ebuild_ip_install:
- return "loadenv install saveenv";
-
- case ebuild_ip_preinstall:
- return "loadenv strip preinst saveenv";
-
- case ebuild_ip_postinstall:
- return "loadenv postinst saveenv";
-
- case ebuild_ip_tidyup:
- return "tidyup";
-
- case last_ebuild_ip:
- ;
- };
-
- throw InternalError(PALUDIS_HERE, "Bad phase");
+ return params.commands;
}
bool
@@ -412,10 +374,6 @@ EbuildInstallCommand::extend_command(const Command & cmd)
j(install_params.expand_vars->end()) ; i != j ; ++i)
result.with_setenv(i->first, i->second);
- if ((ebuild_ip_build == install_params.phase || ebuild_ip_init == install_params.phase)
- && install_params.userpriv)
- result.with_uid_gid(params.environment->reduced_uid(), params.environment->reduced_gid());
-
return result;
}
@@ -429,19 +387,7 @@ EbuildInstallCommand::EbuildInstallCommand(const EbuildCommandParams & p,
std::string
EbuildUninstallCommand::commands() const
{
- switch (uninstall_params.phase)
- {
- case up_preremove:
- return "prerm saveenv";
-
- case up_postremove:
- return "loadenv postrm";
-
- case last_up:
- ;
- }
-
- throw InternalError(PALUDIS_HERE, "Bad phase value");
+ return params.commands;
}
std::string
@@ -511,7 +457,7 @@ EbuildVersionMetadata::~EbuildVersionMetadata()
std::string
EbuildConfigCommand::commands() const
{
- return "config";
+ return params.commands;
}
bool
@@ -593,7 +539,8 @@ VDBPostMergeCommand::operator() ()
#ifdef HAVE_GNU_LDCONFIG
std::string ebuild_cmd("ldconfig -r '" + stringify(params.root) + "'");
#else
- std::string ebuild_cmd("ldconfig -elf -i -f '" + stringify(params.root) + "var/run/ld-elf.so.hints' '" + stringify(params.root) + "etc/ld.so.conf'");
+ std::string ebuild_cmd("ldconfig -elf -i -f '" + stringify(params.root) +
+ "var/run/ld-elf.so.hints' '" + stringify(params.root) + "etc/ld.so.conf'");
#endif
if (0 != (run_command(ebuild_cmd)))
@@ -603,7 +550,7 @@ VDBPostMergeCommand::operator() ()
std::string
EbuildPretendCommand::commands() const
{
- return "pretend";
+ return params.commands;
}
bool
diff --git a/paludis/repositories/gentoo/ebuild.hh b/paludis/repositories/gentoo/ebuild.hh
index 21401bc..af0bc88 100644
--- a/paludis/repositories/gentoo/ebuild.hh
+++ b/paludis/repositories/gentoo/ebuild.hh
@@ -38,7 +38,6 @@ namespace paludis
class Environment;
class Command;
-#include <paludis/repositories/gentoo/ebuild-se.hh>
#include <paludis/repositories/gentoo/ebuild-sr.hh>
/**
@@ -109,11 +108,6 @@ namespace paludis
virtual bool success();
/**
- * Should the sandbox, if available, be used?
- */
- virtual bool use_sandbox() const;
-
- /**
* Actions to be taken after a failed command.
*
* The return value of this function is used for the return value
diff --git a/paludis/repositories/gentoo/ebuild.se b/paludis/repositories/gentoo/ebuild.se
deleted file mode 100644
index 78e206b..0000000
--- a/paludis/repositories/gentoo/ebuild.se
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et ft=sh :
-
-make_enum_EbuildInstallCommandPhase()
-{
- prefix ebuild_ip
-
- key ebuild_ip_prepare "Prepare the filesystem."
- key ebuild_ip_init "Initialise the package."
- key ebuild_ip_setup "Set up the package."
- key ebuild_ip_build "Build the package."
- key ebuild_ip_install "Install the package to D."
- key ebuild_ip_preinstall "Preinstall to a live system."
- key ebuild_ip_postinstall "Postinstall to a live system."
- key ebuild_ip_tidyup "Tidy up work."
-
- doxygen_comment << "END"
- /**
- * Which phase of an EbuildInstallCommand to run.
- *
- * \see EbuildInstallCommand
- * \ingroup grpportagerepository
- */
-END
-}
-
-make_enum_EbuildUninstallCommandPhase()
-{
- prefix up
-
- key up_preremove "Preremove from a live system."
- key up_postremove "Postremove from a live system."
-
- doxygen_comment << "END"
- /**
- * Which phase of an EbuildUninstallCommand to run.
- *
- * \see EbuildUninstallCommand
- * \ingroup grpportagerepository
- */
-END
-}
-
diff --git a/paludis/repositories/gentoo/ebuild.sr b/paludis/repositories/gentoo/ebuild.sr
index 7ca09eb..8a19d56 100644
--- a/paludis/repositories/gentoo/ebuild.sr
+++ b/paludis/repositories/gentoo/ebuild.sr
@@ -5,13 +5,16 @@ make_class_EbuildCommandParams()
{
key environment "const Environment *"
key db_entry "const PackageDatabaseEntry *"
+ key eapi "tr1::shared_ptr<const EAPI>"
key ebuild_dir FSEntry
key files_dir FSEntry
key eclassdirs "tr1::shared_ptr<const FSEntryCollection>"
key portdir FSEntry
key distdir FSEntry
key buildroot FSEntry
- key want_portage_emulation_vars bool
+ key userpriv bool
+ key sandbox bool
+ key commands std::string
doxygen_comment << "END"
/**
@@ -36,9 +39,7 @@ make_class_EbuildFetchCommandParams()
key root std::string
key profiles "tr1::shared_ptr<const FSEntryCollection>"
key expand_vars "tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >"
- key no_fetch bool
key safe_resume bool
- key userpriv bool
doxygen_comment << "END"
/**
@@ -63,10 +64,8 @@ make_class_EbuildInstallCommandParams()
key profiles "tr1::shared_ptr<const FSEntryCollection>"
key expand_vars "tr1::shared_ptr<const AssociativeCollection<std::string, std::string> >"
key disable_cfgpro bool
- key userpriv bool
key debug_build InstallDebugOption
key slot SlotName
- key phase EbuildInstallCommandPhase
key config_protect std::string
key config_protect_mask std::string
key loadsaveenv_dir FSEntry
@@ -111,7 +110,6 @@ make_class_EbuildUninstallCommandParams()
key disable_cfgpro bool
key unmerge_only bool
key load_environment "const FSEntry *"
- key phase EbuildUninstallCommandPhase
key loadsaveenv_dir FSEntry
doxygen_comment << "END"
diff --git a/paludis/repositories/gentoo/ebuild_entries.cc b/paludis/repositories/gentoo/ebuild_entries.cc
index d7a736d..4889b88 100644
--- a/paludis/repositories/gentoo/ebuild_entries.cc
+++ b/paludis/repositories/gentoo/ebuild_entries.cc
@@ -21,7 +21,10 @@
#include <paludis/repositories/gentoo/ebuild_flat_metadata_cache.hh>
#include <paludis/repositories/gentoo/portage_repository.hh>
#include <paludis/repositories/gentoo/ebuild.hh>
+#include <paludis/repositories/gentoo/eapi_phase.hh>
+#include <paludis/distribution.hh>
+#include <paludis/eapi.hh>
#include <paludis/dep_spec_flattener.hh>
#include <paludis/environment.hh>
#include <paludis/portage_dep_parser.hh>
@@ -34,16 +37,17 @@
#include <paludis/util/system.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/tr1_functional.hh>
#include <fstream>
#include <list>
#include <set>
#include <sys/types.h>
#include <grp.h>
-#include <paludis/util/tr1_functional.hh>
#include <functional>
using namespace paludis;
+using namespace paludis::erepository;
namespace paludis
{
@@ -133,6 +137,15 @@ EbuildEntries::generate_version_metadata(const QualifiedPackageName & q,
"No usable cache entry for '" + stringify(q) +
"-" + stringify(v) + "' in '" + stringify(_imp->portage_repository->name()) + "'");
+ tr1::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(
+ DistributionData::get_instance()->default_distribution()->eapi_when_unknown));
+ EAPIPhases phases(eapi->supported->ebuild_phases->ebuild_metadata);
+
+ int c(std::distance(phases.begin_phases(), phases.end_phases()));
+ if (1 != c)
+ throw EAPIConfigurationError("EAPI '" + eapi->name + "' defines "
+ + (c == 0 ? "no" : stringify(c)) + " ebuild variable phases but expected exactly one");
+
PackageDatabaseEntry e(q, v, _imp->portage_repository->name());
EbuildMetadataCommand cmd(EbuildCommandParams::create()
.environment(_imp->environment)
@@ -143,8 +156,11 @@ EbuildEntries::generate_version_metadata(const QualifiedPackageName & q,
.portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
_imp->params.location)
.distdir(_imp->params.distdir)
- .want_portage_emulation_vars(false)
- .buildroot(_imp->params.buildroot));
+ .buildroot(_imp->params.buildroot)
+ .commands(join(phases.begin_phases()->begin_commands(), phases.begin_phases()->end_commands(), " "))
+ .sandbox(phases.begin_phases()->option("sandbox"))
+ .userpriv(phases.begin_phases()->option("userpriv"))
+ .eapi(eapi));
if (! cmd())
Log::get_instance()->message(ll_warning, lc_no_context,
@@ -154,7 +170,7 @@ EbuildEntries::generate_version_metadata(const QualifiedPackageName & q,
if (0 == ((result = cmd.metadata())))
throw InternalError(PALUDIS_HERE, "cmd.metadata() is zero pointer???");
- if (_imp->params.write_cache.basename() != "empty" && result->eapi.supported)
+ if (_imp->params.write_cache.basename() != "empty" && result->eapi->supported)
{
EbuildFlatMetadataCache metadata_cache(write_cache_file, ebuild_file, _imp->master_mtime,
_imp->eclass_mtimes, false);
@@ -223,7 +239,7 @@ namespace
if (env->query_use(i->flag, pde))
use += stringify(i->flag) + " ";
- if (metadata->eapi.supported->want_arch_var)
+ if (metadata->eapi->supported->want_arch_var)
use += profile->environment_variable("ARCH") + " ";
return use;
@@ -265,7 +281,7 @@ namespace
if (! env->query_use(UseFlagName(lower_x + "_" + stringify(*u)), e))
continue;
- if (! metadata->eapi.supported->require_use_expand_in_iuse)
+ if (! metadata->eapi->supported->require_use_expand_in_iuse)
use.append(lower_x + "_" + stringify(*u) + " ");
std::string value;
@@ -413,7 +429,7 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
}
/* make AA */
- if (metadata->eapi.supported->want_aa_var)
+ if (metadata->eapi->supported->want_aa_var)
{
AAFinder g;
metadata->ebuild_interface->src_uri()->accept(g);
@@ -460,67 +476,76 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
tr1::shared_ptr<AssociativeCollection<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment, e, metadata, p, use));
- EbuildCommandParams command_params(EbuildCommandParams::create()
- .environment(_imp->params.environment)
- .db_entry(&e)
- .ebuild_dir(_imp->portage_repository->layout()->package_directory(q))
- .files_dir(_imp->portage_repository->layout()->package_directory(q) / "files")
- .eclassdirs(_imp->params.eclassdirs)
- .portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
- _imp->params.location)
- .distdir(_imp->params.distdir)
- .want_portage_emulation_vars(metadata->eapi.supported->want_portage_emulation_vars)
- .buildroot(_imp->params.buildroot));
- bool fetch_userpriv_ok(_imp->environment->reduced_gid() != getgid());
- if (fetch_userpriv_ok)
+ /* fetch */
{
- FSEntry f(_imp->params.distdir);
- Context c("When checking permissions on '" + stringify(f) + "' for userpriv:");
-
- if (f.exists())
+ bool fetch_userpriv_ok(_imp->environment->reduced_gid() != getgid());
+ if (fetch_userpriv_ok)
{
- if (f.group() != _imp->environment->reduced_gid())
- {
- Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
- stringify(f) + "' owned by group '" +
- stringify(get_group_name(f.group())) + "', not '" +
- stringify(get_group_name(_imp->environment->reduced_gid())) +
- "', so cannot enable userpriv");
- fetch_userpriv_ok = false;
- }
- else if (! f.has_permission(fs_ug_group, fs_perm_write))
+ FSEntry f(_imp->params.distdir);
+ Context c("When checking permissions on '" + stringify(f) + "' for userpriv:");
+
+ if (f.exists())
{
- Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
- stringify(f) + "' does not group write permission," +
- "cannot enable userpriv");
- fetch_userpriv_ok = false;
+ if (f.group() != _imp->environment->reduced_gid())
+ {
+ Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
+ stringify(f) + "' owned by group '" +
+ stringify(get_group_name(f.group())) + "', not '" +
+ stringify(get_group_name(_imp->environment->reduced_gid())) +
+ "', so cannot enable userpriv");
+ fetch_userpriv_ok = false;
+ }
+ else if (! f.has_permission(fs_ug_group, fs_perm_write))
+ {
+ Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
+ stringify(f) + "' does not group write permission," +
+ "cannot enable userpriv");
+ fetch_userpriv_ok = false;
+ }
}
}
- }
- EbuildFetchCommand fetch_cmd(command_params,
- EbuildFetchCommandParams::create()
- .a(archives)
- .aa(all_archives)
- .use(use)
- .use_expand(join(p->begin_use_expand(), p->end_use_expand(), " "))
- .expand_vars(expand_vars)
- .flat_src_uri(flat_src_uri)
- .root(stringify(get_root(o.destinations)))
- .profiles(_imp->params.profiles)
- .no_fetch(fetch_restrict)
- .userpriv(fetch_userpriv_ok)
- .safe_resume(o.safe_resume));
-
- fetch_cmd();
-
- if (o.fetch_only)
- return;
-
- if (! o.destinations)
- throw PackageInstallActionError("Can't install '" + stringify(q) + "-"
- + stringify(v) + "' because no destinations were provided");
+ EAPIPhases phases(fetch_restrict ?
+ metadata->eapi->supported->ebuild_phases->ebuild_nofetch :
+ metadata->eapi->supported->ebuild_phases->ebuild_fetch);
+
+ for (EAPIPhases::Iterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
+ phase != phase_end ; ++phase)
+ {
+ EbuildCommandParams command_params(EbuildCommandParams::create()
+ .environment(_imp->params.environment)
+ .db_entry(&e)
+ .ebuild_dir(_imp->portage_repository->layout()->package_directory(q))
+ .files_dir(_imp->portage_repository->layout()->package_directory(q) / "files")
+ .eclassdirs(_imp->params.eclassdirs)
+ .portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
+ _imp->params.location)
+ .distdir(_imp->params.distdir)
+ .eapi(metadata->eapi)
+ .commands(join(phase->begin_commands(), phase->end_commands(), " "))
+ .sandbox(phase->option("sandbox"))
+ .userpriv(phase->option("userpriv") && fetch_userpriv_ok)
+ .buildroot(_imp->params.buildroot));
+
+ EbuildFetchCommand fetch_cmd(command_params,
+ EbuildFetchCommandParams::create()
+ .a(archives)
+ .aa(all_archives)
+ .use(use)
+ .use_expand(join(p->begin_use_expand(), p->end_use_expand(), " "))
+ .expand_vars(expand_vars)
+ .flat_src_uri(flat_src_uri)
+ .root(o.destination->installed_interface ? stringify(o.destination->installed_interface->root()) : "/")
+ .profiles(_imp->params.profiles)
+ .safe_resume(o.safe_resume));
+
+ fetch_cmd();
+ }
+
+ if (o.fetch_only)
+ return;
+ }
bool userpriv_ok((! userpriv_restrict) && (_imp->environment->reduced_gid() != getgid()));
if (userpriv_ok)
@@ -548,83 +573,65 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
}
}
- EbuildInstallCommandParams install_params(
- EbuildInstallCommandParams::create()
- .phase(ebuild_ip_prepare)
- .use(use)
- .a(archives)
- .aa(all_archives)
- .use_expand(join(p->begin_use_expand(), p->end_use_expand(), " "))
- .expand_vars(expand_vars)
- .root(stringify(get_root(o.destinations)))
- .profiles(_imp->params.profiles)
- .disable_cfgpro(o.no_config_protect)
- .debug_build(o.debug_build)
- .config_protect(_imp->portage_repository->profile_variable("CONFIG_PROTECT"))
- .config_protect_mask(_imp->portage_repository->profile_variable("CONFIG_PROTECT_MASK"))
- .loadsaveenv_dir(_imp->params.buildroot / stringify(q.category) / (
- stringify(q.package) + "-" + stringify(v)) / "temp")
- .userpriv(userpriv_ok)
- .slot(SlotName(metadata->slot)));
-
- EbuildInstallCommand prepare_cmd(command_params, install_params);
- prepare_cmd();
-
- install_params.phase = ebuild_ip_init;
- EbuildInstallCommand init_cmd(command_params, install_params);
- init_cmd();
-
- install_params.phase = ebuild_ip_setup;
- EbuildInstallCommand setup_cmd(command_params, install_params);
- setup_cmd();
-
- install_params.phase = ebuild_ip_build;
- EbuildInstallCommand build_cmd(command_params, install_params);
- build_cmd();
-
- install_params.phase = ebuild_ip_install;
- EbuildInstallCommand install_cmd(command_params, install_params);
- install_cmd();
-
- for (DestinationsCollection::Iterator d(o.destinations->begin()),
- d_end(o.destinations->end()) ; d != d_end ; ++d)
+ EAPIPhases phases(metadata->eapi->supported->ebuild_phases->ebuild_install);
+ for (EAPIPhases::Iterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
+ phase != phase_end ; ++phase)
{
- if (! (*d)->destination_interface)
- throw PackageInstallActionError("Can't install '" + stringify(q) + "-"
- + stringify(v) + "' to destination '" + stringify((*d)->name())
- + "' because destination does not provide destination_interface");
-
- install_params.root = (*d)->installed_interface ?
- stringify((*d)->installed_interface->root()) : "/";
-
- if ((*d)->destination_interface->want_pre_post_phases())
+ if (phase->option("merge"))
{
- install_params.phase = ebuild_ip_preinstall;
- EbuildInstallCommand preinst_cmd(command_params, install_params);
- preinst_cmd();
+ if (! o.destination->destination_interface)
+ throw PackageInstallActionError("Can't install '" + stringify(q) + "-"
+ + stringify(v) + "' to destination '" + stringify(o.destination->name())
+ + "' because destination does not provide destination_interface");
+
+ o.destination->destination_interface->merge(
+ MergeOptions::create()
+ .package(PackageDatabaseEntry(q, v, _imp->portage_repository->name()))
+ .image_dir(_imp->params.buildroot / stringify(q.category) / (stringify(q.package) + "-"
+ + stringify(v)) / "image")
+ .environment_file(_imp->params.buildroot / stringify(q.category) / (stringify(q.package) + "-"
+ + stringify(v)) / "temp" / "loadsaveenv")
+ );
}
-
- (*d)->destination_interface->merge(
- MergeOptions::create()
- .package(PackageDatabaseEntry(q, v, _imp->portage_repository->name()))
- .image_dir(command_params.buildroot / stringify(q.category) / (stringify(q.package) + "-"
- + stringify(v)) / "image")
- .environment_file(command_params.buildroot / stringify(q.category) / (stringify(q.package) + "-"
- + stringify(v)) / "temp" / "loadsaveenv")
- );
-
- if ((*d)->destination_interface->want_pre_post_phases())
+ else if ((! phase->option("prepost")) ||
+ (o.destination->destination_interface && o.destination->destination_interface->want_pre_post_phases()))
{
- install_params.phase = ebuild_ip_postinstall;
- EbuildInstallCommand postinst_cmd(command_params, install_params);
- postinst_cmd();
+ EbuildCommandParams command_params(EbuildCommandParams::create()
+ .environment(_imp->params.environment)
+ .db_entry(&e)
+ .ebuild_dir(_imp->portage_repository->layout()->package_directory(q))
+ .files_dir(_imp->portage_repository->layout()->package_directory(q) / "files")
+ .eclassdirs(_imp->params.eclassdirs)
+ .portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
+ _imp->params.location)
+ .distdir(_imp->params.distdir)
+ .eapi(metadata->eapi)
+ .commands(join(phase->begin_commands(), phase->end_commands(), " "))
+ .sandbox(phase->option("sandbox"))
+ .userpriv(phase->option("userpriv") && userpriv_ok)
+ .buildroot(_imp->params.buildroot));
+
+ EbuildInstallCommandParams install_params(
+ EbuildInstallCommandParams::create()
+ .use(use)
+ .a(archives)
+ .aa(all_archives)
+ .use_expand(join(p->begin_use_expand(), p->end_use_expand(), " "))
+ .expand_vars(expand_vars)
+ .root(o.destination->installed_interface ? stringify(o.destination->installed_interface->root()) : "/")
+ .profiles(_imp->params.profiles)
+ .disable_cfgpro(o.no_config_protect)
+ .debug_build(o.debug_build)
+ .config_protect(_imp->portage_repository->profile_variable("CONFIG_PROTECT"))
+ .config_protect_mask(_imp->portage_repository->profile_variable("CONFIG_PROTECT_MASK"))
+ .loadsaveenv_dir(_imp->params.buildroot / stringify(q.category) / (
+ stringify(q.package) + "-" + stringify(v)) / "temp")
+ .slot(SlotName(metadata->slot)));
+
+ EbuildInstallCommand cmd(command_params, install_params);
+ cmd();
}
}
-
- install_params.phase = ebuild_ip_tidyup;
- install_params.root = stringify(get_root(o.destinations));
- EbuildInstallCommand tidyup_cmd(command_params, install_params);
- tidyup_cmd();
}
std::string
@@ -633,6 +640,13 @@ EbuildEntries::get_environment_variable(const QualifiedPackageName & q,
tr1::shared_ptr<const PortageRepositoryProfile>) const
{
PackageDatabaseEntry for_package(q, v, _imp->portage_repository->name());
+ tr1::shared_ptr<const VersionMetadata> metadata(_imp->portage_repository->version_metadata(q, v));
+ EAPIPhases phases(metadata->eapi->supported->ebuild_phases->ebuild_variable);
+
+ int c(std::distance(phases.begin_phases(), phases.end_phases()));
+ if (1 != c)
+ throw EAPIConfigurationError("EAPI '" + metadata->eapi->name + "' defines "
+ + (c == 0 ? "no" : stringify(c)) + " ebuild variable phases but expected exactly one");
EbuildVariableCommand cmd(EbuildCommandParams::create()
.environment(_imp->params.environment)
@@ -643,7 +657,10 @@ EbuildEntries::get_environment_variable(const QualifiedPackageName & q,
.portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
_imp->params.location)
.distdir(_imp->params.distdir)
- .want_portage_emulation_vars(false)
+ .eapi(metadata->eapi)
+ .sandbox(phases.begin_phases()->option("sandbox"))
+ .userpriv(phases.begin_phases()->option("userpriv"))
+ .commands(join(phases.begin_phases()->begin_commands(), phases.begin_phases()->end_commands(), " "))
.buildroot(_imp->params.buildroot),
var);
@@ -697,9 +714,9 @@ EbuildEntries::pretend(const QualifiedPackageName & q, const VersionSpec & v,
tr1::shared_ptr<const VersionMetadata> metadata(_imp->portage_repository->version_metadata(q, v));
- if (! metadata->eapi.supported)
+ if (! metadata->eapi->supported)
return true;
- if (! metadata->eapi.supported->has_pkg_pretend)
+ if (metadata->eapi->supported->ebuild_phases->ebuild_pretend.empty())
return true;
PackageDatabaseEntry e(q, v, _imp->portage_repository->name());
@@ -708,26 +725,37 @@ EbuildEntries::pretend(const QualifiedPackageName & q, const VersionSpec & v,
tr1::shared_ptr<AssociativeCollection<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment, e, metadata, p, use));
- EbuildCommandParams command_params(EbuildCommandParams::create()
- .environment(_imp->params.environment)
- .db_entry(&e)
- .ebuild_dir(_imp->portage_repository->layout()->package_directory(q))
- .files_dir(_imp->portage_repository->layout()->package_directory(q) / "files")
- .eclassdirs(_imp->params.eclassdirs)
- .portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
- _imp->params.location)
- .distdir(_imp->params.distdir)
- .want_portage_emulation_vars(metadata->eapi.supported->want_portage_emulation_vars)
- .buildroot(_imp->params.buildroot));
-
- EbuildPretendCommand pretend_cmd(command_params,
- EbuildPretendCommandParams::create()
- .use(use)
- .use_expand(join(p->begin_use_expand(), p->end_use_expand(), " "))
- .expand_vars(expand_vars)
- .root(stringify(_imp->params.environment->root()))
- .profiles(_imp->params.profiles));
-
- return pretend_cmd();
+ EAPIPhases phases(metadata->eapi->supported->ebuild_phases->ebuild_pretend);
+ for (EAPIPhases::Iterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
+ phase != phase_end ; ++phase)
+ {
+ EbuildCommandParams command_params(EbuildCommandParams::create()
+ .environment(_imp->params.environment)
+ .db_entry(&e)
+ .ebuild_dir(_imp->portage_repository->layout()->package_directory(q))
+ .files_dir(_imp->portage_repository->layout()->package_directory(q) / "files")
+ .eclassdirs(_imp->params.eclassdirs)
+ .portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
+ _imp->params.location)
+ .distdir(_imp->params.distdir)
+ .eapi(metadata->eapi)
+ .userpriv(phase->option("userpriv"))
+ .sandbox(phase->option("sandbox"))
+ .commands(join(phase->begin_commands(), phase->end_commands(), " "))
+ .buildroot(_imp->params.buildroot));
+
+ EbuildPretendCommand pretend_cmd(command_params,
+ EbuildPretendCommandParams::create()
+ .use(use)
+ .use_expand(join(p->begin_use_expand(), p->end_use_expand(), " "))
+ .expand_vars(expand_vars)
+ .root(stringify(_imp->params.environment->root()))
+ .profiles(_imp->params.profiles));
+
+ if (! pretend_cmd())
+ return false;
+ }
+
+ return true;
}
diff --git a/paludis/repositories/gentoo/ebuild_flat_metadata_cache.cc b/paludis/repositories/gentoo/ebuild_flat_metadata_cache.cc
index e42f8f9..5b7f02c 100644
--- a/paludis/repositories/gentoo/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/gentoo/ebuild_flat_metadata_cache.cc
@@ -22,6 +22,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/join.hh>
#include <paludis/dep_spec_pretty_printer.hh>
+#include <paludis/eapi.hh>
#include <fstream>
#include <set>
#include <list>
@@ -141,7 +142,7 @@ EbuildFlatMetadataCache::save(tr1::shared_ptr<const EbuildVersionMetadata> v)
cache << std::endl;
cache << flatten(v->post_depend()) << std::endl;
cache << flatten(v->provide()) << std::endl;
- cache << normalise(v->eapi.name) << std::endl;
+ cache << normalise(v->eapi->name) << std::endl;
}
else
{
diff --git a/paludis/repositories/gentoo/portage_repository_TEST.cc b/paludis/repositories/gentoo/portage_repository_TEST.cc
index 02b6ef7..c1ca4f6 100644
--- a/paludis/repositories/gentoo/portage_repository_TEST.cc
+++ b/paludis/repositories/gentoo/portage_repository_TEST.cc
@@ -23,6 +23,7 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/system.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/eapi.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -545,13 +546,13 @@ namespace test_cases
m = repo->version_metadata(QualifiedPackageName("cat-one/pkg-one"), VersionSpec("1"));
TEST_CHECK_EQUAL(m->description, "The Description");
- TEST_CHECK_EQUAL(m->eapi.name, "0");
- TEST_CHECK(m->eapi.supported);
+ TEST_CHECK_EQUAL(m->eapi->name, "0");
+ TEST_CHECK(m->eapi->supported);
m = repo->version_metadata(QualifiedPackageName("cat-one/pkg-one"), VersionSpec("2"));
TEST_CHECK_EQUAL(m->description, "dquote \" squote ' backslash \\ dollar $");
- TEST_CHECK_EQUAL(m->eapi.name, "0");
- TEST_CHECK(m->eapi.supported);
+ TEST_CHECK_EQUAL(m->eapi->name, "0");
+ TEST_CHECK(m->eapi->supported);
}
}
}
@@ -588,8 +589,8 @@ namespace test_cases
tr1::shared_ptr<const VersionMetadata> m;
m = repo->version_metadata(QualifiedPackageName("cat-one/pkg-two"), VersionSpec("1"));
- TEST_CHECK_EQUAL(m->eapi.name, "UNKNOWN");
- TEST_CHECK(! m->eapi.supported);
+ TEST_CHECK_EQUAL(m->eapi->name, "UNKNOWN");
+ TEST_CHECK(! m->eapi->supported);
}
}
} test_portage_repository_metadata_unparsable;
diff --git a/paludis/repositories/gentoo/portage_repository_profile.cc b/paludis/repositories/gentoo/portage_repository_profile.cc
index b0685f7..dcc3491 100644
--- a/paludis/repositories/gentoo/portage_repository_profile.cc
+++ b/paludis/repositories/gentoo/portage_repository_profile.cc
@@ -28,6 +28,7 @@
#include <paludis/util/system.hh>
#include <paludis/util/join.hh>
#include <paludis/config_file.hh>
+#include <paludis/dep_tag.hh>
#include <paludis/environment.hh>
#include <paludis/match_package.hh>
#include <paludis/hashed_containers.hh>
diff --git a/paludis/repositories/gentoo/portage_repository_sets.cc b/paludis/repositories/gentoo/portage_repository_sets.cc
index 9f1732a..1d29be7 100644
--- a/paludis/repositories/gentoo/portage_repository_sets.cc
+++ b/paludis/repositories/gentoo/portage_repository_sets.cc
@@ -26,6 +26,9 @@
#include <paludis/config_file.hh>
#include <paludis/query.hh>
#include <paludis/set_file.hh>
+#include <paludis/dep_tag.hh>
+#include <paludis/version_operator.hh>
+#include <paludis/version_requirements.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/util/collection_concrete.hh>
#include <paludis/util/dir_iterator.hh>
diff --git a/paludis/repositories/gentoo/portage_virtual_version_metadata.cc b/paludis/repositories/gentoo/portage_virtual_version_metadata.cc
index f0f727e..1c1cfd6 100644
--- a/paludis/repositories/gentoo/portage_virtual_version_metadata.cc
+++ b/paludis/repositories/gentoo/portage_virtual_version_metadata.cc
@@ -19,6 +19,8 @@
#include "portage_virtual_version_metadata.hh"
#include <paludis/portage_dep_parser.hh>
+#include <paludis/eapi.hh>
+#include <paludis/util/make_shared_ptr.hh>
using namespace paludis;
@@ -40,7 +42,7 @@ PortageVirtualVersionMetadata::PortageVirtualVersionMetadata(const SlotName & s,
.origins_interface(0)
.ebin_interface(0)
),
- VersionMetadataVirtualInterface(e),
+ VersionMetadataVirtualInterface(make_shared_ptr(new PackageDatabaseEntry(e))),
VersionMetadataDepsInterface(&PortageDepParser::parse_depend)
{
}
diff --git a/paludis/repositories/gentoo/vdb_repository.cc b/paludis/repositories/gentoo/vdb_repository.cc
index 35cc3e0..a0cd621 100644
--- a/paludis/repositories/gentoo/vdb_repository.cc
+++ b/paludis/repositories/gentoo/vdb_repository.cc
@@ -21,9 +21,12 @@
#include <paludis/repositories/gentoo/vdb_version_metadata.hh>
#include <paludis/repositories/gentoo/vdb_merger.hh>
#include <paludis/repositories/gentoo/vdb_unmerger.hh>
+#include <paludis/repositories/gentoo/eapi_phase.hh>
#include <paludis/dep_spec.hh>
#include <paludis/dep_spec_flattener.hh>
+#include <paludis/dep_tag.hh>
+#include <paludis/eapi.hh>
#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/repositories/gentoo/ebuild.hh>
#include <paludis/portage_dep_parser.hh>
@@ -34,6 +37,8 @@
#include <paludis/repository_name_cache.hh>
#include <paludis/set_file.hh>
#include <paludis/hook.hh>
+#include <paludis/version_requirements.hh>
+#include <paludis/version_operator.hh>
#include <paludis/util/collection_concrete.hh>
#include <paludis/util/dir_iterator.hh>
@@ -62,6 +67,7 @@
*/
using namespace paludis;
+using namespace paludis::erepository;
#include <paludis/repositories/gentoo/vdb_repository-sr.cc>
@@ -918,12 +924,12 @@ VDBRepositoryKeyReadError::VDBRepositoryKeyReadError(
void
VDBRepository::do_uninstall(const QualifiedPackageName & q, const VersionSpec & v, const UninstallOptions & o) const
{
- _uninstall(q, v, o, false);
+ _uninstall(q, v, *version_metadata(q, v), o, false);
}
void
-VDBRepository::_uninstall(const QualifiedPackageName & q, const VersionSpec & v, const UninstallOptions & o,
- bool reinstalling) const
+VDBRepository::_uninstall(const QualifiedPackageName & q, const VersionSpec & v, const VersionMetadata & m,
+ const UninstallOptions & o, bool reinstalling) const
{
Context context("When uninstalling '" + stringify(q) + "-" + stringify(v) +
"' from '" + stringify(name()) + (reinstalling ? "' for a reinstall:" : "':"));
@@ -948,57 +954,65 @@ VDBRepository::_uninstall(const QualifiedPackageName & q, const VersionSpec & v,
tr1::shared_ptr<FSEntry> load_env(new FSEntry(pkg_dir / "environment.bz2"));
- EbuildCommandParams params(EbuildCommandParams::create()
- .environment(_imp->env)
- .db_entry(&e)
- .ebuild_dir(pkg_dir)
- .files_dir(pkg_dir)
- .eclassdirs(eclassdirs)
- .portdir(_imp->location)
- .distdir(pkg_dir)
- .want_portage_emulation_vars(true)
- .buildroot(_imp->buildroot));
-
- EbuildUninstallCommandParams uninstall_params(EbuildUninstallCommandParams::create()
- .phase(up_preremove)
- .root(stringify(_imp->root) + "/")
- .disable_cfgpro(o.no_config_protect)
- .unmerge_only(false)
- .loadsaveenv_dir(pkg_dir)
- .load_environment(load_env.get()));
-
- EbuildUninstallCommand uninstall_cmd_pre(params, uninstall_params);
- uninstall_cmd_pre();
-
- /* load CONFIG_PROTECT, CONFIG_PROTECT_MASK from vdb, supplement with env */
- std::string config_protect, config_protect_mask;
+ EAPIPhases phases(m.eapi->supported->ebuild_phases->ebuild_uninstall);
+ for (EAPIPhases::Iterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
+ phase != phase_end ; ++phase)
{
- std::ifstream c(stringify(pkg_dir / "CONFIG_PROTECT").c_str());
- config_protect = std::string((std::istreambuf_iterator<char>(c)), std::istreambuf_iterator<char>()) +
- " " + getenv_with_default("CONFIG_PROTECT", "");
-
- std::ifstream c_m(stringify(pkg_dir / "CONFIG_PROTECT_MASK").c_str());
- config_protect_mask = std::string((std::istreambuf_iterator<char>(c_m)), std::istreambuf_iterator<char>()) +
- " " + getenv_with_default("CONFIG_PROTECT_MASK", "");
- }
-
- /* unmerge */
- VDBUnmerger unmerger(
- VDBUnmergerOptions::create()
- .environment(_imp->params.environment)
- .root(root())
- .contents_file(pkg_dir / "CONTENTS")
- .config_protect(config_protect)
- .config_protect_mask(config_protect_mask)
- .package_name(q)
- .version(v)
- .repository(this));
+ if (phase->option("unmerge"))
+ {
+ /* load CONFIG_PROTECT, CONFIG_PROTECT_MASK from vdb, supplement with env */
+ std::string config_protect, config_protect_mask;
+ {
+ std::ifstream c(stringify(pkg_dir / "CONFIG_PROTECT").c_str());
+ config_protect = std::string((std::istreambuf_iterator<char>(c)), std::istreambuf_iterator<char>()) +
+ " " + getenv_with_default("CONFIG_PROTECT", "");
- unmerger.unmerge();
+ std::ifstream c_m(stringify(pkg_dir / "CONFIG_PROTECT_MASK").c_str());
+ config_protect_mask = std::string((std::istreambuf_iterator<char>(c_m)), std::istreambuf_iterator<char>()) +
+ " " + getenv_with_default("CONFIG_PROTECT_MASK", "");
+ }
- uninstall_params.phase = up_postremove;
- EbuildUninstallCommand uninstall_cmd_post(params, uninstall_params);
- uninstall_cmd_post();
+ /* unmerge */
+ VDBUnmerger unmerger(
+ VDBUnmergerOptions::create()
+ .environment(_imp->params.environment)
+ .root(root())
+ .contents_file(pkg_dir / "CONTENTS")
+ .config_protect(config_protect)
+ .config_protect_mask(config_protect_mask)
+ .package_name(q)
+ .version(v)
+ .repository(this));
+
+ unmerger.unmerge();
+ }
+ else
+ {
+ EbuildCommandParams params(EbuildCommandParams::create()
+ .environment(_imp->env)
+ .db_entry(&e)
+ .ebuild_dir(pkg_dir)
+ .files_dir(pkg_dir)
+ .eclassdirs(eclassdirs)
+ .portdir(_imp->location)
+ .distdir(pkg_dir)
+ .eapi(m.eapi)
+ .sandbox(phase->option("sandbox"))
+ .userpriv(phase->option("userpriv"))
+ .commands(join(phase->begin_commands(), phase->end_commands(), " "))
+ .buildroot(_imp->buildroot));
+
+ EbuildUninstallCommandParams uninstall_params(EbuildUninstallCommandParams::create()
+ .root(stringify(_imp->root) + "/")
+ .disable_cfgpro(o.no_config_protect)
+ .unmerge_only(false)
+ .loadsaveenv_dir(pkg_dir)
+ .load_environment(load_env.get()));
+
+ EbuildUninstallCommand uninstall_cmd_pre(params, uninstall_params);
+ uninstall_cmd_pre();
+ }
+ }
/* remove vdb entry */
for (DirIterator d(pkg_dir, false), d_end ; d != d_end ; ++d)
@@ -1033,23 +1047,31 @@ VDBRepository::do_config(const QualifiedPackageName & q, const VersionSpec & v)
(stringify(q.package) + "-" + stringify(v)));
tr1::shared_ptr<FSEntry> load_env(new FSEntry(pkg_dir / "environment.bz2"));
+ EAPIPhases phases(metadata->eapi->supported->ebuild_phases->ebuild_config);
- EbuildConfigCommand config_cmd(EbuildCommandParams::create()
- .environment(_imp->env)
- .db_entry(&e)
- .ebuild_dir(pkg_dir)
- .files_dir(pkg_dir)
- .eclassdirs(eclassdirs)
- .portdir(_imp->location)
- .distdir(pkg_dir)
- .want_portage_emulation_vars(metadata->eapi.supported->want_portage_emulation_vars)
- .buildroot(_imp->buildroot),
-
- EbuildConfigCommandParams::create()
- .root(stringify(_imp->root) + "/")
- .load_environment(load_env.get()));
-
- config_cmd();
+ for (EAPIPhases::Iterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
+ phase != phase_end ; ++phase)
+ {
+ EbuildConfigCommand config_cmd(EbuildCommandParams::create()
+ .environment(_imp->env)
+ .db_entry(&e)
+ .ebuild_dir(pkg_dir)
+ .files_dir(pkg_dir)
+ .eclassdirs(eclassdirs)
+ .portdir(_imp->location)
+ .distdir(pkg_dir)
+ .eapi(metadata->eapi)
+ .sandbox(phase->option("sandbox"))
+ .userpriv(phase->option("userpriv"))
+ .commands(join(phase->begin_commands(), phase->end_commands(), " "))
+ .buildroot(_imp->buildroot),
+
+ EbuildConfigCommandParams::create()
+ .root(stringify(_imp->root) + "/")
+ .load_environment(load_env.get()));
+
+ config_cmd();
+ }
}
tr1::shared_ptr<SetSpecTree::ConstItem>
@@ -1332,7 +1354,7 @@ VDBRepository::load_provided_using_cache() const
PackageDatabaseEntry dbe(QualifiedPackageName(tokens.at(0)), VersionSpec(tokens.at(1)), name());
DepSpecFlattener f(_imp->env, &dbe);
tr1::shared_ptr<ProvideSpecTree::ConstItem> pp(PortageDepParser::parse_provide(
- join(next(next(tokens.begin())), tokens.end(), " "), EAPIData::get_instance()->eapi_from_string("paludis-1")));
+ join(next(next(tokens.begin())), tokens.end(), " "), *EAPIData::get_instance()->eapi_from_string("paludis-1")));
pp->accept(f);
for (DepSpecFlattener::Iterator p(f.begin()), p_end(f.end()) ; p != p_end ; ++p)
@@ -1371,7 +1393,7 @@ VDBRepository::load_provided_the_slow_way() const
provide = e->metadata->ebuild_interface->provide();
else
provide = PortageDepParser::parse_provide(file_contents(_imp->location, e->name, e->version, "PROVIDE"),
- EAPIData::get_instance()->eapi_from_string("paludis-1"));
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"));
PackageDatabaseEntry dbe(e->name, e->version, name());
DepSpecFlattener f(_imp->env, &dbe);
@@ -1451,7 +1473,7 @@ VDBRepository::regenerate_provides_cache() const
provide = c->metadata->ebuild_interface->provide();
else
provide = PortageDepParser::parse_provide(file_contents(_imp->location, c->name, c->version, "PROVIDE"),
- EAPIData::get_instance()->eapi_from_string("paludis-1"));
+ *EAPIData::get_instance()->eapi_from_string("paludis-1"));
DepSpecPrettyPrinter p(0, false);
provide->accept(p);
@@ -1517,6 +1539,9 @@ VDBRepository::merge(const MergeOptions & m)
throw PackageInstallActionError("Not a suitable destination for '" + stringify(m.package) + "'");
bool is_replace(has_version(m.package.name, m.package.version));
+ tr1::shared_ptr<const VersionMetadata> metadata_if_is_replace;
+ if (is_replace)
+ metadata_if_is_replace = version_metadata(m.package.name, m.package.version);
FSEntry tmp_vdb_dir(_imp->params.location);
if (! tmp_vdb_dir.exists())
@@ -1585,7 +1610,7 @@ VDBRepository::merge(const MergeOptions & m)
if (is_replace)
{
UninstallOptions uninstall_options(false);
- _uninstall(m.package.name, m.package.version, uninstall_options, true);
+ _uninstall(m.package.name, m.package.version, *metadata_if_is_replace, uninstall_options, true);
}
VDBPostMergeCommand post_merge_command(
diff --git a/paludis/repositories/gentoo/vdb_repository.hh b/paludis/repositories/gentoo/vdb_repository.hh
index 3ac01e9..6fcd45b 100644
--- a/paludis/repositories/gentoo/vdb_repository.hh
+++ b/paludis/repositories/gentoo/vdb_repository.hh
@@ -65,7 +65,7 @@ namespace paludis
void regenerate_provides_cache() const;
- void _uninstall(const QualifiedPackageName &, const VersionSpec &,
+ void _uninstall(const QualifiedPackageName &, const VersionSpec &, const VersionMetadata &,
const UninstallOptions &, bool reinstalling) const;
protected:
diff --git a/paludis/repositories/gentoo/vdb_version_metadata.cc b/paludis/repositories/gentoo/vdb_version_metadata.cc
index 52a2f7d..dc92a8e 100644
--- a/paludis/repositories/gentoo/vdb_version_metadata.cc
+++ b/paludis/repositories/gentoo/vdb_version_metadata.cc
@@ -19,6 +19,8 @@
#include "vdb_version_metadata.hh"
#include <paludis/portage_dep_parser.hh>
+#include <paludis/eapi.hh>
+#include <paludis/util/make_shared_ptr.hh>
using namespace paludis;
@@ -67,7 +69,7 @@ VDBVirtualVersionMetadata::VDBVirtualVersionMetadata(const SlotName & s,
.ebin_interface(0)
),
VersionMetadataDepsInterface(&PortageDepParser::parse_depend),
- VersionMetadataVirtualInterface(e)
+ VersionMetadataVirtualInterface(make_shared_ptr(new PackageDatabaseEntry(e)))
{
}
diff --git a/paludis/repository.sr b/paludis/repository.sr
index 650b95e..13a8ff2 100644
--- a/paludis/repository.sr
+++ b/paludis/repository.sr
@@ -9,7 +9,7 @@ make_class_InstallOptions()
key fetch_only bool
key debug_build InstallDebugOption
key safe_resume bool
- key destinations "tr1::shared_ptr<const DestinationsCollection>"
+ key destination "tr1::shared_ptr<Repository>"
doxygen_comment << "END"
/**
diff --git a/paludis/tasks/install_task.cc b/paludis/tasks/install_task.cc
index 753696e..3a4232f 100644
--- a/paludis/tasks/install_task.cc
+++ b/paludis/tasks/install_task.cc
@@ -64,7 +64,7 @@ namespace paludis
env(e),
dep_list(e, o),
current_dep_list_entry(dep_list.begin()),
- install_options(false, false, ido_none, false, tr1::shared_ptr<const DestinationsCollection>()),
+ install_options(false, false, ido_none, false, tr1::shared_ptr<Repository>()),
uninstall_options(false),
targets(new ConstTreeSequence<SetSpecTree, AllDepSpec>(tr1::shared_ptr<AllDepSpec>(new AllDepSpec))),
destinations(d),
@@ -244,12 +244,9 @@ InstallTask::execute()
bool any_live_destination(false);
for (DepList::Iterator dep(_imp->dep_list.begin()), dep_end(_imp->dep_list.end()) ;
dep != dep_end && ! any_live_destination ; ++dep)
- if (dlk_package == dep->kind && dep->destinations)
- for (SortedCollection<DepListEntryDestination>::Iterator d(dep->destinations->begin()),
- d_end(dep->destinations->end()) ; d != d_end ; ++d)
- if (d->destination->destination_interface &&
- d->destination->destination_interface->want_pre_post_phases())
- any_live_destination = true;
+ if (dlk_package == dep->kind && dep->destination)
+ if (dep->destination->destination_interface && dep->destination->destination_interface->want_pre_post_phases())
+ any_live_destination = true;
if (0 != perform_hook(Hook("install_all_pre")
("TARGETS", join(_imp->raw_targets.begin(), _imp->raw_targets.end(), " "))
@@ -272,11 +269,9 @@ InstallTask::execute()
continue;
bool live_destination(false);
- if (dep->destinations)
- for (SortedCollection<DepListEntryDestination>::Iterator d(dep->destinations->begin()),
- d_end(dep->destinations->end()) ; d != d_end ; ++d)
- if (d->destination->destination_interface && d->destination->destination_interface->want_pre_post_phases())
- live_destination = true;
+ if (dep->destination)
+ if (dep->destination->destination_interface && dep->destination->destination_interface->want_pre_post_phases())
+ live_destination = true;
++x;
_imp->current_dep_list_entry = dep;
@@ -313,7 +308,7 @@ InstallTask::execute()
try
{
- _imp->install_options.destinations = extract_dep_list_entry_destinations(dep->destinations);
+ _imp->install_options.destination = dep->destination;
installable_interface->install(dep->package.name, dep->package.version, _imp->install_options);
}
catch (const PackageInstallActionError & e)
@@ -358,20 +353,18 @@ InstallTask::execute()
// look for packages with the same name in the same slot in the destination repos
tr1::shared_ptr<PackageDatabaseEntryCollection> collision_list;
- if (dep->destinations)
- for (SortedCollection<DepListEntryDestination>::Iterator d(dep->destinations->begin()),
- d_end(dep->destinations->end()) ; d != d_end ; ++d)
- if (d->destination->uninstallable_interface)
- collision_list = _imp->env->package_database()->query(
- query::Matches(PackageDepSpec(
- tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(dep->package.name)),
- tr1::shared_ptr<CategoryNamePart>(),
- tr1::shared_ptr<PackageNamePart>(),
- tr1::shared_ptr<VersionRequirements>(),
- vr_and,
- tr1::shared_ptr<SlotName>(new SlotName(dep->metadata->slot)),
- tr1::shared_ptr<RepositoryName>(new RepositoryName(d->destination->name())))) &
- query::RepositoryHasInstalledInterface(), qo_order_by_version);
+ if (dep->destination)
+ if (dep->destination->uninstallable_interface)
+ collision_list = _imp->env->package_database()->query(
+ query::Matches(PackageDepSpec(
+ tr1::shared_ptr<QualifiedPackageName>(new QualifiedPackageName(dep->package.name)),
+ tr1::shared_ptr<CategoryNamePart>(),
+ tr1::shared_ptr<PackageNamePart>(),
+ tr1::shared_ptr<VersionRequirements>(),
+ vr_and,
+ tr1::shared_ptr<SlotName>(new SlotName(dep->metadata->slot)),
+ tr1::shared_ptr<RepositoryName>(new RepositoryName(dep->destination->name())))) &
+ query::RepositoryHasInstalledInterface(), qo_order_by_version);
// don't clean the thing we just installed
PackageDatabaseEntryCollection::Concrete clean_list;
diff --git a/paludis/version_metadata.cc b/paludis/version_metadata.cc
index 9f5f2b1..bdff34c 100644
--- a/paludis/version_metadata.cc
+++ b/paludis/version_metadata.cc
@@ -21,6 +21,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/version_metadata.hh>
#include <paludis/portage_dep_parser.hh>
+#include <paludis/eapi.hh>
#include <paludis/util/log.hh>
#include <paludis/util/collection_concrete.hh>
@@ -77,12 +78,12 @@ VersionMetadataHasInterfaces::~VersionMetadataHasInterfaces()
tr1::shared_ptr<const DependencySpecTree::ConstItem>
VersionMetadataDepsInterface::_make_depend(const std::string & s) const
{
- if (version_metadata()->eapi.supported)
- return parser(s, version_metadata()->eapi);
+ if (version_metadata()->eapi->supported)
+ return parser(s, *version_metadata()->eapi);
else
{
Log::get_instance()->message(ll_warning, lc_context) <<
- "Don't know how to parse dependency strings for EAPI '" + version_metadata()->eapi.name + "'";
+ "Don't know how to parse dependency strings for EAPI '" + version_metadata()->eapi->name + "'";
return tr1::shared_ptr<DependencySpecTree::ConstItem>(new ConstTreeSequence<DependencySpecTree, AllDepSpec>(
tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
}
@@ -91,12 +92,12 @@ VersionMetadataDepsInterface::_make_depend(const std::string & s) const
tr1::shared_ptr<const RestrictSpecTree::ConstItem>
VersionMetadataEbuildInterface::_make_restrict(const std::string & s) const
{
- if (version_metadata()->eapi.supported)
- return PortageDepParser::parse_restrict(s, version_metadata()->eapi);
+ if (version_metadata()->eapi->supported)
+ return PortageDepParser::parse_restrict(s, *version_metadata()->eapi);
else
{
Log::get_instance()->message(ll_warning, lc_context) <<
- "Don't know how to parse restrict strings for EAPI '" + version_metadata()->eapi.name + "'";
+ "Don't know how to parse restrict strings for EAPI '" + version_metadata()->eapi->name + "'";
return tr1::shared_ptr<RestrictSpecTree::ConstItem>(new ConstTreeSequence<RestrictSpecTree, AllDepSpec>(
tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
}
@@ -105,12 +106,12 @@ VersionMetadataEbuildInterface::_make_restrict(const std::string & s) const
tr1::shared_ptr<const ProvideSpecTree::ConstItem>
VersionMetadataEbuildInterface::_make_provide(const std::string & s) const
{
- if (version_metadata()->eapi.supported)
- return PortageDepParser::parse_provide(s, version_metadata()->eapi);
+ if (version_metadata()->eapi->supported)
+ return PortageDepParser::parse_provide(s, *version_metadata()->eapi);
else
{
Log::get_instance()->message(ll_warning, lc_context) <<
- "Don't know how to parse provide strings for EAPI '" + version_metadata()->eapi.name + "'";
+ "Don't know how to parse provide strings for EAPI '" + version_metadata()->eapi->name + "'";
return tr1::shared_ptr<ProvideSpecTree::ConstItem>(new ConstTreeSequence<ProvideSpecTree, AllDepSpec>(
tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
}
@@ -119,12 +120,12 @@ VersionMetadataEbuildInterface::_make_provide(const std::string & s) const
tr1::shared_ptr<const LicenseSpecTree::ConstItem>
VersionMetadataLicenseInterface::_make_license(const std::string & s) const
{
- if (version_metadata()->eapi.supported)
- return parser(s, version_metadata()->eapi);
+ if (version_metadata()->eapi->supported)
+ return parser(s, *version_metadata()->eapi);
else
{
Log::get_instance()->message(ll_warning, lc_context) <<
- "Don't know how to parse license strings for EAPI '" + version_metadata()->eapi.name + "'";
+ "Don't know how to parse license strings for EAPI '" + version_metadata()->eapi->name + "'";
return tr1::shared_ptr<LicenseSpecTree::ConstItem>(new ConstTreeSequence<LicenseSpecTree, AllDepSpec>(
tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
}
@@ -146,16 +147,16 @@ VersionMetadataEbuildInterface::_make_iuse_collection(const std::string & s) con
std::list<std::string> t;
WhitespaceTokeniser::get_instance()->tokenise(s, std::back_inserter(t));
- if (version_metadata()->eapi.supported)
+ if (version_metadata()->eapi->supported)
{
- IUseFlagParseMode m(version_metadata()->eapi.supported->iuse_flag_parse_mode);
+ IUseFlagParseMode m(version_metadata()->eapi->supported->iuse_flag_parse_mode);
for (std::list<std::string>::const_iterator u(t.begin()), u_end(t.end()) ;
u != u_end ; ++u)
result->insert(IUseFlag(*u, m));
}
else
Log::get_instance()->message(ll_warning, lc_context) <<
- "Don't know how to parse IUSE strings for EAPI '" + version_metadata()->eapi.name + "'";
+ "Don't know how to parse IUSE strings for EAPI '" + version_metadata()->eapi->name + "'";
return result;
}
@@ -163,19 +164,19 @@ VersionMetadataEbuildInterface::_make_iuse_collection(const std::string & s) con
tr1::shared_ptr<const URISpecTree::ConstItem>
VersionMetadataEbinInterface::_make_uri(const std::string & s) const
{
- return PortageDepParser::parse_uri(s, version_metadata()->eapi);
+ return PortageDepParser::parse_uri(s, *version_metadata()->eapi);
}
tr1::shared_ptr<const URISpecTree::ConstItem>
VersionMetadataEbuildInterface::_make_uri(const std::string & s) const
{
- return PortageDepParser::parse_uri(s, version_metadata()->eapi);
+ return PortageDepParser::parse_uri(s, *version_metadata()->eapi);
}
tr1::shared_ptr<const URISpecTree::ConstItem>
VersionMetadataBase::_make_text(const std::string & s) const
{
- return PortageDepParser::parse_uri(s, version_metadata()->eapi);
+ return PortageDepParser::parse_uri(s, *version_metadata()->eapi);
}
template <typename Item_, typename Container_>
diff --git a/paludis/version_metadata.hh b/paludis/version_metadata.hh
index 60c92e9..818a4c3 100644
--- a/paludis/version_metadata.hh
+++ b/paludis/version_metadata.hh
@@ -24,9 +24,9 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/sr.hh>
-#include <paludis/dep_spec.hh>
+#include <paludis/dep_spec-fwd.hh>
#include <paludis/package_database_entry.hh>
-#include <paludis/eapi.hh>
+#include <paludis/eapi-fwd.hh>
#include <string>
/** \file
diff --git a/paludis/version_metadata.sr b/paludis/version_metadata.sr
index 25a175d..c2b1c41 100644
--- a/paludis/version_metadata.sr
+++ b/paludis/version_metadata.sr
@@ -118,7 +118,7 @@ make_class_VersionMetadataBase()
key slot SlotName
cache_key homepage std::string URISpecTree::ConstItem _make_text
key description std::string
- key eapi EAPI
+ key eapi "tr1::shared_ptr<const EAPI>"
key interactive bool
allow_named_args
@@ -245,7 +245,7 @@ make_class_VersionMetadataVirtualInterface()
inherit "public virtual VersionMetadataHasInterfaces"
- key virtual_for PackageDatabaseEntry
+ key virtual_for "tr1::shared_ptr<PackageDatabaseEntry>"
doxygen_comment << "END"
/**
diff --git a/paludis/version_operator-fwd.hh b/paludis/version_operator-fwd.hh
new file mode 100644
index 0000000..8c735b4
--- /dev/null
+++ b/paludis/version_operator-fwd.hh
@@ -0,0 +1,41 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_VERSION_OPERATOR_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_VERSION_OPERATOR_FWD_HH 1
+
+#include <iosfwd>
+#include <paludis/util/attributes.hh>
+
+namespace paludis
+{
+#include <paludis/version_operator-se.hh>
+
+ class VersionOperator;
+ class BadVersionOperatorError;
+
+ /**
+ * A VersionOperator can be written to an ostream.
+ *
+ * \ingroup grpversions
+ */
+ std::ostream & operator<< (std::ostream & s, const VersionOperator &) PALUDIS_VISIBLE;
+}
+
+#endif
diff --git a/paludis/version_operator.hh b/paludis/version_operator.hh
index 0dfdcd6..5c8c78c 100644
--- a/paludis/version_operator.hh
+++ b/paludis/version_operator.hh
@@ -21,10 +21,10 @@
#define PALUDIS_GUARD_PALUDIS_VERSION_OPERATOR_HH 1
#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/validated.hh>
-
+#include <paludis/util/operators.hh>
+#include <paludis/version_operator-fwd.hh>
+#include <paludis/version_spec-fwd.hh>
#include <string>
-#include <iosfwd>
/** \file
* Declarations for the VersionOperator class.
@@ -34,10 +34,6 @@
namespace paludis
{
- class VersionSpec;
-
-#include <paludis/version_operator-se.hh>
-
/**
* An operator attached to a VersionSpec, validated.
*
@@ -131,13 +127,6 @@ namespace paludis
*/
BadVersionOperatorError(const std::string & msg) throw ();
};
-
- /**
- * A VersionOperator can be written to an ostream.
- *
- * \ingroup grpversions
- */
- std::ostream & operator<< (std::ostream & s, const VersionOperator &) PALUDIS_VISIBLE;
}
#endif
diff --git a/paludis/version_requirements-fwd.hh b/paludis/version_requirements-fwd.hh
new file mode 100644
index 0000000..96654b3
--- /dev/null
+++ b/paludis/version_requirements-fwd.hh
@@ -0,0 +1,63 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+ *
+ * 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_VERSION_REQUIREMENTS_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_VERSION_REQUIREMENTS_FWD_HH 1
+
+#include <paludis/util/collection-fwd.hh>
+#include <paludis/util/attributes.hh>
+#include <iosfwd>
+
+namespace paludis
+{
+ class VersionRequirement;
+
+ /**
+ * A collection of VersionRequirement instances, usually for a
+ * PackageDepSpec.
+ *
+ * \see PackageDepSpec
+ * \ingroup grpversions
+ */
+ typedef SequentialCollection<VersionRequirement> VersionRequirements;
+
+ /**
+ * Whether our version requirements are an 'and' or an 'or' set.
+ *
+ * \see PackageDepSpec
+ * \ingroup grpversions
+ */
+ enum VersionRequirementsMode
+ {
+ vr_or, ///\< Must match one
+ vr_and, ///\< Must match all
+ last_vr
+ };
+
+ /**
+ * Write a VersionRequirementsMode to a stream.
+ *
+ * \ingroup grpversions
+ */
+ std::ostream &
+ operator<< (std::ostream &, const VersionRequirementsMode &) PALUDIS_VISIBLE;
+
+}
+
+#endif
diff --git a/paludis/version_requirements.hh b/paludis/version_requirements.hh
index 68d7371..96e2bcd 100644
--- a/paludis/version_requirements.hh
+++ b/paludis/version_requirements.hh
@@ -22,42 +22,13 @@
#include <paludis/util/collection.hh>
#include <paludis/util/sr.hh>
+#include <paludis/version_requirements-fwd.hh>
#include <paludis/version_operator.hh>
#include <paludis/version_spec.hh>
namespace paludis
{
#include <paludis/version_requirements-sr.hh>
-
- /**
- * A collection of VersionRequirement instances, usually for a
- * PackageDepSpec.
- *
- * \see PackageDepSpec
- * \ingroup grpversions
- */
- typedef SequentialCollection<VersionRequirement> VersionRequirements;
-
- /**
- * Whether our version requirements are an 'and' or an 'or' set.
- *
- * \see PackageDepSpec
- * \ingroup grpversions
- */
- enum VersionRequirementsMode
- {
- vr_or, ///\< Must match one
- vr_and, ///\< Must match all
- last_vr
- };
-
- /**
- * Write a VersionRequirementsMode to a stream.
- *
- * \ingroup grpversions
- */
- std::ostream &
- operator<< (std::ostream &, const VersionRequirementsMode &) PALUDIS_VISIBLE;
}
#endif
diff --git a/python/eapi.cc b/python/eapi.cc
index c224328..ccb0934 100644
--- a/python/eapi.cc
+++ b/python/eapi.cc
@@ -49,7 +49,8 @@ void PALUDIS_VISIBLE expose_eapi()
"[ro] bool"
);
- bp::class_<EAPI>
+ register_shared_ptrs_to_python<EAPI>();
+ bp::class_<EAPI, boost::noncopyable>
e("EAPI",
"Information about an EAPI.",
bp::no_init
diff --git a/ruby/dep_list.cc b/ruby/dep_list.cc
index 736d1e0..8e7da46 100644
--- a/ruby/dep_list.cc
+++ b/ruby/dep_list.cc
@@ -1041,24 +1041,6 @@ namespace
}
}
- /*
- * call-seq:
- * destinations -> Array
- *
- * Returns an array of our destinations.
- */
- VALUE
- dep_list_entry_destinations(VALUE self)
- {
- DepListEntry * p;
- Data_Get_Struct(self, DepListEntry, p);
- VALUE result = rb_ary_new();
- for (SortedCollection<DepListEntryDestination>::Iterator i(p->destinations->begin()),
- i_end(p->destinations->end()) ; i != i_end ; ++i)
- rb_ary_push(result, repository_to_value(i->destination));
- return result;
- }
-
VALUE
dep_list_override_masks_init(VALUE self)
{
@@ -1490,7 +1472,6 @@ namespace
#if CIARANM_REMOVED_THIS
rb_define_method(c_dep_list_entry, "tags", RUBY_FUNC_CAST(&dep_list_entry_tags), 0);
#endif
- rb_define_method(c_dep_list_entry, "destinations", RUBY_FUNC_CAST(&dep_list_entry_destinations), 0);
/*
* Document-class: DepListOverrideMasks
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index c268510..d7af867 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -20,6 +20,8 @@
#include <paludis_ruby.hh>
#include <paludis/dep_spec.hh>
+#include <paludis/version_requirements.hh>
+#include <paludis/version_operator.hh>
#include <ruby.h>
using namespace paludis;
diff --git a/ruby/eapi.cc b/ruby/eapi.cc
index 36d9c1f..ce0973e 100644
--- a/ruby/eapi.cc
+++ b/ruby/eapi.cc
@@ -42,18 +42,18 @@ namespace
VALUE
eapi_name(VALUE self)
{
- EAPI * p;
- Data_Get_Struct(self, EAPI, p);
- return rb_str_new2((p->name).c_str());
+ tr1::shared_ptr<const EAPI> * p;
+ Data_Get_Struct(self, tr1::shared_ptr<const EAPI>, p);
+ return rb_str_new2(((*p)->name).c_str());
}
VALUE
eapi_supported(VALUE self)
{
- EAPI * p;
- Data_Get_Struct(self, EAPI, p);
- if (p->supported)
- return supported_eapi_to_value((p->supported));
+ tr1::shared_ptr<const EAPI> * p;
+ Data_Get_Struct(self, tr1::shared_ptr<const EAPI>, p);
+ if ((*p)->supported)
+ return supported_eapi_to_value(((*p)->supported));
return Qnil;
}
/*
@@ -187,10 +187,10 @@ namespace
}
VALUE
-paludis::ruby::eapi_to_value(const EAPI & v)
+paludis::ruby::eapi_to_value(const tr1::shared_ptr<const EAPI> & v)
{
- EAPI * m_ptr = new EAPI(v);
- return Data_Wrap_Struct(c_eapi, 0, &Common<EAPI>::free, m_ptr);
+ tr1::shared_ptr<const EAPI> * m_ptr = new tr1::shared_ptr<const EAPI>(v);
+ return Data_Wrap_Struct(c_eapi, 0, &Common<tr1::shared_ptr<const EAPI> >::free, m_ptr);
}
RegisterRubyClass::Register paludis_ruby_register_eapi PALUDIS_ATTRIBUTE((used))
diff --git a/ruby/paludis_ruby.hh b/ruby/paludis_ruby.hh
index 65b1ac6..89ba2d2 100644
--- a/ruby/paludis_ruby.hh
+++ b/ruby/paludis_ruby.hh
@@ -76,7 +76,7 @@ namespace paludis
#endif
VALUE qualified_package_name_to_value(const QualifiedPackageName &);
VALUE contents_to_value(tr1::shared_ptr<const Contents>);
- VALUE eapi_to_value(const EAPI &);
+ VALUE eapi_to_value(const tr1::shared_ptr<const EAPI> &);
VersionSpec value_to_version_spec(VALUE v);
tr1::shared_ptr<const VersionMetadata> value_to_version_metadata(VALUE);
diff --git a/ruby/version_metadata.cc b/ruby/version_metadata.cc
index 58239a2..1ff2d2a 100644
--- a/ruby/version_metadata.cc
+++ b/ruby/version_metadata.cc
@@ -408,7 +408,7 @@ namespace
tr1::shared_ptr<const VersionMetadata> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<const VersionMetadata>, self_ptr);
if ((*self_ptr)->virtual_interface)
- return package_database_entry_to_value((*self_ptr)->virtual_interface->virtual_for);
+ return package_database_entry_to_value(*(*self_ptr)->virtual_interface->virtual_for);
else
return Qnil;
diff --git a/src/clients/adjutrix/find_insecure_packages.cc b/src/clients/adjutrix/find_insecure_packages.cc
index 077590b..ea77f28 100644
--- a/src/clients/adjutrix/find_insecure_packages.cc
+++ b/src/clients/adjutrix/find_insecure_packages.cc
@@ -23,6 +23,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/query.hh>
#include <paludis/dep_spec.hh>
+#include <paludis/dep_tag.hh>
#include <paludis/package_database.hh>
#include <paludis/util/visitor-impl.hh>
diff --git a/src/clients/contrarius/install.cc b/src/clients/contrarius/install.cc
index 8b834f5..e05fe39 100644
--- a/src/clients/contrarius/install.cc
+++ b/src/clients/contrarius/install.cc
@@ -331,7 +331,7 @@ do_install(tr1::shared_ptr<Environment> env, std::string spec_str)
std::string eapi_str(env->
package_database()->fetch_repository(
pp->repository)->version_metadata(
- pp->name, pp->version)->eapi.name);
+ pp->name, pp->version)->eapi->name);
cerr << " ( " << colour(cl_masked, eapi_str) << " )";
}
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index 3bf22fd..1ca271e 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -80,11 +80,11 @@ int do_best_version(tr1::shared_ptr<Environment> env)
Log::get_instance()->message(ll_qa, lc_context, "best-version of '" + query +
"' resolves to '" + stringify(*entries->last()) + "', which is a virtual for '"
- + stringify(metadata->virtual_interface->virtual_for) + "'. This will break with "
+ + stringify(*metadata->virtual_interface->virtual_for) + "'. This will break with "
"new style virtuals.");
tr1::shared_ptr<PackageDatabaseEntryCollection> new_entries(
new PackageDatabaseEntryCollection::Concrete);
- new_entries->push_back(metadata->virtual_interface->virtual_for);
+ new_entries->push_back(*metadata->virtual_interface->virtual_for);
entries = new_entries;
}
diff --git a/src/clients/paludis/install.cc b/src/clients/paludis/install.cc
index aa3653d..5e1eb14 100644
--- a/src/clients/paludis/install.cc
+++ b/src/clients/paludis/install.cc
@@ -645,7 +645,7 @@ do_install(tr1::shared_ptr<Environment> env)
{
std::string eapi_str(env->package_database()->fetch_repository(
pp->repository)->version_metadata(
- pp->name, pp->version)->eapi.name);
+ pp->name, pp->version)->eapi->name);
if (eapi_str == "UNKNOWN")
cerr << " ( " << colour(cl_masked, eapi_str) <<
diff --git a/src/clients/paludis/upgrade_TEST b/src/clients/paludis/upgrade_TEST
index 1d471d3..3de7ff8 100755
--- a/src/clients/paludis/upgrade_TEST
+++ b/src/clients/paludis/upgrade_TEST
@@ -1,17 +1,23 @@
#!/bin/bash
-PALUDIS_HOME=./upgrade_TEST_dir/config/ \
+PALUDIS_HOME=./upgrade_TEST_dir/config/ REPEAT= \
./paludis --config-suffix upgrade-test --install =test-category/target-1 || exit 1
./upgrade_TEST_dir/root/usr/bin/testbin | grep testbin-1 >/dev/null || exit 2
./upgrade_TEST_dir/root/usr/bin/testbin1 | grep testbin1 >/dev/null || exit 3
./upgrade_TEST_dir/root/usr/bin/testbin2 && exit 4
+PALUDIS_HOME=./upgrade_TEST_dir/config/ REPEAT=yes \
+ ./paludis --config-suffix upgrade-test --install =test-category/target-1 || exit 5
+
+./upgrade_TEST_dir/root/usr/bin/testbin | grep testbin-1 >/dev/null || exit 6
+./upgrade_TEST_dir/root/usr/bin/testbin1 | grep repeatbin1 >/dev/null || exit 7
+./upgrade_TEST_dir/root/usr/bin/testbin2 && exit 8
PALUDIS_HOME=./upgrade_TEST_dir/config/ \
- ./paludis --config-suffix upgrade-test --install target || exit 5
+ ./paludis --config-suffix upgrade-test --install target || exit 9
-./upgrade_TEST_dir/root/usr/bin/testbin | grep testbin-2 >/dev/null || exit 6
-./upgrade_TEST_dir/root/usr/bin/testbin1 2>/dev/null && exit 7
-./upgrade_TEST_dir/root/usr/bin/testbin2 | grep testbin2 >/dev/null || exit 8
+./upgrade_TEST_dir/root/usr/bin/testbin | grep testbin-2 >/dev/null || exit 10
+./upgrade_TEST_dir/root/usr/bin/testbin1 2>/dev/null && exit 11
+./upgrade_TEST_dir/root/usr/bin/testbin2 | grep testbin2 >/dev/null || exit 12
diff --git a/src/clients/paludis/upgrade_TEST_setup.sh b/src/clients/paludis/upgrade_TEST_setup.sh
index 069820c..b84768f 100755
--- a/src/clients/paludis/upgrade_TEST_setup.sh
+++ b/src/clients/paludis/upgrade_TEST_setup.sh
@@ -121,6 +121,12 @@ pkg_setup() {
local VAR3=yes
}
+src_compile() {
+ if [[ ${REPEAT} == yes ]] ; then
+ sed -i -e 's,testbin1,repeatbin1,' testbin1 || die
+ fi
+}
+
src_install() {
[[ "${VAR1}" == yes ]] || die
[[ "${VAR2}" == yes ]] || die
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index 6ee5648..c0c610f 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -215,8 +215,8 @@ ConsoleInstallTask::on_display_merge_list_entry(const DepListEntry & d)
} while (false);
tr1::shared_ptr<RepositoryName> repo;
- if (d.destinations && ! d.destinations->empty())
- repo.reset(new RepositoryName((d.destinations->begin()->destination)->name()));
+ if (d.destination)
+ repo.reset(new RepositoryName(d.destination->name()));
tr1::shared_ptr<PackageDatabaseEntryCollection> existing_repo(environment()->package_database()->
query(query::Matches(PackageDepSpec(
@@ -246,7 +246,7 @@ ConsoleInstallTask::on_display_merge_list_entry(const DepListEntry & d)
display_merge_list_entry_repository(d, m);
if (d.metadata->virtual_interface)
- display_merge_list_entry_for(d.metadata->virtual_interface->virtual_for, m);
+ display_merge_list_entry_for(*d.metadata->virtual_interface->virtual_for, m);
display_merge_list_entry_slot(d, m);
@@ -822,18 +822,16 @@ ConsoleInstallTask::display_merge_list_entry_status_and_update_counts(const DepL
break;
case normal_entry:
- output_no_endl(render_as_update_mode(" ["));
-
- for (SortedCollection<DepListEntryDestination>::Iterator dest(d.destinations->begin()),
- dest_end(d.destinations->end()) ; dest != dest_end ; ++dest)
{
+ output_no_endl(render_as_update_mode(" ["));
+
if (need_comma)
output_no_endl(render_as_update_mode(", "));
std::string destination_str;
tr1::shared_ptr<const DestinationsCollection> default_destinations(environment()->default_destinations());
- if (default_destinations->end() == default_destinations->find(dest->destination))
- destination_str = " ::" + stringify(dest->destination->name());
+ if (default_destinations->end() == default_destinations->find(d.destination))
+ destination_str = " ::" + stringify(d.destination->name());
if (existing_repo->empty())
{
@@ -868,9 +866,8 @@ ConsoleInstallTask::display_merge_list_entry_status_and_update_counts(const DepL
set_count<max_count>(count<max_count>() + 1);
}
- need_comma = true;
+ output_no_endl(render_as_update_mode("]"));
}
- output_no_endl(render_as_update_mode("]"));
break;
case error_entry:
@@ -1101,7 +1098,7 @@ ConsoleInstallTask::display_merge_list_entry_mask_reasons(const DepListEntry & e
if (mr_eapi == mm)
{
std::string eapi_str(environment()->package_database()->fetch_repository(
- e.package.repository)->version_metadata(e.package.name, e.package.version)->eapi.name);
+ e.package.repository)->version_metadata(e.package.name, e.package.version)->eapi->name);
if (eapi_str == "UNKNOWN")
output_no_endl(" ( " + render_as_masked(eapi_str) + " ) (probably a broken ebuild)");
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index 1768084..bc3a51c 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -241,7 +241,7 @@ ConsoleQueryTask::display_metadata(const PackageDepSpec &, const PackageDatabase
}
if (metadata->virtual_interface)
- display_metadata_pde("Virtual for", "VIRTUAL_FOR", metadata->virtual_interface->virtual_for);
+ display_metadata_pde("Virtual for", "VIRTUAL_FOR", *metadata->virtual_interface->virtual_for);
}
namespace
diff --git a/src/output/console_query_task.hh b/src/output/console_query_task.hh
index b4cef8c..db5f735 100644
--- a/src/output/console_query_task.hh
+++ b/src/output/console_query_task.hh
@@ -22,6 +22,7 @@
#include <paludis/environment.hh>
#include <paludis/dep_spec.hh>
+#include <paludis/package_database_entry.hh>
#include <src/output/console_task.hh>
namespace paludis