aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e/exheres_mask_store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories/e/exheres_mask_store.cc')
-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 14f625af4..daf75e65a 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;