aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-08-05 21:21:57 +0000
committerAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-08-05 21:21:57 +0000
commitd99ebe8475fc1efd6cf13f4468bca9334c0c3453 (patch)
treef3376969889a3c4e69ae35e6fa953badf8ff5932
parentf7b523dc3a006d78884cd744344fc88a3cf294c2 (diff)
downloadpaludis-d99ebe8475fc1efd6cf13f4468bca9334c0c3453.tar.gz
paludis-d99ebe8475fc1efd6cf13f4468bca9334c0c3453.tar.xz
Fix stale cache check for ebuilds not inheriting any eclasses.
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc12
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh34
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc7
3 files changed, 48 insertions, 5 deletions
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 2d4201d..06d1953 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -587,6 +587,18 @@ namespace test_cases
TEST_CHECK(id1->short_description_key());
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Generated Description");
}
+
+ for (int pass = 1 ; pass <= 3 ; ++pass)
+ {
+ TestMessageSuffix pass_suffix("pass=" + stringify(pass), true);
+
+ tr1::shared_ptr<const PackageID> id1(*env.package_database()->query(query::Matches(
+ PackageDepSpec("=cat-one/stale-pkg-2", pds_pm_unspecific)), qo_require_exactly_one)->begin());
+
+ TEST_CHECK(id1->end_metadata() != id1->find_metadata("EAPI"));
+ TEST_CHECK(id1->short_description_key());
+ TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Generated Description");
+ }
}
}
} test_e_repository_metadata_stale;
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index 568de7a..cd589d0 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -163,7 +163,37 @@ END
cat <<END > cat-one/pkg-two/pkg-two-1.ebuild || exit 1
i am a fish
END
+
cat <<END > cat-one/stale-pkg/stale-pkg-1.ebuild || exit 1
+DESCRIPTION="The Generated Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+DEPEND=""
+END
+cat <<END > metadata/cache/cat-one/stale-pkg-1
+the/depend
+the/rdepend
+the-slot
+the-src-uri
+the-restrict
+the-homepage
+the-license
+The Stale Description
+the-keywords
+
+the-iuse
+unused
+the/pdepend
+the/provide
+0
+END
+touch -t 199901010101 metadata/cache/cat-one/stale-pkg-1 || exit 2
+
+cat <<END > cat-one/stale-pkg/stale-pkg-2.ebuild || exit 1
inherit stale
DESCRIPTION="The Generated Description"
@@ -175,7 +205,7 @@ LICENSE="GPL-2"
KEYWORDS="test"
DEPEND=""
END
-cat <<END > metadata/cache/cat-one/stale-pkg-1
+cat <<END > metadata/cache/cat-one/stale-pkg-2
the/depend
the/rdepend
the-slot
@@ -192,7 +222,7 @@ the/pdepend
the/provide
0
END
-touch -t 199901010101 metadata/cache/cat-one/stale-pkg-1 || exit 2
+touch -t 199901010101 metadata/cache/cat-one/stale-pkg-2 || exit 2
cd ..
mkdir -p repo8/{eclass,distfiles,profiles/profile} || exit 1
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index b8c3c57..2bdc30d 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -74,13 +74,14 @@ EbuildFlatMetadataCache::load(const tr1::shared_ptr<const EbuildID> & id)
{
const EAPIEbuildMetadataVariables & m(*id->eapi()->supported->ebuild_metadata_variables);
- if (! lines[9].empty())
{
time_t cache_time(std::max(_master_mtime, _filename.mtime()));
std::set<std::string> tokens;
WhitespaceTokeniser::get_instance()->tokenise(lines[9], std::inserter(tokens, tokens.begin()));
- ok = _ebuild.mtime() <= cache_time &&
- tokens.end() == std::find_if(tokens.begin(), tokens.end(),
+ ok = _ebuild.mtime() <= cache_time;
+
+ if (ok && ! tokens.empty())
+ ok = tokens.end() == std::find_if(tokens.begin(), tokens.end(),
tr1::bind(std::greater<time_t>(), tr1::bind(
tr1::mem_fn(&EclassMtimes::mtime), _eclass_mtimes.get(), _1), cache_time));
}