aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-12 14:02:44 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-12 14:02:44 +0000
commit9ee5a6f599ef9ea49c95c898afd37856bd649e74 (patch)
tree8d017271d2c53befc605af81965ef7fc7af42eb5
parentfedcaf434a0ad8a9e191e39f99f810a031299c47 (diff)
downloadpaludis-9ee5a6f599ef9ea49c95c898afd37856bd649e74.tar.gz
paludis-9ee5a6f599ef9ea49c95c898afd37856bd649e74.tar.xz
Use shorter generated repo names. More likely to collide, but a lot less ugly.
-rw-r--r--paludis/portage_repository.cc2
-rw-r--r--paludis/portage_repository_TEST.cc6
2 files changed, 3 insertions, 5 deletions
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index 105e4c2..0e91c9b 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -654,7 +654,7 @@ 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.");
- std::string modified_location(location);
+ std::string modified_location(FSEntry(location).basename());
std::replace(modified_location.begin(), modified_location.end(), '/', '-');
return RepositoryName("x-" + modified_location);
}
diff --git a/paludis/portage_repository_TEST.cc b/paludis/portage_repository_TEST.cc
index a3c10c8..738d06a 100644
--- a/paludis/portage_repository_TEST.cc
+++ b/paludis/portage_repository_TEST.cc
@@ -63,8 +63,7 @@ namespace test_cases
keys.insert(std::make_pair("profile", "portage_repository_TEST_dir/repo2/profiles/profile"));
PortageRepository::Pointer repo(PortageRepository::make_portage_repository(
&env, env.package_database().raw_pointer(), keys));
- TEST_CHECK(0 == repo->name().data().substr(
- repo->name().data().length() - 33).compare("portage_repository_TEST_dir-repo2"));
+ TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "x-repo2");
}
} test_portage_repository_no_repo_name;
@@ -81,8 +80,7 @@ namespace test_cases
keys.insert(std::make_pair("profile", "portage_repository_TEST_dir/repo3/profiles/profile"));
PortageRepository::Pointer repo(PortageRepository::make_portage_repository(
&env, env.package_database().raw_pointer(), keys));
- TEST_CHECK(0 == repo->name().data().substr(
- repo->name().data().length() - 33).compare("portage_repository_TEST_dir-repo3"));
+ TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "x-repo3");
}
} test_portage_repository_empty_repo_name;