aboutsummaryrefslogtreecommitdiff
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
parentd4e6b01a56f4222e274d14633f363eb22fc6e370 (diff)
downloadpaludis-978107dad062e022fc7b7403e4ce2fd470f7a760.tar.gz
paludis-978107dad062e022fc7b7403e4ce2fd470f7a760.tar.xz
Tie package IDs and metadata keys to QA messages. Fixes: ticket:339
-rw-r--r--paludis/dep_list/override_functions.cc12
-rw-r--r--paludis/metadata_key-fwd.hh1
-rw-r--r--paludis/metadata_key.cc5
-rw-r--r--paludis/metadata_key.hh16
-rw-r--r--paludis/package_id.hh1
-rw-r--r--paludis/qa.cc33
-rw-r--r--paludis/qa.hh4
-rw-r--r--paludis/qa.sr11
-rw-r--r--paludis/repositories/cran/cran_package_id.cc11
-rw-r--r--paludis/repositories/cran/cran_package_id.hh3
-rw-r--r--paludis/repositories/cran/keys.cc13
-rw-r--r--paludis/repositories/cran/keys.hh14
-rw-r--r--paludis/repositories/e/e_key.cc17
-rw-r--r--paludis/repositories/e/e_key.hh17
-rw-r--r--paludis/repositories/e/ebuild_id.cc25
-rw-r--r--paludis/repositories/e/ebuild_id.hh1
-rw-r--r--paludis/repositories/e/qa/eapi_supported.cc4
-rw-r--r--paludis/repositories/e/qa/extractors.cc15
-rw-r--r--paludis/repositories/e/qa/homepage_key.cc17
-rw-r--r--paludis/repositories/e/qa/qa_controller.cc3
-rw-r--r--paludis/repositories/e/qa/short_description_key.cc23
-rw-r--r--paludis/repositories/e/qa/spec_keys.cc81
-rw-r--r--paludis/repositories/e/qa/visibility.cc44
-rw-r--r--paludis/repositories/e/vdb_id.cc27
-rw-r--r--paludis/repositories/e/vdb_id.hh1
-rw-r--r--paludis/repositories/fake/fake_package_id.cc6
-rw-r--r--paludis/repositories/fake/fake_package_id.hh1
-rw-r--r--paludis/repositories/gems/gem_specification.cc37
-rw-r--r--paludis/repositories/gems/gem_specification.hh1
-rw-r--r--paludis/repositories/gems/gem_specification_TEST.cc4
-rw-r--r--paludis/repositories/virtuals/package_id.cc6
-rw-r--r--paludis/repositories/virtuals/package_id.hh1
-rw-r--r--paludis/util/visitor-fwd.hh7
-rw-r--r--paludis/util/visitor.hh47
-rw-r--r--python/metadata_key.cc48
-rw-r--r--ruby/package_id.cc163
-rw-r--r--src/clients/instruo/instruo.cc4
-rw-r--r--src/clients/qualudis/qualudis.cc107
-rw-r--r--src/output/console_query_task.cc6
39 files changed, 690 insertions, 147 deletions
diff --git a/paludis/dep_list/override_functions.cc b/paludis/dep_list/override_functions.cc
index 3eac36d..4cd54d9 100644
--- a/paludis/dep_list/override_functions.cc
+++ b/paludis/dep_list/override_functions.cc
@@ -65,6 +65,10 @@ namespace
{
}
+ void visit(const MetadataFSEntryKey &)
+ {
+ }
+
void visit(const MetadataSpecTreeKey<RestrictSpecTree> &)
{
}
@@ -188,6 +192,10 @@ namespace
{
}
+ void visit(const MetadataFSEntryKey &)
+ {
+ }
+
void visit(const MetadataSpecTreeKey<RestrictSpecTree> &)
{
}
@@ -336,6 +344,10 @@ namespace
{
}
+ void visit(const MetadataFSEntryKey &)
+ {
+ }
+
void visit(const MetadataSpecTreeKey<RestrictSpecTree> &)
{
}
diff --git a/paludis/metadata_key-fwd.hh b/paludis/metadata_key-fwd.hh
index 04f0cf7..9a37b3f 100644
--- a/paludis/metadata_key-fwd.hh
+++ b/paludis/metadata_key-fwd.hh
@@ -33,6 +33,7 @@ namespace paludis
class MetadataContentsKey;
class MetadataTimeKey;
class MetadataRepositoryMaskInfoKey;
+ class MetadataFSEntryKey;
template <typename C_> class MetadataSetKey;
template <typename C_> class MetadataSpecTreeKey;
diff --git a/paludis/metadata_key.cc b/paludis/metadata_key.cc
index 4e5a94a..01ac455 100644
--- a/paludis/metadata_key.cc
+++ b/paludis/metadata_key.cc
@@ -77,6 +77,11 @@ MetadataStringKey::MetadataStringKey(const std::string & r, const std::string &
{
}
+MetadataFSEntryKey::MetadataFSEntryKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
+ MetadataKey(r, h, t)
+{
+}
+
MetadataTimeKey::MetadataTimeKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
MetadataKey(r, h, t)
{
diff --git a/paludis/metadata_key.hh b/paludis/metadata_key.hh
index da813de..c02f308 100644
--- a/paludis/metadata_key.hh
+++ b/paludis/metadata_key.hh
@@ -27,6 +27,7 @@
#include <paludis/dep_spec-fwd.hh>
#include <paludis/contents-fwd.hh>
#include <paludis/repository-fwd.hh>
+#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
@@ -53,7 +54,8 @@ namespace paludis
MetadataStringKey,
MetadataContentsKey,
MetadataTimeKey,
- MetadataRepositoryMaskInfoKey
+ MetadataRepositoryMaskInfoKey,
+ MetadataFSEntryKey
>
{
};
@@ -98,6 +100,18 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
};
+ class PALUDIS_VISIBLE MetadataFSEntryKey :
+ public MetadataKey,
+ public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataFSEntryKey>
+ {
+ protected:
+ MetadataFSEntryKey(const std::string &, const std::string &, const MetadataKeyType);
+
+ public:
+ virtual const FSEntry value() const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ };
+
class PALUDIS_VISIBLE MetadataTimeKey :
public MetadataKey,
public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataTimeKey>
diff --git a/paludis/package_id.hh b/paludis/package_id.hh
index 83c7e85..38200aa 100644
--- a/paludis/package_id.hh
+++ b/paludis/package_id.hh
@@ -89,6 +89,7 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataTimeKey> installed_time_key() const = 0;
virtual const tr1::shared_ptr<const MetadataStringKey> source_origin_key() const = 0;
virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const = 0;
+ virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const = 0;
///\}
diff --git a/paludis/qa.cc b/paludis/qa.cc
index d3b8cfc..bdf8d7a 100644
--- a/paludis/qa.cc
+++ b/paludis/qa.cc
@@ -18,16 +18,45 @@
*/
#include <paludis/qa.hh>
-#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
-#include <ostream>
+#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/set-impl.hh>
using namespace paludis;
#include <paludis/qa-se.cc>
#include <paludis/qa-sr.cc>
+template class Set<tr1::shared_ptr<const PackageID>, PackageIDSetComparator>;
+template class Sequence<tr1::shared_ptr<const MetadataKey> >;
+
QAReporter::~QAReporter()
{
}
+tr1::shared_ptr<PackageIDSet>
+QAMessage::default_associated_ids()
+{
+ return tr1::shared_ptr<PackageIDSet>(new PackageIDSet);
+}
+
+tr1::shared_ptr<QAMessage::KeysSequence>
+QAMessage::default_associated_keys()
+{
+ return tr1::shared_ptr<KeysSequence>(new KeysSequence);
+}
+
+QAMessage &
+QAMessage::with_associated_id(const tr1::shared_ptr<const PackageID> & id)
+{
+ associated_ids->insert(id);
+ return *this;
+}
+
+QAMessage &
+QAMessage::with_associated_key(const tr1::shared_ptr<const MetadataKey> & k)
+{
+ associated_keys->push_back(k);
+ return *this;
+}
+
diff --git a/paludis/qa.hh b/paludis/qa.hh
index 1483a3b..48b1c7c 100644
--- a/paludis/qa.hh
+++ b/paludis/qa.hh
@@ -21,7 +21,11 @@
#define PALUDIS_GUARD_PALUDIS_QA_HH 1
#include <paludis/qa-fwd.hh>
+#include <paludis/package_id.hh>
+#include <paludis/metadata_key-fwd.hh>
#include <paludis/util/fs_entry.hh>
+#include <paludis/util/sequence-fwd.hh>
+#include <paludis/util/set-fwd.hh>
#include <paludis/util/sr.hh>
namespace paludis
diff --git a/paludis/qa.sr b/paludis/qa.sr
index 97634f5..394e924 100644
--- a/paludis/qa.sr
+++ b/paludis/qa.sr
@@ -5,10 +5,21 @@ make_class_QAMessage()
{
visible
+ typedef "Sequence<tr1::shared_ptr<const MetadataKey> > KeysSequence"
+
key entry "FSEntry"
key level "QAMessageLevel"
key name "std::string"
key message "std::string"
+ key associated_ids "tr1::shared_ptr<PackageIDSet>" "default_associated_ids()"
+ key associated_keys "tr1::shared_ptr<KeysSequence>" "default_associated_keys()"
+
+ extra_methods <<END
+ static tr1::shared_ptr<PackageIDSet> default_associated_ids();
+ static tr1::shared_ptr<KeysSequence> default_associated_keys();
+ QAMessage & with_associated_id(const tr1::shared_ptr<const PackageID> &);
+ QAMessage & with_associated_key(const tr1::shared_ptr<const MetadataKey> &);
+END
allow_named_args
}
diff --git a/paludis/repositories/cran/cran_package_id.cc b/paludis/repositories/cran/cran_package_id.cc
index 4d94a7d..9b498c5 100644
--- a/paludis/repositories/cran/cran_package_id.cc
+++ b/paludis/repositories/cran/cran_package_id.cc
@@ -61,6 +61,7 @@ namespace paludis
QualifiedPackageName name;
VersionSpec version;
+ tr1::shared_ptr<FSLocationKey> fs_location_key;
tr1::shared_ptr<URIKey> homepage_key;
tr1::shared_ptr<StringKey> short_description_key;
tr1::shared_ptr<StringKey> long_description_key;
@@ -101,6 +102,10 @@ CRANPackageID::CRANPackageID(const tr1::shared_ptr<const CRANRepository> & r, co
return;
}
+ _imp->fs_location_key.reset(new FSLocationKey("DescriptionFileLocation", "Description File Location",
+ f, mkt_internal));
+ add_metadata_key(_imp->fs_location_key);
+
try
{
DescriptionFile file(f);
@@ -537,3 +542,9 @@ CRANPackageID::contained_in_key() const
return _imp->contained_in_key;
}
+const tr1::shared_ptr<const MetadataFSEntryKey>
+CRANPackageID::fs_location_key() const
+{
+ return _imp->fs_location_key;
+}
+
diff --git a/paludis/repositories/cran/cran_package_id.hh b/paludis/repositories/cran/cran_package_id.hh
index c2244c6..2ec4425 100644
--- a/paludis/repositories/cran/cran_package_id.hh
+++ b/paludis/repositories/cran/cran_package_id.hh
@@ -78,9 +78,10 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const;
virtual const tr1::shared_ptr<const MetadataSetKey<PackageIDSequence> > contains_key() const;
virtual const tr1::shared_ptr<const MetadataPackageIDKey> contained_in_key() const;
+ virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const;
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual void perform_action(Action &) const;
+ virtual void perform_action(Action &) const PALUDIS_ATTRIBUTE((noreturn));
virtual bool breaks_portage() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/cran/keys.cc b/paludis/repositories/cran/keys.cc
index 872d165..1272f82 100644
--- a/paludis/repositories/cran/keys.cc
+++ b/paludis/repositories/cran/keys.cc
@@ -65,6 +65,19 @@ StringKey::value() const
return _v;
}
+FSLocationKey::FSLocationKey(const std::string & r, const std::string & h,
+ const FSEntry & v, const MetadataKeyType t) :
+ MetadataFSEntryKey(r, h, t),
+ _v(v)
+{
+}
+
+const FSEntry
+FSLocationKey::value() const
+{
+ return _v;
+}
+
PackageIDSequenceKey::PackageIDSequenceKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
MetadataSetKey<PackageIDSequence>(r, h, t),
_v(new PackageIDSequence)
diff --git a/paludis/repositories/cran/keys.hh b/paludis/repositories/cran/keys.hh
index ca39b0a..44efba6 100644
--- a/paludis/repositories/cran/keys.hh
+++ b/paludis/repositories/cran/keys.hh
@@ -21,6 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_PALUDIS_REPOSITORIES_CRAN_KEYS_HH 1
#include <paludis/metadata_key.hh>
+#include <paludis/util/fs_entry.hh>
#include <paludis/util/mutex.hh>
namespace paludis
@@ -61,6 +62,19 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result));
};
+ class FSLocationKey :
+ public MetadataFSEntryKey
+ {
+ private:
+ const FSEntry _v;
+
+ public:
+ FSLocationKey(const std::string &, const std::string &, const FSEntry &, const MetadataKeyType);
+
+ virtual const FSEntry value() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
class PackageIDSequenceKey :
public MetadataSetKey<PackageIDSequence>
{
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index ac38574..e1d9d9f 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -855,3 +855,20 @@ ECTimeKey::value() const
return *_imp->value;
}
+EFSLocationKey::EFSLocationKey(const tr1::shared_ptr<const ERepositoryID> &,
+ const std::string & r, const std::string & h, const FSEntry & v, const MetadataKeyType t) :
+ MetadataFSEntryKey(r, h, t),
+ _value(v)
+{
+}
+
+EFSLocationKey::~EFSLocationKey()
+{
+}
+
+const FSEntry
+EFSLocationKey::value() const
+{
+ return _value;
+}
+
diff --git a/paludis/repositories/e/e_key.hh b/paludis/repositories/e/e_key.hh
index 5ff7c1a..ac473bb 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -21,8 +21,8 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_E_KEY_HH 1
#include <paludis/metadata_key.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/idle_action_pool-fwd.hh>
+#include <paludis/util/fs_entry.hh>
namespace paludis
{
@@ -275,6 +275,21 @@ namespace paludis
const time_t value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
};
+
+ class EFSLocationKey :
+ public MetadataFSEntryKey
+ {
+ private:
+ const FSEntry _value;
+
+ public:
+ EFSLocationKey(const tr1::shared_ptr<const ERepositoryID> &,
+ const std::string &, const std::string &, const FSEntry &, const MetadataKeyType);
+ ~EFSLocationKey();
+
+ const FSEntry value() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
}
}
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index dd162cf..166ca93 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -85,6 +85,7 @@ namespace paludis
mutable bool has_keys;
mutable bool has_masks;
+ mutable tr1::shared_ptr<const EFSLocationKey> fs_location;
mutable tr1::shared_ptr<const EStringKey> short_description;
mutable tr1::shared_ptr<const EDependenciesKey> build_dependencies;
mutable tr1::shared_ptr<const EDependenciesKey> run_dependencies;
@@ -145,6 +146,14 @@ EbuildID::need_keys_added() const
_imp->has_keys = true;
+ // fs_location key could have been loaded by the ::fs_location_key() already.
+ if (! _imp->fs_location)
+ {
+ _imp->fs_location.reset(new EFSLocationKey(shared_from_this(), "EBUILD", "Ebuild Location",
+ _imp->ebuild, mkt_internal));
+ add_metadata_key(_imp->fs_location);
+ }
+
Context context("When generating metadata for ID '" + canonical_form(idcf_full) + "':");
FSEntry cache_file(_imp->repository->params().cache);
@@ -609,6 +618,22 @@ EbuildID::inherited_key() const
return _imp->inherited;
}
+const tr1::shared_ptr<const MetadataFSEntryKey>
+EbuildID::fs_location_key() const
+{
+ // Avoid loading whole metadata
+ if (! _imp->fs_location)
+ {
+ Lock l(_imp->mutex);
+
+ _imp->fs_location.reset(new EFSLocationKey(shared_from_this(), "EBUILD", "Ebuild Location",
+ _imp->ebuild, mkt_internal));
+ add_metadata_key(_imp->fs_location);
+ }
+
+ return _imp->fs_location;
+}
+
bool
EbuildID::arbitrary_less_than_comparison(const PackageID &) const
{
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index 23dcd9a..b458896 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -87,6 +87,7 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const;
virtual const tr1::shared_ptr<const MetadataSetKey<PackageIDSequence> > contains_key() const;
virtual const tr1::shared_ptr<const MetadataPackageIDKey> contained_in_key() const;
+ virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const;
virtual bool arbitrary_less_than_comparison(const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/qa/eapi_supported.cc b/paludis/repositories/e/qa/eapi_supported.cc
index fea8eb4..c39a355 100644
--- a/paludis/repositories/e/qa/eapi_supported.cc
+++ b/paludis/repositories/e/qa/eapi_supported.cc
@@ -35,7 +35,9 @@ paludis::erepository::eapi_supported_check(
if (! id->eapi()->supported)
{
- reporter.message(QAMessage(entry, qaml_severe, name, "EAPI '" + stringify(id->eapi()->name) + "' not supported"));
+ reporter.message(QAMessage(entry, qaml_severe, name,
+ "EAPI '" + stringify(id->eapi()->name) + "' not supported")
+ .with_associated_id(id));
return false;
}
diff --git a/paludis/repositories/e/qa/extractors.cc b/paludis/repositories/e/qa/extractors.cc
index 89b6666..7c707f4 100644
--- a/paludis/repositories/e/qa/extractors.cc
+++ b/paludis/repositories/e/qa/extractors.cc
@@ -241,7 +241,9 @@ paludis::erepository::extractors_check(
if (r->second.size() > 10)
{
reporter.message(QAMessage(entry, qaml_maybe, name, "Too many flags to determine whether "
- "extractor dependency requirement '" + stringify(r->first) + "' is met"));
+ "extractor dependency requirement '" + stringify(r->first) + "' is met")
+ .with_associated_id(id)
+ .with_associated_key(id->src_uri_key()));
continue;
}
@@ -352,14 +354,19 @@ paludis::erepository::extractors_check(
}
reporter.message(QAMessage(entry, qaml_maybe, name, "Extractor '" + stringify(r->first)
- + "' may be required as a build dependency" + cond));
+ + "' may be required as a build dependency" + cond)
+ .with_associated_id(id)
+ .with_associated_key(id->src_uri_key()));
}
}
}
catch (const Exception & e)
{
- reporter.message(QAMessage(entry, qaml_severe, name, "Caught exception '" + stringify(e.message()) + "' ("
- + stringify(e.what()) + ") when handling key '" + id->src_uri_key()->raw_name() + "'"));
+ reporter.message(QAMessage(entry, qaml_severe, name,
+ "Caught exception '" + stringify(e.message()) + "' ("
+ + stringify(e.what()) + ") when handling key '" + id->src_uri_key()->raw_name() + "'")
+ .with_associated_id(id)
+ .with_associated_key(id->src_uri_key()));
}
}
diff --git a/paludis/repositories/e/qa/homepage_key.cc b/paludis/repositories/e/qa/homepage_key.cc
index f3a9114..4cb2210 100644
--- a/paludis/repositories/e/qa/homepage_key.cc
+++ b/paludis/repositories/e/qa/homepage_key.cc
@@ -41,6 +41,7 @@ namespace
using ConstVisitor<URISpecTree>::VisitConstSequence<HomepageChecker, UseDepSpec>::visit_sequence;
using ConstVisitor<URISpecTree>::VisitConstSequence<HomepageChecker, AllDepSpec>::visit_sequence;
+ const tr1::shared_ptr<const MetadataKey> & key;
const FSEntry entry;
QAReporter & reporter;
const tr1::shared_ptr<const ERepositoryID> id;
@@ -48,10 +49,12 @@ namespace
bool found_one;
HomepageChecker(
+ const tr1::shared_ptr<const MetadataKey> & k,
const FSEntry & f,
QAReporter & r,
const tr1::shared_ptr<const ERepositoryID> & i,
const std::string & n) :
+ key(k),
entry(f),
reporter(r),
id(i),
@@ -77,12 +80,17 @@ namespace
if (0 == u.original_url().compare(0, 7, "http://") &&
0 == u.original_url().compare(0, 8, "https://") &&
0 == u.original_url().compare(0, 6, "ftp://"))
- reporter.message(QAMessage(entry, qaml_normal, name, "Homepage uses no or unknown protocol in part '" + u.text() + "'"));
+ reporter.message(QAMessage(entry, qaml_normal, name,
+ "Homepage uses no or unknown protocol in part '" + u.text() + "'")
+ .with_associated_id(id)
+ .with_associated_key(key));
}
void visit_leaf(const LabelsDepSpec<URILabelVisitorTypes> &)
{
- reporter.message(QAMessage(entry, qaml_normal, name, "Homepage uses labels"));
+ reporter.message(QAMessage(entry, qaml_normal, name, "Homepage uses labels")
+ .with_associated_id(id)
+ .with_associated_key(key));
}
};
}
@@ -99,10 +107,11 @@ paludis::erepository::homepage_key_check(
<< entry << "', " << *id << "', " << name << "'";
if (! id->homepage_key())
- reporter.message(QAMessage(entry, qaml_normal, name, "No homepage available"));
+ reporter.message(QAMessage(entry, qaml_normal, name, "No homepage available")
+ .with_associated_id(id));
else
{
- HomepageChecker h(entry, reporter, id, name);
+ HomepageChecker h(id->homepage_key(), entry, reporter, id, name);
id->homepage_key()->value()->accept(h);
}
diff --git a/paludis/repositories/e/qa/qa_controller.cc b/paludis/repositories/e/qa/qa_controller.cc
index 72eb8ca..383f353 100644
--- a/paludis/repositories/e/qa/qa_controller.cc
+++ b/paludis/repositories/e/qa/qa_controller.cc
@@ -193,7 +193,8 @@ QAController::_run_id(const tr1::shared_ptr<const PackageID> & i)
{
_imp->reporter.message(
QAMessage(_imp->repo->layout()->package_file(*i), qaml_severe, "package_id_checks_group",
- "Caught exception '" + e.message() + "' (" + e.what() + ")"));
+ "Caught exception '" + e.message() + "' (" + e.what() + ")")
+ .with_associated_id(i));
}
}
diff --git a/paludis/repositories/e/qa/short_description_key.cc b/paludis/repositories/e/qa/short_description_key.cc
index 553f174..d72c680 100644
--- a/paludis/repositories/e/qa/short_description_key.cc
+++ b/paludis/repositories/e/qa/short_description_key.cc
@@ -36,19 +36,30 @@ paludis::erepository::short_description_key_check(
<< entry << "', " << *id << "', " << name << "'";
if (! id->short_description_key())
- reporter.message(QAMessage(entry, qaml_normal, name, "No description available"));
+ reporter.message(QAMessage(entry, qaml_normal, name, "No description available")
+ .with_associated_id(id));
else if (id->short_description_key()->value() == stringify(id->name()))
- reporter.message(QAMessage(entry, qaml_normal, name, "Description is equal to PN"));
+ reporter.message(QAMessage(entry, qaml_normal, name, "Description is equal to PN")
+ .with_associated_id(id)
+ .with_associated_key(id->short_description_key()));
else if (std::string::npos != id->short_description_key()->value().find("Based on the")
&& std::string::npos != id->short_description_key()->value().find("eclass"))
reporter.message(
- QAMessage(entry, qaml_normal, name, "Description is about as useful as a chocolate teapot"));
+ QAMessage(entry, qaml_normal, name, "Description is about as useful as a chocolate teapot")
+ .with_associated_id(id)
+ .with_associated_key(id->short_description_key()));
else if (id->short_description_key()->value().length() < 10)
- reporter.message(QAMessage(entry, qaml_normal, name, "Description is suspiciously short"));
+ reporter.message(QAMessage(entry, qaml_normal, name, "Description is suspiciously short")
+ .with_associated_id(id)
+ .with_associated_key(id->short_description_key()));
else if (id->short_description_key()->value().length() > 300)
- reporter.message(QAMessage(entry, qaml_normal, name, "Description written by Duncan?"));
+ reporter.message(QAMessage(entry, qaml_normal, name, "Description written by Duncan?")
+ .with_associated_id(id)
+ .with_associated_key(id->short_description_key()));
else if (id->short_description_key()->value().length() > 120)
- reporter.message(QAMessage(entry, qaml_normal, name, "Description is too long"));
+ reporter.message(QAMessage(entry, qaml_normal, name, "Description is too long")
+ .with_associated_id(id)
+ .with_associated_key(id->short_description_key()));
return true;
}
diff --git a/paludis/repositories/e/qa/spec_keys.cc b/paludis/repositories/e/qa/spec_keys.cc
index ef793ea..14e6cf1 100644
--- a/paludis/repositories/e/qa/spec_keys.cc
+++ b/paludis/repositories/e/qa/spec_keys.cc
@@ -87,7 +87,7 @@ namespace
const FSEntry entry;
QAReporter & reporter;
const tr1::shared_ptr<const PackageID> & id;
- const MetadataKey & key;
+ const tr1::shared_ptr<const MetadataKey> & key;
const std::string name;
const tr1::shared_ptr<const QualifiedPackageNameSet> pds_blacklist;
@@ -99,7 +99,7 @@ namespace
const FSEntry & f,
QAReporter & r,
const tr1::shared_ptr<const PackageID> & i,
- const MetadataKey & k,
+ const tr1::shared_ptr<const MetadataKey> & k,
const std::string & n,
const tr1::shared_ptr<const QualifiedPackageNameSet> p) :
entry(f),
@@ -119,7 +119,9 @@ namespace
{
if (pds_blacklist->end() != pds_blacklist->find(*p.package_ptr()))
reporter.message(QAMessage(entry, qaml_normal, name, "Package '" + stringify(p)
- + "' blacklisted in '" + stringify(key.raw_name()) + "'"));
+ + "' blacklisted in '" + stringify(key->raw_name()) + "'")
+ .with_associated_id(id)
+ .with_associated_key(key));
}
}
@@ -127,7 +129,9 @@ namespace
{
if (child_of_any)
reporter.message(QAMessage(entry, qaml_normal, name, "'|| ( )' with block child '!"
- + stringify(*b.blocked_spec()) + "' in '" + stringify(key.raw_name()) + "'"));
+ + stringify(*b.blocked_spec()) + "' in '" + stringify(key->raw_name()) + "'")
+ .with_associated_id(id)
+ .with_associated_key(key));
}
void visit_leaf(const URIDepSpec &)
@@ -149,12 +153,16 @@ namespace
if (child_of_any)
reporter.message(QAMessage(entry, qaml_normal, name,
"'|| ( )' with 'use? ( )' child in '"
- + stringify(key.raw_name()) + "'"));
+ + stringify(key->raw_name()) + "'")
+ .with_associated_id(id)
+ .with_associated_key(key));
if (uses.count(u.flag()))
reporter.message(QAMessage(entry, qaml_normal, name,
"Recursive use of flag '" + stringify(u.flag()) + "' in '"
- + stringify(key.raw_name()) + "'"));
+ + stringify(key->raw_name()) + "'")
+ .with_associated_id(id)
+ .with_associated_key(key));
Save<unsigned> save_level(&level, level + 1);
Save<bool> save_child_of_any(&child_of_any, false);
@@ -162,7 +170,9 @@ namespace
uses.insert(u.flag());
if (cur == end)
reporter.message(QAMessage(entry, qaml_normal, name,
- "Empty 'use? ( )' in '" + stringify(key.raw_name()) + "'"));
+ "Empty 'use? ( )' in '" + stringify(key->raw_name()) + "'")
+ .with_associated_id(id)
+ .with_associated_key(key));
else
std::for_each(cur, end, accept_visitor(*this));
}
@@ -177,7 +187,9 @@ namespace
{
if (level > 1)
reporter.message(QAMessage(entry, qaml_normal, name,
- "Empty '( )' in '" + stringify(key.raw_name()) + "'"));
+ "Empty '( )' in '" + stringify(key->raw_name()) + "'")
+ .with_associated_id(id)
+ .with_associated_key(key));
}
else
std::for_each(cur, end, accept_visitor(*this));
@@ -191,12 +203,16 @@ namespace
Save<bool> save_child_of_any(&child_of_any, true);
if (cur == end)
reporter.message(QAMessage(entry, qaml_normal, name,
- "Empty '|| ( )' in '" + stringify(key.raw_name()) + "'"));
+ "Empty '|| ( )' in '" + stringify(key->raw_name()) + "'")
+ .with_associated_id(id)
+ .with_associated_key(key));
else if (next(cur) == end)
{
cur->accept(*this);
reporter.message(QAMessage(entry, qaml_normal, name,
- "'|| ( )' with only one child in '" + stringify(key.raw_name()) + "'"));
+ "'|| ( )' with only one child in '" + stringify(key->raw_name()) + "'")
+ .with_associated_id(id)
+ .with_associated_key(key));
}
else
std::for_each(cur, end, accept_visitor(*this));
@@ -208,6 +224,7 @@ namespace
{
const FSEntry entry;
QAReporter & reporter;
+ tr1::shared_ptr<const MetadataKey> key;
const tr1::shared_ptr<const PackageID> & id;
const std::string name;
@@ -223,6 +240,12 @@ namespace
{
}
+ void visit_sptr(const tr1::shared_ptr<const MetadataKey> & k)
+ {
+ key = k;
+ k->accept(*this);
+ }
+
void visit(const MetadataStringKey &)
{
}
@@ -263,18 +286,24 @@ namespace
{
}
+ void visit(const MetadataFSEntryKey &)
+ {
+ }
+
void visit(const MetadataSpecTreeKey<URISpecTree> & k)
{
try
{
Context context("When visiting metadata key '" + k.raw_name() + "':");
- Checker c(entry, reporter, id, k, name, tr1::shared_ptr<const QualifiedPackageNameSet>());
+ Checker c(entry, reporter, id, key, name, tr1::shared_ptr<const QualifiedPackageNameSet>());
k.value()->accept(c);
}
catch (const Exception & e)
{
reporter.message(QAMessage(entry, qaml_severe, name, "Caught exception '" + stringify(e.message()) + "' ("
- + stringify(e.what()) + ") when handling key '" + k.raw_name() + "'"));
+ + stringify(e.what()) + ") when handling key '" + k.raw_name() + "'")
+ .with_associated_id(id)
+ .with_associated_key(key));
}
}
@@ -283,13 +312,15 @@ namespace
try
{
Context context("When visiting metadata key '" + k.raw_name() + "':");
- Checker c(entry, reporter, id, k, name, tr1::shared_ptr<const QualifiedPackageNameSet>());
+ Checker c(entry, reporter, id, key, name, tr1::shared_ptr<const QualifiedPackageNameSet>());
k.value()->accept(c);
}
catch (const Exception & e)
{
reporter.message(QAMessage(entry, qaml_severe, name, "Caught exception '" + stringify(e.message()) + "' ("
- + stringify(e.what()) + ") when handling key '" + k.raw_name() + "'"));
+ + stringify(e.what()) + ") when handling key '" + k.raw_name() + "'")
+ .with_associated_id(id)
+ .with_associated_key(key));
}
}
@@ -298,13 +329,15 @@ namespace
try
{
Context context("When visiting metadata key '" + k.raw_name() + "':");
- Checker c(entry, reporter, id, k, name, SpecKeysBlacklist::get_instance()->blacklist(k.raw_name()));
+ Checker c(entry, reporter, id, key, name, SpecKeysBlacklist::get_instance()->blacklist(k.raw_name()));
k.value()->accept(c);
}
catch (const Exception & e)
{
reporter.message(QAMessage(entry, qaml_severe, name, "Caught exception '" + stringify(e.message()) + "' ("
- + stringify(e.what()) + ") when handling key '" + k.raw_name() + "'"));
+ + stringify(e.what()) + ") when handling key '" + k.raw_name() + "'")
+ .with_associated_id(id)
+ .with_associated_key(key));
}
}
@@ -313,13 +346,15 @@ namespace
try
{
Context context("When visiting metadata key '" + k.raw_name() + "':");
- Checker c(entry, reporter, id, k, name, SpecKeysBlacklist::get_instance()->blacklist(k.raw_name()));
+ Checker c(entry, reporter, id, key, name, SpecKeysBlacklist::get_instance()->blacklist(k.raw_name()));
k.value()->accept(c);
}
catch (const Exception & e)
{
reporter.message(QAMessage(entry, qaml_severe, name, "Caught exception '" + stringify(e.message()) + "' ("
- + stringify(e.what()) + ") when handling key '" + k.raw_name() + "'"));
+ + stringify(e.what()) + ") when handling key '" + k.raw_name() + "'")
+ .with_associated_id(id)
+ .with_associated_key(key));
}
}
@@ -328,13 +363,15 @@ namespace
try
{
Context context("When visiting metadata key '" + k.raw_name() + "':");
- Checker c(entry, reporter, id, k, name, tr1::shared_ptr<const QualifiedPackageNameSet>());
+ Checker c(entry, reporter, id, key, name, tr1::shared_ptr<const QualifiedPackageNameSet>());
k.value()->accept(c);
}
catch (const Exception & e)
{
reporter.message(QAMessage(entry, qaml_severe, name, "Caught exception '" + stringify(e.message()) + "' ("
- + stringify(e.what()) + ") when handling key '" + k.raw_name() + "'"));
+ + stringify(e.what()) + ") when handling key '" + k.raw_name() + "'")
+ .with_associated_id(id)
+ .with_associated_key(key));
}
}
};
@@ -351,8 +388,10 @@ paludis::erepository::spec_keys_check(
Log::get_instance()->message(ll_debug, lc_context) << "spec_keys_check '"
<< entry << "', " << *id << "', " << name << "'";
+ using namespace tr1::placeholders;
+
CheckForwarder f(entry, reporter, id, name);
- parallel_for_each(indirect_iterator(id->begin_metadata()), indirect_iterator(id->end_metadata()), accept_visitor(f));
+ parallel_for_each(id->begin_metadata(), id->end_metadata(), tr1::bind(&CheckForwarder::visit_sptr, &f, _1));
return true;
}
diff --git a/paludis/repositories/e/qa/visibility.cc b/paludis/repositories/e/qa/visibility.cc
index ba3dd21..a8d40d8 100644
--- a/paludis/repositories/e/qa/visibility.cc
+++ b/paludis/repositories/e/qa/visibility.cc
@@ -49,13 +49,13 @@ namespace
const FSEntry entry;
QAReporter * const reporter;
const Environment * const env;
- const PackageID & id;
+ const tr1::shared_ptr<const PackageID> & id;
const tr1::shared_ptr<const ERepository> repo;
const std::set<KeywordName> & accepted_keywords;
const ERepository::ProfilesIterator profile;
const std::string name;
const bool unstable;
- const MetadataKey & key;
+ const tr1::shared_ptr<const MetadataKey> & key;
bool success;
bool viable;
@@ -64,13 +64,13 @@ namespace
const FSEntry & e,
QAReporter * const r,
const Environment * const v,
- const PackageID & i,
+ const tr1::shared_ptr<const PackageID> & i,
const tr1::shared_ptr<const ERepository> o,
const std::set<KeywordName> & a,
const ERepository::ProfilesIterator & p,
const std::string & n,
const bool u,
- const MetadataKey & k) :
+ const tr1::shared_ptr<const MetadataKey> & k) :
entry(e),
reporter(r),
env(v),
@@ -144,9 +144,11 @@ namespace
{
if (reporter)
reporter->message(QAMessage(entry, qaml_normal, name, "No packages matching '"
- + stringify(orig_p) + "' in dependencies key '" + stringify(key.raw_name()) + "' for profile '"
+ + stringify(orig_p) + "' in dependencies key '" + stringify(key->raw_name()) + "' for profile '"
+ stringify(profile->path) + "' (" + stringify(profile->arch) + "." + stringify(profile->status)
- + (unstable ? ".unstable" : ".stable") + ")"));
+ + (unstable ? ".unstable" : ".stable") + ")")
+ .with_associated_id(id)
+ .with_associated_key(key));
}
else
{
@@ -188,9 +190,11 @@ namespace
if (! success)
if (reporter)
reporter->message(QAMessage(entry, qaml_normal, name, "No visible packages matching '"
- + stringify(orig_p) + "' in dependencies key '" + stringify(key.raw_name()) + "' for profile '"
+ + stringify(orig_p) + "' in dependencies key '" + stringify(key->raw_name()) + "' for profile '"
+ stringify(profile->path) + "' (" + stringify(profile->arch) + "." + stringify(profile->status)
- + (unstable ? ".unstable" : ".stable") + ")"));
+ + (unstable ? ".unstable" : ".stable") + ")")
+ .with_associated_id(id)
+ .with_associated_key(key));
}
}
@@ -199,8 +203,8 @@ namespace
DependencySpecTree::ConstSequenceIterator end)
{
viable =
- ((! u.inverse()) && (! repo->query_use_mask(u.flag(), id))) ||
- ((u.inverse()) && (! repo->query_use_force(u.flag(), id)));
+ ((! u.inverse()) && (! repo->query_use_mask(u.flag(), *id))) ||
+ ((u.inverse()) && (! repo->query_use_force(u.flag(), *id)));
if (viable)
std::for_each(cur, end, accept_visitor(*this));
@@ -234,7 +238,9 @@ namespace
reporter->message(QAMessage(entry, qaml_normal, name, "No item in block '|| ( "
+ stringify(printer) + " )' visible for profile '"
+ stringify(profile->path) + "' (" + stringify(profile->arch) + "." + stringify(profile->status)
- + (unstable ? ".unstable" : ".stable") + ")"));
+ + (unstable ? ".unstable" : ".stable") + ")")
+ .with_associated_id(id)
+ .with_associated_key(key));
}
}
}
@@ -284,25 +290,25 @@ paludis::erepository::visibility_check(
{
if (id->build_dependencies_key())
{
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, false, *id->build_dependencies_key());
+ Checker c(entry, &reporter, env, id, repo, accepted_keywords, p, name, false, id->build_dependencies_key());
id->build_dependencies_key()->value()->accept(c);
}
if (id->run_dependencies_key())
{
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, false, *id->run_dependencies_key());
+ Checker c(entry, &reporter, env, id, repo, accepted_keywords, p, name, false, id->run_dependencies_key());
id->run_dependencies_key()->value()->accept(c);
}
if (id->post_dependencies_key())
{
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, false, *id->post_dependencies_key());
+ Checker c(entry, &reporter, env, id, repo, accepted_keywords, p, name, false, id->post_dependencies_key());
id->post_dependencies_key()->value()->accept(c);
}
if (id->suggested_dependencies_key())
{
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, false, *id->suggested_dependencies_key());
+ Checker c(entry, &reporter, env, id, repo, accepted_keywords, p, name, false, id->suggested_dependencies_key());
id->post_dependencies_key()->value()->accept(c);
}
}
@@ -321,25 +327,25 @@ paludis::erepository::visibility_check(
{
if (id->build_dependencies_key())
{
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, true, *id->build_dependencies_key());
+ Checker c(entry, &reporter, env, id, repo, accepted_keywords, p, name, true, id->build_dependencies_key());
id->build_dependencies_key()->value()->accept(c);
}
if (id->run_dependencies_key())
{
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, true, *id->run_dependencies_key());
+ Checker c(entry, &reporter, env, id, repo, accepted_keywords, p, name, true, id->run_dependencies_key());
id->run_dependencies_key()->value()->accept(c);
}
if (id->post_dependencies_key())
{
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, true, *id->post_dependencies_key());
+ Checker c(entry, &reporter, env, id, repo, accepted_keywords, p, name, true, id->post_dependencies_key());
id->post_dependencies_key()->value()->accept(c);
}
if (id->suggested_dependencies_key())
{
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, true, *id->suggested_dependencies_key());
+ Checker c(entry, &reporter, env, id, repo, accepted_keywords, p, name, true, id->suggested_dependencies_key());
id->post_dependencies_key()->value()->accept(c);
}
}
diff --git a/paludis/repositories/e/vdb_id.cc b/paludis/repositories/e/vdb_id.cc
index c991d7f..649414a 100644
--- a/paludis/repositories/e/vdb_id.cc
+++ b/paludis/repositories/e/vdb_id.cc
@@ -71,6 +71,7 @@ namespace paludis
tr1::shared_ptr<const SlotName> slot;
tr1::shared_ptr<const EAPI> eapi;
+ tr1::shared_ptr<const MetadataFSEntryKey> fs_location;
tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> > use;
tr1::shared_ptr<const MetadataSetKey<InheritedSet> > inherited;
tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> > iuse;
@@ -134,6 +135,15 @@ VDBID::need_keys_added() const
return;
_imp->has_keys = true;
+
+ // fs_location key could have been loaded by the ::fs_location_key() already.
+ if (! _imp->fs_location)
+ {
+ _imp->fs_location.reset(new EFSLocationKey(shared_from_this(), "VDBDIR", "VDB Location",
+ _imp->dir, mkt_internal));
+ add_metadata_key(_imp->fs_location);
+ }
+
Context context("When loading VDB ID keys from '" + stringify(_imp->dir) + "':");
if (! eapi()->supported)
@@ -566,6 +576,23 @@ VDBID::binary_origin_key() const
return _imp->binary_origin;
}
+const tr1::shared_ptr<const MetadataFSEntryKey>
+VDBID::fs_location_key() const
+{
+ // Avoid loading whole metadata
+ if (! _imp->fs_location)
+ {
+ Lock l(_imp->mutex);
+
+ _imp->fs_location.reset(new EFSLocationKey(shared_from_this(), "VDBDIR", "VDB Location",
+ _imp->dir, mkt_internal));
+ add_metadata_key(_imp->fs_location);
+ }
+
+ return _imp->fs_location;
+}
+
+
bool
VDBID::arbitrary_less_than_comparison(const PackageID &) const
{
diff --git a/paludis/repositories/e/vdb_id.hh b/paludis/repositories/e/vdb_id.hh
index d2da574..483329f 100644
--- a/paludis/repositories/e/vdb_id.hh
+++ b/paludis/repositories/e/vdb_id.hh
@@ -81,6 +81,7 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const;
virtual const tr1::shared_ptr<const MetadataSetKey<PackageIDSequence> > contains_key() const;
virtual const tr1::shared_ptr<const MetadataPackageIDKey> contained_in_key() const;
+ virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const;
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void perform_action(Action &) const;
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 46d8a2f..5716662 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -766,6 +766,12 @@ FakePackageID::contained_in_key() const
return tr1::shared_ptr<const MetadataPackageIDKey>();
}
+const tr1::shared_ptr<const MetadataFSEntryKey>
+FakePackageID::fs_location_key() const
+{
+ return tr1::shared_ptr<const MetadataFSEntryKey>();
+}
+
template class FakeMetadataSpecTreeKey<LicenseSpecTree>;
template class FakeMetadataSpecTreeKey<ProvideSpecTree>;
template class FakeMetadataSpecTreeKey<DependencySpecTree>;
diff --git a/paludis/repositories/fake/fake_package_id.hh b/paludis/repositories/fake/fake_package_id.hh
index c2c19b9..2a0d5ca 100644
--- a/paludis/repositories/fake/fake_package_id.hh
+++ b/paludis/repositories/fake/fake_package_id.hh
@@ -165,6 +165,7 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const;
virtual const tr1::shared_ptr<const MetadataSetKey<PackageIDSequence> > contains_key() const;
virtual const tr1::shared_ptr<const MetadataPackageIDKey> contained_in_key() const;
+ virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const;
const tr1::shared_ptr<FakeMetadataKeywordSetKey> keywords_key();
const tr1::shared_ptr<FakeMetadataIUseSetKey> iuse_key();
diff --git a/paludis/repositories/gems/gem_specification.cc b/paludis/repositories/gems/gem_specification.cc
index 990402a..167f517 100644
--- a/paludis/repositories/gems/gem_specification.cc
+++ b/paludis/repositories/gems/gem_specification.cc
@@ -66,6 +66,34 @@ namespace
{
return _value;
}
+
+ class GemMetadataFSEntryKey :
+ public MetadataFSEntryKey
+ {
+ private:
+ const FSEntry _value;
+
+ public:
+ GemMetadataFSEntryKey(const std::string &, const std::string &, const FSEntry &,
+ const MetadataKeyType);
+
+ virtual const FSEntry value() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+
+ GemMetadataFSEntryKey::GemMetadataFSEntryKey(const std::string & r, const std::string & h,
+ const FSEntry & v, const MetadataKeyType t) :
+ MetadataFSEntryKey(r, h, t),
+ _value(v)
+ {
+ }
+
+ const FSEntry
+ GemMetadataFSEntryKey::value() const
+ {
+ return _value;
+ }
}
namespace paludis
@@ -85,6 +113,7 @@ namespace paludis
tr1::shared_ptr<GemMetadataStringKey> summary_key;
tr1::shared_ptr<GemMetadataStringKey> authors_key;
tr1::shared_ptr<GemMetadataStringKey> rubyforge_project_key;
+ tr1::shared_ptr<GemMetadataFSEntryKey> fs_location_key;
tr1::shared_ptr<const FSEntry> load_from_file;
@@ -304,6 +333,8 @@ GemSpecification::GemSpecification(const Environment * const e, const tr1::share
_imp->name_part = stringify(q);
_imp->version = stringify(v);
_imp->load_from_file.reset(new FSEntry(f));
+ _imp->fs_location_key.reset(new GemMetadataFSEntryKey("GEM", "Gem Location", f, mkt_internal));
+ add_metadata_key(_imp->fs_location_key);
}
GemSpecification::~GemSpecification()
@@ -462,6 +493,12 @@ GemSpecification::long_description_key() const
return _imp->description_key;
}
+const tr1::shared_ptr<const MetadataFSEntryKey>
+GemSpecification::fs_location_key() const
+{
+ return _imp->fs_location_key;
+}
+
const tr1::shared_ptr<const MetadataContentsKey>
GemSpecification::contents_key() const
{
diff --git a/paludis/repositories/gems/gem_specification.hh b/paludis/repositories/gems/gem_specification.hh
index 2e2dae8..aba3467 100644
--- a/paludis/repositories/gems/gem_specification.hh
+++ b/paludis/repositories/gems/gem_specification.hh
@@ -110,6 +110,7 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataSetKey<PackageIDSequence> > contains_key() const;
virtual const tr1::shared_ptr<const MetadataPackageIDKey> contained_in_key() const;
+ virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const;
virtual const tr1::shared_ptr<const MetadataContentsKey> contents_key() const;
virtual const tr1::shared_ptr<const MetadataTimeKey> installed_time_key() const;
virtual const tr1::shared_ptr<const MetadataStringKey> source_origin_key() const;
diff --git a/paludis/repositories/gems/gem_specification_TEST.cc b/paludis/repositories/gems/gem_specification_TEST.cc
index e0fcbf6..95e9fa4 100644
--- a/paludis/repositories/gems/gem_specification_TEST.cc
+++ b/paludis/repositories/gems/gem_specification_TEST.cc
@@ -99,6 +99,10 @@ namespace
void visit(const MetadataRepositoryMaskInfoKey &)
{
}
+
+ void visit(const MetadataFSEntryKey &)
+ {
+ }
};
}
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index e43975d..02e3d70 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -508,3 +508,9 @@ VirtualsPackageID::contained_in_key() const
return tr1::shared_ptr<const MetadataPackageIDKey>();
}
+const tr1::shared_ptr<const MetadataFSEntryKey>
+VirtualsPackageID::fs_location_key() const
+{
+ return tr1::shared_ptr<const MetadataFSEntryKey>();
+}
+
diff --git a/paludis/repositories/virtuals/package_id.hh b/paludis/repositories/virtuals/package_id.hh
index 93d84c7..f74eade 100644
--- a/paludis/repositories/virtuals/package_id.hh
+++ b/paludis/repositories/virtuals/package_id.hh
@@ -115,6 +115,7 @@ namespace paludis
virtual const tr1::shared_ptr<const MetadataStringKey> binary_origin_key() const;
virtual const tr1::shared_ptr<const MetadataSetKey<PackageIDSequence> > contains_key() const;
virtual const tr1::shared_ptr<const MetadataPackageIDKey> contained_in_key() const;
+ virtual const tr1::shared_ptr<const MetadataFSEntryKey> fs_location_key() const;
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void perform_action(Action &) const;
diff --git a/paludis/util/visitor-fwd.hh b/paludis/util/visitor-fwd.hh
index 258a792..30092f1 100644
--- a/paludis/util/visitor-fwd.hh
+++ b/paludis/util/visitor-fwd.hh
@@ -134,7 +134,12 @@ namespace paludis
typename ContainedItem12_ = visitor_internals::NoType<12>,
typename ContainedItem13_ = visitor_internals::NoType<13>,
typename ContainedItem14_ = visitor_internals::NoType<14>,
- typename ContainedItem15_ = visitor_internals::NoType<15> >
+ typename ContainedItem15_ = visitor_internals::NoType<15>,
+ typename ContainedItem16_ = visitor_internals::NoType<16>,
+ typename ContainedItem17_ = visitor_internals::NoType<17>,
+ typename ContainedItem18_ = visitor_internals::NoType<18>,
+ typename ContainedItem19_ = visitor_internals::NoType<19>,
+ typename ContainedItem20_ = visitor_internals::NoType<20> >
class VisitorTypes;
template <typename I_>
diff --git a/paludis/util/visitor.hh b/paludis/util/visitor.hh
index 57b38d2..7c15371 100644
--- a/paludis/util/visitor.hh
+++ b/paludis/util/visitor.hh
@@ -832,7 +832,12 @@ namespace paludis
public ProxyVisits<H_, LargerH_, const typename H_::ContainedItem12>,
public ProxyVisits<H_, LargerH_, const typename H_::ContainedItem13>,
public ProxyVisits<H_, LargerH_, const typename H_::ContainedItem14>,
- public ProxyVisits<H_, LargerH_, const typename H_::ContainedItem15>
+ public ProxyVisits<H_, LargerH_, const typename H_::ContainedItem15>,
+ public ProxyVisits<H_, LargerH_, const typename H_::ContainedItem16>,
+ public ProxyVisits<H_, LargerH_, const typename H_::ContainedItem17>,
+ public ProxyVisits<H_, LargerH_, const typename H_::ContainedItem18>,
+ public ProxyVisits<H_, LargerH_, const typename H_::ContainedItem19>,
+ public ProxyVisits<H_, LargerH_, const typename H_::ContainedItem20>
{
private:
ConstVisitor<LargerH_> * const _larger_h;
@@ -876,7 +881,12 @@ namespace paludis
public ProxyVisits<H_, LargerH_, typename H_::ContainedItem12>,
public ProxyVisits<H_, LargerH_, typename H_::ContainedItem13>,
public ProxyVisits<H_, LargerH_, typename H_::ContainedItem14>,
- public ProxyVisits<H_, LargerH_, typename H_::ContainedItem15>
+ public ProxyVisits<H_, LargerH_, typename H_::ContainedItem15>,
+ public ProxyVisits<H_, LargerH_, typename H_::ContainedItem16>,
+ public ProxyVisits<H_, LargerH_, typename H_::ContainedItem17>,
+ public ProxyVisits<H_, LargerH_, typename H_::ContainedItem18>,
+ public ProxyVisits<H_, LargerH_, typename H_::ContainedItem19>,
+ public ProxyVisits<H_, LargerH_, typename H_::ContainedItem20>
{
private:
MutableVisitor<LargerH_> * const _larger_h;
@@ -1004,7 +1014,12 @@ namespace paludis
typename ContainedItem12_,
typename ContainedItem13_,
typename ContainedItem14_,
- typename ContainedItem15_>
+ typename ContainedItem15_,
+ typename ContainedItem16_,
+ typename ContainedItem17_,
+ typename ContainedItem18_,
+ typename ContainedItem19_,
+ typename ContainedItem20_>
class VisitorTypes
{
public:
@@ -1029,6 +1044,11 @@ namespace paludis
typedef ContainedItem13_ ContainedItem13;
typedef ContainedItem14_ ContainedItem14;
typedef ContainedItem15_ ContainedItem15;
+ typedef ContainedItem16_ ContainedItem16;
+ typedef ContainedItem17_ ContainedItem17;
+ typedef ContainedItem18_ ContainedItem18;
+ typedef ContainedItem19_ ContainedItem19;
+ typedef ContainedItem20_ ContainedItem20;
typedef MutableAcceptInterface<Heirarchy_> Item;
typedef const ConstAcceptInterface<Heirarchy_> ConstItem;
@@ -1061,7 +1081,12 @@ namespace paludis
public virtual Visits<const typename H_::ContainedItem12>,
public virtual Visits<const typename H_::ContainedItem13>,
public virtual Visits<const typename H_::ContainedItem14>,
- public virtual Visits<const typename H_::ContainedItem15>
+ public virtual Visits<const typename H_::ContainedItem15>,
+ public virtual Visits<const typename H_::ContainedItem16>,
+ public virtual Visits<const typename H_::ContainedItem17>,
+ public virtual Visits<const typename H_::ContainedItem18>,
+ public virtual Visits<const typename H_::ContainedItem19>,
+ public virtual Visits<const typename H_::ContainedItem20>
{
public:
///\name Visitor type definitions
@@ -1138,7 +1163,12 @@ namespace paludis
public virtual Visits<typename H_::ContainedItem12>,
public virtual Visits<typename H_::ContainedItem13>,
public virtual Visits<typename H_::ContainedItem14>,
- public virtual Visits<typename H_::ContainedItem15>
+ public virtual Visits<typename H_::ContainedItem15>,
+ public virtual Visits<typename H_::ContainedItem16>,
+ public virtual Visits<typename H_::ContainedItem17>,
+ public virtual Visits<typename H_::ContainedItem18>,
+ public virtual Visits<typename H_::ContainedItem19>,
+ public virtual Visits<typename H_::ContainedItem20>
{
public:
///\name Visitor type definitions
@@ -1273,7 +1303,12 @@ namespace paludis
GetConstItemVisits<GetConstItemVisitor<I_>, typename I_::Heirarchy, const typename I_::Heirarchy::ContainedItem12>,
GetConstItemVisits<GetConstItemVisitor<I_>, typename I_::Heirarchy, const typename I_::Heirarchy::ContainedItem13>,
GetConstItemVisits<GetConstItemVisitor<I_>, typename I_::Heirarchy, const typename I_::Heirarchy::ContainedItem14>,
- GetConstItemVisits<GetConstItemVisitor<I_>, typename I_::Heirarchy, const typename I_::Heirarchy::ContainedItem15>
+ GetConstItemVisits<GetConstItemVisitor<I_>, typename I_::Heirarchy, const typename I_::Heirarchy::ContainedItem15>,
+ GetConstItemVisits<GetConstItemVisitor<I_>, typename I_::Heirarchy, const typename I_::Heirarchy::ContainedItem16>,
+ GetConstItemVisits<GetConstItemVisitor<I_>, typename I_::Heirarchy, const typename I_::Heirarchy::ContainedItem17>,
+ GetConstItemVisits<GetConstItemVisitor<I_>, typename I_::Heirarchy, const typename I_::Heirarchy::ContainedItem18>,
+ GetConstItemVisits<GetConstItemVisitor<I_>, typename I_::Heirarchy, const typename I_::Heirarchy::ContainedItem19>,
+ GetConstItemVisits<GetConstItemVisitor<I_>, typename I_::Heirarchy, const typename I_::Heirarchy::ContainedItem20>
{
///\name Visitor operations
///\{
diff --git a/python/metadata_key.cc b/python/metadata_key.cc
index f5ddd1b..85ee4cf 100644
--- a/python/metadata_key.cc
+++ b/python/metadata_key.cc
@@ -22,6 +22,7 @@
#include <paludis/metadata_key.hh>
#include <paludis/name.hh>
+#include <paludis/util/fs_entry.hh>
#include <paludis/util/visitor-impl.hh>
using namespace paludis;
@@ -67,6 +68,11 @@ class MetadataKeySptrToPythonVisitor :
obj = bp::object(tr1::static_pointer_cast<const MetadataRepositoryMaskInfoKey>(_m_ptr));
}
+ void visit(const MetadataFSEntryKey & k)
+ {
+ obj = bp::object(tr1::static_pointer_cast<const MetadataFSEntryKey>(_m_ptr));
+ }
+
void visit(const MetadataSetKey<KeywordNameSet> & k)
{
obj = bp::object(tr1::static_pointer_cast<const MetadataSetKey<KeywordNameSet> >(_m_ptr));
@@ -218,6 +224,27 @@ struct MetadataContentsKeyWrapper :
}
};
+struct MetadataFSEntryKeyWrapper :
+ MetadataFSEntryKey,
+ bp::wrapper<MetadataFSEntryKey>
+{
+ MetadataFSEntryKeyWrapper(const std::string & r, const std::string & h, const MetadataKeyType t) :
+ MetadataFSEntryKey(r, h, t)
+ {
+ }
+
+ virtual const FSEntry value() const
+ PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ Lock l(get_mutex());
+
+ if (bp::override f = get_override("value"))
+ return f();
+ else
+ throw PythonMethodNotImplemented("MetadataFSEntryKey", "value");
+ }
+};
+
struct MetadataRepositoryMaskInfoKeyWrapper :
MetadataRepositoryMaskInfoKey,
bp::wrapper<MetadataRepositoryMaskInfoKey>
@@ -452,6 +479,27 @@ void expose_metadata_key()
;
/**
+ * MetadataFSEntryKey
+ */
+ bp::register_ptr_to_python<tr1::shared_ptr<const MetadataFSEntryKey> >();
+ bp::implicitly_convertible<tr1::shared_ptr<MetadataFSEntryKeyWrapper>,
+ tr1::shared_ptr<MetadataKey> >();
+ bp::class_<MetadataFSEntryKeyWrapper, tr1::shared_ptr<MetadataFSEntryKeyWrapper>,
+ bp::bases<MetadataKey>, boost::noncopyable>
+ (
+ "MetadataFSEntryKey",
+ "NEED_DOC\n"
+ "This class can be subclassed in Python.",
+ bp::init<const std::string &, const std::string &, MetadataKeyType>(
+ "__init__(raw_name, human_name, MetadataKeyType)"
+ )
+ )
+ .def("value", bp::pure_virtual(&MetadataFSEntryKey::value),
+ "value() -> FSEntry\n"
+ )
+ ;
+
+ /**
* MetadataContentsKey
*/
bp::register_ptr_to_python<tr1::shared_ptr<const MetadataContentsKey> >();
diff --git a/ruby/package_id.cc b/ruby/package_id.cc
index e5b78c8..a10e311 100644
--- a/ruby/package_id.cc
+++ b/ruby/package_id.cc
@@ -51,100 +51,105 @@ namespace
struct V :
ConstVisitor<MetadataKeyVisitorTypes>
+ {
+ VALUE value;
+ tr1::shared_ptr<const MetadataKey> mm;
+
+ V(tr1::shared_ptr<const MetadataKey> _m) :
+ mm(_m)
{
- VALUE value;
- tr1::shared_ptr<const MetadataKey> mm;
+ }
- V(tr1::shared_ptr<const MetadataKey> _m) :
- mm(_m)
- {
- }
+ void visit(const MetadataPackageIDKey &)
+ {
+ value = Data_Wrap_Struct(c_metadata_package_id_key, 0, &Common<tr1::shared_ptr<const MetadataPackageIDKey> >::free,
+ new tr1::shared_ptr<const MetadataPackageIDKey>(tr1::static_pointer_cast<const MetadataPackageIDKey>(mm)));
+ }
- void visit(const MetadataPackageIDKey &)
- {
- value = Data_Wrap_Struct(c_metadata_package_id_key, 0, &Common<tr1::shared_ptr<const MetadataPackageIDKey> >::free,
- new tr1::shared_ptr<const MetadataPackageIDKey>(tr1::static_pointer_cast<const MetadataPackageIDKey>(mm)));
- }
+ void visit(const MetadataStringKey &)
+ {
+ value = Data_Wrap_Struct(c_metadata_string_key, 0, &Common<tr1::shared_ptr<const MetadataStringKey> >::free,
+ new tr1::shared_ptr<const MetadataStringKey>(tr1::static_pointer_cast<const MetadataStringKey>(mm)));
+ }
- void visit(const MetadataStringKey &)
- {
- value = Data_Wrap_Struct(c_metadata_string_key, 0, &Common<tr1::shared_ptr<const MetadataStringKey> >::free,
- new tr1::shared_ptr<const MetadataStringKey>(tr1::static_pointer_cast<const MetadataStringKey>(mm)));
- }
+ void visit(const MetadataTimeKey &)
+ {
+ value = Data_Wrap_Struct(c_metadata_time_key, 0, &Common<tr1::shared_ptr<const MetadataTimeKey> >::free,
+ new tr1::shared_ptr<const MetadataTimeKey>(tr1::static_pointer_cast<const MetadataTimeKey>(mm)));
+ }
- void visit(const MetadataTimeKey &)
- {
- value = Data_Wrap_Struct(c_metadata_time_key, 0, &Common<tr1::shared_ptr<const MetadataTimeKey> >::free,
- new tr1::shared_ptr<const MetadataTimeKey>(tr1::static_pointer_cast<const MetadataTimeKey>(mm)));
- }
+ void visit(const MetadataContentsKey &)
+ {
+ value = Data_Wrap_Struct(c_metadata_contents_key, 0, &Common<tr1::shared_ptr<const MetadataContentsKey> >::free,
+ new tr1::shared_ptr<const MetadataContentsKey>(tr1::static_pointer_cast<const MetadataContentsKey>(mm)));
+ }
- void visit(const MetadataContentsKey &)
- {
- value = Data_Wrap_Struct(c_metadata_contents_key, 0, &Common<tr1::shared_ptr<const MetadataContentsKey> >::free,
- new tr1::shared_ptr<const MetadataContentsKey>(tr1::static_pointer_cast<const MetadataContentsKey>(mm)));
- }
+ void visit(const MetadataFSEntryKey &)
+ {
+ value = Qnil;
+ }
- void visit(const MetadataRepositoryMaskInfoKey &)
- {
- value = Data_Wrap_Struct(c_metadata_repository_mask_info_key, 0, &Common<tr1::shared_ptr<const MetadataContentsKey> >::free,
- new tr1::shared_ptr<const MetadataRepositoryMaskInfoKey>(tr1::static_pointer_cast<const MetadataRepositoryMaskInfoKey>(mm)));
- }
+ void visit(const MetadataRepositoryMaskInfoKey &)
+ {
+ value = Data_Wrap_Struct(c_metadata_repository_mask_info_key, 0, &Common<tr1::shared_ptr<const MetadataContentsKey> >::free,
+ new tr1::shared_ptr<const MetadataRepositoryMaskInfoKey>(tr1::static_pointer_cast<const MetadataRepositoryMaskInfoKey>(mm)));
+ }
- void visit(const MetadataSetKey<KeywordNameSet> &)
- {
- value = Data_Wrap_Struct(c_metadata_keyword_name_set_key, 0, &Common<tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> > >::free,
- new tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> >(tr1::static_pointer_cast<const MetadataSetKey<KeywordNameSet> >(mm)));
- }
+ void visit(const MetadataSetKey<KeywordNameSet> &)
+ {
+ value = Data_Wrap_Struct(c_metadata_keyword_name_set_key, 0, &Common<tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> > >::free,
+ new tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> >(tr1::static_pointer_cast<const MetadataSetKey<KeywordNameSet> >(mm)));
+ }
- void visit(const MetadataSetKey<UseFlagNameSet> &)
- {
- value = Data_Wrap_Struct(c_metadata_use_flag_name_set_key, 0, &Common<tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> > >::free,
- new tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> >(tr1::static_pointer_cast<const MetadataSetKey<UseFlagNameSet> >(mm)));
- }
+ void visit(const MetadataSetKey<UseFlagNameSet> &)
+ {
+ value = Data_Wrap_Struct(c_metadata_use_flag_name_set_key, 0, &Common<tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> > >::free,
+ new tr1::shared_ptr<const MetadataSetKey<UseFlagNameSet> >(tr1::static_pointer_cast<const MetadataSetKey<UseFlagNameSet> >(mm)));
+ }
- void visit(const MetadataSetKey<IUseFlagSet> &)
- {
- value = Data_Wrap_Struct(c_metadata_iuse_flag_set_key, 0, &Common<tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> > >::free,
- new tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> >(tr1::static_pointer_cast<const MetadataSetKey<IUseFlagSet> >(mm)));
- }
+ void visit(const MetadataSetKey<IUseFlagSet> &)
+ {
+ value = Data_Wrap_Struct(c_metadata_iuse_flag_set_key, 0, &Common<tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> > >::free,
+ new tr1::shared_ptr<const MetadataSetKey<IUseFlagSet> >(tr1::static_pointer_cast<const MetadataSetKey<IUseFlagSet> >(mm)));
+ }
- void visit(const MetadataSetKey<InheritedSet> &)
- {
- value = Data_Wrap_Struct(c_metadata_inherited_set_key, 0, &Common<tr1::shared_ptr<const MetadataSetKey<InheritedSet> > >::free,
- new tr1::shared_ptr<const MetadataSetKey<InheritedSet> >(tr1::static_pointer_cast<const MetadataSetKey<InheritedSet> >(mm)));
- }
+ void visit(const MetadataSetKey<InheritedSet> &)
+ {
+ value = Data_Wrap_Struct(c_metadata_inherited_set_key, 0, &Common<tr1::shared_ptr<const MetadataSetKey<InheritedSet> > >::free,
+ new tr1::shared_ptr<const MetadataSetKey<InheritedSet> >(tr1::static_pointer_cast<const MetadataSetKey<InheritedSet> >(mm)));
+ }
- void visit(const MetadataSetKey<PackageIDSequence> &)
- {
- value = Data_Wrap_Struct(c_metadata_package_id_sequence_key, 0, &Common<tr1::shared_ptr<const MetadataSetKey<PackageIDSequence> > >::free,
- new tr1::shared_ptr<const MetadataSetKey<PackageIDSequence> >(tr1::static_pointer_cast<const MetadataSetKey<PackageIDSequence> >(mm)));
- }
+ void visit(const MetadataSetKey<PackageIDSequence> &)
+ {
+ value = Data_Wrap_Struct(c_metadata_package_id_sequence_key, 0, &Common<tr1::shared_ptr<const MetadataSetKey<PackageIDSequence> > >::free,
+ new tr1::shared_ptr<const MetadataSetKey<PackageIDSequence> >(tr1::static_pointer_cast<const MetadataSetKey<PackageIDSequence> >(mm)));
+ }
- void visit(const MetadataSpecTreeKey<LicenseSpecTree> &)
- {
- value = Qnil;
- }
+ void visit(const MetadataSpecTreeKey<LicenseSpecTree> &)
+ {
+ value = Qnil;
+ }
- void visit(const MetadataSpecTreeKey<ProvideSpecTree> &)
- {
- value = Qnil;
- }
+ void visit(const MetadataSpecTreeKey<ProvideSpecTree> &)
+ {
+ value = Qnil;
+ }
- void visit(const MetadataSpecTreeKey<DependencySpecTree> &)
- {
- value = Qnil;
- }
+ void visit(const MetadataSpecTreeKey<DependencySpecTree> &)
+ {
+ value = Qnil;
+ }
- void visit(const MetadataSpecTreeKey<RestrictSpecTree> &)
- {
- value = Qnil;
- }
+ void visit(const MetadataSpecTreeKey<RestrictSpecTree> &)
+ {
+ value = Qnil;
+ }
- void visit(const MetadataSpecTreeKey<URISpecTree> &)
- {
- value = Qnil;
- }
- };
+ void visit(const MetadataSpecTreeKey<URISpecTree> &)
+ {
+ value = Qnil;
+ }
+ };
VALUE
metadata_key_to_value(tr1::shared_ptr<const MetadataKey> m)
@@ -284,13 +289,13 @@ namespace
tr1::shared_ptr<const PackageID> * self_ptr;
Data_Get_Struct(self, tr1::shared_ptr<const PackageID>, self_ptr);
for (PackageID::MetadataIterator it((*self_ptr)->begin_metadata()),
- it_end((*self_ptr)->end_metadata()); it_end != it; ++it)
+ it_end((*self_ptr)->end_metadata()); it_end != it; ++it)
{
VALUE val(metadata_key_to_value(*it));
if (Qnil != val)
rb_yield(val);
}
- return Qnil;
+ return Qnil;
}
/*
diff --git a/src/clients/instruo/instruo.cc b/src/clients/instruo/instruo.cc
index 53cabb1..0ce0953 100644
--- a/src/clients/instruo/instruo.cc
+++ b/src/clients/instruo/instruo.cc
@@ -73,6 +73,10 @@ namespace
{
}
+ void visit(const MetadataFSEntryKey &)
+ {
+ }
+
void visit(const MetadataRepositoryMaskInfoKey &)
{
}
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;
+ }
+ }
}
};
}
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index 8f2754b..d654c41 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -357,6 +357,12 @@ namespace
task->display_metadata_repository_mask_info(k.human_name(), k.raw_name(), k.value());
}
+ void visit(const MetadataFSEntryKey & k)
+ {
+ if (k.type() == type)
+ task->display_metadata_key(k.human_name(), k.raw_name(), stringify(k.value()));
+ }
+
void visit(const MetadataContentsKey &)
{
}