aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-04 15:29:48 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-11-04 15:29:48 +0000
commit6b8bbcfa904d3f5ddfa10d8f59d8099b0a428e77 (patch)
tree13b44874dbf8548d6084931c6a5874b0d9fde0f6
parenta3da76a7780eb98017b185127693962316fd12ac (diff)
downloadpaludis-6b8bbcfa904d3f5ddfa10d8f59d8099b0a428e77.tar.gz
paludis-6b8bbcfa904d3f5ddfa10d8f59d8099b0a428e77.tar.xz
Split up e_repository_TEST a bit
-rw-r--r--.gitignore4
-rw-r--r--paludis/repositories/e/Makefile.am64
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc908
-rw-r--r--paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc132
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_dependencies_rewriter_cleanup.sh9
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_dependencies_rewriter_setup.sh43
-rw-r--r--paludis/repositories/e/e_repository_TEST_exheres_0.cc692
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_exheres_0_cleanup.sh9
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_exheres_0_setup.sh1177
-rw-r--r--paludis/repositories/e/e_repository_TEST_kdebuild_1.cc290
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_kdebuild_1_cleanup.sh9
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_kdebuild_1_setup.sh1120
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh1301
-rw-r--r--paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc154
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_symlink_rewriting_cleanup.sh9
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_symlink_rewriting_setup.sh48
-rwxr-xr-xtest/run_test.sh6
17 files changed, 3764 insertions, 2211 deletions
diff --git a/.gitignore b/.gitignore
index 2d8c179..3395973 100644
--- a/.gitignore
+++ b/.gitignore
@@ -222,10 +222,14 @@ paludis-*.*.*.tar.bz2
/paludis/repositories/e/dep_spec_pretty_printer_TEST
/paludis/repositories/e/depend_rdepend_TEST
/paludis/repositories/e/e_repository_TEST
+/paludis/repositories/e/e_repository_TEST_dependencies_rewriter
/paludis/repositories/e/e_repository_TEST_ever
+/paludis/repositories/e/e_repository_TEST_exheres_0
/paludis/repositories/e/e_repository_TEST_exlibs
+/paludis/repositories/e/e_repository_TEST_kdebuild_1
/paludis/repositories/e/e_repository_TEST_phases
/paludis/repositories/e/e_repository_TEST_replacing
+/paludis/repositories/e/e_repository_TEST_symlink_rewriting
/paludis/repositories/e/e_repository_sets_TEST
/paludis/repositories/e/ebuild_flat_metadata_cache_TEST
/paludis/repositories/e/ebuild/utils/3/dohard
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index c67ef0d..80c6281 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -163,6 +163,17 @@ depend_rdepend_TEST_LDADD = \
depend_rdepend_TEST_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
+e_repository_TEST_dependencies_rewriter_SOURCES = e_repository_TEST_dependencies_rewriter.cc
+
+e_repository_TEST_dependencies_rewriter_LDADD = \
+ $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/paludis/util/test_extras.o \
+ $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/test/libtest.a \
+ $(DYNAMIC_LD_LIBS)
+
+e_repository_TEST_dependencies_rewriter_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
+
e_repository_TEST_ever_SOURCES = e_repository_TEST_ever.cc
e_repository_TEST_ever_LDADD = \
@@ -174,6 +185,28 @@ e_repository_TEST_ever_LDADD = \
e_repository_TEST_ever_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
+e_repository_TEST_exheres_0_SOURCES = e_repository_TEST_exheres_0.cc
+
+e_repository_TEST_exheres_0_LDADD = \
+ $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/paludis/util/test_extras.o \
+ $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/test/libtest.a \
+ $(DYNAMIC_LD_LIBS)
+
+e_repository_TEST_exheres_0_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
+
+e_repository_TEST_kdebuild_1_SOURCES = e_repository_TEST_kdebuild_1.cc
+
+e_repository_TEST_kdebuild_1_LDADD = \
+ $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/paludis/util/test_extras.o \
+ $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/test/libtest.a \
+ $(DYNAMIC_LD_LIBS)
+
+e_repository_TEST_kdebuild_1_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
+
e_repository_TEST_phases_SOURCES = e_repository_TEST_phases.cc
e_repository_TEST_phases_LDADD = \
@@ -207,6 +240,17 @@ e_repository_TEST_replacing_LDADD = \
e_repository_TEST_replacing_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
+e_repository_TEST_symlink_rewriting_SOURCES = e_repository_TEST_symlink_rewriting.cc
+
+e_repository_TEST_symlink_rewriting_LDADD = \
+ $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/paludis/util/test_extras.o \
+ $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/test/libtest.a \
+ $(DYNAMIC_LD_LIBS)
+
+e_repository_TEST_symlink_rewriting_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
+
vdb_repository_TEST_SOURCES = vdb_repository_TEST.cc
vdb_repository_TEST_LDADD = \
@@ -352,9 +396,18 @@ EXTRA_DIST = \
e_repository_TEST.cc \
e_repository_TEST_setup.sh \
e_repository_TEST_cleanup.sh \
+ e_repository_TEST_dependencies_rewriter.cc \
+ e_repository_TEST_dependencies_rewriter_setup.sh \
+ e_repository_TEST_dependencies_rewriter_cleanup.sh \
e_repository_TEST_ever.cc \
e_repository_TEST_ever_setup.sh \
e_repository_TEST_ever_cleanup.sh \
+ e_repository_TEST_exheres_0.cc \
+ e_repository_TEST_exheres_0_setup.sh \
+ e_repository_TEST_exheres_0_cleanup.sh \
+ e_repository_TEST_kdebuild_1.cc \
+ e_repository_TEST_kdebuild_1_setup.sh \
+ e_repository_TEST_kdebuild_1_cleanup.sh \
e_repository_TEST_phases.cc \
e_repository_TEST_phases_setup.sh \
e_repository_TEST_phases_cleanup.sh \
@@ -364,6 +417,9 @@ EXTRA_DIST = \
e_repository_TEST_replacing.cc \
e_repository_TEST_replacing_setup.sh \
e_repository_TEST_replacing_cleanup.sh \
+ e_repository_TEST_symlink_rewriting.cc \
+ e_repository_TEST_symlink_rewriting_setup.sh \
+ e_repository_TEST_symlink_rewriting_cleanup.sh \
e_repository_params-se.hh \
e_repository_params-se.cc \
e_repository_params.se \
@@ -408,10 +464,14 @@ BUILT_SOURCES = \
check_SCRIPTS = \
depend_rdepend_TEST_setup.sh depend_rdepend_TEST_cleanup.sh \
e_repository_TEST_setup.sh e_repository_TEST_cleanup.sh \
+ e_repository_TEST_dependencies_rewriter_setup.sh e_repository_TEST_dependencies_rewriter_cleanup.sh \
e_repository_TEST_ever_setup.sh e_repository_TEST_ever_cleanup.sh \
+ e_repository_TEST_exheres_0_setup.sh e_repository_TEST_exheres_0_cleanup.sh \
+ e_repository_TEST_kdebuild_1_setup.sh e_repository_TEST_kdebuild_1_cleanup.sh \
e_repository_TEST_phases_setup.sh e_repository_TEST_phases_cleanup.sh \
e_repository_TEST_exlibs_setup.sh e_repository_TEST_exlibs_cleanup.sh \
e_repository_TEST_replacing_setup.sh e_repository_TEST_replacing_cleanup.sh \
+ e_repository_TEST_symlink_rewriting_setup.sh e_repository_TEST_symlink_rewriting_cleanup.sh \
xml_things_TEST_setup.sh xml_things_TEST_cleanup.sh \
vdb_repository_TEST_setup.sh vdb_repository_TEST_cleanup.sh \
exndbam_repository_TEST_setup.sh exndbam_repository_TEST_cleanup.sh \
@@ -472,10 +532,14 @@ TESTS = \
dep_spec_pretty_printer_TEST \
depend_rdepend_TEST \
e_repository_TEST \
+ e_repository_TEST_dependencies_rewriter \
e_repository_TEST_ever \
+ e_repository_TEST_exheres_0 \
+ e_repository_TEST_kdebuild_1 \
e_repository_TEST_phases \
e_repository_TEST_exlibs \
e_repository_TEST_replacing \
+ e_repository_TEST_symlink_rewriting \
e_repository_sets_TEST \
ebuild_flat_metadata_cache_TEST \
exndbam_repository_TEST \
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index c5f613b..6d954d8 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1777,913 +1777,5 @@ namespace test_cases
}
}
} test_e_repository_install_eapi_3;
-
- struct ERepositoryInstallEAPIKdebuild1Test : TestCase
- {
- ERepositoryInstallEAPIKdebuild1Test() : TestCase("install_eapi_kdebuild_1") { }
-
- unsigned max_run_time() const
- {
- return 3000;
- }
-
- bool repeatable() const
- {
- return false;
- }
-
- void run()
- {
- TestEnvironment env;
- env.set_paludis_command("/bin/false");
- std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
- keys->insert("format", "ebuild");
- keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo13"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo13/profiles/profile"));
- keys->insert("layout", "traditional");
- keys->insert("eapi_when_unknown", "0");
- keys->insert("eapi_when_unspecified", "0");
- keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
- std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
- std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
-
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
- make_named_values<FakeInstalledRepositoryParams>(
- value_for<n::environment>(&env),
- value_for<n::name>(RepositoryName("installed")),
- value_for<n::suitable_destination>(true),
- value_for<n::supports_uninstall>(true)
- )));
- env.package_database()->add_repository(2, installed_repo);
-
- InstallAction action(make_named_values<InstallActionOptions>(
- value_for<n::destination>(installed_repo),
- value_for<n::make_output_manager>(&make_standard_output_manager),
- value_for<n::perform_uninstall>(&cannot_uninstall),
- value_for<n::replacing>(make_shared_ptr(new PackageIDSequence)),
- value_for<n::want_phase>(&want_all_phases)
- ));
-
- {
- TestMessageSuffix suffix("econf source kdebuild-1", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/econf-source-kdebuild-1",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("banned functions kdebuild-1", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/banned-functions-kdebuild-1",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("banned vars kdebuild-1", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/banned-vars-kdebuild-1",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "UNKNOWN");
- }
-
- {
- TestMessageSuffix suffix("dosym success kdebuild-1", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/dosym-success-kdebuild-1",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("dosym fail kdebuild-1", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/dosym-fail-kdebuild-1",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("doman kdebuild-1", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/doman-kdebuild-1",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("no src_prepare kdebuild-1", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/src_prepare-kdebuild-1",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("no src_configure kdebuild-1", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/src_configure-kdebuild-1",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
- id->perform_action(action);
- }
- }
- } test_e_repository_install_eapi_kdebuild_1;
-
- struct ERepositoryInfoEAPIKdebuild1Test : TestCase
- {
- ERepositoryInfoEAPIKdebuild1Test() : TestCase("info_eapi_kdebuild_1") { }
-
- unsigned max_run_time() const
- {
- return 3000;
- }
-
- bool repeatable() const
- {
- return false;
- }
-
- void run()
- {
- TestEnvironment env;
- env.set_paludis_command("/bin/false");
- std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
- keys->insert("format", "ebuild");
- keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo13"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo13/profiles/profile"));
- keys->insert("layout", "traditional");
- keys->insert("eapi_when_unknown", "0");
- keys->insert("eapi_when_unspecified", "0");
- keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
- std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
- std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
-
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
- make_named_values<FakeInstalledRepositoryParams>(
- value_for<n::environment>(&env),
- value_for<n::name>(RepositoryName("installed")),
- value_for<n::suitable_destination>(true),
- value_for<n::supports_uninstall>(true)
- )));
- env.package_database()->add_repository(2, installed_repo);
-
- InfoActionOptions options(make_named_values<InfoActionOptions>(
- value_for<n::make_output_manager>(&make_standard_output_manager)
- ));
- InfoAction action(options);
-
- {
- TestMessageSuffix suffix("info success kdebuild-1", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/info-success-kdebuild-1",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("info fail kdebuild-1", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/info-fail-kdebuild-1",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
- }
- } test_e_repository_info_eapi_kdebuild_1;
-
- struct ERepositoryInstallExheres0Test : TestCase
- {
- ERepositoryInstallExheres0Test() : TestCase("install_exheres_0") { }
-
- unsigned max_run_time() const
- {
- return 3000;
- }
-
- bool repeatable() const
- {
- return false;
- }
-
- void run()
- {
-#ifdef ENABLE_VIRTUALS_REPOSITORY
- ::setenv("PALUDIS_ENABLE_VIRTUALS_REPOSITORY", "yes", 1);
-#else
- ::setenv("PALUDIS_ENABLE_VIRTUALS_REPOSITORY", "", 1);
-#endif
- TestEnvironment env;
- env.set_paludis_command("/bin/false");
- std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
- keys->insert("format", "ebuild");
- keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo14"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo14/profiles/profile"));
- keys->insert("layout", "exheres");
- keys->insert("eapi_when_unknown", "exheres-0");
- keys->insert("eapi_when_unspecified", "exheres-0");
- keys->insert("profile_eapi", "exheres-0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
- std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
- std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
-
- std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
- make_named_values<FakeInstalledRepositoryParams>(
- value_for<n::environment>(&env),
- value_for<n::name>(RepositoryName("installed")),
- value_for<n::suitable_destination>(true),
- value_for<n::supports_uninstall>(true)
- )));
- installed_repo->add_version("cat", "pretend-installed", "0")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
- installed_repo->add_version("cat", "pretend-installed", "1")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
- env.package_database()->add_repository(2, installed_repo);
-
-#ifdef ENABLE_VIRTUALS_REPOSITORY
- std::tr1::shared_ptr<Map<std::string, std::string> > iv_keys(new Map<std::string, std::string>);
- iv_keys->insert("root", "/");
- iv_keys->insert("format", "installed_virtuals");
- env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
- std::tr1::bind(from_keys, iv_keys, std::tr1::placeholders::_1)));
- std::tr1::shared_ptr<Map<std::string, std::string> > v_keys(new Map<std::string, std::string>);
- v_keys->insert("format", "virtuals");
- env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
- std::tr1::bind(from_keys, v_keys, std::tr1::placeholders::_1)));
-#endif
-
- InstallAction action(make_named_values<InstallActionOptions>(
- value_for<n::destination>(installed_repo),
- value_for<n::make_output_manager>(&make_standard_output_manager),
- value_for<n::perform_uninstall>(&cannot_uninstall),
- value_for<n::replacing>(make_shared_ptr(new PackageIDSequence)),
- value_for<n::want_phase>(&want_all_phases)
- ));
-
- {
- TestMessageSuffix suffix("in-ebuild die", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/in-ebuild-die",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("in-subshell die", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/in-subshell-die",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("success", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/success",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("expatch success", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/expatch-success",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("expatch success-dir", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/expatch-success-dir",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("expatch die", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/expatch-die",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("expatch unrecognised", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/expatch-unrecognised",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("nonfatal expatch fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-expatch-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("nonfatal expatch die", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-expatch-die",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("unpack die", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/unpack-die",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("nonfatal unpack fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-unpack-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("nonfatal unpack die", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-unpack-die",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("econf fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/econf-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("nonfatal econf", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-econf",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("nonfatal econf die", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-econf-die",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("emake fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/emake-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("nonfatal emake", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-emake",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("nonfatal emake die", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-emake-die",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("einstall fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/einstall-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("nonfatal einstall", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-einstall",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("nonfatal einstall die", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-einstall-die",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("keepdir success", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/keepdir-success",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("keepdir fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/keepdir-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("nonfatal keepdir", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-keepdir",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("nonfatal keepdir die", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-keepdir-die",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("dobin success", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/dobin-success",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("dobin fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/dobin-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("nonfatal dobin success", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-dobin-success",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("nonfatal dobin fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-dobin-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("nonfatal dobin die", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-dobin-die",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("herebin success", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/herebin-success",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("herebin fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/herebin-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("hereconfd success", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/hereconfd-success",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("hereconfd fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/hereconfd-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("hereenvd success", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/hereenvd-success",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("hereenvd fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/hereenvd-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("hereinitd success", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/hereinitd-success",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("hereinitd fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/hereinitd-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("hereins success", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/hereins-success",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("hereins fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/hereins-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("heresbin success", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/heresbin-success",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("heresbin fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/heresbin-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("fperms success", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/fperms-success",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("fperms fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/fperms-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("nonfatal fperms success", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-fperms-success",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("nonfatal fperms fail", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-fperms-fail",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("nonfatal fperms die", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-fperms-die",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("best version", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/best-version-0",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("has version", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/has-version-0",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("match", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/match-0",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("econf phase", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/econf-phase-0",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("econf vars", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/econf-vars-0",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("expand vars", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/expand-vars-0",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("doman success", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/doman-success-0",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("doman nofatal", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/doman-nonfatal-0",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("doman failure", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/doman-failure-0",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("change globals", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/change-globals-0",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
-
- {
- TestMessageSuffix suffix("install", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/install-0",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- id->perform_action(action);
- }
-
- {
- TestMessageSuffix suffix("install s", true);
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/install-s-0",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
- TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
- }
- }
- } test_e_repository_install_exheres_0;
-
- struct ERepositoryDependenciesRewriterTest : TestCase
- {
- ERepositoryDependenciesRewriterTest() : TestCase("dependencies_rewriter") { }
-
- void run()
- {
- TestEnvironment env;
- env.set_paludis_command("/bin/false");
- std::tr1::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
- keys->insert("format", "ebuild");
- keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo17"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo17/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
- std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
- std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
-
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("category/package",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
-
- StringifyFormatter ff;
-
- erepository::DepSpecPrettyPrinter pd(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
- TEST_CHECK(id->build_dependencies_key());
- id->build_dependencies_key()->value()->root()->accept(pd);
- TEST_CHECK_STRINGIFY_EQUAL(pd, "( cat/pkg1 build: cat/pkg2 build+run: cat/pkg3 suggestion: post: )");
-
- erepository::DepSpecPrettyPrinter pr(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
- TEST_CHECK(id->run_dependencies_key());
- id->run_dependencies_key()->value()->root()->accept(pr);
- TEST_CHECK_STRINGIFY_EQUAL(pr, "( cat/pkg1 build: build+run: cat/pkg3 suggestion: post: )");
-
- erepository::DepSpecPrettyPrinter pp(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
- TEST_CHECK(id->post_dependencies_key());
- id->post_dependencies_key()->value()->root()->accept(pp);
- TEST_CHECK_STRINGIFY_EQUAL(pp, "( build: build+run: suggestion: cat/pkg4 post: cat/pkg5 )");
- }
- } test_e_repository_dependencies_rewriter;
-
- struct ERepositorySymlinkRewritingTest : TestCase
- {
- ERepositorySymlinkRewritingTest() : TestCase("symlink_rewriting") { }
-
- unsigned max_run_time() const
- {
- return 3000;
- }
-
- bool repeatable() const
- {
- return false;
- }
-
- void run()
- {
- TestEnvironment env;
- env.set_paludis_command("/bin/false");
-
- std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
- keys->insert("format", "ebuild");
- keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo20"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo20/profiles/profile"));
- keys->insert("layout", "traditional");
- keys->insert("eapi_when_unknown", "0");
- keys->insert("eapi_when_unspecified", "0");
- keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "symlinked_build"));
- keys->insert("root", stringify(FSEntry(stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "root")).realpath()));
- std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
- std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
- env.package_database()->add_repository(1, repo);
-
- keys.reset(new Map<std::string, std::string>);
- keys->insert("format", "vdb");
- keys->insert("names_cache", "/var/empty");
- keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "vdb"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry(stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "root")).realpath()));
- std::tr1::shared_ptr<Repository> installed_repo(VDBRepository::repository_factory_create(&env,
- std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
- env.package_database()->add_repository(1, installed_repo);
-
- InstallAction action(make_named_values<InstallActionOptions>(
- value_for<n::destination>(installed_repo),
- value_for<n::make_output_manager>(&make_standard_output_manager),
- value_for<n::perform_uninstall>(&cannot_uninstall),
- value_for<n::replacing>(make_shared_ptr(new PackageIDSequence)),
- value_for<n::want_phase>(&want_all_phases)
- ));
-
- const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
- PackageDepSpec(parse_user_package_dep_spec("cat/pkg",
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
- TEST_CHECK(id);
-
- id->perform_action(action);
- TEST_CHECK_EQUAL(FSEntry(stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "root/bar")).readlink(), "/foo");
- }
- } test_e_repository_symlink_rewriting;
}
diff --git a/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
new file mode 100644
index 0000000..3447cd5
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
@@ -0,0 +1,132 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * 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/repositories/e/e_repository.hh>
+#include <paludis/repositories/e/e_repository_exceptions.hh>
+#include <paludis/repositories/e/e_repository_id.hh>
+#include <paludis/repositories/e/vdb_repository.hh>
+#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
+#include <paludis/repositories/fake/fake_installed_repository.hh>
+#include <paludis/repositories/fake/fake_package_id.hh>
+#include <paludis/environments/test/test_environment.hh>
+#include <paludis/util/system.hh>
+#include <paludis/util/simple_visitor_cast.hh>
+#include <paludis/util/map.hh>
+#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_named_values.hh>
+#include <paludis/util/set.hh>
+#include <paludis/standard_output_manager.hh>
+#include <paludis/util/safe_ifstream.hh>
+#include <paludis/package_id.hh>
+#include <paludis/metadata_key.hh>
+#include <paludis/action.hh>
+#include <paludis/stringify_formatter.hh>
+#include <paludis/user_dep_spec.hh>
+#include <paludis/generator.hh>
+#include <paludis/filter.hh>
+#include <paludis/filtered_generator.hh>
+#include <paludis/selection.hh>
+#include <paludis/repository_factory.hh>
+#include <paludis/choice.hh>
+#include <test/test_framework.hh>
+#include <test/test_runner.hh>
+#include <tr1/functional>
+#include <set>
+#include <string>
+
+#include "config.h"
+
+using namespace test;
+using namespace paludis;
+
+namespace
+{
+ void cannot_uninstall(const std::tr1::shared_ptr<const PackageID> & id, const UninstallActionOptions &)
+ {
+ if (id)
+ throw InternalError(PALUDIS_HERE, "cannot uninstall");
+ }
+
+ std::tr1::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
+ {
+ return make_shared_ptr(new StandardOutputManager);
+ }
+
+ std::string from_keys(const std::tr1::shared_ptr<const Map<std::string, std::string> > & m,
+ const std::string & k)
+ {
+ Map<std::string, std::string>::ConstIterator mm(m->find(k));
+ if (m->end() == mm)
+ return "";
+ else
+ return mm->second;
+ }
+
+ WantPhase want_all_phases(const std::string &)
+ {
+ return wp_yes;
+ }
+}
+
+namespace test_cases
+{
+ struct ERepositoryDependenciesRewriterTest : TestCase
+ {
+ ERepositoryDependenciesRewriterTest() : TestCase("dependencies_rewriter") { }
+
+ void run()
+ {
+ TestEnvironment env;
+ env.set_paludis_command("/bin/false");
+ std::tr1::shared_ptr<Map<std::string, std::string> > keys(
+ new Map<std::string, std::string>);
+ keys->insert("format", "ebuild");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "repo"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "repo/profiles/profile"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "build"));
+ std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
+ std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
+ env.package_database()->add_repository(1, repo);
+
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("category/package",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+
+ StringifyFormatter ff;
+
+ erepository::DepSpecPrettyPrinter pd(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
+ TEST_CHECK(id->build_dependencies_key());
+ id->build_dependencies_key()->value()->root()->accept(pd);
+ TEST_CHECK_STRINGIFY_EQUAL(pd, "( cat/pkg1 build: cat/pkg2 build+run: cat/pkg3 suggestion: post: )");
+
+ erepository::DepSpecPrettyPrinter pr(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
+ TEST_CHECK(id->run_dependencies_key());
+ id->run_dependencies_key()->value()->root()->accept(pr);
+ TEST_CHECK_STRINGIFY_EQUAL(pr, "( cat/pkg1 build: build+run: cat/pkg3 suggestion: post: )");
+
+ erepository::DepSpecPrettyPrinter pp(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false, false);
+ TEST_CHECK(id->post_dependencies_key());
+ id->post_dependencies_key()->value()->root()->accept(pp);
+ TEST_CHECK_STRINGIFY_EQUAL(pp, "( build: build+run: suggestion: cat/pkg4 post: cat/pkg5 )");
+ }
+ } test_e_repository_dependencies_rewriter;
+}
+
diff --git a/paludis/repositories/e/e_repository_TEST_dependencies_rewriter_cleanup.sh b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter_cleanup.sh
new file mode 100755
index 0000000..713193b
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter_cleanup.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+if [ -d e_repository_TEST_dependencies_rewriter_dir ] ; then
+ rm -fr e_repository_TEST_dependencies_rewriter_dir
+else
+ true
+fi
+
diff --git a/paludis/repositories/e/e_repository_TEST_dependencies_rewriter_setup.sh b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter_setup.sh
new file mode 100755
index 0000000..c3431eb
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter_setup.sh
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+mkdir e_repository_TEST_dependencies_rewriter_dir || exit 1
+cd e_repository_TEST_dependencies_rewriter_dir || exit 1
+
+mkdir -p root/etc
+
+mkdir -p vdb
+touch vdb/THISISTHEVDB
+
+mkdir -p build
+ln -s build symlinked_build
+
+mkdir -p distdir
+echo "already fetched" > distdir/already-fetched.txt || exit 1
+cat <<END > distdir/expatch-success-1.patch || exit 1
+--- a/bar
++++ b/bar
+@@ -1 +1,3 @@
+ foo
++bar
++baz
+END
+
+mkdir -p repo/{eclass,distfiles,profiles/profile} || exit 1
+mkdir -p repo/category/package || exit 1
+cd repo || exit 1
+echo "test-repo" >> profiles/repo_name || exit 1
+echo "category" >> profiles/categories || exit 1
+cat <<END > profiles/profile/make.defaults
+ARCH=test
+END
+cat <<END > category/package/package-1.ebuild || exit 1
+EAPI="exheres-0"
+SLOT="0"
+PLATFORMS="test"
+DEPENDENCIES="cat/pkg1 build: cat/pkg2 build+run: cat/pkg3 suggestion: cat/pkg4 post: cat/pkg5"
+END
+cd ..
+
+cd ..
+
diff --git a/paludis/repositories/e/e_repository_TEST_exheres_0.cc b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
new file mode 100644
index 0000000..067e3b1
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
@@ -0,0 +1,692 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * 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/repositories/e/e_repository.hh>
+#include <paludis/repositories/e/e_repository_exceptions.hh>
+#include <paludis/repositories/e/e_repository_id.hh>
+#include <paludis/repositories/e/vdb_repository.hh>
+#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
+#include <paludis/repositories/fake/fake_installed_repository.hh>
+#include <paludis/repositories/fake/fake_package_id.hh>
+#include <paludis/environments/test/test_environment.hh>
+#include <paludis/util/system.hh>
+#include <paludis/util/simple_visitor_cast.hh>
+#include <paludis/util/map.hh>
+#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_named_values.hh>
+#include <paludis/util/set.hh>
+#include <paludis/standard_output_manager.hh>
+#include <paludis/util/safe_ifstream.hh>
+#include <paludis/package_id.hh>
+#include <paludis/metadata_key.hh>
+#include <paludis/action.hh>
+#include <paludis/stringify_formatter.hh>
+#include <paludis/user_dep_spec.hh>
+#include <paludis/generator.hh>
+#include <paludis/filter.hh>
+#include <paludis/filtered_generator.hh>
+#include <paludis/selection.hh>
+#include <paludis/repository_factory.hh>
+#include <paludis/choice.hh>
+#include <test/test_framework.hh>
+#include <test/test_runner.hh>
+#include <tr1/functional>
+#include <set>
+#include <string>
+
+#include "config.h"
+
+using namespace test;
+using namespace paludis;
+
+namespace
+{
+ void cannot_uninstall(const std::tr1::shared_ptr<const PackageID> & id, const UninstallActionOptions &)
+ {
+ if (id)
+ throw InternalError(PALUDIS_HERE, "cannot uninstall");
+ }
+
+ std::tr1::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
+ {
+ return make_shared_ptr(new StandardOutputManager);
+ }
+
+ std::string from_keys(const std::tr1::shared_ptr<const Map<std::string, std::string> > & m,
+ const std::string & k)
+ {
+ Map<std::string, std::string>::ConstIterator mm(m->find(k));
+ if (m->end() == mm)
+ return "";
+ else
+ return mm->second;
+ }
+
+ WantPhase want_all_phases(const std::string &)
+ {
+ return wp_yes;
+ }
+}
+
+namespace test_cases
+{
+ struct ERepositoryInstallExheres0Test : TestCase
+ {
+ ERepositoryInstallExheres0Test() : TestCase("install_exheres_0") { }
+
+ unsigned max_run_time() const
+ {
+ return 3000;
+ }
+
+ bool repeatable() const
+ {
+ return false;
+ }
+
+ void run()
+ {
+#ifdef ENABLE_VIRTUALS_REPOSITORY
+ ::setenv("PALUDIS_ENABLE_VIRTUALS_REPOSITORY", "yes", 1);
+#else
+ ::setenv("PALUDIS_ENABLE_VIRTUALS_REPOSITORY", "", 1);
+#endif
+ TestEnvironment env;
+ env.set_paludis_command("/bin/false");
+ std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ keys->insert("format", "ebuild");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_exheres_0_dir" / "repo"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_exheres_0_dir" / "repo/profiles/profile"));
+ keys->insert("layout", "exheres");
+ keys->insert("eapi_when_unknown", "exheres-0");
+ keys->insert("eapi_when_unspecified", "exheres-0");
+ keys->insert("profile_eapi", "exheres-0");
+ keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_exheres_0_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_exheres_0_dir" / "build"));
+ std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
+ std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
+ env.package_database()->add_repository(1, repo);
+
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
+ installed_repo->add_version("cat", "pretend-installed", "0")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
+ installed_repo->add_version("cat", "pretend-installed", "1")->provide_key()->set_from_string("virtual/virtual-pretend-installed");
+ env.package_database()->add_repository(2, installed_repo);
+
+#ifdef ENABLE_VIRTUALS_REPOSITORY
+ std::tr1::shared_ptr<Map<std::string, std::string> > iv_keys(new Map<std::string, std::string>);
+ iv_keys->insert("root", "/");
+ iv_keys->insert("format", "installed_virtuals");
+ env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
+ std::tr1::bind(from_keys, iv_keys, std::tr1::placeholders::_1)));
+ std::tr1::shared_ptr<Map<std::string, std::string> > v_keys(new Map<std::string, std::string>);
+ v_keys->insert("format", "virtuals");
+ env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
+ std::tr1::bind(from_keys, v_keys, std::tr1::placeholders::_1)));
+#endif
+
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::destination>(installed_repo),
+ value_for<n::make_output_manager>(&make_standard_output_manager),
+ value_for<n::perform_uninstall>(&cannot_uninstall),
+ value_for<n::replacing>(make_shared_ptr(new PackageIDSequence)),
+ value_for<n::want_phase>(&want_all_phases)
+ ));
+
+ {
+ TestMessageSuffix suffix("in-ebuild die", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/in-ebuild-die",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("in-subshell die", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/in-subshell-die",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("success", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/success",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("expatch success", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/expatch-success",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("expatch success-dir", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/expatch-success-dir",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("expatch die", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/expatch-die",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("expatch unrecognised", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/expatch-unrecognised",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal expatch fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-expatch-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal expatch die", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-expatch-die",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("unpack die", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/unpack-die",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal unpack fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-unpack-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal unpack die", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-unpack-die",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("econf fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/econf-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal econf", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-econf",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal econf die", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-econf-die",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("emake fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/emake-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal emake", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-emake",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal emake die", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-emake-die",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("einstall fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/einstall-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal einstall", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-einstall",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal einstall die", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-einstall-die",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("keepdir success", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/keepdir-success",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("keepdir fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/keepdir-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal keepdir", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-keepdir",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal keepdir die", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-keepdir-die",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("dobin success", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/dobin-success",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("dobin fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/dobin-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal dobin success", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-dobin-success",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal dobin fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-dobin-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal dobin die", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-dobin-die",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("herebin success", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/herebin-success",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("herebin fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/herebin-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("hereconfd success", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/hereconfd-success",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("hereconfd fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/hereconfd-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("hereenvd success", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/hereenvd-success",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("hereenvd fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/hereenvd-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("hereinitd success", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/hereinitd-success",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("hereinitd fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/hereinitd-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("hereins success", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/hereins-success",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("hereins fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/hereins-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("heresbin success", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/heresbin-success",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("heresbin fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/heresbin-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("fperms success", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/fperms-success",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("fperms fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/fperms-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal fperms success", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-fperms-success",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal fperms fail", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-fperms-fail",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("nonfatal fperms die", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-fperms-die",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("best version", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/best-version-0",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("has version", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/has-version-0",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("match", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/match-0",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("econf phase", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/econf-phase-0",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("econf vars", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/econf-vars-0",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("expand vars", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/expand-vars-0",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("doman success", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/doman-success-0",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("doman nofatal", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/doman-nonfatal-0",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("doman failure", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/doman-failure-0",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("change globals", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/change-globals-0",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("install", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/install-0",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("install s", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/install-s-0",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+ }
+ } test_e_repository_install_exheres_0;
+}
+
diff --git a/paludis/repositories/e/e_repository_TEST_exheres_0_cleanup.sh b/paludis/repositories/e/e_repository_TEST_exheres_0_cleanup.sh
new file mode 100755
index 0000000..dec6a8c
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_exheres_0_cleanup.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+if [ -d e_repository_TEST_exheres_0_dir ] ; then
+ rm -fr e_repository_TEST_exheres_0_dir
+else
+ true
+fi
+
diff --git a/paludis/repositories/e/e_repository_TEST_exheres_0_setup.sh b/paludis/repositories/e/e_repository_TEST_exheres_0_setup.sh
new file mode 100755
index 0000000..1bf64e6
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_exheres_0_setup.sh
@@ -0,0 +1,1177 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+mkdir e_repository_TEST_exheres_0_dir || exit 1
+cd e_repository_TEST_exheres_0_dir || exit 1
+
+mkdir -p root/etc
+
+mkdir -p vdb
+touch vdb/THISISTHEVDB
+
+mkdir -p build
+ln -s build symlinked_build
+
+mkdir -p distdir
+echo "already fetched" > distdir/already-fetched.txt || exit 1
+cat <<END > distdir/expatch-success-1.patch || exit 1
+--- a/bar
++++ b/bar
+@@ -1 +1,3 @@
+ foo
++bar
++baz
+END
+
+mkdir -p repo/{profiles/profile,metadata,eclass} || exit 1
+cd repo || exit 1
+echo "test-repo" >> profiles/repo_name || exit 1
+cat <<END > profiles/profile/virtuals
+virtual/virtual-pretend-installed cat/pretend-installed
+virtual/virtual-doesnotexist cat/doesnotexist
+END
+echo "cat" >> metadata/categories.conf || exit 1
+cat <<END > profiles/profile/make.defaults
+CHOST="i286-badger-linux-gnu"
+SUBOPTIONS="LINGUAS"
+LINGUAS="en en_GB en_GB@UTF-8"
+USERLAND="GNU"
+OPTIONS="weasel spinach"
+USE_EXPAND="USERLAND"
+END
+mkdir -p "packages/cat/in-ebuild-die"
+cat <<'END' > packages/cat/in-ebuild-die/in-ebuild-die-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS=""
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+pkg_setup() {
+ die "boom"
+}
+END
+mkdir -p "packages/cat/in-subshell-die"
+cat <<'END' > packages/cat/in-subshell-die/in-subshell-die-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS=""
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+pkg_setup() {
+ ( hasq test $PLATFORMS && die "boom" )
+}
+END
+mkdir -p "packages/cat/success"
+cat <<'END' > packages/cat/success/success-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+pkg_setup() {
+ optionq spork && die "boom"
+}
+END
+mkdir -p "packages/cat/expatch-success"
+cat <<'END' > packages/cat/expatch-success/expatch-success-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_unpack() {
+ echo foo > bar
+ echo -e 'foo\nbar\nbaz' > baz
+}
+
+src_prepare() {
+ expatch "${FETCHEDDIR}"/${PNV}.patch
+ diff bar baz || die "expatch failed"
+}
+END
+mkdir -p "packages/cat/expatch-success-dir/files/expatch-success-dir"
+cat <<END > packages/cat/expatch-success-dir/files/expatch-success-dir/foo.patch || exit 1
+--- a/bar
++++ b/bar
+@@ -1 +1,3 @@
+ foo
++bar
++baz
+END
+cat <<'END' > packages/cat/expatch-success-dir/expatch-success-dir-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_unpack() {
+ echo foo > bar
+ echo -e 'foo\nbar\nbaz' > baz
+}
+
+src_prepare() {
+ expatch "${FILES}"/${PN}/
+ diff bar baz || die "expatch failed"
+}
+END
+mkdir -p "packages/cat/expatch-die"
+cat <<'END' > packages/cat/expatch-die/expatch-die-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_prepare() {
+ expatch monkey.patch
+}
+END
+mkdir -p "packages/cat/expatch-unrecognised/files/expatch-unrecognised"
+cat <<END > packages/cat/expatch-unrecognised/files/expatch-unrecognised/foo || exit 1
+--- a/bar
++++ b/bar
+@@ -1 +1,3 @@
+ foo
++bar
++baz
+END
+cat <<'END' > packages/cat/expatch-unrecognised/expatch-unrecognised-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_unpack() {
+ echo foo > bar
+ echo foo > baz
+}
+
+src_prepare() {
+ expatch "${FILES}"/${PN}/
+ diff bar baz || die "expatch applied unrecognised patch"
+}
+END
+mkdir -p "packages/cat/nonfatal-expatch-fail"
+cat <<'END' > packages/cat/nonfatal-expatch-fail/nonfatal-expatch-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_prepare() {
+ nonfatal expatch monkey.patch
+}
+END
+mkdir -p "packages/cat/nonfatal-expatch-die"
+cat <<'END' > packages/cat/nonfatal-expatch-die/nonfatal-expatch-die-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_prepare() {
+ nonfatal expatch monkey.patch || die
+}
+END
+mkdir -p "packages/cat/unpack-die"
+cat <<'END' > packages/cat/unpack-die/unpack-die-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_unpack() {
+ echo "123" > f.bz2
+ unpack ./f.bz2
+}
+END
+mkdir -p "packages/cat/nonfatal-unpack-fail"
+cat <<'END' > packages/cat/nonfatal-unpack-fail/nonfatal-unpack-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_unpack() {
+ echo "123" > f.bz2
+ nonfatal unpack ./f.bz2
+}
+END
+mkdir -p "packages/cat/nonfatal-unpack-die"
+cat <<'END' > packages/cat/nonfatal-unpack-die/nonfatal-unpack-die-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_unpack() {
+ echo "123" > f.bz2
+ nonfatal unpack ./f.bz2 || die
+}
+END
+mkdir -p "packages/cat/econf-fail"
+cat <<'END' > packages/cat/econf-fail/econf-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_configure() {
+ econf
+}
+END
+mkdir -p "packages/cat/nonfatal-econf"
+cat <<'END' > packages/cat/nonfatal-econf/nonfatal-econf-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_configure() {
+ nonfatal econf
+}
+END
+mkdir -p "packages/cat/nonfatal-econf-die"
+cat <<'END' > packages/cat/nonfatal-econf-die/nonfatal-econf-die-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_configure() {
+ nonfatal econf || die
+}
+END
+mkdir -p "packages/cat/emake-fail"
+cat <<'END' > packages/cat/emake-fail/emake-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_compile() {
+ emake monkey
+}
+END
+mkdir -p "packages/cat/nonfatal-emake"
+cat <<'END' > packages/cat/nonfatal-emake/nonfatal-emake-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_compile() {
+ nonfatal emake monkey
+}
+END
+mkdir -p "packages/cat/nonfatal-emake-die"
+cat <<'END' > packages/cat/nonfatal-emake-die/nonfatal-emake-die-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_compile() {
+ nonfatal emake monkey || die
+}
+END
+mkdir -p "packages/cat/keepdir-success"
+cat <<'END' > packages/cat/keepdir-success/keepdir-success-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ keepdir /usr/share/monkey
+}
+END
+mkdir -p "packages/cat/keepdir-fail"
+cat <<'END' > packages/cat/keepdir-fail/keepdir-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ dodir /usr/share
+ touch "${IMAGE}"/usr/share/monkey
+ keepdir /usr/share/monkey
+}
+END
+mkdir -p "packages/cat/nonfatal-keepdir"
+cat <<'END' > packages/cat/nonfatal-keepdir/nonfatal-keepdir-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ dodir /usr/share
+ touch "${IMAGE}"/usr/share/monkey
+ nonfatal keepdir /usr/share/monkey
+}
+END
+mkdir -p "packages/cat/nonfatal-keepdir-die"
+cat <<'END' > packages/cat/nonfatal-keepdir-die/nonfatal-keepdir-die-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ dodir /usr/share
+ touch "${IMAGE}"/usr/share/monkey
+ nonfatal keepdir /usr/share/monkey || die
+}
+END
+mkdir -p "packages/cat/einstall-fail"
+cat <<'END' > packages/cat/einstall-fail/einstall-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ einstall
+}
+END
+mkdir -p "packages/cat/nonfatal-einstall"
+cat <<'END' > packages/cat/nonfatal-einstall/nonfatal-einstall-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ nonfatal einstall
+}
+END
+mkdir -p "packages/cat/nonfatal-einstall-die"
+cat <<'END' > packages/cat/nonfatal-einstall-die/nonfatal-einstall-die-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ nonfatal einstall || die
+}
+END
+mkdir -p "packages/cat/dobin-success"
+cat <<'END' > packages/cat/dobin-success/dobin-success-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_compile() {
+ touch foo
+}
+
+src_install() {
+ dobin foo
+}
+END
+mkdir -p "packages/cat/dobin-fail"
+cat <<'END' > packages/cat/dobin-fail/dobin-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ dobin monkey
+}
+END
+mkdir -p "packages/cat/nonfatal-dobin-success"
+cat <<'END' > packages/cat/nonfatal-dobin-success/nonfatal-dobin-success-1.ebuild || exit 1
+DESCRIPTION="The Lnog Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_compile() {
+ touch foo
+}
+
+src_install() {
+ nonfatal dobin foo || die
+}
+END
+mkdir -p "packages/cat/nonfatal-dobin-fail"
+cat <<'END' > packages/cat/nonfatal-dobin-fail/nonfatal-dobin-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ nonfatal dobin monkey
+}
+END
+mkdir -p "packages/cat/nonfatal-dobin-die"
+cat <<'END' > packages/cat/nonfatal-dobin-die/nonfatal-dobin-die-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ nonfatal dobin monkey || die
+}
+END
+mkdir -p "packages/cat/herebin-success"
+cat <<'END' > packages/cat/herebin-success/herebin-success-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ herebin foo <<EOF
+blah
+EOF
+}
+END
+mkdir -p "packages/cat/herebin-fail"
+cat <<'END' > packages/cat/herebin-fail/herebin-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ herebin <<EOF
+blah
+EOF
+}
+END
+mkdir -p "packages/cat/hereconfd-success"
+cat <<'END' > packages/cat/hereconfd-success/hereconfd-success-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ hereconfd foo <<EOF
+blah
+EOF
+}
+END
+mkdir -p "packages/cat/hereconfd-fail"
+cat <<'END' > packages/cat/hereconfd-fail/hereconfd-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ hereconfd <<EOF
+blah
+EOF
+}
+END
+mkdir -p "packages/cat/hereenvd-success"
+cat <<'END' > packages/cat/hereenvd-success/hereenvd-success-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ hereenvd foo <<EOF
+blah
+EOF
+}
+END
+mkdir -p "packages/cat/hereenvd-fail"
+cat <<'END' > packages/cat/hereenvd-fail/hereenvd-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ hereenvd <<EOF
+blah
+EOF
+}
+END
+mkdir -p "packages/cat/hereinitd-success"
+cat <<'END' > packages/cat/hereinitd-success/hereinitd-success-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ hereinitd foo <<EOF
+blah
+EOF
+}
+END
+mkdir -p "packages/cat/hereinitd-fail"
+cat <<'END' > packages/cat/hereinitd-fail/hereinitd-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ hereinitd <<EOF
+blah
+EOF
+}
+END
+mkdir -p "packages/cat/hereins-success"
+cat <<'END' > packages/cat/hereins-success/hereins-success-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ hereins foo <<EOF
+blah
+EOF
+}
+END
+mkdir -p "packages/cat/hereins-fail"
+cat <<'END' > packages/cat/hereins-fail/hereins-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ hereins <<EOF
+blah
+EOF
+}
+END
+mkdir -p "packages/cat/heresbin-success"
+cat <<'END' > packages/cat/heresbin-success/heresbin-success-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ heresbin foo <<EOF
+blah
+EOF
+}
+END
+mkdir -p "packages/cat/heresbin-fail"
+cat <<'END' > packages/cat/heresbin-fail/heresbin-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ heresbin <<EOF
+blah
+EOF
+}
+END
+mkdir -p "packages/cat/fperms-success"
+cat <<'END' > packages/cat/fperms-success/fperms-success-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_compile() {
+ touch foo
+}
+
+src_install() {
+ fperms 755 foo
+}
+END
+mkdir -p "packages/cat/fperms-fail"
+cat <<'END' > packages/cat/fperms-fail/fperms-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ fperms 755 monkey
+}
+END
+mkdir -p "packages/cat/nonfatal-fperms-success"
+cat <<'END' > packages/cat/nonfatal-fperms-success/nonfatal-fperms-success-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_compile() {
+ touch foo
+}
+
+src_install() {
+ nonfatal fperms 755 foo || die
+}
+END
+mkdir -p "packages/cat/nonfatal-fperms-fail"
+cat <<'END' > packages/cat/nonfatal-fperms-fail/nonfatal-fperms-fail-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ nonfatal fperms 755 monkey
+}
+END
+mkdir -p "packages/cat/nonfatal-fperms-die"
+cat <<'END' > packages/cat/nonfatal-fperms-die/nonfatal-fperms-die-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ nonfatal fperms 755 monkey || die
+}
+END
+mkdir -p "packages/cat/best-version"
+cat <<'END' > packages/cat/best-version/best-version-0.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+pkg_setup() {
+ if ! best_version cat/pretend-installed >/dev/null ; then
+ die "failed cat/pretend-installed"
+ fi
+
+ BV1=$(best_version cat/pretend-installed )
+ [[ "$BV1" == "cat/pretend-installed-1:0::installed" ]] || die "BV1 is $BV1"
+
+ if best_version cat/doesnotexist >/dev/null ; then
+ die "not failed cat/doesnotexist"
+ fi
+
+ BV2=$(best_version cat/doesnotexist )
+ [[ "$BV2" == "" ]] || die "BV2 is $BV2"
+
+ if [[ -n "$PALUDIS_ENABLE_VIRTUALS_REPOSITORY" ]] ; then
+ if ! best_version virtual/virtual-pretend-installed >/dev/null ; then
+ die "failed virtual/virtual-pretend-installed"
+ fi
+
+ BV3=$(best_version virtual/virtual-pretend-installed )
+ [[ "$BV3" == "virtual/virtual-pretend-installed-1::installed-virtuals (virtual for cat/pretend-installed-1:0::installed)" ]] \
+ || die "BV3 is $BV3"
+
+ if best_version virtual/virtual-doesnotexist >/dev/null ; then
+ die "not failed virtual/virtual-doesnotexist"
+ fi
+
+ BV2=$(best_version virtual/virtual-doesnotexist )
+ [[ "$BV4" == "" ]] || die "BV4 is $BV4"
+ fi
+}
+END
+mkdir -p "packages/cat/has-version"
+cat <<'END' > packages/cat/has-version/has-version-0.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+pkg_setup() {
+ if ! has_version cat/pretend-installed ; then
+ die "failed cat/pretend-installed"
+ fi
+
+ if has_version cat/doesnotexist >/dev/null ; then
+ die "not failed cat/doesnotexist"
+ fi
+}
+END
+mkdir -p "packages/cat/match"
+cat <<'END' > packages/cat/match/match-0.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+pkg_setup() {
+ portageq match "${ROOT}" cat/foo | while read a ; do
+ einfo moo
+ done
+}
+END
+mkdir -p "packages/cat/econf-phase"
+cat <<'END' > packages/cat/econf-phase/econf-phase-0.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_unpack() {
+ mkdir ${WORK}
+ echo "#!/bin/bash" > ${WORK}/configure
+ chmod +x ${WORK}/configure
+}
+
+src_compile() {
+ econf
+}
+END
+mkdir -p "packages/cat/econf-vars"
+cat <<'END' > packages/cat/econf-vars/econf-vars-0.ebuild || exit 1
+DESCRIPTION="The Long Description"
+DESCRIPTION="The Short Description"
+
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="enabled-hamster gerbil dormouse"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+DEFAULT_SRC_CONFIGURE_PARAMS=( --nice-juicy-steak )
+DEFAULT_SRC_CONFIGURE_OPTION_ENABLES=( enabled-hamster gerbil )
+DEFAULT_SRC_CONFIGURE_OPTION_WITHS=( dormouse )
+
+src_unpack() {
+ mkdir ${WORK}
+ cat <<'END2' > ${WORK}/configure
+#!/usr/bin/env bash
+echo "${@}" | grep -q -- '--enable-enabled-hamster' || exit 1
+echo "${@}" | grep -q -- '--disable-gerbil' || exit 2
+echo "${@}" | grep -q -- '--nice-juicy-steak' || exit 3
+echo "${@}" | grep -q -- '--without-dormouse' || exit 4
+true
+END2
+ chmod +x ${WORK}/configure
+}
+END
+mkdir -p "packages/cat/expand-vars"
+cat <<"END" > packages/cat/expand-vars/expand-vars-0.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="enabled-weasel broccoli linguas: enabled-en_GB"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+pkg_setup() {
+ [[ ${OPTIONS%%+( )} == "enabled-weasel linguas:enabled-en_GB" ]] || die "OPTIONS=$OPTIONS is wrong"
+ [[ ${LINGUAS%%+( )} == "enabled-en_GB" ]] || die "LINGUAS=$LINGUAS is wrong"
+}
+END
+mkdir -p "packages/cat/doman-success"
+cat <<'END' > packages/cat/doman-success/doman-success-0.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_compile() {
+ echo ${PNVR} >foo.1
+ mkdir dir
+ echo ${PNVR} >dir/foo.2
+ echo ${PNVR} >foo.3x
+ echo ${PNVR} >foo.4.gz
+ echo ${PNVR} >foo.5f.bz2
+ echo ${PNVR} >foo.6.Z
+ echo ${PNVR} >foo.en.7
+ echo ${PNVR} >foo.en_GB.8
+ echo ${PNVR} >foo.e.9
+ echo ${PNVR} >foo.enn.n
+ echo ${PNVR} >foo.EN.1
+ echo ${PNVR} >foo.en-GB.2
+ echo ${PNVR} >foo.en_gb.3
+ echo ${PNVR} >foo.en_G.4
+ echo ${PNVR} >foo.en_GBB.5
+ echo ${PNVR} >foo.nonkey
+ touch foo.1x
+ echo ${PNVR} >baz.6
+ echo ${PNVR} >baz.en_US.7
+}
+
+src_install() {
+ doman foo.* dir/foo.* || die
+ doman -i18n=en_GB baz.* || die
+ keepdir /meh || die
+ cd "${IMAGE}"/meh || die
+ doman .keep* || die
+ rm "${IMAGE}"/usr/share/man/{man1/foo.1,man2/foo.2,man3/foo.3x,man4/foo.4.gz,man5/foo.5f.bz2} || die
+ rm "${IMAGE}"/usr/share/man/{man6/foo.6.Z,en/man7/foo.7,en_GB/man8/foo.8,man9/foo.e.9,mann/foo.enn.n} || die
+ rm "${IMAGE}"/usr/share/man/{man1/foo.EN.1,man2/foo.en-GB.2,man3/foo.en_gb.3,man4/foo.en_G.4} || die
+ rm "${IMAGE}"/usr/share/man/{man5/foo.en_GBB.5,mann/foo.nonkey,en_GB/man6/baz.6,en_US/man7/baz.7} || die
+ rmdir "${IMAGE}"/usr/share/man/{man1,man2,man3,man4,man5,man6,man9,mann,en/man7,en_GB/man6,en_GB/man8,en_US/man7,en,en_GB,en_US,} || die
+}
+END
+mkdir -p "packages/cat/doman-failure"
+cat <<'END' > packages/cat/doman-failure/doman-failure-0.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_compile() {
+ echo ${PNVR} >bar.m
+}
+
+src_install() {
+ doman bar.m
+}
+END
+mkdir -p "packages/cat/change-globals"
+cat <<'END' > packages/cat/change-globals/change-globals-0.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_compile() {
+ DEFAULT_SRC_COMPILE_PARAMS="foo"
+ default
+}
+END
+mkdir -p "packages/cat/install"
+cat <<'END' > packages/cat/install/install-0.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_unpack() {
+ touch -- -s
+}
+
+src_install() {
+ install -v -- -s dest
+ [[ -x dest ]] || die "install didn't work"
+}
+END
+mkdir -p "packages/cat/install-s"
+cat <<'END' > packages/cat/install-s/install-s-0.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_unpack() {
+ touch src
+}
+
+src_install() {
+ install -s src dest
+ [[ -x dest ]] && die "install didn't fail"
+}
+END
+mkdir -p "packages/cat/doman-nonfatal"
+cat <<'END' > packages/cat/doman-nonfatal/doman-nonfatal-0.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_install() {
+ nonfatal doman bar.1 && die
+}
+END
+cd ..
+
+cd ..
diff --git a/paludis/repositories/e/e_repository_TEST_kdebuild_1.cc b/paludis/repositories/e/e_repository_TEST_kdebuild_1.cc
new file mode 100644
index 0000000..536fba7
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_kdebuild_1.cc
@@ -0,0 +1,290 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * 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/repositories/e/e_repository.hh>
+#include <paludis/repositories/e/e_repository_exceptions.hh>
+#include <paludis/repositories/e/e_repository_id.hh>
+#include <paludis/repositories/e/vdb_repository.hh>
+#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
+#include <paludis/repositories/fake/fake_installed_repository.hh>
+#include <paludis/repositories/fake/fake_package_id.hh>
+#include <paludis/environments/test/test_environment.hh>
+#include <paludis/util/system.hh>
+#include <paludis/util/simple_visitor_cast.hh>
+#include <paludis/util/map.hh>
+#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_named_values.hh>
+#include <paludis/util/set.hh>
+#include <paludis/standard_output_manager.hh>
+#include <paludis/util/safe_ifstream.hh>
+#include <paludis/package_id.hh>
+#include <paludis/metadata_key.hh>
+#include <paludis/action.hh>
+#include <paludis/stringify_formatter.hh>
+#include <paludis/user_dep_spec.hh>
+#include <paludis/generator.hh>
+#include <paludis/filter.hh>
+#include <paludis/filtered_generator.hh>
+#include <paludis/selection.hh>
+#include <paludis/repository_factory.hh>
+#include <paludis/choice.hh>
+#include <test/test_framework.hh>
+#include <test/test_runner.hh>
+#include <tr1/functional>
+#include <set>
+#include <string>
+
+#include "config.h"
+
+using namespace test;
+using namespace paludis;
+
+namespace
+{
+ void cannot_uninstall(const std::tr1::shared_ptr<const PackageID> & id, const UninstallActionOptions &)
+ {
+ if (id)
+ throw InternalError(PALUDIS_HERE, "cannot uninstall");
+ }
+
+ std::tr1::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
+ {
+ return make_shared_ptr(new StandardOutputManager);
+ }
+
+ std::string from_keys(const std::tr1::shared_ptr<const Map<std::string, std::string> > & m,
+ const std::string & k)
+ {
+ Map<std::string, std::string>::ConstIterator mm(m->find(k));
+ if (m->end() == mm)
+ return "";
+ else
+ return mm->second;
+ }
+
+ WantPhase want_all_phases(const std::string &)
+ {
+ return wp_yes;
+ }
+}
+
+namespace test_cases
+{
+ struct ERepositoryInstallEAPIKdebuild1Test : TestCase
+ {
+ ERepositoryInstallEAPIKdebuild1Test() : TestCase("install_eapi_kdebuild_1") { }
+
+ unsigned max_run_time() const
+ {
+ return 3000;
+ }
+
+ bool repeatable() const
+ {
+ return false;
+ }
+
+ void run()
+ {
+ TestEnvironment env;
+ env.set_paludis_command("/bin/false");
+ std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ keys->insert("format", "ebuild");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_kdebuild_1_dir" / "repo"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_kdebuild_1_dir" / "repo/profiles/profile"));
+ keys->insert("layout", "traditional");
+ keys->insert("eapi_when_unknown", "0");
+ keys->insert("eapi_when_unspecified", "0");
+ keys->insert("profile_eapi", "0");
+ keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_kdebuild_1_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_kdebuild_1_dir" / "build"));
+ std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
+ std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
+ env.package_database()->add_repository(1, repo);
+
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
+ env.package_database()->add_repository(2, installed_repo);
+
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::destination>(installed_repo),
+ value_for<n::make_output_manager>(&make_standard_output_manager),
+ value_for<n::perform_uninstall>(&cannot_uninstall),
+ value_for<n::replacing>(make_shared_ptr(new PackageIDSequence)),
+ value_for<n::want_phase>(&want_all_phases)
+ ));
+
+ {
+ TestMessageSuffix suffix("econf source kdebuild-1", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/econf-source-kdebuild-1",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("banned functions kdebuild-1", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/banned-functions-kdebuild-1",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("banned vars kdebuild-1", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/banned-vars-kdebuild-1",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "UNKNOWN");
+ }
+
+ {
+ TestMessageSuffix suffix("dosym success kdebuild-1", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/dosym-success-kdebuild-1",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("dosym fail kdebuild-1", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/dosym-fail-kdebuild-1",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+
+ {
+ TestMessageSuffix suffix("doman kdebuild-1", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/doman-kdebuild-1",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("no src_prepare kdebuild-1", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/src_prepare-kdebuild-1",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("no src_configure kdebuild-1", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/src_configure-kdebuild-1",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ id->perform_action(action);
+ }
+ }
+ } test_e_repository_install_eapi_kdebuild_1;
+
+ struct ERepositoryInfoEAPIKdebuild1Test : TestCase
+ {
+ ERepositoryInfoEAPIKdebuild1Test() : TestCase("info_eapi_kdebuild_1") { }
+
+ unsigned max_run_time() const
+ {
+ return 3000;
+ }
+
+ bool repeatable() const
+ {
+ return false;
+ }
+
+ void run()
+ {
+ TestEnvironment env;
+ env.set_paludis_command("/bin/false");
+ std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ keys->insert("format", "ebuild");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_kdebuild_1_dir" / "repo"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_kdebuild_1_dir" / "repo/profiles/profile"));
+ keys->insert("layout", "traditional");
+ keys->insert("eapi_when_unknown", "0");
+ keys->insert("eapi_when_unspecified", "0");
+ keys->insert("profile_eapi", "0");
+ keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_kdebuild_1_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_kdebuild_1_dir" / "build"));
+ std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
+ std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
+ env.package_database()->add_repository(1, repo);
+
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
+ env.package_database()->add_repository(2, installed_repo);
+
+ InfoActionOptions options(make_named_values<InfoActionOptions>(
+ value_for<n::make_output_manager>(&make_standard_output_manager)
+ ));
+ InfoAction action(options);
+
+ {
+ TestMessageSuffix suffix("info success kdebuild-1", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/info-success-kdebuild-1",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("info fail kdebuild-1", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/info-fail-kdebuild-1",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ TEST_CHECK_THROWS(id->perform_action(action), ActionFailedError);
+ }
+ }
+ } test_e_repository_info_eapi_kdebuild_1;
+}
+
diff --git a/paludis/repositories/e/e_repository_TEST_kdebuild_1_cleanup.sh b/paludis/repositories/e/e_repository_TEST_kdebuild_1_cleanup.sh
new file mode 100755
index 0000000..1d5d96d
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_kdebuild_1_cleanup.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+if [ -d e_repository_TEST_kdebuild_1_dir ] ; then
+ rm -fr e_repository_TEST_kdebuild_1_dir
+else
+ true
+fi
+
diff --git a/paludis/repositories/e/e_repository_TEST_kdebuild_1_setup.sh b/paludis/repositories/e/e_repository_TEST_kdebuild_1_setup.sh
new file mode 100755
index 0000000..15adb97
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_kdebuild_1_setup.sh
@@ -0,0 +1,1120 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+mkdir e_repository_TEST_kdebuild_1_dir || exit 1
+cd e_repository_TEST_kdebuild_1_dir || exit 1
+
+mkdir -p root/etc
+
+mkdir -p vdb
+touch vdb/THISISTHEVDB
+
+mkdir -p build
+ln -s build symlinked_build
+
+mkdir -p distdir
+echo "already fetched" > distdir/already-fetched.txt || exit 1
+cat <<END > distdir/expatch-success-1.patch || exit 1
+--- a/bar
++++ b/bar
+@@ -1 +1,3 @@
+ foo
++bar
++baz
+END
+
+mkdir -p repo/{profiles/profile,metadata,eclass} || exit 1
+cd repo || exit 1
+echo "test-repo" >> profiles/repo_name || exit 1
+echo "cat" >> profiles/categories || exit 1
+cat <<END > profiles/profile/virtuals
+virtual/virtual-pretend-installed cat/pretend-installed
+virtual/virtual-doesnotexist cat/doesnotexist
+END
+cat <<END > profiles/profile/make.defaults
+ARCH="cheese"
+USERLAND="GNU"
+KERNEL="linux"
+LIBC="glibc"
+CHOST="i286-badger-linux-gnu"
+LINGUAS="enabled_en enabled_en_GB enabled_en_GB@UTF-8"
+USE_EXPAND="LINGUAS USERLAND"
+USE_EXPAND_UNPREFIXED="ARCH"
+USE_EXPAND_IMPLICIT="USERLAND ARCH"
+USE_EXPAND_VALUES_USERLAND="GNU"
+USE_EXPAND_VALUES_ARCH="cheese otherarch"
+IUSE_IMPLICIT="build"
+END
+mkdir -p "cat/in-ebuild-die"
+cat <<END > cat/in-ebuild-die/in-ebuild-die-1.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+pkg_setup() {
+ die "boom"
+}
+END
+mkdir -p "cat/in-subshell-die"
+cat <<'END' > cat/in-subshell-die/in-subshell-die-1.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+pkg_setup() {
+ ( hasq test $KEYWORDS && die "boom" )
+}
+END
+mkdir -p "cat/success"
+cat <<END > cat/success/success-1.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+pkg_setup() {
+ useq spork && die "boom"
+}
+END
+mkdir -p "cat/unpack-die"
+cat <<END > cat/unpack-die/unpack-die-1.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_unpack() {
+ echo "123" > f.bz2
+ unpack ./f.bz2
+}
+END
+mkdir -p "cat/econf-die"
+cat <<END > cat/econf-die/econf-die-1.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_compile() {
+ econf
+}
+END
+mkdir -p "cat/emake-fail"
+cat <<END > cat/emake-fail/emake-fail-1.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_compile() {
+ emake monkey
+}
+END
+mkdir -p "cat/emake-die"
+cat <<END > cat/emake-die/emake-die-1.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_compile() {
+ emake monkey || die
+}
+END
+mkdir -p "cat/einstall-die"
+cat <<END > cat/einstall-die/einstall-die-1.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_install() {
+ einstall
+}
+END
+mkdir -p "cat/keepdir-die"
+cat <<"END" > cat/keepdir-die/keepdir-die-1.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_install() {
+ dodir /usr/share
+ touch "${D}"/usr/share/monkey
+ keepdir /usr/share/monkey
+}
+END
+mkdir -p "cat/dobin-fail"
+cat <<END > cat/dobin-fail/dobin-fail-1.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_install() {
+ dobin monkey
+}
+END
+mkdir -p "cat/dobin-die"
+cat <<END > cat/dobin-die/dobin-die-1.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_install() {
+ dobin monkey || die
+}
+END
+mkdir -p "cat/fperms-fail"
+cat <<END > cat/fperms-fail/fperms-fail-1.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_install() {
+ fperms 755 monkey
+}
+END
+mkdir -p "cat/fperms-die"
+cat <<END > cat/fperms-die/fperms-die-1.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_install() {
+ fperms 755 monkey || die
+}
+END
+mkdir -p "cat/pretend-installed"
+cat <<END > cat/pretend-installed/pretend-installed-2.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_compile() {
+ die "not supposed to install this"
+}
+END
+mkdir -p "cat/econf-source"
+cat <<END > cat/econf-source/econf-source-0.ebuild || exit 1
+EAPI="\${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_unpack() {
+ ECONF_SOURCE=subdir
+ mkdir \${S}
+ cd \${S}
+ mkdir subdir
+ echo 'touch monkey' > subdir/configure
+ chmod +x subdir/configure
+}
+
+src_install() {
+ insinto /usr/bin
+ doins monkey || die "no monkey"
+}
+END
+cp cat/econf-source/econf-source-{0,1}.ebuild || exit 1
+cp cat/econf-source/econf-source-{0,2}.ebuild || exit 1
+mkdir -p "cat/doman"
+cat <<END > cat/doman/doman-0.ebuild || exit 1
+EAPI="\${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_compile() {
+ echo \${PF} >foo.1
+ mkdir dir
+ echo \${PF} >dir/foo.2
+ echo \${PF} >foo.2
+ echo \${PF} >foo.3x
+ echo \${PF} >foo.4.gz
+ echo \${PF} >foo.5f.bz2
+ echo \${PF} >foo.6.Z
+ echo \${PF} >foo.en.7
+ echo \${PF} >foo.en_GB.8
+ echo \${PF} >foo.e.9
+ echo \${PF} >foo.enn.n
+ echo \${PF} >foo.EN.1
+ echo \${PF} >foo.en-GB.2
+ echo \${PF} >foo.en_gb.3
+ echo \${PF} >foo.en_G.4
+ echo \${PF} >foo.en_GBB.5
+ echo \${PF} >foo.nonkey
+ touch foo.1x
+ echo \${PF} >bar.m
+ echo \${PF} >bar.monkey
+ echo \${PF} >baz.6
+ echo \${PF} >baz.en_US.7
+}
+
+src_install() {
+ doman foo.* dir/foo.* || die
+ doman bar.m && die
+ doman bar.monkey && die
+ doman bar.1 && die
+ doman -i18n=en_GB baz.* || die
+ keepdir /meh || die
+ cd "\${D}"/meh || die
+ doman .keep* || die
+ rm "\${D}"/usr/share/man/{man1/foo.1,man2/foo.2,man3/foo.3x,man4/foo.4.gz,man5/foo.5f.bz2} || die
+ rm "\${D}"/usr/share/man/{man6/foo.6.Z,man7/foo.en.7,man8/foo.en_GB.8,man9/foo.e.9,mann/foo.enn.n} || die
+ rm "\${D}"/usr/share/man/{man1/foo.EN.1,man2/foo.en-GB.2,man3/foo.en_gb.3,man4/foo.en_G.4} || die
+ rm "\${D}"/usr/share/man/{man5/foo.en_GBB.5,mann/foo.nonkey,en_GB/man6/baz.6,en_GB/man7/baz.en_US.7} || die
+ rmdir "\${D}"/usr/share/man/{man1,man2,man3,man4,man5,man6,man7,man8,man9,mann,en_GB/man6,en_GB/man7,en_GB,} || die
+}
+END
+cp cat/doman/doman-{0,1}.ebuild || exit 1
+cat <<END > cat/doman/doman-2.ebuild || exit 1
+EAPI="\${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_compile() {
+ echo \${PF} >foo.1
+ mkdir dir
+ echo \${PF} >dir/foo.2
+ echo \${PF} >foo.3x
+ echo \${PF} >foo.4.gz
+ echo \${PF} >foo.5f.bz2
+ echo \${PF} >foo.6.Z
+ echo \${PF} >foo.en.7
+ echo \${PF} >foo.en_GB.8
+ echo \${PF} >foo.e.9
+ echo \${PF} >foo.enn.n
+ echo \${PF} >foo.EN.1
+ echo \${PF} >foo.en-GB.2
+ echo \${PF} >foo.en_gb.3
+ echo \${PF} >foo.en_G.4
+ echo \${PF} >foo.en_GBB.5
+ echo \${PF} >foo.nonkey
+ touch foo.1x
+ echo \${PF} >bar.m
+ echo \${PF} >bar.monkey
+ echo \${PF} >baz.6
+ echo \${PF} >baz.en_US.7
+}
+
+src_install() {
+ doman foo.* dir/foo.* || die
+ doman bar.m && die
+ doman bar.monkey && die
+ doman bar.1 && die
+ doman -i18n=en_GB baz.* || die
+ keepdir /meh || die
+ cd "\${D}"/meh || die
+ doman .keep* || die
+ rm "\${D}"/usr/share/man/{man1/foo.1,man2/foo.2,man3/foo.3x,man4/foo.4.gz,man5/foo.5f.bz2} || die
+ rm "\${D}"/usr/share/man/{man6/foo.6.Z,en/man7/foo.7,en_GB/man8/foo.8,man9/foo.e.9,mann/foo.enn.n} || die
+ rm "\${D}"/usr/share/man/{man1/foo.EN.1,man2/foo.en-GB.2,man3/foo.en_gb.3,man4/foo.en_G.4} || die
+ rm "\${D}"/usr/share/man/{man5/foo.en_GBB.5,mann/foo.nonkey,en_GB/man6/baz.6,en_US/man7/baz.7} || die
+ rmdir "\${D}"/usr/share/man/{man1,man2,man3,man4,man5,man6,man9,mann,en/man7,en_GB/man6,en_GB/man8,en_US/man7,en,en_GB,en_US,} || die
+}
+END
+mkdir -p "cat/dosym-success"
+cat <<'END' > cat/dosym-success/dosym-success-1.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_install() {
+ dosym foo /usr/bin/bar
+ [[ "$(readlink ${D}/usr/bin/bar )" == "foo" ]] || die
+}
+END
+mkdir -p "cat/best-version"
+cat <<'END' > cat/best-version/best-version-0.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+pkg_setup() {
+ if ! best_version cat/pretend-installed >/dev/null ; then
+ die "failed cat/pretend-installed"
+ fi
+
+ BV1=$(best_version cat/pretend-installed )
+ [[ "$BV1" == "cat/pretend-installed-1" ]] || die "BV1 is $BV1"
+
+ if best_version cat/doesnotexist >/dev/null ; then
+ die "not failed cat/doesnotexist"
+ fi
+
+ BV2=$(best_version cat/doesnotexist )
+ [[ "$BV2" == "" ]] || die "BV2 is $BV2"
+
+ if [[ -n "$PALUDIS_ENABLE_VIRTUALS_REPOSITORY" ]] ; then
+ if ! best_version virtual/virtual-pretend-installed >/dev/null ; then
+ die "failed virtual/virtual-pretend-installed"
+ fi
+
+ BV3=$(best_version virtual/virtual-pretend-installed )
+ [[ "$BV3" == "cat/pretend-installed-1" ]] || die "BV3 is $BV3"
+
+ if best_version virtual/virtual-doesnotexist >/dev/null ; then
+ die "not failed virtual/virtual-doesnotexist"
+ fi
+
+ BV2=$(best_version virtual/virtual-doesnotexist )
+ [[ "$BV4" == "" ]] || die "BV4 is $BV4"
+ fi
+}
+END
+mkdir -p "cat/has-version"
+cat <<'END' > cat/has-version/has-version-0.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+pkg_setup() {
+ if ! has_version cat/pretend-installed ; then
+ die "failed cat/pretend-installed"
+ fi
+
+ if has_version cat/doesnotexist >/dev/null ; then
+ die "not failed cat/doesnotexist"
+ fi
+}
+END
+mkdir -p "cat/match"
+cat <<'END' > cat/match/match-0.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+pkg_setup() {
+ if ! portageq match "${ROOT}" cat/pretend-installed >/dev/null ; then
+ die "failed cat/pretend-installed"
+ fi
+
+ cat <<'DONE' > ${T}/expected
+cat/pretend-installed-0
+cat/pretend-installed-1
+DONE
+ portageq match "${ROOT}" cat/pretend-installed > ${T}/got
+ cmp ${T}/expected ${T}/got || die "oops"
+
+ if portageq match "${ROOT}" cat/doesnotexist >/dev/null ; then
+ die "not failed cat/doesnotexist"
+ fi
+
+ BV2=$(portageq match "${ROOT}" cat/doesnotexist )
+ [[ "$BV2" == "" ]] || die "BV2 is $BV2"
+}
+END
+mkdir -p "cat/vars"
+cat <<'END' > cat/vars/vars-0.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+pkg_setup() {
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+src_compile() {
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+pkg_preinst() {
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+END
+mkdir -p "cat/src_prepare"
+cat <<END > cat/src_prepare/src_prepare-0.ebuild || exit 1
+EAPI="\${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_prepare() {
+ die src_prepare
+}
+END
+cp cat/src_prepare/src_prepare-{0,1}.ebuild || exit 1
+cp cat/src_prepare/src_prepare-{0,2}.ebuild || exit 1
+mkdir -p "cat/src_configure"
+cat <<END > cat/src_configure/src_configure-0.ebuild || exit 1
+EAPI="\${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_configure() {
+ die src_configure
+}
+END
+cp cat/src_configure/src_configure-{0,1}.ebuild || exit 1
+cp cat/src_configure/src_configure-{0,2}.ebuild || exit 1
+mkdir -p "cat/default-src_configure" || exit 1
+cat << END > cat/default-src_configure/default-src_configure-2.ebuild || exit 1
+EAPI="\${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_unpack() {
+ cat <<EOF >configure
+#! /bin/sh
+touch foo
+EOF
+ chmod +x configure
+ echo 'all: ; rm foo' >Makefile
+}
+
+src_compile() {
+ [[ -e foo ]] || die
+}
+END
+mkdir -p "cat/default-src_compile" || exit 1
+cat << END > cat/default-src_compile/default-src_compile-2.ebuild || exit 1
+EAPI="\${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_unpack() {
+ cat <<EOF >configure
+#! /bin/sh
+rm Makefile
+EOF
+ chmod +x configure
+ echo 'all: ; touch foo' >Makefile
+}
+
+src_configure() {
+ :
+}
+
+src_install() {
+ [[ -e foo ]] || die
+}
+END
+mkdir -p "cat/default_src_compile" || exit 1
+cat << END > cat/default_src_compile/default_src_compile-2.ebuild || exit 1
+EAPI="\${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_unpack() {
+ cat <<EOF >configure
+#! /bin/sh
+rm Makefile
+EOF
+ chmod +x configure
+ echo 'all: ; touch foo' >Makefile
+}
+
+src_configure() {
+ :
+}
+
+src_compile() {
+ default_src_compile
+ [[ -e foo ]] || die
+}
+END
+mkdir -p "cat/src_compile-via-default-func" || exit 1
+cat << END > cat/src_compile-via-default-func/src_compile-via-default-func-2.ebuild || exit 1
+EAPI="\${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_unpack() {
+ cat <<EOF >configure
+#! /bin/sh
+rm Makefile
+EOF
+ chmod +x configure
+ echo 'all: ; touch foo' >Makefile
+}
+
+src_configure() {
+ :
+}
+
+src_compile() {
+ default
+ [[ -e foo ]] || die
+}
+END
+mkdir -p "cat/econf-source-kdebuild"
+cat <<END > cat/econf-source-kdebuild/econf-source-kdebuild-1.kdebuild-1 || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_unpack() {
+ ECONF_SOURCE=subdir
+ mkdir \${S}
+ cd \${S}
+ mkdir subdir
+ echo 'touch monkey' > subdir/configure
+ chmod +x subdir/configure
+}
+
+src_install() {
+ insinto /usr/bin
+ doins monkey || die "no monkey"
+}
+END
+mkdir -p "cat/info-success-kdebuild"
+cat <<END > cat/info-success-kdebuild/info-success-kdebuild-1.kdebuild-1 || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+pkg_info() {
+ einfo "This is my pkg_info. There are many like it, but this one is mine."
+}
+END
+mkdir -p "cat/info-fail-kdebuild"
+cat <<END > cat/info-fail-kdebuild/info-fail-kdebuild-1.kdebuild-1 || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+pkg_info() {
+ die "This is my pkg_info. There are many like it, but this one is mine."
+}
+END
+mkdir -p "cat/banned-functions-kdebuild"
+cat <<END > cat/banned-functions-kdebuild/banned-functions-kdebuild-1.kdebuild-1 || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+pkg_setup() {
+ prepall
+}
+END
+mkdir -p "cat/banned-vars-kdebuild"
+cat <<END > cat/banned-vars-kdebuild/banned-vars-kdebuild-1.kdebuild-1 || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+PROVIDE="virtual/monkey"
+END
+mkdir -p "cat/dosym-success-kdebuild"
+cat <<'END' > cat/dosym-success-kdebuild/dosym-success-kdebuild-1.kdebuild-1 || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_install() {
+ dodir /usr/bin
+ dosym foo /usr/bin/bar
+ [[ "$(readlink ${D}/usr/bin/bar )" == "foo" ]] || die
+}
+END
+mkdir -p "cat/dosym-fail-kdebuild"
+cat <<END > cat/dosym-fail-kdebuild/dosym-fail-kdebuild-1.kdebuild-1 || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_install() {
+ dosym foo /usr/bin/bar
+}
+END
+mkdir -p "cat/doman-kdebuild"
+sed -e /EAPI=/d cat/doman/doman-0.ebuild >cat/doman-kdebuild/doman-kdebuild-1.kdebuild-1 || exit 1
+mkdir -p "cat/src_prepare-kdebuild"
+sed -e /EAPI=/d cat/src_prepare/src_prepare-0.ebuild >cat/src_prepare-kdebuild/src_prepare-kdebuild-1.kdebuild-1 || exit 1
+mkdir -p "cat/src_configure-kdebuild"
+sed -e /EAPI=/d cat/src_configure/src_configure-0.ebuild >cat/src_configure-kdebuild/src_configure-kdebuild-1.kdebuild-1 || exit 1
+mkdir -p "cat/expand-vars"
+cat <<"END" > cat/expand-vars/expand-vars-0.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="enabled-weasel broccoli"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+pkg_setup() {
+ [[ $USE == "enabled-weasel linguas_enabled_en linguas_enabled_en_GB linguas_enabled_en_GB@UTF-8 userland_GNU cheese " ]] \
+ || die "USE=$USE is wrong"
+ [[ $USERLAND == "GNU" ]] || die "USERLAND=$USERLAND is wrong"
+ [[ $LINGUAS == "enabled_en enabled_en_GB enabled_en_GB@UTF-8" ]] || die "LINGUAS=$LINGUAS is wrong"
+}
+END
+mkdir -p "cat/pkg_pretend"
+cat <<"END" > cat/pkg_pretend/pkg_pretend-3.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="enabled-weasel broccoli"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+pkg_pretend() {
+ einfo "This is my pkg_pretend. There are many like it, but this one is mine."
+}
+END
+mkdir -p "cat/pkg_pretend-failure"
+cat <<"END" > cat/pkg_pretend-failure/pkg_pretend-failure-3.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="enabled-weasel broccoli"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+pkg_pretend() {
+ die "This is my pkg_pretend. There are many like it, but this one is mine."
+}
+END
+mkdir -p "cat/default_src_install" || exit 1
+cat << 'END' > cat/default_src_install/default_src_install-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ mkdir -p ${WORKDIR}
+ cat <<'EOF' >${WORKDIR}/Makefile
+all :
+ echo spork > README
+ echo monkey > README.txt
+ touch README.foo
+ echo gerbil > GERBIL
+
+install :
+ echo spork > $(DESTDIR)/EATME
+EOF
+}
+
+pkg_preinst() {
+ [[ -e ${D}/usr/share/doc/${PF}/README ]] || die README
+ [[ -e ${D}/usr/share/doc/${PF}/README.txt ]] || die README.txt
+ [[ -e ${D}/usr/share/doc/${PF}/README.foo ]] && die README.foo
+ [[ -e ${D}/usr/share/doc/${PF}/GERBIL ]] && die GERBIL
+ [[ -e ${D}/EATME ]] || die EATME
+}
+END
+mkdir -p "cat/docompress" || exit 1
+cat << 'END' > cat/docompress/docompress-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+src_install() {
+ docompress foo || die
+ docompress bar || die
+}
+END
+mkdir -p "cat/dodoc-r" || exit 1
+cat << 'END' > cat/dodoc-r/dodoc-r-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ mkdir -p ${WORKDIR}
+ cd "${WORKDIR}"
+
+ mkdir one two three
+ echo foo > one/first
+ echo foo > two/second
+ echo foo > four
+ mkdir dot
+ mkdir dot/five
+ echo foo > dot/five/fifth
+}
+
+src_install() {
+ dodoc -r one two three four
+ cd dot
+ dodoc -r .
+}
+
+pkg_preinst() {
+ [[ -e ${D}/usr/share/doc/${PF}/one/first ]] || die one/first
+ [[ -e ${D}/usr/share/doc/${PF}/two/second ]] || die two/second
+ [[ -e ${D}/usr/share/doc/${PF}/four ]] || die four
+ [[ -e ${D}/usr/share/doc/${PF}/five/fifth ]] || die five/fifth
+}
+END
+mkdir -p "cat/doins-symlink" || exit 1
+cat << 'END' > cat/doins-symlink/doins-symlink-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ mkdir -p ${WORKDIR}
+ cd "${WORKDIR}"
+
+ mkdir a
+ cd a
+ echo qwerty > qwerty
+ ln -s qwerty uiop
+ ln -s qwerty adfs
+
+ cd ..
+
+ mkdir b
+ cd b
+ echo foo > foo
+ ln -s foo bar
+
+}
+
+src_install() {
+ insinto /foo
+ doins a/qwerty
+ doins a/uiop
+ newins a/adfs asdf
+ cd b
+ doins -r .
+}
+
+pkg_preinst() {
+ [[ -f ${D}/foo/qwerty ]] || die qwerty
+ [[ -L ${D}/foo/uiop ]] || die uiop
+ [[ $(readlink ${D}/foo/uiop ) == qwerty ]] || die sym
+ [[ -L ${D}/foo/asdf ]] || die asdf
+ [[ $(readlink ${D}/foo/asdf ) == qwerty ]] || die sym
+ [[ -f ${D}/foo/foo ]] || die foo
+ [[ -L ${D}/foo/bar ]] || die bar
+ [[ $(readlink ${D}/foo/bar ) == foo ]] || die sym
+}
+END
+mkdir -p "cat/banned-functions"
+cat <<END > cat/banned-functions/banned-functions-3.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="\${WORKDIR}"
+
+src_install() {
+ touch foo
+ dohard foo bar
+}
+END
+mkdir -p "cat/econf-disable-dependency-tracking" || exit 1
+cat << 'END' > cat/econf-disable-dependency-tracking/econf-disable-dependency-tracking-0.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="0"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ mkdir -p ${WORKDIR}
+ cd "${WORKDIR}"
+
+ cat <<'EOF' > configure
+#!/bin/sh
+
+if echo "$@" | grep -q 'disable-dependency-tracking' ; then
+ exit 1
+fi
+
+exit 0
+EOF
+
+ chmod +x configure
+}
+END
+cat << 'END' > cat/econf-disable-dependency-tracking/econf-disable-dependency-tracking-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ mkdir -p ${WORKDIR}
+ cd "${WORKDIR}"
+
+ cat <<'EOF' > configure
+#!/bin/sh
+
+if ! echo "$@" | grep -q 'disable-dependency-tracking' ; then
+ exit 1
+fi
+
+exit 0
+EOF
+
+ chmod +x configure
+}
+END
+mkdir -p "cat/strict-use" || exit 1
+cat << 'END' > cat/strict-use/strict-use-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork enabled"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+ use enabled || die "enabled not enabled"
+ use spork && die "sporks are bad"
+}
+END
+mkdir -p "cat/strict-use-fail" || exit 1
+cat << 'END' > cat/strict-use-fail/strict-use-fail-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork enabled"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+ use pony
+}
+END
+mkdir -p "cat/strict-use-injection" || exit 1
+cat << 'END' > cat/strict-use-injection/strict-use-injection-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork enabled"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+ use build && die "build set"
+ use userland_GNU || die "userland_GNU not set"
+ use cheese || die "cheese not set"
+ use otherarch && die "otherarch set"
+}
+END
+mkdir -p "cat/global-scope-use" || exit 1
+cat << 'END' > cat/global-scope-use/global-scope-use-3.ebuild || exit 1
+use spork
+
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork enabled"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+END
+cd ..
+
+cd ..
+
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index 0d9ae53..600ae5f 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -1088,119 +1088,6 @@ src_compile() {
[[ -e foo ]] || die
}
END
-mkdir -p "cat/econf-source-kdebuild"
-cat <<END > cat/econf-source-kdebuild/econf-source-kdebuild-1.kdebuild-1 || exit 1
-DESCRIPTION="The Description"
-HOMEPAGE="http://example.com/"
-SRC_URI=""
-SLOT="0"
-IUSE="spork"
-LICENSE="GPL-2"
-KEYWORDS="test"
-
-src_unpack() {
- ECONF_SOURCE=subdir
- mkdir \${S}
- cd \${S}
- mkdir subdir
- echo 'touch monkey' > subdir/configure
- chmod +x subdir/configure
-}
-
-src_install() {
- insinto /usr/bin
- doins monkey || die "no monkey"
-}
-END
-mkdir -p "cat/info-success-kdebuild"
-cat <<END > cat/info-success-kdebuild/info-success-kdebuild-1.kdebuild-1 || exit 1
-DESCRIPTION="The Description"
-HOMEPAGE="http://example.com/"
-SRC_URI=""
-SLOT="0"
-IUSE="spork"
-LICENSE="GPL-2"
-KEYWORDS="test"
-
-pkg_info() {
- einfo "This is my pkg_info. There are many like it, but this one is mine."
-}
-END
-mkdir -p "cat/info-fail-kdebuild"
-cat <<END > cat/info-fail-kdebuild/info-fail-kdebuild-1.kdebuild-1 || exit 1
-DESCRIPTION="The Description"
-HOMEPAGE="http://example.com/"
-SRC_URI=""
-SLOT="0"
-IUSE="spork"
-LICENSE="GPL-2"
-KEYWORDS="test"
-
-pkg_info() {
- die "This is my pkg_info. There are many like it, but this one is mine."
-}
-END
-mkdir -p "cat/banned-functions-kdebuild"
-cat <<END > cat/banned-functions-kdebuild/banned-functions-kdebuild-1.kdebuild-1 || exit 1
-DESCRIPTION="The Description"
-HOMEPAGE="http://example.com/"
-SRC_URI=""
-SLOT="0"
-IUSE="spork"
-LICENSE="GPL-2"
-KEYWORDS="test"
-
-pkg_setup() {
- prepall
-}
-END
-mkdir -p "cat/banned-vars-kdebuild"
-cat <<END > cat/banned-vars-kdebuild/banned-vars-kdebuild-1.kdebuild-1 || exit 1
-DESCRIPTION="The Description"
-HOMEPAGE="http://example.com/"
-SRC_URI=""
-SLOT="0"
-IUSE="spork"
-LICENSE="GPL-2"
-KEYWORDS="test"
-PROVIDE="virtual/monkey"
-END
-mkdir -p "cat/dosym-success-kdebuild"
-cat <<'END' > cat/dosym-success-kdebuild/dosym-success-kdebuild-1.kdebuild-1 || exit 1
-DESCRIPTION="The Description"
-HOMEPAGE="http://example.com/"
-SRC_URI=""
-SLOT="0"
-IUSE="spork"
-LICENSE="GPL-2"
-KEYWORDS="test"
-
-src_install() {
- dodir /usr/bin
- dosym foo /usr/bin/bar
- [[ "$(readlink ${D}/usr/bin/bar )" == "foo" ]] || die
-}
-END
-mkdir -p "cat/dosym-fail-kdebuild"
-cat <<END > cat/dosym-fail-kdebuild/dosym-fail-kdebuild-1.kdebuild-1 || exit 1
-DESCRIPTION="The Description"
-HOMEPAGE="http://example.com/"
-SRC_URI=""
-SLOT="0"
-IUSE="spork"
-LICENSE="GPL-2"
-KEYWORDS="test"
-
-src_install() {
- dosym foo /usr/bin/bar
-}
-END
-mkdir -p "cat/doman-kdebuild"
-sed -e /EAPI=/d cat/doman/doman-0.ebuild >cat/doman-kdebuild/doman-kdebuild-1.kdebuild-1 || exit 1
-mkdir -p "cat/src_prepare-kdebuild"
-sed -e /EAPI=/d cat/src_prepare/src_prepare-0.ebuild >cat/src_prepare-kdebuild/src_prepare-kdebuild-1.kdebuild-1 || exit 1
-mkdir -p "cat/src_configure-kdebuild"
-sed -e /EAPI=/d cat/src_configure/src_configure-0.ebuild >cat/src_configure-kdebuild/src_configure-kdebuild-1.kdebuild-1 || exit 1
mkdir -p "cat/expand-vars"
cat <<"END" > cat/expand-vars/expand-vars-0.ebuild || exit 1
DESCRIPTION="The Description"
@@ -1551,1157 +1438,6 @@ S="${WORKDIR}"
END
cd ..
-mkdir -p repo14/{profiles/profile,metadata,eclass} || exit 1
-cd repo14 || exit 1
-echo "test-repo-14" >> profiles/repo_name || exit 1
-cat <<END > profiles/profile/virtuals
-virtual/virtual-pretend-installed cat/pretend-installed
-virtual/virtual-doesnotexist cat/doesnotexist
-END
-echo "cat" >> metadata/categories.conf || exit 1
-cat <<END > profiles/profile/make.defaults
-CHOST="i286-badger-linux-gnu"
-SUBOPTIONS="LINGUAS"
-LINGUAS="en en_GB en_GB@UTF-8"
-USERLAND="GNU"
-OPTIONS="weasel spinach"
-USE_EXPAND="USERLAND"
-END
-mkdir -p "packages/cat/in-ebuild-die"
-cat <<'END' > packages/cat/in-ebuild-die/in-ebuild-die-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS=""
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-pkg_setup() {
- die "boom"
-}
-END
-mkdir -p "packages/cat/in-subshell-die"
-cat <<'END' > packages/cat/in-subshell-die/in-subshell-die-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS=""
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-pkg_setup() {
- ( hasq test $PLATFORMS && die "boom" )
-}
-END
-mkdir -p "packages/cat/success"
-cat <<'END' > packages/cat/success/success-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-pkg_setup() {
- optionq spork && die "boom"
-}
-END
-mkdir -p "packages/cat/expatch-success"
-cat <<'END' > packages/cat/expatch-success/expatch-success-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_unpack() {
- echo foo > bar
- echo -e 'foo\nbar\nbaz' > baz
-}
-
-src_prepare() {
- expatch "${FETCHEDDIR}"/${PNV}.patch
- diff bar baz || die "expatch failed"
-}
-END
-mkdir -p "packages/cat/expatch-success-dir/files/expatch-success-dir"
-cat <<END > packages/cat/expatch-success-dir/files/expatch-success-dir/foo.patch || exit 1
---- a/bar
-+++ b/bar
-@@ -1 +1,3 @@
- foo
-+bar
-+baz
-END
-cat <<'END' > packages/cat/expatch-success-dir/expatch-success-dir-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_unpack() {
- echo foo > bar
- echo -e 'foo\nbar\nbaz' > baz
-}
-
-src_prepare() {
- expatch "${FILES}"/${PN}/
- diff bar baz || die "expatch failed"
-}
-END
-mkdir -p "packages/cat/expatch-die"
-cat <<'END' > packages/cat/expatch-die/expatch-die-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_prepare() {
- expatch monkey.patch
-}
-END
-mkdir -p "packages/cat/expatch-unrecognised/files/expatch-unrecognised"
-cat <<END > packages/cat/expatch-unrecognised/files/expatch-unrecognised/foo || exit 1
---- a/bar
-+++ b/bar
-@@ -1 +1,3 @@
- foo
-+bar
-+baz
-END
-cat <<'END' > packages/cat/expatch-unrecognised/expatch-unrecognised-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_unpack() {
- echo foo > bar
- echo foo > baz
-}
-
-src_prepare() {
- expatch "${FILES}"/${PN}/
- diff bar baz || die "expatch applied unrecognised patch"
-}
-END
-mkdir -p "packages/cat/nonfatal-expatch-fail"
-cat <<'END' > packages/cat/nonfatal-expatch-fail/nonfatal-expatch-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_prepare() {
- nonfatal expatch monkey.patch
-}
-END
-mkdir -p "packages/cat/nonfatal-expatch-die"
-cat <<'END' > packages/cat/nonfatal-expatch-die/nonfatal-expatch-die-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_prepare() {
- nonfatal expatch monkey.patch || die
-}
-END
-mkdir -p "packages/cat/unpack-die"
-cat <<'END' > packages/cat/unpack-die/unpack-die-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_unpack() {
- echo "123" > f.bz2
- unpack ./f.bz2
-}
-END
-mkdir -p "packages/cat/nonfatal-unpack-fail"
-cat <<'END' > packages/cat/nonfatal-unpack-fail/nonfatal-unpack-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_unpack() {
- echo "123" > f.bz2
- nonfatal unpack ./f.bz2
-}
-END
-mkdir -p "packages/cat/nonfatal-unpack-die"
-cat <<'END' > packages/cat/nonfatal-unpack-die/nonfatal-unpack-die-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_unpack() {
- echo "123" > f.bz2
- nonfatal unpack ./f.bz2 || die
-}
-END
-mkdir -p "packages/cat/econf-fail"
-cat <<'END' > packages/cat/econf-fail/econf-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_configure() {
- econf
-}
-END
-mkdir -p "packages/cat/nonfatal-econf"
-cat <<'END' > packages/cat/nonfatal-econf/nonfatal-econf-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_configure() {
- nonfatal econf
-}
-END
-mkdir -p "packages/cat/nonfatal-econf-die"
-cat <<'END' > packages/cat/nonfatal-econf-die/nonfatal-econf-die-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_configure() {
- nonfatal econf || die
-}
-END
-mkdir -p "packages/cat/emake-fail"
-cat <<'END' > packages/cat/emake-fail/emake-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_compile() {
- emake monkey
-}
-END
-mkdir -p "packages/cat/nonfatal-emake"
-cat <<'END' > packages/cat/nonfatal-emake/nonfatal-emake-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_compile() {
- nonfatal emake monkey
-}
-END
-mkdir -p "packages/cat/nonfatal-emake-die"
-cat <<'END' > packages/cat/nonfatal-emake-die/nonfatal-emake-die-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_compile() {
- nonfatal emake monkey || die
-}
-END
-mkdir -p "packages/cat/keepdir-success"
-cat <<'END' > packages/cat/keepdir-success/keepdir-success-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- keepdir /usr/share/monkey
-}
-END
-mkdir -p "packages/cat/keepdir-fail"
-cat <<'END' > packages/cat/keepdir-fail/keepdir-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- dodir /usr/share
- touch "${IMAGE}"/usr/share/monkey
- keepdir /usr/share/monkey
-}
-END
-mkdir -p "packages/cat/nonfatal-keepdir"
-cat <<'END' > packages/cat/nonfatal-keepdir/nonfatal-keepdir-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- dodir /usr/share
- touch "${IMAGE}"/usr/share/monkey
- nonfatal keepdir /usr/share/monkey
-}
-END
-mkdir -p "packages/cat/nonfatal-keepdir-die"
-cat <<'END' > packages/cat/nonfatal-keepdir-die/nonfatal-keepdir-die-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- dodir /usr/share
- touch "${IMAGE}"/usr/share/monkey
- nonfatal keepdir /usr/share/monkey || die
-}
-END
-mkdir -p "packages/cat/einstall-fail"
-cat <<'END' > packages/cat/einstall-fail/einstall-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- einstall
-}
-END
-mkdir -p "packages/cat/nonfatal-einstall"
-cat <<'END' > packages/cat/nonfatal-einstall/nonfatal-einstall-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- nonfatal einstall
-}
-END
-mkdir -p "packages/cat/nonfatal-einstall-die"
-cat <<'END' > packages/cat/nonfatal-einstall-die/nonfatal-einstall-die-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- nonfatal einstall || die
-}
-END
-mkdir -p "packages/cat/dobin-success"
-cat <<'END' > packages/cat/dobin-success/dobin-success-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_compile() {
- touch foo
-}
-
-src_install() {
- dobin foo
-}
-END
-mkdir -p "packages/cat/dobin-fail"
-cat <<'END' > packages/cat/dobin-fail/dobin-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- dobin monkey
-}
-END
-mkdir -p "packages/cat/nonfatal-dobin-success"
-cat <<'END' > packages/cat/nonfatal-dobin-success/nonfatal-dobin-success-1.ebuild || exit 1
-DESCRIPTION="The Lnog Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_compile() {
- touch foo
-}
-
-src_install() {
- nonfatal dobin foo || die
-}
-END
-mkdir -p "packages/cat/nonfatal-dobin-fail"
-cat <<'END' > packages/cat/nonfatal-dobin-fail/nonfatal-dobin-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- nonfatal dobin monkey
-}
-END
-mkdir -p "packages/cat/nonfatal-dobin-die"
-cat <<'END' > packages/cat/nonfatal-dobin-die/nonfatal-dobin-die-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- nonfatal dobin monkey || die
-}
-END
-mkdir -p "packages/cat/herebin-success"
-cat <<'END' > packages/cat/herebin-success/herebin-success-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- herebin foo <<EOF
-blah
-EOF
-}
-END
-mkdir -p "packages/cat/herebin-fail"
-cat <<'END' > packages/cat/herebin-fail/herebin-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- herebin <<EOF
-blah
-EOF
-}
-END
-mkdir -p "packages/cat/hereconfd-success"
-cat <<'END' > packages/cat/hereconfd-success/hereconfd-success-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- hereconfd foo <<EOF
-blah
-EOF
-}
-END
-mkdir -p "packages/cat/hereconfd-fail"
-cat <<'END' > packages/cat/hereconfd-fail/hereconfd-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- hereconfd <<EOF
-blah
-EOF
-}
-END
-mkdir -p "packages/cat/hereenvd-success"
-cat <<'END' > packages/cat/hereenvd-success/hereenvd-success-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- hereenvd foo <<EOF
-blah
-EOF
-}
-END
-mkdir -p "packages/cat/hereenvd-fail"
-cat <<'END' > packages/cat/hereenvd-fail/hereenvd-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- hereenvd <<EOF
-blah
-EOF
-}
-END
-mkdir -p "packages/cat/hereinitd-success"
-cat <<'END' > packages/cat/hereinitd-success/hereinitd-success-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- hereinitd foo <<EOF
-blah
-EOF
-}
-END
-mkdir -p "packages/cat/hereinitd-fail"
-cat <<'END' > packages/cat/hereinitd-fail/hereinitd-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- hereinitd <<EOF
-blah
-EOF
-}
-END
-mkdir -p "packages/cat/hereins-success"
-cat <<'END' > packages/cat/hereins-success/hereins-success-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- hereins foo <<EOF
-blah
-EOF
-}
-END
-mkdir -p "packages/cat/hereins-fail"
-cat <<'END' > packages/cat/hereins-fail/hereins-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- hereins <<EOF
-blah
-EOF
-}
-END
-mkdir -p "packages/cat/heresbin-success"
-cat <<'END' > packages/cat/heresbin-success/heresbin-success-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- heresbin foo <<EOF
-blah
-EOF
-}
-END
-mkdir -p "packages/cat/heresbin-fail"
-cat <<'END' > packages/cat/heresbin-fail/heresbin-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- heresbin <<EOF
-blah
-EOF
-}
-END
-mkdir -p "packages/cat/fperms-success"
-cat <<'END' > packages/cat/fperms-success/fperms-success-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_compile() {
- touch foo
-}
-
-src_install() {
- fperms 755 foo
-}
-END
-mkdir -p "packages/cat/fperms-fail"
-cat <<'END' > packages/cat/fperms-fail/fperms-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- fperms 755 monkey
-}
-END
-mkdir -p "packages/cat/nonfatal-fperms-success"
-cat <<'END' > packages/cat/nonfatal-fperms-success/nonfatal-fperms-success-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_compile() {
- touch foo
-}
-
-src_install() {
- nonfatal fperms 755 foo || die
-}
-END
-mkdir -p "packages/cat/nonfatal-fperms-fail"
-cat <<'END' > packages/cat/nonfatal-fperms-fail/nonfatal-fperms-fail-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- nonfatal fperms 755 monkey
-}
-END
-mkdir -p "packages/cat/nonfatal-fperms-die"
-cat <<'END' > packages/cat/nonfatal-fperms-die/nonfatal-fperms-die-1.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- nonfatal fperms 755 monkey || die
-}
-END
-mkdir -p "packages/cat/best-version"
-cat <<'END' > packages/cat/best-version/best-version-0.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-pkg_setup() {
- if ! best_version cat/pretend-installed >/dev/null ; then
- die "failed cat/pretend-installed"
- fi
-
- BV1=$(best_version cat/pretend-installed )
- [[ "$BV1" == "cat/pretend-installed-1:0::installed" ]] || die "BV1 is $BV1"
-
- if best_version cat/doesnotexist >/dev/null ; then
- die "not failed cat/doesnotexist"
- fi
-
- BV2=$(best_version cat/doesnotexist )
- [[ "$BV2" == "" ]] || die "BV2 is $BV2"
-
- if [[ -n "$PALUDIS_ENABLE_VIRTUALS_REPOSITORY" ]] ; then
- if ! best_version virtual/virtual-pretend-installed >/dev/null ; then
- die "failed virtual/virtual-pretend-installed"
- fi
-
- BV3=$(best_version virtual/virtual-pretend-installed )
- [[ "$BV3" == "virtual/virtual-pretend-installed-1::installed-virtuals (virtual for cat/pretend-installed-1:0::installed)" ]] \
- || die "BV3 is $BV3"
-
- if best_version virtual/virtual-doesnotexist >/dev/null ; then
- die "not failed virtual/virtual-doesnotexist"
- fi
-
- BV2=$(best_version virtual/virtual-doesnotexist )
- [[ "$BV4" == "" ]] || die "BV4 is $BV4"
- fi
-}
-END
-mkdir -p "packages/cat/has-version"
-cat <<'END' > packages/cat/has-version/has-version-0.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-pkg_setup() {
- if ! has_version cat/pretend-installed ; then
- die "failed cat/pretend-installed"
- fi
-
- if has_version cat/doesnotexist >/dev/null ; then
- die "not failed cat/doesnotexist"
- fi
-}
-END
-mkdir -p "packages/cat/match"
-cat <<'END' > packages/cat/match/match-0.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-pkg_setup() {
- portageq match "${ROOT}" cat/foo | while read a ; do
- einfo moo
- done
-}
-END
-mkdir -p "packages/cat/econf-phase"
-cat <<'END' > packages/cat/econf-phase/econf-phase-0.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_unpack() {
- mkdir ${WORK}
- echo "#!/bin/bash" > ${WORK}/configure
- chmod +x ${WORK}/configure
-}
-
-src_compile() {
- econf
-}
-END
-mkdir -p "packages/cat/econf-vars"
-cat <<'END' > packages/cat/econf-vars/econf-vars-0.ebuild || exit 1
-DESCRIPTION="The Long Description"
-DESCRIPTION="The Short Description"
-
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="enabled-hamster gerbil dormouse"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-DEFAULT_SRC_CONFIGURE_PARAMS=( --nice-juicy-steak )
-DEFAULT_SRC_CONFIGURE_OPTION_ENABLES=( enabled-hamster gerbil )
-DEFAULT_SRC_CONFIGURE_OPTION_WITHS=( dormouse )
-
-src_unpack() {
- mkdir ${WORK}
- cat <<'END2' > ${WORK}/configure
-#!/usr/bin/env bash
-echo "${@}" | grep -q -- '--enable-enabled-hamster' || exit 1
-echo "${@}" | grep -q -- '--disable-gerbil' || exit 2
-echo "${@}" | grep -q -- '--nice-juicy-steak' || exit 3
-echo "${@}" | grep -q -- '--without-dormouse' || exit 4
-true
-END2
- chmod +x ${WORK}/configure
-}
-END
-mkdir -p "packages/cat/expand-vars"
-cat <<"END" > packages/cat/expand-vars/expand-vars-0.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="enabled-weasel broccoli linguas: enabled-en_GB"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-pkg_setup() {
- [[ ${OPTIONS%%+( )} == "enabled-weasel linguas:enabled-en_GB" ]] || die "OPTIONS=$OPTIONS is wrong"
- [[ ${LINGUAS%%+( )} == "enabled-en_GB" ]] || die "LINGUAS=$LINGUAS is wrong"
-}
-END
-mkdir -p "packages/cat/doman-success"
-cat <<'END' > packages/cat/doman-success/doman-success-0.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_compile() {
- echo ${PNVR} >foo.1
- mkdir dir
- echo ${PNVR} >dir/foo.2
- echo ${PNVR} >foo.3x
- echo ${PNVR} >foo.4.gz
- echo ${PNVR} >foo.5f.bz2
- echo ${PNVR} >foo.6.Z
- echo ${PNVR} >foo.en.7
- echo ${PNVR} >foo.en_GB.8
- echo ${PNVR} >foo.e.9
- echo ${PNVR} >foo.enn.n
- echo ${PNVR} >foo.EN.1
- echo ${PNVR} >foo.en-GB.2
- echo ${PNVR} >foo.en_gb.3
- echo ${PNVR} >foo.en_G.4
- echo ${PNVR} >foo.en_GBB.5
- echo ${PNVR} >foo.nonkey
- touch foo.1x
- echo ${PNVR} >baz.6
- echo ${PNVR} >baz.en_US.7
-}
-
-src_install() {
- doman foo.* dir/foo.* || die
- doman -i18n=en_GB baz.* || die
- keepdir /meh || die
- cd "${IMAGE}"/meh || die
- doman .keep* || die
- rm "${IMAGE}"/usr/share/man/{man1/foo.1,man2/foo.2,man3/foo.3x,man4/foo.4.gz,man5/foo.5f.bz2} || die
- rm "${IMAGE}"/usr/share/man/{man6/foo.6.Z,en/man7/foo.7,en_GB/man8/foo.8,man9/foo.e.9,mann/foo.enn.n} || die
- rm "${IMAGE}"/usr/share/man/{man1/foo.EN.1,man2/foo.en-GB.2,man3/foo.en_gb.3,man4/foo.en_G.4} || die
- rm "${IMAGE}"/usr/share/man/{man5/foo.en_GBB.5,mann/foo.nonkey,en_GB/man6/baz.6,en_US/man7/baz.7} || die
- rmdir "${IMAGE}"/usr/share/man/{man1,man2,man3,man4,man5,man6,man9,mann,en/man7,en_GB/man6,en_GB/man8,en_US/man7,en,en_GB,en_US,} || die
-}
-END
-mkdir -p "packages/cat/doman-failure"
-cat <<'END' > packages/cat/doman-failure/doman-failure-0.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_compile() {
- echo ${PNVR} >bar.m
-}
-
-src_install() {
- doman bar.m
-}
-END
-mkdir -p "packages/cat/change-globals"
-cat <<'END' > packages/cat/change-globals/change-globals-0.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_compile() {
- DEFAULT_SRC_COMPILE_PARAMS="foo"
- default
-}
-END
-mkdir -p "packages/cat/install"
-cat <<'END' > packages/cat/install/install-0.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_unpack() {
- touch -- -s
-}
-
-src_install() {
- install -v -- -s dest
- [[ -x dest ]] || die "install didn't work"
-}
-END
-mkdir -p "packages/cat/install-s"
-cat <<'END' > packages/cat/install-s/install-s-0.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_unpack() {
- touch src
-}
-
-src_install() {
- install -s src dest
- [[ -x dest ]] && die "install didn't fail"
-}
-END
-mkdir -p "packages/cat/doman-nonfatal"
-cat <<'END' > packages/cat/doman-nonfatal/doman-nonfatal-0.ebuild || exit 1
-DESCRIPTION="The Long Description"
-SUMMARY="The Short Description"
-HOMEPAGE="http://example.com/"
-DOWNLOADS=""
-SLOT="0"
-MYOPTIONS="spork"
-LICENCES="GPL-2"
-PLATFORMS="test"
-WORK="${WORKBASE}"
-
-src_install() {
- nonfatal doman bar.1 && die
-}
-END
-cd ..
-
mkdir -p repo15/{eclass,distfiles,profiles/profile/subprofile} || exit 1
cd repo15 || exit 1
echo "test-repo-15" >> profiles/repo_name || exit 1
@@ -2775,22 +1511,6 @@ cp Manifest category/package-c/
rm Manifest
cd ..
-mkdir -p repo17/{eclass,distfiles,profiles/profile} || exit 1
-mkdir -p repo17/category/package || exit 1
-cd repo17 || exit 1
-echo "test-repo-17" >> profiles/repo_name || exit 1
-echo "category" >> profiles/categories || exit 1
-cat <<END > profiles/profile/make.defaults
-ARCH=test
-END
-cat <<END > category/package/package-1.ebuild || exit 1
-EAPI="exheres-0"
-SLOT="0"
-PLATFORMS="test"
-DEPENDENCIES="cat/pkg1 build: cat/pkg2 build+run: cat/pkg3 suggestion: cat/pkg4 post: cat/pkg5"
-END
-cd ..
-
mkdir -p repo18/{eclass,distfiles,profiles/profile} || exit 1
mkdir -p repo18/category/package || exit 1
cd repo18 || exit 1
@@ -2848,26 +1568,5 @@ KEYWORDS="test"
END
cd ..
-mkdir -p repo20/{eclass,distfiles,profiles/profile} || exit 1
-mkdir -p repo20/cat/pkg || exit 1
-cd repo20 || exit 1
-echo "test-repo-20" >> profiles/repo_name || exit 1
-echo "cat" >> profiles/categories || exit 1
-cat <<END > profiles/profile/make.defaults
-ARCH=test
-USERLAND="GNU"
-KERNEL="linux"
-LIBC="glibc"
-CHOST="i286-badger-linux-gnu"
-END
-cat <<END > cat/pkg/pkg-1.ebuild || exit 1
-SLOT="0"
-PLATFORMS="test"
-src_install() {
- ln -s "\${IMAGE}/foo" "\${IMAGE}/bar" || die
-}
-END
-cd ..
-
cd ..
diff --git a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
new file mode 100644
index 0000000..b0ed3d2
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
@@ -0,0 +1,154 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * 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/repositories/e/e_repository.hh>
+#include <paludis/repositories/e/e_repository_exceptions.hh>
+#include <paludis/repositories/e/e_repository_id.hh>
+#include <paludis/repositories/e/vdb_repository.hh>
+#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
+#include <paludis/repositories/fake/fake_installed_repository.hh>
+#include <paludis/repositories/fake/fake_package_id.hh>
+#include <paludis/environments/test/test_environment.hh>
+#include <paludis/util/system.hh>
+#include <paludis/util/simple_visitor_cast.hh>
+#include <paludis/util/map.hh>
+#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_named_values.hh>
+#include <paludis/util/set.hh>
+#include <paludis/standard_output_manager.hh>
+#include <paludis/util/safe_ifstream.hh>
+#include <paludis/package_id.hh>
+#include <paludis/metadata_key.hh>
+#include <paludis/action.hh>
+#include <paludis/stringify_formatter.hh>
+#include <paludis/user_dep_spec.hh>
+#include <paludis/generator.hh>
+#include <paludis/filter.hh>
+#include <paludis/filtered_generator.hh>
+#include <paludis/selection.hh>
+#include <paludis/repository_factory.hh>
+#include <paludis/choice.hh>
+#include <test/test_framework.hh>
+#include <test/test_runner.hh>
+#include <tr1/functional>
+#include <set>
+#include <string>
+
+#include "config.h"
+
+using namespace test;
+using namespace paludis;
+
+namespace
+{
+ void cannot_uninstall(const std::tr1::shared_ptr<const PackageID> & id, const UninstallActionOptions &)
+ {
+ if (id)
+ throw InternalError(PALUDIS_HERE, "cannot uninstall");
+ }
+
+ std::tr1::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
+ {
+ return make_shared_ptr(new StandardOutputManager);
+ }
+
+ std::string from_keys(const std::tr1::shared_ptr<const Map<std::string, std::string> > & m,
+ const std::string & k)
+ {
+ Map<std::string, std::string>::ConstIterator mm(m->find(k));
+ if (m->end() == mm)
+ return "";
+ else
+ return mm->second;
+ }
+
+ WantPhase want_all_phases(const std::string &)
+ {
+ return wp_yes;
+ }
+}
+
+namespace test_cases
+{
+ struct ERepositorySymlinkRewritingTest : TestCase
+ {
+ ERepositorySymlinkRewritingTest() : TestCase("symlink_rewriting") { }
+
+ unsigned max_run_time() const
+ {
+ return 3000;
+ }
+
+ bool repeatable() const
+ {
+ return false;
+ }
+
+ void run()
+ {
+ TestEnvironment env;
+ env.set_paludis_command("/bin/false");
+
+ std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ keys->insert("format", "ebuild");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "repo"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "repo/profiles/profile"));
+ keys->insert("layout", "traditional");
+ keys->insert("eapi_when_unknown", "0");
+ keys->insert("eapi_when_unspecified", "0");
+ keys->insert("profile_eapi", "0");
+ keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "symlinked_build"));
+ keys->insert("root", stringify(FSEntry(stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root")).realpath()));
+ std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
+ std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
+ env.package_database()->add_repository(1, repo);
+
+ keys.reset(new Map<std::string, std::string>);
+ keys->insert("format", "vdb");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("provides_cache", "/var/empty");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "vdb"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "build"));
+ keys->insert("root", stringify(FSEntry(stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root")).realpath()));
+ std::tr1::shared_ptr<Repository> installed_repo(VDBRepository::repository_factory_create(&env,
+ std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
+ env.package_database()->add_repository(1, installed_repo);
+
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::destination>(installed_repo),
+ value_for<n::make_output_manager>(&make_standard_output_manager),
+ value_for<n::perform_uninstall>(&cannot_uninstall),
+ value_for<n::replacing>(make_shared_ptr(new PackageIDSequence)),
+ value_for<n::want_phase>(&want_all_phases)
+ ));
+
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/pkg",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+
+ id->perform_action(action);
+ TEST_CHECK_EQUAL(FSEntry(stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root/bar")).readlink(), "/foo");
+ }
+ } test_e_repository_symlink_rewriting;
+}
+
diff --git a/paludis/repositories/e/e_repository_TEST_symlink_rewriting_cleanup.sh b/paludis/repositories/e/e_repository_TEST_symlink_rewriting_cleanup.sh
new file mode 100755
index 0000000..e054438
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_symlink_rewriting_cleanup.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+if [ -d e_repository_TEST_symlink_rewriting_dir ] ; then
+ rm -fr e_repository_TEST_symlink_rewriting_dir
+else
+ true
+fi
+
diff --git a/paludis/repositories/e/e_repository_TEST_symlink_rewriting_setup.sh b/paludis/repositories/e/e_repository_TEST_symlink_rewriting_setup.sh
new file mode 100755
index 0000000..19e5eec
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_symlink_rewriting_setup.sh
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+mkdir e_repository_TEST_symlink_rewriting_dir || exit 1
+cd e_repository_TEST_symlink_rewriting_dir || exit 1
+
+mkdir -p root/etc
+
+mkdir -p vdb
+touch vdb/THISISTHEVDB
+
+mkdir -p build
+ln -s build symlinked_build
+
+mkdir -p distdir
+echo "already fetched" > distdir/already-fetched.txt || exit 1
+cat <<END > distdir/expatch-success-1.patch || exit 1
+--- a/bar
++++ b/bar
+@@ -1 +1,3 @@
+ foo
++bar
++baz
+END
+
+mkdir -p repo/{eclass,distfiles,profiles/profile} || exit 1
+mkdir -p repo/cat/pkg || exit 1
+cd repo || exit 1
+echo "test-repo" >> profiles/repo_name || exit 1
+echo "cat" >> profiles/categories || exit 1
+cat <<END > profiles/profile/make.defaults
+ARCH=test
+USERLAND="GNU"
+KERNEL="linux"
+LIBC="glibc"
+CHOST="i286-badger-linux-gnu"
+END
+cat <<END > cat/pkg/pkg-1.ebuild || exit 1
+SLOT="0"
+PLATFORMS="test"
+src_install() {
+ ln -s "\${IMAGE}/foo" "\${IMAGE}/bar" || die
+}
+END
+cd ..
+
+cd ..
+
diff --git a/test/run_test.sh b/test/run_test.sh
index 62e3da0..63b3ebc 100755
--- a/test/run_test.sh
+++ b/test/run_test.sh
@@ -32,12 +32,14 @@ else
echo ">>> No $TEST_SCRIPT_DIR${testname}_setup.sh to run" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
fi
+now=$(date +'%s' )
echo ">>> test ${testname}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
$interp ${@}
code=$?
+duration=$(( $(date +'%s' ) - ${now} ))
if [[ 0 != ${code} ]] ; then
- echo ">>> test ${testname} returned ${code}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
+ echo ">>> test ${testname} returned ${code} [${duration}s]" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
if [[ -z "${PALUDIS_TESTS_RERUN_VERBOSELY}" ]] && [[ "${testname#./}" != "test_fail_TEST" ]] ; then
out=`pwd`/${testname#./}.epicfail
echo ">>> rerunning test ${testname} verbosely redirected to ${out}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
@@ -59,7 +61,7 @@ else
echo ">>> No $TEST_SCRIPT_DIR${testname}_cleanup.sh to run" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
fi
-echo ">>> exiting with success for test ${testname}" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
+echo ">>> exiting with success for test ${testname} [${duration}s]" 1>&$PALUDIS_TESTS_REAL_STDOUT_FD
exit 0