aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-09 20:51:26 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-09 20:51:26 +0000
commit558da2343f25cec822041f2b3490bbe40bce02d6 (patch)
treee34a8997403a7e0b2776625e7c6b606802872f82
parentf954164eb7cd27563b48cfb5df5313a2faa9542e (diff)
downloadpaludis-558da2343f25cec822041f2b3490bbe40bce02d6.tar.gz
paludis-558da2343f25cec822041f2b3490bbe40bce02d6.tar.xz
Better single / multiline tags logic.
-rw-r--r--src/output/console_install_task.cc32
-rw-r--r--src/output/console_install_task.hh3
2 files changed, 24 insertions, 11 deletions
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index 626ee44..1b40cbf 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -368,12 +368,13 @@ ConsoleInstallTask::on_display_merge_list_entry(const DepListEntry & d)
display_merge_list_entry_slot(d, m);
display_merge_list_entry_status_and_update_counts(d, existing_repo, existing_slot_repo, m);
+ display_merge_list_entry_non_package_tags(d, m);
if (! want_compact())
- display_merge_list_entry_tags(d, m);
+ display_merge_list_entry_package_tags(d, m);
display_merge_list_entry_description(d, existing_repo, existing_slot_repo, m);
display_merge_list_entry_use(d, existing_repo, existing_slot_repo, m);
if (want_compact())
- display_merge_list_entry_tags(d, m);
+ display_merge_list_entry_package_tags(d, m);
display_merge_list_entry_end(d, m);
if (d.kind == dlk_masked)
@@ -1160,7 +1161,7 @@ ConsoleInstallTask::display_merge_list_entry_use(const DepListEntry & d,
}
void
-ConsoleInstallTask::display_merge_list_entry_tags(const DepListEntry & d, const DisplayMode m)
+ConsoleInstallTask::display_merge_list_entry_non_package_tags(const DepListEntry & d, const DisplayMode m)
{
if (d.tags->empty())
return;
@@ -1205,6 +1206,22 @@ ConsoleInstallTask::display_merge_list_entry_tags(const DepListEntry & d, const
}
}
+ if (! s.str().empty())
+ {
+ std::string t(s.str());
+ t.erase(t.length() - 1);
+ output_no_endl(" " + t);
+ }
+}
+
+void
+ConsoleInstallTask::display_merge_list_entry_package_tags(const DepListEntry & d, const DisplayMode m)
+{
+ if (d.tags->empty())
+ return;
+
+ std::stringstream s;
+
if (! want_install_reasons())
if (d.kind != dlk_block)
return;
@@ -1282,13 +1299,8 @@ ConsoleInstallTask::display_merge_list_entry_tags(const DepListEntry & d, const
output_no_endl(" " + t);
else
{
- if (std::string::npos != t.find_first_of(" :"))
- {
- output_endl();
- output_no_endl(" " + t);
- }
- else
- output_no_endl(" " + t);
+ output_endl();
+ output_no_endl(" " + t);
}
}
}
diff --git a/src/output/console_install_task.hh b/src/output/console_install_task.hh
index 33e2eeb..cb21c12 100644
--- a/src/output/console_install_task.hh
+++ b/src/output/console_install_task.hh
@@ -226,7 +226,8 @@ namespace paludis
virtual void display_merge_list_entry_use(const DepListEntry &,
tr1::shared_ptr<const PackageIDSequence>,
tr1::shared_ptr<const PackageIDSequence>, const DisplayMode);
- virtual void display_merge_list_entry_tags(const DepListEntry &, const DisplayMode);
+ virtual void display_merge_list_entry_non_package_tags(const DepListEntry &, const DisplayMode);
+ virtual void display_merge_list_entry_package_tags(const DepListEntry &, const DisplayMode);
virtual void display_merge_list_entry_end(const DepListEntry &, const DisplayMode);
virtual void display_merge_list_entry_mask_reasons(const DepListEntry &);