aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-08 14:43:07 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-08 03:25:07 +0100
commit69f549d700cacfba0644623ee1da114b0e55c92b (patch)
treea6c719fb4706e35fd9c512a08fa86d799c08cdb4
parentb1d99fda9ae809a2df798497f612274c39acb1fa (diff)
downloadpaludis-69f549d700cacfba0644623ee1da114b0e55c92b.tar.gz
paludis-69f549d700cacfba0644623ee1da114b0e55c92b.tar.xz
key formatting tweaks
-rw-r--r--paludis/resolver/sanitised_dependencies.cc19
-rw-r--r--paludis/resolver/sanitised_dependencies.hh4
-rw-r--r--src/clients/cave/cmd_display_resolution.cc14
-rw-r--r--src/clients/cave/cmd_resolve_dump.cc5
4 files changed, 32 insertions, 10 deletions
diff --git a/paludis/resolver/sanitised_dependencies.cc b/paludis/resolver/sanitised_dependencies.cc
index 35d3ffc..c58f381 100644
--- a/paludis/resolver/sanitised_dependencies.cc
+++ b/paludis/resolver/sanitised_dependencies.cc
@@ -232,16 +232,22 @@ namespace
const Resolver & resolver;
const QPN_S our_qpn_s;
SanitisedDependencies & sanitised_dependencies;
+ const std::string raw_name;
+ const std::string human_name;
std::list<std::tr1::shared_ptr<ActiveDependencyLabels> > labels_stack;
Finder(
const Resolver & r,
const QPN_S & q,
SanitisedDependencies & s,
- const std::tr1::shared_ptr<const DependencyLabelSequence> & l) :
+ const std::tr1::shared_ptr<const DependencyLabelSequence> & l,
+ const std::string & rn,
+ const std::string & hn) :
resolver(r),
our_qpn_s(q),
- sanitised_dependencies(s)
+ sanitised_dependencies(s),
+ raw_name(rn),
+ human_name(hn)
{
labels_stack.push_front(make_shared_ptr(new ActiveDependencyLabels(*l)));
}
@@ -256,6 +262,8 @@ namespace
{
return make_named_values<SanitisedDependency>(
value_for<n::active_dependency_labels>(*labels_stack.begin()),
+ value_for<n::metadata_key_human_name>(human_name),
+ value_for<n::metadata_key_raw_name>(raw_name),
value_for<n::spec>(spec)
);
}
@@ -336,7 +344,8 @@ SanitisedDependencies::_populate_one(
{
Context context("When finding dependencies for '" + stringify(*id) + "' from key '" + ((*id).*pmf)()->raw_name() + "':");
- Finder f(resolver, QPN_S(id), *this, ((*id).*pmf)()->initial_labels());
+ Finder f(resolver, QPN_S(id), *this, ((*id).*pmf)()->initial_labels(), ((*id).*pmf)()->raw_name(),
+ ((*id).*pmf)()->human_name());
((*id).*pmf)()->value()->root()->accept(f);
}
@@ -438,6 +447,8 @@ void
SanitisedDependency::serialise(Serialiser & s) const
{
s.object("SanitisedDependency")
+ .member(SerialiserFlags<>(), "metadata_key_human_name", metadata_key_human_name())
+ .member(SerialiserFlags<>(), "metadata_key_raw_name", metadata_key_raw_name())
.member(SerialiserFlags<>(), "spec", spec())
;
}
@@ -451,6 +462,8 @@ SanitisedDependency::deserialise(Deserialisation & d, const std::tr1::shared_ptr
return make_named_values<SanitisedDependency>(
value_for<n::active_dependency_labels>(make_null_shared_ptr()),
+ value_for<n::metadata_key_human_name>(v.member<std::string>("metadata_key_human_name")),
+ value_for<n::metadata_key_raw_name>(v.member<std::string>("metadata_key_raw_name")),
value_for<n::spec>(PackageOrBlockDepSpec::deserialise(*v.find_remove_member("spec"),
from_id))
);
diff --git a/paludis/resolver/sanitised_dependencies.hh b/paludis/resolver/sanitised_dependencies.hh
index 4678c14..5e40669 100644
--- a/paludis/resolver/sanitised_dependencies.hh
+++ b/paludis/resolver/sanitised_dependencies.hh
@@ -36,6 +36,8 @@ namespace paludis
struct active_dependency_labels;
struct if_package;
struct if_block;
+ struct metadata_key_human_name;
+ struct metadata_key_raw_name;
struct spec;
}
@@ -59,6 +61,8 @@ namespace paludis
struct SanitisedDependency
{
NamedValue<n::active_dependency_labels, std::tr1::shared_ptr<const ActiveDependencyLabels> > active_dependency_labels;
+ NamedValue<n::metadata_key_human_name, std::string> metadata_key_human_name;
+ NamedValue<n::metadata_key_raw_name, std::string> metadata_key_raw_name;
NamedValue<n::spec, PackageOrBlockDepSpec> spec;
void serialise(Serialiser &) const;
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 8ac62dc..696e998 100644
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -106,13 +106,15 @@ namespace
std::pair<std::string, bool> visit(const DependencyReason & r) const
{
if (r.sanitised_dependency().spec().if_block())
- return std::make_pair(stringify(r.from_id()->name()) + " blocker " +
- stringify(*r.sanitised_dependency().spec().if_block()), true);
+ return std::make_pair(stringify(*r.sanitised_dependency().spec().if_block())
+ + " from " + (verbose ? stringify(*r.from_id()) : stringify(r.from_id()->name())),
+ true);
else
{
if (verbose)
- return std::make_pair(stringify(*r.from_id()) + " dependency "
- + stringify(*r.sanitised_dependency().spec().if_package()), false);
+ return std::make_pair(stringify(*r.sanitised_dependency().spec().if_package())
+ + " from " + stringify(*r.from_id()) + " key "
+ + r.sanitised_dependency().metadata_key_human_name(), false);
else
return std::make_pair(stringify(r.from_id()->name()), false);
}
@@ -162,11 +164,11 @@ namespace
cout << " Because of" << endl;
if (! special_reason_names.empty())
cout << " * " << c::bold_yellow() << join(special_reason_names.begin(),
- special_reason_names.end(), c::normal() + "\n " + c::bold_yellow())
+ special_reason_names.end(), c::normal() + "\n * " + c::bold_yellow())
<< c::normal() << endl;
if (! reason_names.empty())
- cout << " * " << join(reason_names.begin(), reason_names.end(), "\n ")
+ cout << " * " << join(reason_names.begin(), reason_names.end(), "\n * ")
<< endl;
}
else
diff --git a/src/clients/cave/cmd_resolve_dump.cc b/src/clients/cave/cmd_resolve_dump.cc
index e2c814d..7dca922 100644
--- a/src/clients/cave/cmd_resolve_dump.cc
+++ b/src/clients/cave/cmd_resolve_dump.cc
@@ -98,7 +98,10 @@ namespace
operator<< (std::ostream & s, const SanitisedDependency & d)
{
std::stringstream ss;
- ss << "Dep(" << d.spec();
+ ss << "Dep(";
+ if (! d.metadata_key_raw_name().empty())
+ ss << d.metadata_key_raw_name() << " ";
+ ss << d.spec();
if (! d.active_dependency_labels()->system_labels()->empty())
ss << " system { " << join(indirect_iterator(d.active_dependency_labels()->system_labels()->begin()),