aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-04-02 19:27:47 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-04-02 19:27:47 +0000
commit4445df47ba1aad254909664fdcc480de1960ec5c (patch)
tree1cc0905690a05df7f26ffd7278e91688092651d1
parent7f6b888727f4d3d170a542c76f458de51c2e4843 (diff)
downloadpaludis-4445df47ba1aad254909664fdcc480de1960ec5c.tar.gz
paludis-4445df47ba1aad254909664fdcc480de1960ec5c.tar.xz
Handle broken profiles more gracefully for NoConfigEnvironment things.
-rw-r--r--paludis/repositories/e/e_repository.cc29
-rw-r--r--paludis/repositories/e/e_repository_profile.cc2
2 files changed, 22 insertions, 9 deletions
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 93e9581..785ce29 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -395,14 +395,26 @@ namespace paludis
FSEntrySequence profiles;
profiles.push_back(layout->profiles_base_dir() / tokens.at(1));
- profiles_desc.push_back(RepositoryEInterface::ProfilesDescLine::named_create()
- (k::arch(), tokens.at(0))
- (k::path(), *profiles.begin())
- (k::status(), tokens.at(2))
- (k::profile(), tr1::shared_ptr<ERepositoryProfile>(new ERepositoryProfile(
- params.environment, repo, repo->name(), profiles,
- (*(*erepository::EAPIData::get_instance()->eapi_from_string(
- params.eapi_when_unknown))[k::supported()])[k::ebuild_environment_variables()][k::env_arch()]))));
+ try
+ {
+ profiles_desc.push_back(RepositoryEInterface::ProfilesDescLine::named_create()
+ (k::arch(), tokens.at(0))
+ (k::path(), *profiles.begin())
+ (k::status(), tokens.at(2))
+ (k::profile(), tr1::shared_ptr<ERepositoryProfile>(new ERepositoryProfile(
+ params.environment, repo, repo->name(), profiles,
+ (*(*erepository::EAPIData::get_instance()->eapi_from_string(
+ params.eapi_when_unknown))[k::supported()])[k::ebuild_environment_variables()][k::env_arch()]))));
+ }
+ catch (const InternalError &)
+ {
+ throw;
+ }
+ catch (const Exception & e)
+ {
+ Log::get_instance()->message(ll_warning, lc_context, "No loading profile '" +
+ tokens.at(1) + "' due to exception '" + e.message() + "' (" + e.what() + ")");
+ }
}
}
@@ -1027,6 +1039,7 @@ ERepository::set_profile(const ProfilesConstIterator & iter)
{
Context context("When setting profile by iterator:");
+ Log::get_instance()->message(ll_debug, lc_context, "Using profile '" + stringify((*iter)[k::path()]) + "'");
_imp->profile_ptr = (*iter)[k::profile()];
if ((*DistributionData::get_instance()->distribution_from_string(_imp->params.environment->default_distribution()))
diff --git a/paludis/repositories/e/e_repository_profile.cc b/paludis/repositories/e/e_repository_profile.cc
index d96c528..1fb1418 100644
--- a/paludis/repositories/e/e_repository_profile.cc
+++ b/paludis/repositories/e/e_repository_profile.cc
@@ -182,7 +182,7 @@ namespace paludis
tr1::shared_ptr<AllDepSpec>(new AllDepSpec))),
system_tag(new GeneralSetDepTag(SetName("system"), stringify(name)))
{
- Context context("When loading profiles for repository '" + stringify(name) + "':");
+ Context context("When loading profiles '" + join(dirs.begin(), dirs.end(), "' '") + "' for repository '" + stringify(name) + "':");
load_environment();
for (FSEntrySequence::ConstIterator d(dirs.begin()), d_end(dirs.end()) ;