aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-08-24 01:02:23 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2008-08-24 01:02:23 +0100
commita74bd5b6e5db7221829f57c9975434e815363764 (patch)
tree6703ce1126dc1fe588c5a9885e1b4b9e6a520be7
parentd04fe3ec84b3752c6aa57294763f18cc9be5e6f4 (diff)
downloadpaludis-a74bd5b6e5db7221829f57c9975434e815363764.tar.gz
paludis-a74bd5b6e5db7221829f57c9975434e815363764.tar.xz
Fix cache for relative repository paths.
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc4
-rwxr-xr-xpaludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh28
-rw-r--r--paludis/repositories/e/eclass_mtimes.cc2
3 files changed, 17 insertions, 17 deletions
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index a6f159a..c4dd3ad 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -115,7 +115,7 @@ namespace
{
std::set<std::string> tokens;
tokenise_whitespace(lines[m.inherited().flat_list_index()], std::inserter(tokens, tokens.begin()));
- FSEntry eclassdir(id->repository()->location_key()->value() / "eclass");
+ FSEntry eclassdir((id->repository()->location_key()->value() / "eclass").realpath_if_exists());
for (std::set<std::string>::const_iterator it(tokens.begin()),
it_end(tokens.end()); it_end != it; ++it)
{
@@ -346,7 +346,7 @@ EbuildFlatMetadataCache::load(const std::tr1::shared_ptr<const EbuildID> & id)
{
std::vector<std::string> eclasses;
tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(keys["_eclasses_"], "\t", "", std::back_inserter(eclasses));
- FSEntry eclassdir(id->repository()->location_key()->value() / "eclass");
+ FSEntry eclassdir((id->repository()->location_key()->value() / "eclass").realpath_if_exists());
for (std::vector<std::string>::const_iterator it(eclasses.begin()),
it_end(eclasses.end()); it_end != it; ++it)
{
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh
index 59bbe15..9754c58 100755
--- a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh
@@ -538,7 +538,7 @@ cat <<END > cat/flat_hash-full-eclass/flat_hash-full-eclass-1.ebuild || exit 1
END
cat <<END > metadata/cache/cat/flat_hash-full-eclass-1 || exit 1
_mtime_=60
-_eclasses_=foo ebuild_flat_metadata_cache_TEST_dir/repo/eclass 180
+_eclasses_=foo $(../../ebuild/utils/canonicalise eclass) 180
DEPEND=the/depend
RDEPEND=the/rdepend
SLOT=the-slot
@@ -560,7 +560,7 @@ cat <<END > cat/flat_hash-full-eclass-nonstandard/flat_hash-full-eclass-nonstand
END
cat <<END > metadata/cache/cat/flat_hash-full-eclass-nonstandard-1 || exit 1
_mtime_=60
-_eclasses_=foo ebuild_flat_metadata_cache_TEST_dir/repo/eclass 180 bar ebuild_flat_metadata_cache_TEST_dir/extra_eclasses 180
+_eclasses_=foo $(../../ebuild/utils/canonicalise eclass) 180 bar $(../../ebuild/utils/canonicalise ../extra_eclasses) 180
DEPEND=the/depend
RDEPEND=the/rdepend
SLOT=the-slot
@@ -590,7 +590,7 @@ DEPEND=""
END
cat <<END > metadata/cache/cat/flat_hash-full-eclass-stale-1 || exit 1
_mtime_=60
-_eclasses_=foo ebuild_flat_metadata_cache_TEST_dir/repo/eclass 120
+_eclasses_=foo $(../../ebuild/utils/canonicalise eclass) 120
DEPEND=the/depend
RDEPEND=the/rdepend
SLOT=the-slot
@@ -620,7 +620,7 @@ DEPEND=""
END
cat <<END > metadata/cache/cat/flat_hash-full-eclass-wrong-1 || exit 1
_mtime_=60
-_eclasses_=foo ebuild_flat_metadata_cache_TEST_dir/repo/eclass 180 bar ebuild_flat_metadata_cache_TEST_dir/repo/eclass 180
+_eclasses_=foo $(../../ebuild/utils/canonicalise eclass) 180 bar $(../../ebuild/utils/canonicalise eclass) 180
DEPEND=the/depend
RDEPEND=the/rdepend
SLOT=the-slot
@@ -650,7 +650,7 @@ DEPEND=""
END
cat <<END > metadata/cache/cat/flat_hash-full-eclass-gone-1 || exit 1
_mtime_=60
-_eclasses_=baz ebuild_flat_metadata_cache_TEST_dir/repo/eclass 180
+_eclasses_=baz $(../../ebuild/utils/canonicalise eclass) 180
DEPEND=the/depend
RDEPEND=the/rdepend
SLOT=the-slot
@@ -680,7 +680,7 @@ DEPEND=""
END
cat <<END > metadata/cache/cat/flat_hash-eclasses-truncated-1 || exit 1
_mtime_=60
-_eclasses_=foo ebuild_flat_metadata_cache_TEST_dir/repo/eclass
+_eclasses_=foo $(../../ebuild/utils/canonicalise eclass)
DEPEND=the/depend
RDEPEND=the/rdepend
SLOT=the-slot
@@ -790,7 +790,7 @@ cat <<END > cat/flat_hash-exlib/flat_hash-exlib-1.ebuild || exit 1
END
cat <<END > metadata/cache/cat/flat_hash-exlib-1 || exit 1
_mtime_=60
-_exlibs_=foo ebuild_flat_metadata_cache_TEST_dir/repo/exlibs 180
+_exlibs_=foo $(../../ebuild/utils/canonicalise exlibs) 180
DEPENDENCIES=the/depend
SLOT=the-slot
DOWNLOADS=the-src-uri
@@ -809,7 +809,7 @@ cat <<END > cat/flat_hash-exlib-percat/flat_hash-exlib-percat-1.ebuild || exit 1
END
cat <<END > metadata/cache/cat/flat_hash-exlib-percat-1 || exit 1
_mtime_=60
-_exlibs_=foo ebuild_flat_metadata_cache_TEST_dir/repo/exlibs 180 bar ebuild_flat_metadata_cache_TEST_dir/repo/cat/exlibs 180
+_exlibs_=foo $(../../ebuild/utils/canonicalise exlibs) 180 bar $(../../ebuild/utils/canonicalise cat/exlibs) 180
DEPENDENCIES=the/depend
SLOT=the-slot
DOWNLOADS=the-src-uri
@@ -836,7 +836,7 @@ DEPENDENCIES=""
END
cat <<END > metadata/cache/cat/flat_hash-exlib-stale-1 || exit 1
_mtime_=60
-_exlibs_=foo ebuild_flat_metadata_cache_TEST_dir/repo/exlibs 120
+_exlibs_=foo $(../../ebuild/utils/canonicalise exlibs) 120
DEPENDENCIES=the/depend
SLOT=the-slot
DOWNLOADS=the-src-uri
@@ -863,7 +863,7 @@ DEPENDENCIES=""
END
cat <<END > metadata/cache/cat/flat_hash-exlib-wrong-1 || exit 1
_mtime_=60
-_exlibs_=foo ebuild_flat_metadata_cache_TEST_dir/repo/exlibs 180 bar ebuild_flat_metadata_cache_TEST_dir/repo/exlibs 180
+_exlibs_=foo $(../../ebuild/utils/canonicalise exlibs) 180 bar $(../../ebuild/utils/canonicalise exlibs) 180
DEPENDENCIES=the/depend
SLOT=the-slot
DOWNLOADS=the-src-uri
@@ -890,7 +890,7 @@ DEPENDENCIES=""
END
cat <<END > metadata/cache/cat/flat_hash-exlib-gone-1 || exit 1
_mtime_=60
-_exlibs_=baz ebuild_flat_metadata_cache_TEST_dir/repo/exlibs 180
+_exlibs_=baz $(../../ebuild/utils/canonicalise exlibs) 180
DEPENDENCIES=the/depend
SLOT=the-slot
DOWNLOADS=the-src-uri
@@ -917,7 +917,7 @@ DEPENDENCIES=""
END
cat <<END > metadata/cache/cat/flat_hash-exlibs-truncated-1 || exit 1
_mtime_=60
-_exlibs_=foo ebuild_flat_metadata_cache_TEST_dir/repo/exlibs
+_exlibs_=foo $(../../ebuild/utils/canonicalise exlibs)
DEPENDENCIES=the/depend
SLOT=the-slot
DOWNLOADS=the-src-uri
@@ -1070,7 +1070,7 @@ END
cat <<END > cache/expected/cat/write-eclasses-1
_mtime_=60
-_eclasses_=bar ebuild_flat_metadata_cache_TEST_dir/extra_eclasses 180 foo ebuild_flat_metadata_cache_TEST_dir/repo/eclass 180
+_eclasses_=bar $(../ebuild/utils/canonicalise extra_eclasses) 180 foo $(../ebuild/utils/canonicalise repo/eclass) 180
DEPEND=cat/foo bar? ( cat/bar ) cat/baz
RDEPEND=cat/foo bar? ( cat/bar )
SLOT=0
@@ -1084,7 +1084,7 @@ END
cat <<END > cache/expected/cat/write-exlibs-1
_mtime_=60
-_exlibs_=bar ebuild_flat_metadata_cache_TEST_dir/repo/cat/exlibs 180 foo ebuild_flat_metadata_cache_TEST_dir/repo/exlibs 180
+_exlibs_=bar $(../ebuild/utils/canonicalise repo/cat/exlibs) 180 foo $(../ebuild/utils/canonicalise repo/exlibs) 180
DEPENDENCIES=( build: cat/foo bar? ( cat/bar ) ) cat/baz ( build: bar? ( ) ) cat/baz ( build: bar? ( ) )
SLOT=0
HOMEPAGE=http://example.com/
diff --git a/paludis/repositories/e/eclass_mtimes.cc b/paludis/repositories/e/eclass_mtimes.cc
index e8136c7..546537e 100644
--- a/paludis/repositories/e/eclass_mtimes.cc
+++ b/paludis/repositories/e/eclass_mtimes.cc
@@ -57,7 +57,7 @@ namespace
{
FSEntry f(*d / e);
if (f.exists())
- return & c.files.insert(std::make_pair(e, f)).first->second;
+ return & c.files.insert(std::make_pair(e, f.realpath())).first->second;
}
return 0;