aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-19 16:09:52 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-19 16:09:52 +0000
commit532919d8b59ef82edaba3f903af6dfbbaca8e7d4 (patch)
tree5e0b632bd88774d637afb27bb0703a071efc5d04
parent417da2b92c17bee0313ab80d5f9e29884093f7fa (diff)
downloadpaludis-532919d8b59ef82edaba3f903af6dfbbaca8e7d4.tar.gz
paludis-532919d8b59ef82edaba3f903af6dfbbaca8e7d4.tar.xz
Make more use of mask annotaions
-rw-r--r--paludis/repositories/e/exheres_mask_store.cc32
1 files changed, 30 insertions, 2 deletions
diff --git a/paludis/repositories/e/exheres_mask_store.cc b/paludis/repositories/e/exheres_mask_store.cc
index 14f625a..daf75e6 100644
--- a/paludis/repositories/e/exheres_mask_store.cc
+++ b/paludis/repositories/e/exheres_mask_store.cc
@@ -99,12 +99,40 @@ namespace
return a->value();
}
+ std::string extract_comment(const PackageDepSpec & s)
+ {
+ const auto author(extract_annotation(s, dsar_general_author));
+ const auto description(extract_annotation(s, dsar_general_description));
+ const auto date(extract_annotation(s, dsar_general_date));
+
+ std::string result;
+
+ if (! description.empty())
+ result = description;
+
+ if (! author.empty())
+ {
+ if (! author.empty())
+ result.append(" ");
+ result.append("(" + author + ")");
+ }
+
+ if (! date.empty())
+ {
+ if (! result.empty())
+ result.append(", ");
+ result.append(date);
+ }
+
+ return result;
+ }
+
std::shared_ptr<MaskInfo> make_mask_info(const PackageDepSpec & s, const FSPath & f)
{
auto result(std::make_shared<MaskInfo>(make_named_values<MaskInfo>(
- n::comment() = extract_annotation(s, dsar_general_description),
+ n::comment() = extract_comment(s),
n::mask_file() = f,
- n::token() = ""
+ n::token() = extract_annotation(s, dsar_general_token)
)));
return result;