aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-05 16:29:52 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-05 16:29:52 +0000
commit2feebf57efe1208db481c2dac67d82f4725b4a4a (patch)
treef7171ad2ac59010bde5050acb075e68840642439
parent796ae59ba6e45c3e67a56b5741c2fc0890555010 (diff)
downloadpaludis-2feebf57efe1208db481c2dac67d82f4725b4a4a.tar.gz
paludis-2feebf57efe1208db481c2dac67d82f4725b4a4a.tar.xz
Fix repo name cache
-rw-r--r--paludis/repository_name_cache.cc6
-rwxr-xr-xpaludis/repository_name_cache_TEST_setup.sh21
2 files changed, 15 insertions, 12 deletions
diff --git a/paludis/repository_name_cache.cc b/paludis/repository_name_cache.cc
index 73a7158..c84150e 100644
--- a/paludis/repository_name_cache.cc
+++ b/paludis/repository_name_cache.cc
@@ -36,14 +36,14 @@ namespace paludis
template<>
struct Implementation<RepositoryNameCache>
{
- const FSEntry location;
+ mutable FSEntry location;
const Repository * const repo;
mutable NameCacheMap name_cache_map;
mutable bool checked_name_cache_map;
Implementation(const FSEntry & l, const Repository * const r) :
- location(l / stringify(r->name())),
+ location(l == FSEntry("/var/empty") ? l : l / stringify(r->name())),
repo(r),
checked_name_cache_map(false)
{
@@ -75,6 +75,8 @@ RepositoryNameCache::category_names_containing_package(const PackageNamePart & p
std::tr1::shared_ptr<CategoryNamePartCollection> result(new CategoryNamePartCollection::Concrete);
NameCacheMap::iterator r(_imp->name_cache_map.find(p));
+ _imp->location = FSEntry(stringify(_imp->location));
+
if (_imp->name_cache_map.end() == r)
{
r = _imp->name_cache_map.insert(std::make_pair(p, std::list<CategoryNamePart>())).first;
diff --git a/paludis/repository_name_cache_TEST_setup.sh b/paludis/repository_name_cache_TEST_setup.sh
index 0ac7f32..6252764 100755
--- a/paludis/repository_name_cache_TEST_setup.sh
+++ b/paludis/repository_name_cache_TEST_setup.sh
@@ -5,17 +5,18 @@ mkdir repository_name_cache_TEST_dir || exit 1
cd repository_name_cache_TEST_dir || exit 1
mkdir -p not_generated
+mkdir -p generated
-mkdir -p old_format
-echo "paludis-1" > old_format/_VERSION_
+mkdir -p old_format/repo
+echo "paludis-1" > old_format/repo/_VERSION_
-mkdir -p bad_repo
-echo "paludis-2" > bad_repo/_VERSION_
-echo "monkey" >> bad_repo/_VERSION_
+mkdir -p bad_repo/repo
+echo "paludis-2" > bad_repo/repo/_VERSION_
+echo "monkey" >> bad_repo/repo/_VERSION_
-mkdir -p good_repo
-echo "paludis-2" > good_repo/_VERSION_
-echo "repo" >> good_repo/_VERSION_
-echo "bar" > good_repo/foo
-echo "baz" >> good_repo/foo
+mkdir -p good_repo/repo
+echo "paludis-2" > good_repo/repo/_VERSION_
+echo "repo" >> good_repo/repo/_VERSION_
+echo "bar" > good_repo/repo/foo
+echo "baz" >> good_repo/repo/foo