aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-03-08 03:08:27 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-03-08 03:08:27 +0000
commit5bf1ffd28b491b8c562c3a353bba7ab1b5312a5a (patch)
treead80751319e188ea9d1e7719fa2f0fea00143135
parente64e86cd978664596b264242b2a47b4710898ad6 (diff)
downloadpaludis-5bf1ffd28b491b8c562c3a353bba7ab1b5312a5a.tar.gz
paludis-5bf1ffd28b491b8c562c3a353bba7ab1b5312a5a.tar.xz
Don't allow / in repo names, as per GLEP 42.
-rw-r--r--paludis/name.cc2
-rw-r--r--paludis/portage_repository.cc5
2 files changed, 5 insertions, 2 deletions
diff --git a/paludis/name.cc b/paludis/name.cc
index 9b600dc..7cfb508 100644
--- a/paludis/name.cc
+++ b/paludis/name.cc
@@ -203,7 +203,7 @@ RepositoryNameValidator::validate(const std::string & s)
static const std::string allowed_chars(
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "0123456789-+_/");
+ "0123456789-+_");
do
{
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index a96c384..98713b0 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -521,7 +521,10 @@ PortageRepository::fetch_repo_name(const std::string & location)
}
Log::get_instance()->message(ll_qa, "Couldn't open repo_name file in '"
+ location + "/profiles/'. Falling back to a generated name.");
- return RepositoryName("x-" + location);
+
+ std::string modified_location(location);
+ std::replace(modified_location.begin(), modified_location.end(), '/', '-');
+ return RepositoryName("x-" + modified_location);
}
VersionMetadata::ConstPointer