diff options
author | 2011-03-19 16:09:52 +0000 | |
---|---|---|
committer | 2011-03-19 16:09:52 +0000 | |
commit | 532919d8b59ef82edaba3f903af6dfbbaca8e7d4 (patch) | |
tree | 5e0b632bd88774d637afb27bb0703a071efc5d04 | |
parent | 417da2b92c17bee0313ab80d5f9e29884093f7fa (diff) | |
download | paludis-532919d8b59ef82edaba3f903af6dfbbaca8e7d4.tar.gz paludis-532919d8b59ef82edaba3f903af6dfbbaca8e7d4.tar.xz |
Make more use of mask annotaions
-rw-r--r-- | paludis/repositories/e/exheres_mask_store.cc | 32 |
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; |