aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-10-09 22:42:41 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-10-09 22:42:41 +0100
commit966875c7887ae5666cba901e78962c8e9499b2d2 (patch)
tree204611813900716d74fbd9e3caf288cde391e6fa
parent4472e115de80b4365a3aa643b6f27db2d413c23f (diff)
downloadpaludis-966875c7887ae5666cba901e78962c8e9499b2d2.tar.gz
paludis-966875c7887ae5666cba901e78962c8e9499b2d2.tar.xz
Work around ebuilds assuming cwd is safe.
Fixes: Gentoo#240722
-rw-r--r--paludis/environments/no_config/no_config_environment.cc2
-rw-r--r--paludis/repositories/e/Makefile.am1
-rw-r--r--paludis/repositories/e/e_repository.cc14
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc151
-rw-r--r--paludis/repositories/e/ebuild.cc4
-rw-r--r--paludis/repositories/e/ebuild/0/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/1/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/2/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/Makefile.am1
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash7
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/kdebuild-1/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/pbin-1/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/utils/Makefile.am1
-rw-r--r--paludis/repositories/e/exndbam_repository_TEST.cc9
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc66
-rwxr-xr-xpython/dep_list_TEST_setup.sh2
-rwxr-xr-xpython/environment_TEST_setup.sh1
-rwxr-xr-xpython/mask_TEST_setup.sh1
-rwxr-xr-xpython/package_database_TEST_setup.sh1
-rwxr-xr-xpython/repository_TEST_setup.sh2
-rwxr-xr-xruby/action_TEST_setup.sh2
-rwxr-xr-xruby/dep_list_TEST_setup.sh2
-rwxr-xr-xruby/dep_spec_TEST_setup.sh1
-rwxr-xr-xruby/dep_tag_TEST_setup.sh1
-rwxr-xr-xruby/environment_TEST_setup.sh1
-rwxr-xr-xruby/generator_TEST_setup.sh1
-rwxr-xr-xruby/package_database_TEST_setup.sh1
-rw-r--r--ruby/package_id_TEST.rb2
-rwxr-xr-xruby/paludis_ruby_TEST_setup.sh2
-rwxr-xr-xruby/repository_TEST_setup.sh2
31 files changed, 173 insertions, 111 deletions
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index 0bfa89f7d..e878526de 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -186,6 +186,7 @@ Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
keys->insert("ignore_deprecated_profiles", "true");
keys->insert("write_cache", stringify(params.write_cache));
keys->insert("names_cache", "/var/empty");
+ keys->insert("builddir", "/var/empty");
if (params.disable_metadata_cache)
keys->insert("cache", "/var/empty");
@@ -205,6 +206,7 @@ Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
keys->insert("ignore_deprecated_profiles", "true");
keys->insert("write_cache", stringify(params.write_cache));
keys->insert("names_cache", "/var/empty");
+ keys->insert("builddir", "/var/empty");
if (params.disable_metadata_cache)
keys->insert("cache", "/var/empty");
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index 654ef0ebd..cc3ccb8a5 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -414,6 +414,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_REPOSITORY_SO_DIR="$(top_builddir)/paludis/repositories" \
PALUDIS_NO_CHOWN="yes" \
PALUDIS_TESTS_KEEP_STDERR="yes" \
+ PALDUIS_TMPDIR="`pwd`" \
LD_LIBRARY_PATH="`echo $$LD_LIBRARY_PATH: | sed -e 's,^:,,'`` \
$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/`:` \
$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/.libs/`" \
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 8bb76db9a..89f85ef9e 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -1772,16 +1772,16 @@ ERepository::repository_factory_create(
.entry_format("ebuild")
.layout(layout)
.environment(env)
- .location(location)
+ .location(FSEntry(location).realpath_if_exists())
.profiles(profiles)
.cache(cache)
- .write_cache(write_cache)
- .names_cache(names_cache)
+ .write_cache(FSEntry(write_cache).realpath_if_exists())
+ .names_cache(FSEntry(names_cache).realpath_if_exists())
.eclassdirs(eclassdirs)
- .distdir(distdir)
- .securitydir(securitydir)
- .setsdir(setsdir)
- .newsdir(newsdir)
+ .distdir(FSEntry(distdir).realpath_if_exists())
+ .securitydir(FSEntry(securitydir).realpath_if_exists())
+ .setsdir(FSEntry(setsdir).realpath_if_exists())
+ .newsdir(FSEntry(newsdir).realpath_if_exists())
.sync(sync)
.sync_options(sync_options)
.master_repositories(master_repositories)
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 3e3bacf81..dc8f074c7 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -85,8 +85,9 @@ namespace test_cases
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", "e_repository_TEST_dir/repo1");
- keys->insert("profiles", "e_repository_TEST_dir/repo1/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1/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)));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "test-repo-1");
@@ -104,8 +105,9 @@ namespace test_cases
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", "e_repository_TEST_dir/repo2");
- keys->insert("profiles", "e_repository_TEST_dir/repo2/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo2"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo2/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)));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "x-repo2");
@@ -123,8 +125,9 @@ namespace test_cases
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", "e_repository_TEST_dir/repo3");
- keys->insert("profiles", "e_repository_TEST_dir/repo3/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo3"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo3/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)));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "x-repo3");
@@ -142,8 +145,9 @@ namespace test_cases
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", "e_repository_TEST_dir/repo1");
- keys->insert("profiles", "e_repository_TEST_dir/repo1/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1/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)));
@@ -170,8 +174,9 @@ namespace test_cases
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", "e_repository_TEST_dir/repo1");
- keys->insert("profiles", "e_repository_TEST_dir/repo1/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1/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)));
@@ -200,8 +205,9 @@ namespace test_cases
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", "e_repository_TEST_dir/repo4");
- keys->insert("profiles", "e_repository_TEST_dir/repo4/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4/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)));
@@ -236,8 +242,9 @@ namespace test_cases
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", "e_repository_TEST_dir/repo4");
- keys->insert("profiles", "e_repository_TEST_dir/repo4/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4/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)));
@@ -276,8 +283,9 @@ namespace test_cases
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", "e_repository_TEST_dir/repo4");
- keys->insert("profiles", "e_repository_TEST_dir/repo4/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4/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)));
@@ -325,8 +333,9 @@ namespace test_cases
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", "e_repository_TEST_dir/repo5");
- keys->insert("profiles", "e_repository_TEST_dir/repo5/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo5"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo5/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)));
@@ -358,8 +367,9 @@ namespace test_cases
new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", "e_repository_TEST_dir/repo4");
- keys->insert("profiles", "e_repository_TEST_dir/repo4/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4/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)));
@@ -402,8 +412,9 @@ namespace test_cases
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", "e_repository_TEST_dir/repo8");
- keys->insert("profiles", "e_repository_TEST_dir/repo8/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo8"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo8/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)));
@@ -454,9 +465,10 @@ namespace test_cases
new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
- keys->insert("write_cache", "e_repository_TEST_dir/repo7/metadata/cache");
- keys->insert("location", "e_repository_TEST_dir/repo7");
- keys->insert("profiles", "e_repository_TEST_dir/repo7/profiles/profile");
+ keys->insert("write_cache", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7/metadata/cache"));
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7/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);
@@ -536,8 +548,9 @@ namespace test_cases
new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", "e_repository_TEST_dir/repo7");
- keys->insert("profiles", "e_repository_TEST_dir/repo7/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7/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);
@@ -569,8 +582,9 @@ namespace test_cases
new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", "e_repository_TEST_dir/repo9");
- keys->insert("profiles", "e_repository_TEST_dir/repo9/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo9"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo9/profiles/profile"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
std::tr1::shared_ptr<ERepository> repo(std::tr1::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1))));
env.package_database()->add_repository(1, repo);
@@ -619,8 +633,9 @@ namespace test_cases
new Map<std::string, std::string>);
keys18->insert("format", "ebuild");
keys18->insert("names_cache", "/var/empty");
- keys18->insert("location", "e_repository_TEST_dir/repo18");
- keys18->insert("profiles", "e_repository_TEST_dir/repo18/profiles/profile");
+ keys18->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo18"));
+ keys18->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo18/profiles/profile"));
+ keys18->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
std::tr1::shared_ptr<Repository> repo18(ERepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys18, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo18);
@@ -629,8 +644,9 @@ namespace test_cases
new Map<std::string, std::string>);
keys19->insert("format", "ebuild");
keys19->insert("names_cache", "/var/empty");
- keys19->insert("location", "e_repository_TEST_dir/repo19");
+ keys19->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo19"));
keys19->insert("master_repository", "test-repo-18");
+ keys19->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
std::tr1::shared_ptr<Repository> repo19(ERepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys19, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo19);
@@ -675,8 +691,9 @@ namespace test_cases
new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", "e_repository_TEST_dir/repo10");
- keys->insert("profiles", "e_repository_TEST_dir/repo10/profiles/profile/subprofile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo10"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo10/profiles/profile/subprofile"));
+ 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);
@@ -710,8 +727,9 @@ namespace test_cases
new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", "e_repository_TEST_dir/repo10");
- keys->insert("profiles", "e_repository_TEST_dir/repo10/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo10"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo10/profiles/profile"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
std::tr1::shared_ptr<ERepository> repo(std::tr1::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1))));
env.package_database()->add_repository(1, repo);
@@ -742,8 +760,9 @@ namespace test_cases
new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", "e_repository_TEST_dir/repo15");
- keys->insert("profiles", "e_repository_TEST_dir/repo15/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo15"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo15/profiles/profile"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
std::tr1::shared_ptr<ERepository> repo(std::tr1::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1))));
env.package_database()->add_repository(1, repo);
@@ -814,8 +833,9 @@ namespace test_cases
new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", "e_repository_TEST_dir/repo11");
- keys->insert("profiles", "e_repository_TEST_dir/repo11/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo11"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo11/profiles/profile"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
std::tr1::shared_ptr<ERepository> repo(std::tr1::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1))));
repo->make_manifest(QualifiedPackageName("category/package"));
@@ -858,13 +878,14 @@ namespace test_cases
std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
keys->insert("format", "exheres");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", "e_repository_TEST_dir/repo12");
- keys->insert("profiles", "e_repository_TEST_dir/repo12/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo12"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo12/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);
@@ -965,8 +986,9 @@ namespace test_cases
new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", "e_repository_TEST_dir/repo11");
- keys->insert("profiles", "e_repository_TEST_dir/repo11/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo11"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo11/profiles/profile"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
std::tr1::shared_ptr<ERepository> repo(std::tr1::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1))));
env.package_database()->add_repository(1, repo);
@@ -1013,8 +1035,8 @@ namespace test_cases
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", "e_repository_TEST_dir/repo13");
- keys->insert("profiles", "e_repository_TEST_dir/repo13/profiles/profile");
+ 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");
@@ -1283,8 +1305,8 @@ namespace test_cases
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", "e_repository_TEST_dir/repo13");
- keys->insert("profiles", "e_repository_TEST_dir/repo13/profiles/profile");
+ 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");
@@ -1378,8 +1400,8 @@ namespace test_cases
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", "e_repository_TEST_dir/repo13");
- keys->insert("profiles", "e_repository_TEST_dir/repo13/profiles/profile");
+ 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");
@@ -1503,8 +1525,8 @@ namespace test_cases
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", "e_repository_TEST_dir/repo13");
- keys->insert("profiles", "e_repository_TEST_dir/repo13/profiles/profile");
+ 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");
@@ -1627,8 +1649,8 @@ namespace test_cases
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", "e_repository_TEST_dir/repo13");
- keys->insert("profiles", "e_repository_TEST_dir/repo13/profiles/profile");
+ 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");
@@ -1692,8 +1714,8 @@ namespace test_cases
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", "e_repository_TEST_dir/repo14");
- keys->insert("profiles", "e_repository_TEST_dir/repo14/profiles/profile");
+ 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");
@@ -2131,8 +2153,9 @@ namespace test_cases
new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", "e_repository_TEST_dir/repo17");
- keys->insert("profiles", "e_repository_TEST_dir/repo17/profiles/profile");
+ 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);
@@ -2182,15 +2205,15 @@ namespace test_cases
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", "e_repository_TEST_dir/repo20");
- keys->insert("profiles", "e_repository_TEST_dir/repo20/profiles/profile");
+ 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("e_repository_TEST_dir/root").realpath()));
+ 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);
@@ -2199,9 +2222,9 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "e_repository_TEST_dir/vdb");
+ 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("e_repository_TEST_dir/root").realpath()));
+ 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);
@@ -2219,7 +2242,7 @@ namespace test_cases
TEST_CHECK(id);
id->perform_action(action);
- TEST_CHECK_EQUAL(FSEntry("e_repository_TEST_dir/root/bar").readlink(), "/foo");
+ 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/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 233a9aa62..e5f578f93 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -332,7 +332,7 @@ EbuildMetadataCommand::do_run_command(const Command & cmd)
{
Log::get_instance()->message("e.ebuild.cache_failure", ll_warning, lc_context) << "Caught exception '"
<< e.message() << "' (" << e.what() << ") when generating cache for '"
- << *params.package_id() << "', input is '" << purdy(input) << "'";
+ << *params.package_id() << "', input is '" << purdy(input) << "', stderr is '" << captured_stderr << "'";
}
if (ok)
@@ -340,7 +340,7 @@ EbuildMetadataCommand::do_run_command(const Command & cmd)
else
{
Log::get_instance()->message("e.ebuild.cache_failure", ll_warning, lc_context) << "Could not generate cache for '"
- << *params.package_id() << "'";
+ << *params.package_id() << "' stderr says '" << captured_stderr << "'";
keys.reset(new Map<std::string, std::string>);
keys->insert("EAPI", EAPIData::get_instance()->unknown_eapi()->name());
diff --git a/paludis/repositories/e/ebuild/0/Makefile.am b/paludis/repositories/e/ebuild/0/Makefile.am
index 8bededbc7..93c3df75c 100644
--- a/paludis/repositories/e/ebuild/0/Makefile.am
+++ b/paludis/repositories/e/ebuild/0/Makefile.am
@@ -51,6 +51,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_OPTIONS="" \
TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/`" \
TEST_SCRIPT_DIR="$(srcdir)/" \
+ PALUDIS_TMPDIR="`pwd`/" \
bash $(top_srcdir)/test/run_test.sh $(top_srcdir)/paludis/repositories/e/ebuild/run_test.bash
TESTS = conditional_functions_TEST.bash list_functions_TEST.bash
diff --git a/paludis/repositories/e/ebuild/1/Makefile.am b/paludis/repositories/e/ebuild/1/Makefile.am
index e242498bc..84f41f7cf 100644
--- a/paludis/repositories/e/ebuild/1/Makefile.am
+++ b/paludis/repositories/e/ebuild/1/Makefile.am
@@ -19,6 +19,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_LOG_LEVEL="warning" \
TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/`" \
TEST_SCRIPT_DIR="$(srcdir)/" \
+ PALUDIS_TMPDIR="`pwd`/" \
bash $(top_srcdir)/test/run_test.sh $(top_srcdir)/paludis/repositories/e/ebuild/run_test.bash
TESTS =
diff --git a/paludis/repositories/e/ebuild/2/Makefile.am b/paludis/repositories/e/ebuild/2/Makefile.am
index 75c3cdb47..0627acf71 100644
--- a/paludis/repositories/e/ebuild/2/Makefile.am
+++ b/paludis/repositories/e/ebuild/2/Makefile.am
@@ -26,6 +26,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_LOG_LEVEL="warning" \
TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/`" \
TEST_SCRIPT_DIR="$(srcdir)/" \
+ PALUDIS_TMPDIR="`pwd`/" \
bash $(top_srcdir)/test/run_test.sh $(top_srcdir)/paludis/repositories/e/ebuild/run_test.bash
TESTS =
diff --git a/paludis/repositories/e/ebuild/Makefile.am b/paludis/repositories/e/ebuild/Makefile.am
index 7ee58ff07..3d35ea22e 100644
--- a/paludis/repositories/e/ebuild/Makefile.am
+++ b/paludis/repositories/e/ebuild/Makefile.am
@@ -33,6 +33,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_LOG_LEVEL="warning" \
TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/`" \
TEST_SCRIPT_DIR="$(srcdir)/" \
+ PALUDIS_TMPDIR="`pwd`/" \
bash $(top_srcdir)/test/run_test.sh $(top_srcdir)/paludis/repositories/e/ebuild/run_test.bash
TESTS = kernel_functions_TEST.bash
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index 5c4f143d4..4990f74ce 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -428,6 +428,13 @@ ebuild_main()
ebuild_notice "warning" "This will cause problems."
fi
+ # this is fatal in builtin_init, but warn early for good measure
+ if [[ -z "${PALUDIS_TMPDIR}" ]] ; then
+ ebuild_notice "warning" "PALUDIS_TMPDIR unset or empty."
+ elif ! cd "${PALUDIS_TMPDIR}" ; then
+ ebuild_notice "warning" "Could not change directory to ${PALUDIS_TMPDIR}."
+ fi
+
local action
export EBUILD="${1}"
shift
diff --git a/paludis/repositories/e/ebuild/exheres-0/Makefile.am b/paludis/repositories/e/ebuild/exheres-0/Makefile.am
index c73092f84..dab76f496 100644
--- a/paludis/repositories/e/ebuild/exheres-0/Makefile.am
+++ b/paludis/repositories/e/ebuild/exheres-0/Makefile.am
@@ -54,6 +54,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_MODULE_SUFFIXES="exheres-0" \
TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/`" \
TEST_SCRIPT_DIR="$(srcdir)/" \
+ PALUDIS_TMPDIR="`pwd`/" \
bash $(top_srcdir)/test/run_test.sh $(top_srcdir)/paludis/repositories/e/ebuild/run_test.bash
TESTS = conditional_functions_TEST.bash list_functions_TEST.bash
diff --git a/paludis/repositories/e/ebuild/kdebuild-1/Makefile.am b/paludis/repositories/e/ebuild/kdebuild-1/Makefile.am
index 311e752bd..f4f694174 100644
--- a/paludis/repositories/e/ebuild/kdebuild-1/Makefile.am
+++ b/paludis/repositories/e/ebuild/kdebuild-1/Makefile.am
@@ -18,6 +18,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_LOG_LEVEL="warning" \
TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/`" \
TEST_SCRIPT_DIR="$(srcdir)/" \
+ PALUDIS_TMPDIR="`pwd`/" \
bash $(top_srcdir)/test/run_test.sh $(top_srcdir)/paludis/repositories/e/ebuild/run_test.bash
TESTS =
diff --git a/paludis/repositories/e/ebuild/pbin-1/Makefile.am b/paludis/repositories/e/ebuild/pbin-1/Makefile.am
index 7f18605c5..d75676b08 100644
--- a/paludis/repositories/e/ebuild/pbin-1/Makefile.am
+++ b/paludis/repositories/e/ebuild/pbin-1/Makefile.am
@@ -18,6 +18,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_LOG_LEVEL="warning" \
TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/`" \
TEST_SCRIPT_DIR="$(srcdir)/" \
+ PALUDIS_TMPDIR="`pwd`/" \
bash $(top_srcdir)/test/run_test.sh $(top_srcdir)/paludis/repositories/e/ebuild/run_test.bash
EXTRA_DIST = $(libexecprogpaludisbinary1_SCRIPTS)
diff --git a/paludis/repositories/e/ebuild/utils/Makefile.am b/paludis/repositories/e/ebuild/utils/Makefile.am
index 6336eb6e6..f7930d43c 100644
--- a/paludis/repositories/e/ebuild/utils/Makefile.am
+++ b/paludis/repositories/e/ebuild/utils/Makefile.am
@@ -75,6 +75,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_OPTIONS="" \
PALUDIS_NO_CHOWN="yes" \
TEST_SCRIPT_DIR="$(srcdir)/" \
+ PALUDIS_TMPDIR="`pwd`/" \
bash $(top_srcdir)/paludis/repositories/e/ebuild/utils/run_test.bash
TESTS = \
diff --git a/paludis/repositories/e/exndbam_repository_TEST.cc b/paludis/repositories/e/exndbam_repository_TEST.cc
index 28be5d34c..37d7af9df 100644
--- a/paludis/repositories/e/exndbam_repository_TEST.cc
+++ b/paludis/repositories/e/exndbam_repository_TEST.cc
@@ -64,7 +64,8 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
keys->insert("format", "exndbam");
- keys->insert("location", "exndbam_repository_TEST_dir/repo1");
+ keys->insert("location", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "repo1"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "build"));
std::tr1::shared_ptr<Repository> repo(ExndbamRepository::ExndbamRepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "installed");
@@ -92,8 +93,8 @@ namespace test_cases
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", "exndbam_repository_TEST_dir/postinsttest_src1");
- keys->insert("profiles", "exndbam_repository_TEST_dir/postinsttest_src1/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "postinsttest_src1"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "postinsttest_src1/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
@@ -107,7 +108,7 @@ namespace test_cases
keys.reset(new Map<std::string, std::string>);
keys->insert("format", "exndbam");
- keys->insert("location", "exndbam_repository_TEST_dir/postinsttest");
+ keys->insert("location", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "postinsttest"));
keys->insert("builddir", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "build"));
keys->insert("root", stringify(FSEntry("exndbam_repository_TEST_dir/root").realpath()));
std::tr1::shared_ptr<Repository> exndbam_repo(ExndbamRepository::ExndbamRepository::repository_factory_create(&env,
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index a747436aa..eadc5caef 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -79,7 +79,7 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/repo1");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "repo1"));
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
std::tr1::shared_ptr<Repository> repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
@@ -100,7 +100,7 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/repo1");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "repo1"));
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
std::tr1::shared_ptr<Repository> repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
@@ -124,7 +124,7 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/repo1");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "repo1"));
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
std::tr1::shared_ptr<Repository> repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
@@ -202,9 +202,9 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/repo1");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "repo1"));
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("world", "vdb_repository_TEST_dir/world-no-match-no-eol");
+ keys->insert("world", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "world-no-match-no-eol"));
std::tr1::shared_ptr<Repository> repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -258,7 +258,7 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/repo2");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "repo2"));
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
std::tr1::shared_ptr<Repository> repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
@@ -314,8 +314,8 @@ namespace test_cases
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", "vdb_repository_TEST_dir/srcrepo");
- keys->insert("profiles", "vdb_repository_TEST_dir/srcrepo/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "srcrepo"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "srcrepo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", eapi);
keys->insert("eapi_when_unspecified", eapi);
@@ -331,7 +331,7 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/repo3");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "repo3"));
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
std::tr1::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
@@ -431,8 +431,8 @@ namespace test_cases
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", "vdb_repository_TEST_dir/srcrepo");
- keys->insert("profiles", "vdb_repository_TEST_dir/srcrepo/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "srcrepo"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "srcrepo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", eapi);
keys->insert("eapi_when_unspecified", eapi);
@@ -448,7 +448,7 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/repo3");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "repo3"));
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
std::tr1::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
@@ -527,7 +527,7 @@ namespace test_cases
NamesCacheIncrementalTest() :
TestCase("names cache incremental"),
- names_cache("vdb_repository_TEST_dir/namesincrtest/.cache/names/installed")
+ names_cache(stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "namesincrtest/.cache/names/installed"))
{
}
@@ -548,8 +548,8 @@ namespace test_cases
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", "vdb_repository_TEST_dir/namesincrtest_src");
- keys->insert("profiles", "vdb_repository_TEST_dir/namesincrtest_src/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "namesincrtest_src"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "namesincrtest_src/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
@@ -565,7 +565,7 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", stringify(names_cache.dirname()));
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/namesincrtest");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "namesincrtest"));
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
std::tr1::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
@@ -821,7 +821,7 @@ namespace test_cases
ProvidesCacheTest() :
TestCase("provides cache"),
- provides_cache("vdb_repository_TEST_dir/providestest/.cache/provides")
+ provides_cache(stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providestest/.cache/provides"))
{
}
@@ -839,7 +839,7 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", stringify(provides_cache));
- keys->insert("location", "vdb_repository_TEST_dir/providestest");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providestest"));
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
std::tr1::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
@@ -903,7 +903,7 @@ namespace test_cases
ProvidesCacheIncrementalTest() :
TestCase("provides cache incremental"),
- provides_cache("vdb_repository_TEST_dir/providesincrtest/.cache/provides")
+ provides_cache(stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providesincrtest/.cache/provides"))
{
}
@@ -924,8 +924,8 @@ namespace test_cases
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", "vdb_repository_TEST_dir/providesincrtest_src1");
- keys->insert("profiles", "vdb_repository_TEST_dir/providesincrtest_src1/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providesincrtest_src1"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providesincrtest_src1/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
@@ -940,8 +940,8 @@ namespace test_cases
keys.reset(new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/providesincrtest_src2");
- keys->insert("profiles", "vdb_repository_TEST_dir/providesincrtest_src1/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providesincrtest_src2"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providesincrtest_src1/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
@@ -957,7 +957,7 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", stringify(provides_cache));
- keys->insert("location", "vdb_repository_TEST_dir/providesincrtest");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providesincrtest"));
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
std::tr1::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
@@ -1162,8 +1162,8 @@ namespace test_cases
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", "vdb_repository_TEST_dir/reinstalltest_src1");
- keys->insert("profiles", "vdb_repository_TEST_dir/reinstalltest_src1/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "reinstalltest_src1"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "reinstalltest_src1/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
@@ -1178,8 +1178,8 @@ namespace test_cases
keys.reset(new Map<std::string, std::string>);
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/reinstalltest_src2");
- keys->insert("profiles", "vdb_repository_TEST_dir/reinstalltest_src1/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "reinstalltest_src2"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "reinstalltest_src1/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
@@ -1195,7 +1195,7 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/reinstalltest");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "reinstalltest"));
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
std::tr1::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
@@ -1265,13 +1265,13 @@ namespace test_cases
void run()
{
- TestEnvironment env(FSEntry("vdb_repository_TEST_dir/root").realpath());
+ TestEnvironment env(FSEntry(stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "root")).realpath());
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", "vdb_repository_TEST_dir/postinsttest_src1");
- keys->insert("profiles", "vdb_repository_TEST_dir/postinsttest_src1/profiles/profile");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "postinsttest_src1"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "postinsttest_src1/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
@@ -1287,7 +1287,7 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/postinsttest");
+ keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "postinsttest"));
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
std::tr1::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
diff --git a/python/dep_list_TEST_setup.sh b/python/dep_list_TEST_setup.sh
index 5a5994148..a9652ced1 100755
--- a/python/dep_list_TEST_setup.sh
+++ b/python/dep_list_TEST_setup.sh
@@ -12,6 +12,7 @@ format = ebuild
names_cache = /var/empty
cache = /var/empty
profiles = \${location}/profiles/testprofile
+builddir = `pwd`
END
cat <<END > home/.paludis/repositories/installed.conf
@@ -19,6 +20,7 @@ location = `pwd`/installed
format = vdb
names_cache = /var/empty
provides_cache = /var/empty
+builddir = `pwd`
END
cat <<END > home/.paludis/keywords.conf
diff --git a/python/environment_TEST_setup.sh b/python/environment_TEST_setup.sh
index 0dfd47d2f..8ca20f825 100755
--- a/python/environment_TEST_setup.sh
+++ b/python/environment_TEST_setup.sh
@@ -12,6 +12,7 @@ format = ebuild
names_cache = /var/empty
cache = /var/empty
profiles = \${location}/profiles/testprofile
+builddir = `pwd`
END
cat <<END > home/.paludis/keywords.conf
diff --git a/python/mask_TEST_setup.sh b/python/mask_TEST_setup.sh
index 4bbc4d1e9..c4240b130 100755
--- a/python/mask_TEST_setup.sh
+++ b/python/mask_TEST_setup.sh
@@ -72,6 +72,7 @@ format = ebuild
names_cache = /var/empty
cache = /var/empty
profiles = \${location}/profiles/testprofile
+builddir = `pwd`
END
cat <<END > home/.paludis/package_mask.conf
diff --git a/python/package_database_TEST_setup.sh b/python/package_database_TEST_setup.sh
index 4782121f8..d482b044c 100755
--- a/python/package_database_TEST_setup.sh
+++ b/python/package_database_TEST_setup.sh
@@ -12,6 +12,7 @@ format = ebuild
names_cache = /var/empty
cache = /var/empty
profiles = \${location}/profiles/testprofile
+builddir = `pwd`
END
cat <<END > home/.paludis/keywords.conf
diff --git a/python/repository_TEST_setup.sh b/python/repository_TEST_setup.sh
index 54e31c9f3..5e9d5c113 100755
--- a/python/repository_TEST_setup.sh
+++ b/python/repository_TEST_setup.sh
@@ -12,6 +12,7 @@ format = ebuild
names_cache = /var/empty
cache = /var/empty
profiles = \${location}/profiles/testprofile
+builddir = `pwd`
END
cat <<END > home/.paludis/repositories/installed.conf
@@ -19,6 +20,7 @@ location = `pwd`/installed
format = vdb
names_cache = /var/empty
provides_cache = /var/empty
+builddir = `pwd`
END
cat <<END > home/.paludis/keywords.conf
diff --git a/ruby/action_TEST_setup.sh b/ruby/action_TEST_setup.sh
index d85130395..2a49bf758 100755
--- a/ruby/action_TEST_setup.sh
+++ b/ruby/action_TEST_setup.sh
@@ -12,6 +12,7 @@ format = ebuild
names_cache = /var/empty
cache = /var/empty
profiles = \${location}/profiles/testprofile
+builddir = `pwd`
END
cat <<END > home/.paludis/repositories/installed.conf
@@ -19,6 +20,7 @@ location = `pwd`/installed
format = vdb
names_cache = /var/empty
provides_cache = /var/empty
+builddir = `pwd`
END
cat <<END > home/.paludis/keywords.conf
diff --git a/ruby/dep_list_TEST_setup.sh b/ruby/dep_list_TEST_setup.sh
index 54aa34d59..c9e8b1c60 100755
--- a/ruby/dep_list_TEST_setup.sh
+++ b/ruby/dep_list_TEST_setup.sh
@@ -12,6 +12,7 @@ format = ebuild
names_cache = /var/empty
cache = /var/empty
profiles = \${location}/profiles/testprofile
+builddir = `pwd`
END
cat <<END > home/.paludis/repositories/installed.conf
@@ -19,6 +20,7 @@ location = `pwd`/installed
format = vdb
names_cache = /var/empty
provides_cache = /var/empty
+builddir = `pwd`
END
cat <<END > home/.paludis/keywords.conf
diff --git a/ruby/dep_spec_TEST_setup.sh b/ruby/dep_spec_TEST_setup.sh
index f8a57c456..b981819fe 100755
--- a/ruby/dep_spec_TEST_setup.sh
+++ b/ruby/dep_spec_TEST_setup.sh
@@ -12,6 +12,7 @@ format = ebuild
names_cache = /var/empty
cache = /var/empty
profiles = \${location}/profiles/testprofile
+builddir = `pwd`
END
cat <<END > home/.paludis/environment.conf
diff --git a/ruby/dep_tag_TEST_setup.sh b/ruby/dep_tag_TEST_setup.sh
index 8d13453f8..691d7a798 100755
--- a/ruby/dep_tag_TEST_setup.sh
+++ b/ruby/dep_tag_TEST_setup.sh
@@ -12,6 +12,7 @@ format = ebuild
names_cache = /var/empty
cache = /var/empty
profiles = \${location}/profiles/testprofile
+builddir = `pwd`
END
cat <<END > home/.paludis/environment.conf
diff --git a/ruby/environment_TEST_setup.sh b/ruby/environment_TEST_setup.sh
index e7b049710..d40bb34f7 100755
--- a/ruby/environment_TEST_setup.sh
+++ b/ruby/environment_TEST_setup.sh
@@ -12,6 +12,7 @@ format = ebuild
names_cache = /var/empty
cache = /var/empty
profiles = \${location}/profiles/testprofile
+builddir = `pwd`
END
cat <<END > home/.paludis/keywords.conf
diff --git a/ruby/generator_TEST_setup.sh b/ruby/generator_TEST_setup.sh
index dea3f7174..b7393421d 100755
--- a/ruby/generator_TEST_setup.sh
+++ b/ruby/generator_TEST_setup.sh
@@ -12,6 +12,7 @@ format = ebuild
names_cache = /var/empty
cache = /var/empty
profiles = \${location}/profiles/testprofile
+builddir = `pwd`
END
cat <<END > home/.paludis/environment.conf
diff --git a/ruby/package_database_TEST_setup.sh b/ruby/package_database_TEST_setup.sh
index c9e9f4e6d..a18060e74 100755
--- a/ruby/package_database_TEST_setup.sh
+++ b/ruby/package_database_TEST_setup.sh
@@ -12,6 +12,7 @@ format = ebuild
names_cache = /var/empty
cache = /var/empty
profiles = \${location}/profiles/testprofile
+builddir = `pwd`
END
cat <<END > home/.paludis/keywords.conf
diff --git a/ruby/package_id_TEST.rb b/ruby/package_id_TEST.rb
index 437758f56..82f541783 100644
--- a/ruby/package_id_TEST.rb
+++ b/ruby/package_id_TEST.rb
@@ -255,7 +255,7 @@ module Paludis
def test_repository_mask_info_keys
assert_kind_of MetadataRepositoryMaskInfoKey, pid_testrepo["repository_mask"]
assert_kind_of RepositoryMaskInfo, pid_testrepo["repository_mask"].value
- assert_equal "package_id_TEST_dir/testrepo/profiles/package.mask", pid_testrepo["repository_mask"].value.mask_file
+ assert pid_testrepo["repository_mask"].value.mask_file =~ %r[package_id_TEST_dir/testrepo/profiles/package.mask$]
assert_equal ["this is", "a test"], pid_testrepo["repository_mask"].value.comment
assert_nil pid_testrepo["profile_mask"].value
end
diff --git a/ruby/paludis_ruby_TEST_setup.sh b/ruby/paludis_ruby_TEST_setup.sh
index e089ce1ab..7aba80ad8 100755
--- a/ruby/paludis_ruby_TEST_setup.sh
+++ b/ruby/paludis_ruby_TEST_setup.sh
@@ -12,6 +12,7 @@ format = ebuild
names_cache = /var/empty
cache = /var/empty
profiles = \${location}/profiles/testprofile
+builddir = `pwd`
END
cat <<END > home/.paludis/repositories/installed.conf
@@ -19,6 +20,7 @@ location = `pwd`/installed
format = vdb
names_cache = /var/empty
provides_cache = /var/empty
+builddir = `pwd`
END
cat <<END > home/.paludis/keywords.conf
diff --git a/ruby/repository_TEST_setup.sh b/ruby/repository_TEST_setup.sh
index 7b3490101..e7b3ef7f3 100755
--- a/ruby/repository_TEST_setup.sh
+++ b/ruby/repository_TEST_setup.sh
@@ -12,6 +12,7 @@ format = ebuild
names_cache = /var/empty
cache = /var/empty
profiles = \${location}/profiles/testprofile
+builddir = `pwd`
END
cat <<END > home/.paludis/repositories/installed.conf
@@ -19,6 +20,7 @@ location = `pwd`/installed
format = vdb
names_cache = /var/empty
provides_cache = /var/empty
+builddir = `pwd`
END
cat <<END > home/.paludis/keywords.conf