aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/clients/cave/cmd_show-fmt.hh6
-rw-r--r--src/clients/cave/cmd_show.cc16
2 files changed, 19 insertions, 3 deletions
diff --git a/src/clients/cave/cmd_show-fmt.hh b/src/clients/cave/cmd_show-fmt.hh
index 69aa6b2ff..59c90e51a 100644
--- a/src/clients/cave/cmd_show-fmt.hh
+++ b/src/clients/cave/cmd_show-fmt.hh
@@ -114,8 +114,10 @@ const auto fs_metadata_subsection_raw = make_format_string_fetcher("show/metadat
<< " " << param<'i'>() << param<'i'>() << param<'i'>() << param<'i'>()
<< c::bold_blue_or_pink() << param<'s'>() << c::normal() << "\\n";
-const auto fs_package_id_heading = make_format_string_fetcher("show/package_id_heading", 1)
- << " " << c::bold_blue_or_pink() << param<'s'>() << c::normal() << "\\n";
+const auto fs_package_id_heading = make_format_string_fetcher("show/package_id_heading", 2)
+ << " " << c::bold_blue_or_pink() << param<'s'>() << c::normal()
+ << param_if<'t'>() << c::yellow() << " (" << param<'t'>() << ")" << c::normal() << param_endif<'t'>()
+ << "\\n";
const auto fs_package_id_masks = make_format_string_fetcher("show/package_id_masks", 1)
<< " " << c::bold_red() << param<'s'>() << c::normal() << "\\n";
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index eef9f821c..2f4ce6b25 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -57,6 +57,7 @@
#include <paludis/contents.hh>
#include <paludis/dep_spec_data.hh>
#include <paludis/dep_spec_annotations.hh>
+#include <paludis/match_package.hh>
#include <cstdlib>
#include <iostream>
@@ -1145,7 +1146,20 @@ namespace
const bool old_id_is_installed,
std::ostream & out)
{
- out << fuc(fs_package_id_heading(), fv<'s'>(stringify(*best)));
+ std::string in_sets;
+ {
+ auto system(env->set(SetName("system")));
+ if (system && match_package_in_set(*env, *system, best, { }))
+ in_sets = "system";
+ else
+ {
+ auto world(env->set(SetName("world")));
+ if (world && match_package_in_set(*env, *world, best, { }))
+ in_sets = "world";
+ }
+ }
+
+ out << fuc(fs_package_id_heading(), fv<'s'>(stringify(*best)), fv<'t'>(in_sets));
std::set<std::shared_ptr<const MetadataKey>, MetadataKeyComparator> keys(best->begin_metadata(), best->end_metadata());
for (std::set<std::shared_ptr<const MetadataKey>, MetadataKeyComparator>::const_iterator
k(keys.begin()), k_end(keys.end()) ; k != k_end ; ++k)