diff options
author | 2012-03-29 21:42:42 +0100 | |
---|---|---|
committer | 2012-03-30 18:30:59 +0100 | |
commit | 27f5b80072a637108d984754616f4a757170cf40 (patch) | |
tree | df645615d31c47cd70f969d069082efc6383b8c8 | |
parent | ad3a7401391d321ae4664a6e8e630ee3611fd512 (diff) | |
download | paludis-27f5b80072a637108d984754616f4a757170cf40.tar.gz paludis-27f5b80072a637108d984754616f4a757170cf40.tar.xz |
Don't reject flat_hash cache with no EAPI
Portage doesn't write the EAPI key if the value is 0. Always assume
0, rather than eapi_when_{unknown,unspecified}, because this only
happens when the EAPI is 0, specifically, never anything else.
3 files changed, 6 insertions, 9 deletions
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc index 5096454ca..9f1c3dfa8 100644 --- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc +++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc @@ -364,12 +364,9 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const std::map<std::string, std::string>::const_iterator eapi(keys.find("EAPI")); if (keys.end() == eapi) - { - Log::get_instance()->message("e.cache.flat_hash.broken", ll_warning, lc_context) - << "cache file contains no 'EAPI' key"; - return false; - } - id->set_eapi(eapi->second); + id->set_eapi("0"); + else + id->set_eapi(eapi->second); if (id->eapi()->supported()) { diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc index c825469a9..f2747594d 100644 --- a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc +++ b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc @@ -509,7 +509,7 @@ TEST(EbuildFlatMetadataCache, HashNoEAPI) &env, { })), make_null_shared_ptr(), { }))]->begin()); ASSERT_TRUE(bool(id1->short_description_key())); - EXPECT_EQ("The Generated Description flat_hash-no-eapi", id1->short_description_key()->parse_value()); + EXPECT_EQ("The Description flat_hash-no-eapi", id1->short_description_key()->parse_value()); } TEST(EbuildFlatMetadataCache, HashDuplicateKey) 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 ee90764f8..61583f826 100755 --- a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh +++ b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST_setup.sh @@ -530,7 +530,7 @@ TZ=UTC touch -t 197001010001 metadata/cache/cat/flat_hash-bad-md5-1 || exit 2 mkdir cat/flat_hash-no-eapi cat <<END > cat/flat_hash-no-eapi/flat_hash-no-eapi-1.ebuild || exit 1 -DESCRIPTION="The Generated Description flat_hash-no-eapi" +DESCRIPTION="Monkey" HOMEPAGE="http://example.com/" SRC_URI="" SLOT="0" @@ -549,7 +549,7 @@ SRC_URI=the-src-uri RESTRICT=the-restrict HOMEPAGE=the-homepage LICENSE=the-license -DESCRIPTION=The Stale Description +DESCRIPTION=The Description flat_hash-no-eapi KEYWORDS=the-keywords IUSE=the-iuse PDEPEND=the/pdepend |