aboutsummaryrefslogtreecommitdiff
path: root/src/clients/qualudis/qualudis.cc
diff options
context:
space:
mode:
authorAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-09-02 19:16:30 +0000
committerAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-09-02 19:16:30 +0000
commit978107dad062e022fc7b7403e4ce2fd470f7a760 (patch)
treef8ddff488203a2ac3bbb1e25f06b6c531eb1166a /src/clients/qualudis/qualudis.cc
parentd4e6b01a56f4222e274d14633f363eb22fc6e370 (diff)
downloadpaludis-978107dad062e022fc7b7403e4ce2fd470f7a760.tar.gz
paludis-978107dad062e022fc7b7403e4ce2fd470f7a760.tar.xz
Tie package IDs and metadata keys to QA messages. Fixes: ticket:339
Diffstat (limited to 'src/clients/qualudis/qualudis.cc')
-rw-r--r--src/clients/qualudis/qualudis.cc107
1 files changed, 107 insertions, 0 deletions
diff --git a/src/clients/qualudis/qualudis.cc b/src/clients/qualudis/qualudis.cc
index ca736c9..13c3276 100644
--- a/src/clients/qualudis/qualudis.cc
+++ b/src/clients/qualudis/qualudis.cc
@@ -27,6 +27,7 @@
#include <paludis/util/strip.hh>
#include <paludis/util/virtual_constructor-impl.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/visitor-impl.hh>
#include <paludis/environments/no_config/no_config_environment.hh>
#include <cstdlib>
@@ -54,6 +55,93 @@ namespace
{
};
+ struct MetadataKeyPrettyPrinter :
+ ConstVisitor<MetadataKeyVisitorTypes>
+ {
+ std::ostringstream stream;
+
+ void visit(const MetadataSetKey<IUseFlagSet> & k)
+ {
+ stream << k.raw_name() << ": " << join(k.value()->begin(), k.value()->end(), " ") << "\n";
+ }
+
+ void visit(const MetadataSetKey<InheritedSet> & k)
+ {
+ stream << k.raw_name() << ": " << join(k.value()->begin(), k.value()->end(), " ") << "\n";
+ }
+
+ void visit(const MetadataSetKey<UseFlagNameSet> & k)
+ {
+ stream << k.raw_name() << ": " << join(k.value()->begin(), k.value()->end(), " ") << "\n";
+ }
+
+ void visit(const MetadataSetKey<KeywordNameSet> & k)
+ {
+ stream << k.raw_name() << ": " << join(k.value()->begin(), k.value()->end(), " ") << "\n";
+ }
+
+ void visit(const MetadataSpecTreeKey<DependencySpecTree> & k)
+ {
+ stream << k.raw_name() << ": " << k.pretty_print_flat();
+ }
+
+ void visit(const MetadataSpecTreeKey<URISpecTree> & k)
+ {
+ stream << k.raw_name() << ": " << k.pretty_print_flat();
+ }
+
+ void visit(const MetadataSpecTreeKey<LicenseSpecTree> & k)
+ {
+ stream << k.raw_name() << ": " << k.pretty_print_flat();
+ }
+
+ void visit(const MetadataSpecTreeKey<ProvideSpecTree> & k)
+ {
+ stream << k.raw_name() << ": " << k.pretty_print_flat();
+ }
+
+ void visit(const MetadataSpecTreeKey<RestrictSpecTree> & k)
+ {
+ stream << k.raw_name() << ": " << k.pretty_print_flat();
+ }
+
+ void visit(const MetadataSetKey<PackageIDSequence> & k)
+ {
+ stream << k.raw_name() << ": "
+ << join(indirect_iterator(k.value()->begin()), indirect_iterator(k.value()->end()), " ") << "\n";
+ }
+
+ void visit(const MetadataPackageIDKey & k)
+ {
+ stream << k.raw_name() << ": " << stringify(*k.value()) << "\n";
+ }
+
+ void visit(const MetadataStringKey & k)
+ {
+ stream << k.raw_name() << ": " << k.value() << "\n";
+ }
+
+ void visit(const MetadataTimeKey & k)
+ {
+ stream << k.raw_name() << ": " << k.value() << "\n";
+ }
+
+ void visit(const MetadataFSEntryKey & k)
+ {
+ stream << k.raw_name() << ": " << k.value() << "\n";
+ }
+
+ void visit(const MetadataRepositoryMaskInfoKey & k)
+ {
+ stream << k.raw_name() << ": " << k.value()->mask_file << ": "
+ << join(k.value()->comment->begin(), k.value()->comment->end(), " ");
+ }
+
+ void visit(const MetadataContentsKey &)
+ {
+ }
+ };
+
struct QualudisReporter :
QAReporter
{
@@ -110,6 +198,25 @@ namespace
}
std::cout << "]: " << msg.message << std::endl;
+
+ if (! msg.associated_ids->empty())
+ {
+ for (PackageIDSet::Iterator i(msg.associated_ids->begin()),
+ i_end(msg.associated_ids->end()) ; i != i_end ; ++i)
+ if (! (*i)->fs_location_key() || (*i)->fs_location_key()->value() != msg.entry)
+ std::cout << " " << stringify(**i) << std::endl;
+ }
+
+ if (! msg.associated_keys->empty())
+ {
+ for (QAMessage::KeysSequence::Iterator i(msg.associated_keys->begin()),
+ i_end(msg.associated_keys->end()) ; i != i_end ; ++i)
+ {
+ MetadataKeyPrettyPrinter pp;
+ (*i)->accept(pp);
+ std::cout << " " << pp.stream.str() << std::endl;
+ }
+ }
}
};
}