aboutsummaryrefslogtreecommitdiff
path: root/paludis/resolver/get_sameness.cc
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2012-11-16 00:17:54 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2012-11-16 22:28:15 +0000
commita48b2c55c744a8a8c04464533b482302f838102b (patch)
treef520104ec739a16543d0065e21cc3b2d59fe2ae8 /paludis/resolver/get_sameness.cc
parent82518eb45b579e15db394764c79a35e0df740def (diff)
downloadpaludis-a48b2c55c744a8a8c04464533b482302f838102b.tar.gz
paludis-a48b2c55c744a8a8c04464533b482302f838102b.tar.xz
Introduce SlotUnknownRewrittenRequirement
Diffstat (limited to 'paludis/resolver/get_sameness.cc')
-rw-r--r--paludis/resolver/get_sameness.cc40
1 files changed, 34 insertions, 6 deletions
diff --git a/paludis/resolver/get_sameness.cc b/paludis/resolver/get_sameness.cc
index 4e3432c6d..81e692afd 100644
--- a/paludis/resolver/get_sameness.cc
+++ b/paludis/resolver/get_sameness.cc
@@ -31,8 +31,6 @@
#include <paludis/name.hh>
#include <paludis/dep_spec.hh>
#include <paludis/slot_requirement.hh>
-#include <paludis/partially_made_package_dep_spec.hh>
-#include <paludis/elike_slot_requirement.hh>
#include <paludis/version_requirements.hh>
#include <set>
@@ -43,6 +41,38 @@ using namespace paludis::resolver;
namespace
{
+ /* since the EAPI5 syntax for rewritten := deps in the VDB doesn't
+ allow us to tell whether the dep was originally a := kind or
+ a :slot= kind, normalise them all to the same thing to avoid
+ spurious differences */
+ struct SloppySlotStringifier
+ {
+ /* this is probably covered by the generic case that just
+ does a stringify, but a package format could theoretically
+ define a different representation, so assume the standard
+ form here for compatibility with the other two that we're
+ assuming */
+ std::string visit(const SlotAnyAtAllLockedRequirement &) const
+ {
+ return ":=";
+ }
+
+ std::string visit(const SlotAnyPartialLockedRequirement &) const
+ {
+ return ":=";
+ }
+
+ std::string visit(const SlotUnknownRewrittenRequirement &) const
+ {
+ return ":=";
+ }
+
+ std::string visit(const SlotRequirement & r) const
+ {
+ return stringify(r);
+ }
+ };
+
struct ComparingPrettyPrinter :
UnformattedPrettyPrinter
{
@@ -74,10 +104,8 @@ namespace
if (s.slot_requirement_ptr())
{
auto r(s.slot_requirement_ptr()->maybe_original_requirement_if_rewritten());
- if (r)
- tokens.insert("slot_requirement:" + stringify(*r));
- else
- tokens.insert("slot_requirement:" + stringify(*s.slot_requirement_ptr()));
+ tokens.insert("slot_requirement:" + (r ? r : s.slot_requirement_ptr())
+ ->accept_returning<std::string>(SloppySlotStringifier()));
}
if (s.in_repository_ptr())