aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-03-19 16:08:42 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-03-19 16:08:42 +0000
commit0d1eded08c45047975d21beee435dd6c48ac598d (patch)
treefb52803333e46569b06763da1ec25cd312aac5b4
parent94ac8571990fcb76100ba1d6b4d5d3cd1c8ef9be (diff)
downloadpaludis-0d1eded08c45047975d21beee435dd6c48ac598d.tar.gz
paludis-0d1eded08c45047975d21beee435dd6c48ac598d.tar.xz
cave show overridden masks
Fixes: ticket:858
-rw-r--r--src/clients/cave/cmd_show.cc31
-rw-r--r--src/clients/cave/formats.cc8
-rw-r--r--src/clients/cave/formats.hh1
3 files changed, 34 insertions, 6 deletions
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index bee572e..05fe135 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -781,6 +781,15 @@ namespace
MaskDisplayer d(cmdline, 2);
std::for_each(indirect_iterator(best->begin_masks()), indirect_iterator(best->end_masks()), accept_visitor(d));
}
+
+ if (best->begin_overridden_masks() != best->end_overridden_masks())
+ {
+ cout << format_general_s(f::show_package_id_masks_overridden(), "Overridden Masks");
+ MaskDisplayer d(cmdline, 2);
+ for (PackageID::OverriddenMasksConstIterator m(best->begin_overridden_masks()), m_end(best->end_overridden_masks()) ;
+ m != m_end ; ++m)
+ (*m)->mask()->accept(d);
+ }
}
void do_one_package(
@@ -842,15 +851,27 @@ namespace
if ((*i)->repository()->installed_root_key())
cout << format_general_s(f::show_package_version_installed(), stringify((*i)->canonical_form(idcf_version)));
- else if (! (*i)->masked())
- cout << format_general_s(f::show_package_version_installable(), stringify((*i)->canonical_form(idcf_version)));
else
{
std::string rr;
- for (PackageID::MasksConstIterator m((*i)->begin_masks()), m_end((*i)->end_masks()) ;
+ for (PackageID::OverriddenMasksConstIterator m((*i)->begin_overridden_masks()), m_end((*i)->end_overridden_masks()) ;
m != m_end ; ++m)
- rr.append(stringify((*m)->key()));
- cout << format_general_sr(f::show_package_version_unavailable(), stringify((*i)->canonical_form(idcf_version)), rr);
+ rr.append(stringify((*m)->mask()->key()));
+
+ if (! rr.empty())
+ rr = "(" + rr + ")";
+
+ if (! (*i)->masked())
+ cout << format_general_sr(f::show_package_version_installable(), stringify((*i)->canonical_form(idcf_version)), rr);
+ else
+ {
+ std::string rs;
+ for (PackageID::MasksConstIterator m((*i)->begin_masks()), m_end((*i)->end_masks()) ;
+ m != m_end ; ++m)
+ rs.append(stringify((*m)->key()));
+ rr = rs + rr;
+ cout << format_general_sr(f::show_package_version_unavailable(), stringify((*i)->canonical_form(idcf_version)), rr);
+ }
}
if (best_installable && (**i == *best_installable))
diff --git a/src/clients/cave/formats.cc b/src/clients/cave/formats.cc
index 8e1fa91..989199c 100644
--- a/src/clients/cave/formats.cc
+++ b/src/clients/cave/formats.cc
@@ -187,7 +187,7 @@ paludis::cave::f::show_package_version_installed()
const std::string
paludis::cave::f::show_package_version_installable()
{
- return c::green() + "%s" + c::normal();
+ return c::green() + "%s%r" + c::normal();
}
const std::string
@@ -227,6 +227,12 @@ paludis::cave::f::show_package_id_masks()
}
const std::string
+paludis::cave::f::show_package_id_masks_overridden()
+{
+ return " " + c::green() + "%s" + c::normal() + "\\n";
+}
+
+const std::string
paludis::cave::f::info_metadata()
{
return "%i%i%i%i%h%{column 30}%s\\n";
diff --git a/src/clients/cave/formats.hh b/src/clients/cave/formats.hh
index 5098f45..3a3eb14 100644
--- a/src/clients/cave/formats.hh
+++ b/src/clients/cave/formats.hh
@@ -66,6 +66,7 @@ namespace paludis
const std::string show_package_id_heading();
const std::string show_package_id_masks();
+ const std::string show_package_id_masks_overridden();
const std::string show_metadata_key_value_raw();
const std::string show_metadata_key_value_human();