aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-11-15 23:37:08 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-11-15 23:37:08 +0000
commit7385570bea9b9d1954edf7a824fa61bd42c371e8 (patch)
treea98bd0709fc85fe2c381ef1a531a9ec9afe9bdfb
parent379066d3b475da76f4e549b3c53426c5fec26dc4 (diff)
downloadpaludis-7385570bea9b9d1954edf7a824fa61bd42c371e8.tar.gz
paludis-7385570bea9b9d1954edf7a824fa61bd42c371e8.tar.xz
Ignore master_repository_dir if it's the same as repository_dir.
-rw-r--r--NEWS4
-rw-r--r--paludis/environments/no_config/no_config_environment.cc41
2 files changed, 28 insertions, 17 deletions
diff --git a/NEWS b/NEWS
index 70f5d51..4d06559 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,10 @@ trunk/:
* Metadata options for importare.
+ * adjutrix, qualudis and friends ignore --master-repository-dir if
+ it is the same as the main repository directory, allowing it to
+ be more usefully specified in {ADJUTRIX,QUALUDIS}_OPTIONS.
+
0.26.0_alpha3:
* STILL BROKEN, wait for 0.26.0 if you use these: CRAN, Ruby bindings for
dep specs.
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index 7e6f688..a003fb2 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -146,22 +146,29 @@ Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
{
if (FSEntry("/var/empty") != params.master_repository_dir)
{
- tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
-
- if (params.extra_params)
- std::copy(params.extra_params->begin(), params.extra_params->end(), keys->inserter());
-
- keys->insert("format", "ebuild");
- keys->insert("location", stringify(params.master_repository_dir));
- keys->insert("profiles", "/var/empty");
- keys->insert("ignore_deprecated_profiles", "true");
- keys->insert("write_cache", stringify(params.write_cache));
- keys->insert("names_cache", "/var/empty");
- if (params.disable_metadata_cache)
- keys->insert("cache", "/var/empty");
-
- package_database->add_repository(1, ((master_repo =
- RepositoryMaker::get_instance()->find_maker("ebuild")(env, keys))));
+ if (params.repository_dir.realpath() == params.master_repository_dir.realpath())
+ Log::get_instance()->message(ll_warning, lc_context, "Ignoring master_repository_dir '" +
+ stringify(params.master_repository_dir) + "' because it is the same as repository_dir");
+
+ else
+ {
+ tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+
+ if (params.extra_params)
+ std::copy(params.extra_params->begin(), params.extra_params->end(), keys->inserter());
+
+ keys->insert("format", "ebuild");
+ keys->insert("location", stringify(params.master_repository_dir));
+ keys->insert("profiles", "/var/empty");
+ keys->insert("ignore_deprecated_profiles", "true");
+ keys->insert("write_cache", stringify(params.write_cache));
+ keys->insert("names_cache", "/var/empty");
+ if (params.disable_metadata_cache)
+ keys->insert("cache", "/var/empty");
+
+ package_database->add_repository(1, ((master_repo =
+ RepositoryMaker::get_instance()->find_maker("ebuild")(env, keys))));
+ }
}
tr1::shared_ptr<Map<std::string, std::string> > keys( new Map<std::string, std::string>);
@@ -179,7 +186,7 @@ Implementation<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
if (params.disable_metadata_cache)
keys->insert("cache", "/var/empty");
- if (FSEntry("/var/empty") != params.master_repository_dir)
+ if (master_repo)
keys->insert("master_repository", stringify(master_repo->name()));
if ((params.repository_dir / "metadata" / "profiles_desc.conf").exists())