aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-06 15:59:58 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-06 15:59:58 +0100
commit6a6d29792c3eac7bc41eb64d14b8f0023aa8a30d (patch)
tree419785e24ccce9e09bc1a7ddd2434092863ee614
parent901a45e44315ec7905513578bb5b810568545c56 (diff)
downloadpaludis-6a6d29792c3eac7bc41eb64d14b8f0023aa8a30d.tar.gz
paludis-6a6d29792c3eac7bc41eb64d14b8f0023aa8a30d.tar.xz
Better error message for duff repo_name contents.
-rw-r--r--paludis/repositories/e/e_repository.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 2308d76..83d63ae 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -434,6 +434,7 @@ namespace
RepositoryName
fetch_repo_name(const FSEntry & tree_root)
{
+ bool illegal(false);
try
{
do
@@ -452,6 +453,10 @@ namespace
} while (false);
}
+ catch (const RepositoryNameError &)
+ {
+ illegal = true;
+ }
catch (...)
{
}
@@ -459,9 +464,14 @@ namespace
std::string modified_location(tree_root.basename());
std::replace(modified_location.begin(), modified_location.end(), '/', '-');
- Log::get_instance()->message("e.repo_name.unusable", ll_qa, lc_no_context)
- << "Couldn't open repo_name file in '" << tree_root << "/profiles/', falling back to generated name 'x-"
- << modified_location << "' (ignore this message if you have yet to sync this repository).";
+ if (illegal)
+ Log::get_instance()->message("e.repo_name.invalid", ll_qa, lc_no_context)
+ << "repo_name file in '" << tree_root << "/profiles/', specifies an illegal repository name, falling back to generated name 'x-"
+ << modified_location << "'.";
+ else
+ Log::get_instance()->message("e.repo_name.unusable", ll_qa, lc_no_context)
+ << "Couldn't open repo_name file in '" << tree_root << "/profiles/', falling back to generated name 'x-"
+ << modified_location << "' (ignore this message if you have yet to sync this repository).";
return RepositoryName("x-" + modified_location);
}