aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-03-29 17:04:18 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-03-29 17:04:26 +0100
commitae15e893ab74f7932e717621c218417aae824b9b (patch)
tree12c634b8f3b8005caf5a5b5293b430eac1f59e85
parent2a768ecc8d271a802d31db7c74d196f2298248b2 (diff)
downloadpaludis-ae15e893ab74f7932e717621c218417aae824b9b.tar.gz
paludis-ae15e893ab74f7932e717621c218417aae824b9b.tar.xz
about.conf
-rw-r--r--paludis/repositories/e/e_repository.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 61dfa4d..33796bf 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -241,6 +241,7 @@ namespace paludis
std::tr1::shared_ptr<const MetadataValueKey<std::string> > binary_src_uri_prefix_key;
std::tr1::shared_ptr<const MetadataValueKey<std::string> > binary_keywords;
std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > accounts_repository_data_location_key;
+ std::list<std::tr1::shared_ptr<const MetadataKey> > about_keys;
};
Implementation<ERepository>::Implementation(ERepository * const r,
@@ -326,6 +327,27 @@ namespace paludis
"binary_keywords", "binary_keywords", mkt_normal, params.binary_keywords())),
accounts_repository_data_location_key(layout->accounts_repository_data_location_key())
{
+ if ((params.location() / "metadata" / "about.conf").is_regular_file_or_symlink_to_regular_file())
+ {
+ Context context("When loading about.conf:");
+ KeyValueConfigFile k(params.location() / "metadata" / "about.conf", KeyValueConfigFileOptions(),
+ &KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation);
+ if (! k.get("description").empty())
+ about_keys.push_back(make_shared_ptr(new LiteralMetadataValueKey<std::string>("description", "description",
+ mkt_significant, k.get("description"))));
+ if (! k.get("summary").empty())
+ about_keys.push_back(make_shared_ptr(new LiteralMetadataValueKey<std::string>("summary", "summary",
+ mkt_significant, k.get("summary"))));
+ if (! k.get("status").empty())
+ about_keys.push_back(make_shared_ptr(new LiteralMetadataValueKey<std::string>("status", "status",
+ mkt_significant, k.get("status"))));
+ if (! k.get("maintainer").empty())
+ about_keys.push_back(make_shared_ptr(new LiteralMetadataValueKey<std::string>("maintainer", "maintainer",
+ mkt_significant, k.get("maintainer"))));
+ if (! k.get("homepage").empty())
+ about_keys.push_back(make_shared_ptr(new LiteralMetadataValueKey<std::string>("homepage", "homepage",
+ mkt_significant, k.get("homepage"))));
+ }
}
Implementation<ERepository>::~Implementation()
@@ -535,6 +557,9 @@ ERepository::_add_metadata_keys() const
add_metadata_key(_imp->binary_keywords);
if (_imp->accounts_repository_data_location_key)
add_metadata_key(_imp->accounts_repository_data_location_key);
+
+ std::for_each(_imp->about_keys.begin(), _imp->about_keys.end(), std::tr1::bind(
+ std::tr1::mem_fn(&ERepository::add_metadata_key), this, std::tr1::placeholders::_1));
}
bool