aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-06-27 23:01:40 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-06-27 23:01:40 +0000
commit15f07ae3e9aacd865f96117d2633e54f2128f11f (patch)
tree85ad7e86e36c1d87e426a818d15c1900cd04db1a
parentf5d52372d8c39a34cb1a06864947aee62230ce50 (diff)
downloadpaludis-15f07ae3e9aacd865f96117d2633e54f2128f11f.tar.gz
paludis-15f07ae3e9aacd865f96117d2633e54f2128f11f.tar.xz
r3624@snowflake: ciaranm | 2007-06-27 23:59:47 +0100
Make metadata keys carry their significance to the user
-rw-r--r--paludis/files.m42
-rw-r--r--paludis/metadata_key-fwd.hh6
-rw-r--r--paludis/metadata_key.cc36
-rw-r--r--paludis/metadata_key.hh11
-rw-r--r--paludis/metadata_key.se23
-rw-r--r--paludis/repositories/fake/fake_package_id.cc36
-rw-r--r--paludis/repositories/fake/fake_package_id.hh11
-rw-r--r--paludis/repositories/gems/gem_specification.cc17
-rw-r--r--paludis/repositories/gentoo/e_key.cc40
-rw-r--r--paludis/repositories/gentoo/e_key.hh20
-rw-r--r--paludis/repositories/gentoo/ebuild_id.cc24
-rw-r--r--paludis/repositories/gentoo/vdb_id.cc40
-rw-r--r--paludis/repositories/virtuals/package_id.cc4
13 files changed, 160 insertions, 110 deletions
diff --git a/paludis/files.m4 b/paludis/files.m4
index 8fbb463..e9f3686 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -25,7 +25,7 @@ add(`hooker', `hh', `cc', `test', `testscript')
add(`host_tuple_name', `hh', `cc', `sr', `test')
add(`mask_reasons', `hh', `cc', `se')
add(`match_package', `hh', `cc')
-add(`metadata_key', `hh', `cc', `fwd')
+add(`metadata_key', `hh', `cc', `se', `fwd')
add(`name', `hh', `cc', `fwd', `test', `sr', `se')
add(`package_database', `hh', `cc', `test', `se')
add(`package_id', `hh', `cc', `fwd', `se')
diff --git a/paludis/metadata_key-fwd.hh b/paludis/metadata_key-fwd.hh
index ac9f07c..95810a3 100644
--- a/paludis/metadata_key-fwd.hh
+++ b/paludis/metadata_key-fwd.hh
@@ -20,6 +20,9 @@
#ifndef PALUDIS_GUARD_PALUDIS_METADATA_KEY_FWD_HH
#define PALUDIS_GUARD_PALUDIS_METADATA_KEY_FWD_HH 1
+#include <paludis/util/attributes.hh>
+#include <iosfwd>
+
namespace paludis
{
class MetadataKeyVisitorTypes;
@@ -29,6 +32,9 @@ namespace paludis
class MetadataStringKey;
template <typename C_> class MetadataCollectionKey;
template <typename C_> class MetadataSpecTreeKey;
+
+#include <paludis/metadata_key-se.hh>
+
}
#endif
diff --git a/paludis/metadata_key.cc b/paludis/metadata_key.cc
index 84f8671..d7d4e83 100644
--- a/paludis/metadata_key.cc
+++ b/paludis/metadata_key.cc
@@ -20,9 +20,13 @@
#include "metadata_key.hh"
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/exception.hh>
+#include <paludis/util/stringify.hh>
using namespace paludis;
+#include <paludis/metadata_key-se.cc>
+
namespace paludis
{
template <>
@@ -30,17 +34,19 @@ namespace paludis
{
const std::string raw_name;
const std::string human_name;
+ const MetadataKeyType type;
- Implementation(const std::string & r, const std::string & h) :
+ Implementation(const std::string & r, const std::string & h, const MetadataKeyType t) :
raw_name(r),
- human_name(h)
+ human_name(h),
+ type(t)
{
}
};
}
-MetadataKey::MetadataKey(const std::string & r, const std::string & h) :
- PrivateImplementationPattern<MetadataKey>(new Implementation<MetadataKey>(r, h))
+MetadataKey::MetadataKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
+ PrivateImplementationPattern<MetadataKey>(new Implementation<MetadataKey>(r, h, t))
{
}
@@ -60,25 +66,31 @@ MetadataKey::human_name() const
return _imp->human_name;
}
-MetadataStringKey::MetadataStringKey(const std::string & r, const std::string & h) :
- MetadataKey(r, h)
+const MetadataKeyType
+MetadataKey::type() const
+{
+ return _imp->type;
+}
+
+MetadataStringKey::MetadataStringKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
+ MetadataKey(r, h, t)
{
}
-MetadataPackageIDKey::MetadataPackageIDKey(const std::string & r, const std::string & h) :
- MetadataKey(r, h)
+MetadataPackageIDKey::MetadataPackageIDKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
+ MetadataKey(r, h, t)
{
}
template <typename C_>
-MetadataCollectionKey<C_>::MetadataCollectionKey(const std::string & r, const std::string & h) :
- MetadataKey(r, h)
+MetadataCollectionKey<C_>::MetadataCollectionKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
+ MetadataKey(r, h, t)
{
}
template <typename C_>
-MetadataSpecTreeKey<C_>::MetadataSpecTreeKey(const std::string & r, const std::string & h) :
- MetadataKey(r, h)
+MetadataSpecTreeKey<C_>::MetadataSpecTreeKey(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 5be3f60..48f7101 100644
--- a/paludis/metadata_key.hh
+++ b/paludis/metadata_key.hh
@@ -57,13 +57,14 @@ namespace paludis
public virtual ConstAcceptInterface<MetadataKeyVisitorTypes>
{
protected:
- MetadataKey(const std::string &, const std::string &);
+ MetadataKey(const std::string &, const std::string &, const MetadataKeyType);
public:
virtual ~MetadataKey() = 0;
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual const MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class PALUDIS_VISIBLE MetadataPackageIDKey :
@@ -71,7 +72,7 @@ namespace paludis
public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataPackageIDKey>
{
protected:
- MetadataPackageIDKey(const std::string &, const std::string &);
+ MetadataPackageIDKey(const std::string &, const std::string &, const MetadataKeyType);
public:
virtual const tr1::shared_ptr<const PackageID> value() const
@@ -83,7 +84,7 @@ namespace paludis
public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataStringKey>
{
protected:
- MetadataStringKey(const std::string &, const std::string &);
+ MetadataStringKey(const std::string &, const std::string &, const MetadataKeyType);
public:
virtual const std::string value() const
@@ -96,7 +97,7 @@ namespace paludis
public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataCollectionKey<C_> >
{
protected:
- MetadataCollectionKey(const std::string &, const std::string &);
+ MetadataCollectionKey(const std::string &, const std::string &, const MetadataKeyType);
public:
virtual const tr1::shared_ptr<const C_> value() const
@@ -109,7 +110,7 @@ namespace paludis
public ConstAcceptInterfaceVisitsThis<MetadataKeyVisitorTypes, MetadataSpecTreeKey<C_> >
{
protected:
- MetadataSpecTreeKey(const std::string &, const std::string &);
+ MetadataSpecTreeKey(const std::string &, const std::string &, const MetadataKeyType);
public:
virtual const tr1::shared_ptr<const typename C_::ConstItem> value() const
diff --git a/paludis/metadata_key.se b/paludis/metadata_key.se
new file mode 100644
index 0000000..41c6564
--- /dev/null
+++ b/paludis/metadata_key.se
@@ -0,0 +1,23 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et ft=sh :
+
+make_enum_MetadataKeyType()
+{
+ prefix mkt
+
+ key mkt_significant "A key of significant interest, to be shown early on"
+ key mkt_normal "A normal key, to be shown underneath mkt_significant keys"
+ key mkt_dependencies "Should only be shown if the user asks for dependencies"
+ key mkt_internal "Should not usually be displayed to the user"
+
+ doxygen_comment << "END"
+ /**
+ * The significance of a MetadataKey to a user.
+ *
+ * \see MetadataKey
+ */
+END
+}
+
+
+
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 8c2e748..1db8b24 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -48,8 +48,8 @@ namespace paludis
template <typename C_>
FakeMetadataCollectionKey<C_>::FakeMetadataCollectionKey(
- const std::string & r, const std::string & h) :
- MetadataCollectionKey<C_>(r, h),
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
+ MetadataCollectionKey<C_>(r, h, t),
PrivateImplementationPattern<FakeMetadataCollectionKey<C_> >(new Implementation<FakeMetadataCollectionKey<C_> >),
_imp(PrivateImplementationPattern<FakeMetadataCollectionKey<C_> >::_imp.get())
{
@@ -68,8 +68,8 @@ FakeMetadataCollectionKey<C_>::value() const
}
FakeMetadataKeywordCollectionKey::FakeMetadataKeywordCollectionKey(const std::string & r,
- const std::string & h, const std::string & v) :
- FakeMetadataCollectionKey<KeywordNameCollection>(r, h)
+ const std::string & h, const std::string & v, const MetadataKeyType t) :
+ FakeMetadataCollectionKey<KeywordNameCollection>(r, h, t)
{
set_from_string(v);
}
@@ -82,8 +82,8 @@ FakeMetadataKeywordCollectionKey::set_from_string(const std::string & s)
}
FakeMetadataIUseCollectionKey::FakeMetadataIUseCollectionKey(const std::string & r,
- const std::string & h, const std::string & v, const IUseFlagParseMode m) :
- FakeMetadataCollectionKey<IUseFlagCollection>(r, h)
+ const std::string & h, const std::string & v, const IUseFlagParseMode m, const MetadataKeyType t) :
+ FakeMetadataCollectionKey<IUseFlagCollection>(r, h, t)
{
set_from_string(v, m);
}
@@ -117,8 +117,8 @@ namespace paludis
template <typename C_>
FakeMetadataSpecTreeKey<C_>::FakeMetadataSpecTreeKey(const std::string & r, const std::string & h, const std::string & v,
- const tr1::function<const tr1::shared_ptr<const typename C_::ConstItem> (const std::string &)> & f) :
- MetadataSpecTreeKey<C_>(r, h),
+ const tr1::function<const tr1::shared_ptr<const typename C_::ConstItem> (const std::string &)> & f, const MetadataKeyType t) :
+ MetadataSpecTreeKey<C_>(r, h, t),
PrivateImplementationPattern<FakeMetadataSpecTreeKey<C_> >(new Implementation<FakeMetadataSpecTreeKey<C_> >(f)),
_imp(PrivateImplementationPattern<FakeMetadataSpecTreeKey<C_> >::_imp.get())
{
@@ -154,8 +154,8 @@ namespace paludis
}
FakeMetadataPackageIDKey::FakeMetadataPackageIDKey(const std::string & r, const std::string & h,
- const tr1::shared_ptr<const PackageID> & v) :
- MetadataPackageIDKey(r, h),
+ const tr1::shared_ptr<const PackageID> & v, const MetadataKeyType t) :
+ MetadataPackageIDKey(r, h, t),
PrivateImplementationPattern<FakeMetadataPackageIDKey>(new Implementation<FakeMetadataPackageIDKey>),
_imp(PrivateImplementationPattern<FakeMetadataPackageIDKey>::_imp.get())
{
@@ -207,20 +207,20 @@ namespace paludis
version(v),
slot("0"),
eapi(EAPIData::get_instance()->eapi_from_string("0")),
- keywords(new FakeMetadataKeywordCollectionKey("KEYWORDS", "Keywords", "test")),
- iuse(new FakeMetadataIUseCollectionKey("IUSE", "Used USE flags", "", iuse_pm_permissive)),
+ keywords(new FakeMetadataKeywordCollectionKey("KEYWORDS", "Keywords", "test", mkt_normal)),
+ iuse(new FakeMetadataIUseCollectionKey("IUSE", "Used USE flags", "", iuse_pm_permissive, mkt_normal)),
license(new FakeMetadataSpecTreeKey<LicenseSpecTree>("LICENSE", "Licenses",
- "", tr1::bind(&PortageDepParser::parse_license, _1, tr1::cref(*eapi)))),
+ "", tr1::bind(&PortageDepParser::parse_license, _1, tr1::cref(*eapi)), mkt_normal)),
provide(new FakeMetadataSpecTreeKey<ProvideSpecTree>("PROVIDE", "Provided packages",
- "", tr1::bind(&PortageDepParser::parse_provide, _1, tr1::cref(*eapi)))),
+ "", tr1::bind(&PortageDepParser::parse_provide, _1, tr1::cref(*eapi)), mkt_normal)),
build_dependencies(new FakeMetadataSpecTreeKey<DependencySpecTree>("DEPEND", "Build dependencies",
- "", tr1::bind(&PortageDepParser::parse_depend, _1, tr1::cref(*eapi)))),
+ "", tr1::bind(&PortageDepParser::parse_depend, _1, tr1::cref(*eapi)), mkt_dependencies)),
run_dependencies(new FakeMetadataSpecTreeKey<DependencySpecTree>("RDEPEND", "Run dependencies",
- "", tr1::bind(&PortageDepParser::parse_depend, _1, tr1::cref(*eapi)))),
+ "", tr1::bind(&PortageDepParser::parse_depend, _1, tr1::cref(*eapi)), mkt_dependencies)),
post_dependencies(new FakeMetadataSpecTreeKey<DependencySpecTree>("PDEPEND", "Post dependencies",
- "", tr1::bind(&PortageDepParser::parse_depend, _1, tr1::cref(*eapi)))),
+ "", tr1::bind(&PortageDepParser::parse_depend, _1, tr1::cref(*eapi)), mkt_dependencies)),
suggested_dependencies(new FakeMetadataSpecTreeKey<DependencySpecTree>("SDEPEND", "Suggested dependencies",
- "", tr1::bind(&PortageDepParser::parse_depend, _1, tr1::cref(*eapi))))
+ "", tr1::bind(&PortageDepParser::parse_depend, _1, tr1::cref(*eapi)), mkt_dependencies))
{
}
};
diff --git a/paludis/repositories/fake/fake_package_id.hh b/paludis/repositories/fake/fake_package_id.hh
index 6a11db8..d16ebd9 100644
--- a/paludis/repositories/fake/fake_package_id.hh
+++ b/paludis/repositories/fake/fake_package_id.hh
@@ -36,7 +36,7 @@ namespace paludis
protected:
Implementation<FakeMetadataCollectionKey> * const _imp;
- FakeMetadataCollectionKey(const std::string &, const std::string &);
+ FakeMetadataCollectionKey(const std::string &, const std::string &, const MetadataKeyType);
public:
~FakeMetadataCollectionKey();
@@ -48,7 +48,7 @@ namespace paludis
public FakeMetadataCollectionKey<KeywordNameCollection>
{
public:
- FakeMetadataKeywordCollectionKey(const std::string &, const std::string &, const std::string &);
+ FakeMetadataKeywordCollectionKey(const std::string &, const std::string &, const std::string &, const MetadataKeyType);
void set_from_string(const std::string &);
};
@@ -57,7 +57,8 @@ namespace paludis
public FakeMetadataCollectionKey<IUseFlagCollection>
{
public:
- FakeMetadataIUseCollectionKey(const std::string &, const std::string &, const std::string &, const IUseFlagParseMode);
+ FakeMetadataIUseCollectionKey(const std::string &, const std::string &, const std::string &, const IUseFlagParseMode,
+ const MetadataKeyType);
void set_from_string(const std::string &, const IUseFlagParseMode);
};
@@ -72,7 +73,7 @@ namespace paludis
public:
FakeMetadataSpecTreeKey(const std::string &, const std::string &, const std::string &,
- const tr1::function<const tr1::shared_ptr<const typename C_::ConstItem> (const std::string &)> &);
+ const tr1::function<const tr1::shared_ptr<const typename C_::ConstItem> (const std::string &)> &, const MetadataKeyType);
~FakeMetadataSpecTreeKey();
virtual const tr1::shared_ptr<const typename C_::ConstItem> value() const
@@ -90,7 +91,7 @@ namespace paludis
public:
FakeMetadataPackageIDKey(const std::string &, const std::string &,
- const tr1::shared_ptr<const PackageID> &);
+ const tr1::shared_ptr<const PackageID> &, const MetadataKeyType);
~FakeMetadataPackageIDKey();
virtual const tr1::shared_ptr<const PackageID> value() const
diff --git a/paludis/repositories/gems/gem_specification.cc b/paludis/repositories/gems/gem_specification.cc
index 405518a..28b0afc 100644
--- a/paludis/repositories/gems/gem_specification.cc
+++ b/paludis/repositories/gems/gem_specification.cc
@@ -44,15 +44,17 @@ namespace
const std::string _value;
public:
- GemMetadataStringKey(const std::string &, const std::string &, const std::string &);
+ GemMetadataStringKey(const std::string &, const std::string &, const std::string &,
+ const MetadataKeyType);
virtual const std::string value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
};
- GemMetadataStringKey::GemMetadataStringKey(const std::string & r, const std::string & h, const std::string & v) :
- MetadataStringKey(r, h),
+ GemMetadataStringKey::GemMetadataStringKey(const std::string & r, const std::string & h, const std::string & v,
+ const MetadataKeyType t) :
+ MetadataStringKey(r, h, t),
_value(v)
{
}
@@ -228,19 +230,20 @@ namespace
{
std::string summary(required_text_only_key(n, "summary"));
if (! summary.empty())
- _imp->summary_key.reset(new GemMetadataStringKey("summary", "Summary", summary));
+ _imp->summary_key.reset(new GemMetadataStringKey("summary", "Summary", summary, mkt_significant));
std::string description(optional_text_only_key(n, "description"));
if (! description.empty())
- _imp->description_key.reset(new GemMetadataStringKey("description", "Description", description));
+ _imp->description_key.reset(new GemMetadataStringKey("description", "Description", description, mkt_normal));
std::string authors(optional_text_sequence_key(n, "authors"));
if (! authors.empty())
- _imp->authors_key.reset(new GemMetadataStringKey("authors", "Authors", authors));
+ _imp->authors_key.reset(new GemMetadataStringKey("authors", "Authors", authors, mkt_normal));
std::string rubyforge_project(optional_text_sequence_key(n, "rubyforge_project"));
if (! rubyforge_project.empty())
- _imp->rubyforge_project_key.reset(new GemMetadataStringKey("rubyforge_project", "Rubyforge Project", rubyforge_project));
+ _imp->rubyforge_project_key.reset(new GemMetadataStringKey("rubyforge_project", "Rubyforge Project", rubyforge_project,
+ mkt_normal));
_imp->date = required_text_only_key(n, "date");
_imp->platform = required_text_only_key(n, "platform");
diff --git a/paludis/repositories/gentoo/e_key.cc b/paludis/repositories/gentoo/e_key.cc
index afca908..72adf0a 100644
--- a/paludis/repositories/gentoo/e_key.cc
+++ b/paludis/repositories/gentoo/e_key.cc
@@ -38,8 +38,8 @@ using namespace paludis;
using namespace paludis::erepository;
EStringKey::EStringKey(const tr1::shared_ptr<const PackageID> &,
- const std::string & r, const std::string & h, const std::string & v) :
- MetadataStringKey(r, h),
+ const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
+ MetadataStringKey(r, h, t),
_value(v)
{
}
@@ -72,8 +72,8 @@ namespace paludis
}
EDependenciesKey::EDependenciesKey(const tr1::shared_ptr<const PackageID> & id,
- const std::string & r, const std::string & h, const std::string & v) :
- MetadataSpecTreeKey<DependencySpecTree>(r, h),
+ const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
+ MetadataSpecTreeKey<DependencySpecTree>(r, h, t),
PrivateImplementationPattern<EDependenciesKey>(new Implementation<EDependenciesKey>(id, v)),
_imp(PrivateImplementationPattern<EDependenciesKey>::_imp.get())
{
@@ -112,8 +112,8 @@ namespace paludis
}
ELicenseKey::ELicenseKey(const tr1::shared_ptr<const PackageID> & id,
- const std::string & r, const std::string & h, const std::string & v) :
- MetadataSpecTreeKey<LicenseSpecTree>(r, h),
+ const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
+ MetadataSpecTreeKey<LicenseSpecTree>(r, h, t),
PrivateImplementationPattern<ELicenseKey>(new Implementation<ELicenseKey>(id, v)),
_imp(PrivateImplementationPattern<ELicenseKey>::_imp.get())
{
@@ -152,8 +152,8 @@ namespace paludis
}
EURIKey::EURIKey(const tr1::shared_ptr<const PackageID> & id,
- const std::string & r, const std::string & h, const std::string & v) :
- MetadataSpecTreeKey<URISpecTree>(r, h),
+ const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
+ MetadataSpecTreeKey<URISpecTree>(r, h, t),
PrivateImplementationPattern<EURIKey>(new Implementation<EURIKey>(id, v)),
_imp(PrivateImplementationPattern<EURIKey>::_imp.get())
{
@@ -192,8 +192,8 @@ namespace paludis
}
ERestrictKey::ERestrictKey(const tr1::shared_ptr<const PackageID> & id,
- const std::string & r, const std::string & h, const std::string & v) :
- MetadataSpecTreeKey<RestrictSpecTree>(r, h),
+ const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
+ MetadataSpecTreeKey<RestrictSpecTree>(r, h, t),
PrivateImplementationPattern<ERestrictKey>(new Implementation<ERestrictKey>(id, v)),
_imp(PrivateImplementationPattern<ERestrictKey>::_imp.get())
{
@@ -232,8 +232,8 @@ namespace paludis
}
EProvideKey::EProvideKey(const tr1::shared_ptr<const PackageID> & id,
- const std::string & r, const std::string & h, const std::string & v) :
- MetadataSpecTreeKey<ProvideSpecTree>(r, h),
+ const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
+ MetadataSpecTreeKey<ProvideSpecTree>(r, h, t),
PrivateImplementationPattern<EProvideKey>(new Implementation<EProvideKey>(id, v)),
_imp(PrivateImplementationPattern<EProvideKey>::_imp.get())
{
@@ -272,8 +272,8 @@ namespace paludis
}
EIUseKey::EIUseKey(const tr1::shared_ptr<const PackageID> & id,
- const std::string & r, const std::string & h, const std::string & v) :
- MetadataCollectionKey<IUseFlagCollection>(r, h),
+ const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
+ MetadataCollectionKey<IUseFlagCollection>(r, h, t),
PrivateImplementationPattern<EIUseKey>(new Implementation<EIUseKey>(id, v)),
_imp(PrivateImplementationPattern<EIUseKey>::_imp.get())
{
@@ -318,8 +318,8 @@ namespace paludis
}
EKeywordsKey::EKeywordsKey(const tr1::shared_ptr<const PackageID> & id,
- const std::string & r, const std::string & h, const std::string & v) :
- MetadataCollectionKey<KeywordNameCollection>(r, h),
+ const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
+ MetadataCollectionKey<KeywordNameCollection>(r, h, t),
PrivateImplementationPattern<EKeywordsKey>(new Implementation<EKeywordsKey>(id, v)),
_imp(PrivateImplementationPattern<EKeywordsKey>::_imp.get())
{
@@ -359,8 +359,8 @@ namespace paludis
}
EUseKey::EUseKey(const tr1::shared_ptr<const PackageID> & id,
- const std::string & r, const std::string & h, const std::string & v) :
- MetadataCollectionKey<UseFlagNameCollection>(r, h),
+ const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
+ MetadataCollectionKey<UseFlagNameCollection>(r, h, t),
PrivateImplementationPattern<EUseKey>(new Implementation<EUseKey>(id, v)),
_imp(PrivateImplementationPattern<EUseKey>::_imp.get())
{
@@ -405,8 +405,8 @@ namespace paludis
}
EInheritedKey::EInheritedKey(const tr1::shared_ptr<const PackageID> & id,
- const std::string & r, const std::string & h, const std::string & v) :
- MetadataCollectionKey<InheritedCollection>(r, h),
+ const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
+ MetadataCollectionKey<InheritedCollection>(r, h, t),
PrivateImplementationPattern<EInheritedKey>(new Implementation<EInheritedKey>(id, v)),
_imp(PrivateImplementationPattern<EInheritedKey>::_imp.get())
{
diff --git a/paludis/repositories/gentoo/e_key.hh b/paludis/repositories/gentoo/e_key.hh
index 1a50aff..ee456fc 100644
--- a/paludis/repositories/gentoo/e_key.hh
+++ b/paludis/repositories/gentoo/e_key.hh
@@ -36,7 +36,7 @@ namespace paludis
public:
EStringKey(const tr1::shared_ptr<const PackageID> &,
- const std::string &, const std::string &, const std::string &);
+ const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EStringKey();
virtual const std::string value() const
@@ -52,7 +52,7 @@ namespace paludis
public:
EDependenciesKey(const tr1::shared_ptr<const PackageID> &,
- const std::string &, const std::string &, const std::string &);
+ const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EDependenciesKey();
virtual const tr1::shared_ptr<const DependencySpecTree::ConstItem> value() const
@@ -68,7 +68,7 @@ namespace paludis
public:
EURIKey(const tr1::shared_ptr<const PackageID> &,
- const std::string &, const std::string &, const std::string &);
+ const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EURIKey();
virtual const tr1::shared_ptr<const URISpecTree::ConstItem> value() const
@@ -84,7 +84,7 @@ namespace paludis
public:
ERestrictKey(const tr1::shared_ptr<const PackageID> &,
- const std::string &, const std::string &, const std::string &);
+ const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~ERestrictKey();
virtual const tr1::shared_ptr<const RestrictSpecTree::ConstItem> value() const
@@ -100,7 +100,7 @@ namespace paludis
public:
EProvideKey(const tr1::shared_ptr<const PackageID> &,
- const std::string &, const std::string &, const std::string &);
+ const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EProvideKey();
virtual const tr1::shared_ptr<const ProvideSpecTree::ConstItem> value() const
@@ -116,7 +116,7 @@ namespace paludis
public:
ELicenseKey(const tr1::shared_ptr<const PackageID> &,
- const std::string &, const std::string &, const std::string &);
+ const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~ELicenseKey();
virtual const tr1::shared_ptr<const LicenseSpecTree::ConstItem> value() const
@@ -132,7 +132,7 @@ namespace paludis
public:
EIUseKey(const tr1::shared_ptr<const PackageID> &,
- const std::string &, const std::string &, const std::string &);
+ const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EIUseKey();
const tr1::shared_ptr<const IUseFlagCollection> value() const
@@ -148,7 +148,7 @@ namespace paludis
public:
EKeywordsKey(const tr1::shared_ptr<const PackageID> &,
- const std::string &, const std::string &, const std::string &);
+ const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EKeywordsKey();
const tr1::shared_ptr<const KeywordNameCollection> value() const
@@ -164,7 +164,7 @@ namespace paludis
public:
EUseKey(const tr1::shared_ptr<const PackageID> &,
- const std::string &, const std::string &, const std::string &);
+ const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EUseKey();
const tr1::shared_ptr<const UseFlagNameCollection> value() const
@@ -180,7 +180,7 @@ namespace paludis
public:
EInheritedKey(const tr1::shared_ptr<const PackageID> &,
- const std::string &, const std::string &, const std::string &);
+ const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EInheritedKey();
const tr1::shared_ptr<const InheritedCollection> value() const
diff --git a/paludis/repositories/gentoo/ebuild_id.cc b/paludis/repositories/gentoo/ebuild_id.cc
index 98acb82..9f14d75 100644
--- a/paludis/repositories/gentoo/ebuild_id.cc
+++ b/paludis/repositories/gentoo/ebuild_id.cc
@@ -444,84 +444,84 @@ EbuildID::portage_repository() const
void
EbuildID::load_short_description(const std::string & r, const std::string & h, const std::string & v) const
{
- _imp->short_description.reset(new EStringKey(shared_from_this(), r, h, v));
+ _imp->short_description.reset(new EStringKey(shared_from_this(), r, h, v, mkt_significant));
add_key(_imp->short_description);
}
void
EbuildID::load_build_depend(const std::string & r, const std::string & h, const std::string & v) const
{
- _imp->build_dependencies.reset(new EDependenciesKey(shared_from_this(), r, h, v));
+ _imp->build_dependencies.reset(new EDependenciesKey(shared_from_this(), r, h, v, mkt_dependencies));
add_key(_imp->build_dependencies);
}
void
EbuildID::load_run_depend(const std::string & r, const std::string & h, const std::string & v) const
{
- _imp->run_dependencies.reset(new EDependenciesKey(shared_from_this(), r, h, v));
+ _imp->run_dependencies.reset(new EDependenciesKey(shared_from_this(), r, h, v, mkt_dependencies));
add_key(_imp->run_dependencies);
}
void
EbuildID::load_post_depend(const std::string & r, const std::string & h, const std::string & v) const
{
- _imp->post_dependencies.reset(new EDependenciesKey(shared_from_this(), r, h, v));
+ _imp->post_dependencies.reset(new EDependenciesKey(shared_from_this(), r, h, v, mkt_dependencies));
add_key(_imp->post_dependencies);
}
void
EbuildID::load_src_uri(const std::string & r, const std::string & h, const std::string & v) const
{
- _imp->src_uri.reset(new EURIKey(shared_from_this(), r, h, v));
+ _imp->src_uri.reset(new EURIKey(shared_from_this(), r, h, v, mkt_dependencies));
add_key(_imp->src_uri);
}
void
EbuildID::load_homepage(const std::string & r, const std::string & h, const std::string & v) const
{
- _imp->homepage.reset(new EURIKey(shared_from_this(), r, h, v));
+ _imp->homepage.reset(new EURIKey(shared_from_this(), r, h, v, mkt_significant));
add_key(_imp->homepage);
}
void
EbuildID::load_license(const std::string & r, const std::string & h, const std::string & v) const
{
- _imp->license.reset(new ELicenseKey(shared_from_this(), r, h, v));
+ _imp->license.reset(new ELicenseKey(shared_from_this(), r, h, v, mkt_normal));
add_key(_imp->license);
}
void
EbuildID::load_restrict(const std::string & r, const std::string & h, const std::string & v) const
{
- _imp->restrictions.reset(new ERestrictKey(shared_from_this(), r, h, v));
+ _imp->restrictions.reset(new ERestrictKey(shared_from_this(), r, h, v, mkt_internal));
add_key(_imp->restrictions);
}
void
EbuildID::load_provide(const std::string & r, const std::string & h, const std::string & v) const
{
- _imp->provide.reset(new EProvideKey(shared_from_this(), r, h, v));
+ _imp->provide.reset(new EProvideKey(shared_from_this(), r, h, v, mkt_dependencies));
add_key(_imp->provide);
}
void
EbuildID::load_iuse(const std::string & r, const std::string & h, const std::string & v) const
{
- _imp->iuse.reset(new EIUseKey(shared_from_this(), r, h, v));
+ _imp->iuse.reset(new EIUseKey(shared_from_this(), r, h, v, mkt_normal));
add_key(_imp->iuse);
}
void
EbuildID::load_keywords(const std::string & r, const std::string & h, const std::string & v) const
{
- _imp->keywords.reset(new EKeywordsKey(shared_from_this(), r, h, v));
+ _imp->keywords.reset(new EKeywordsKey(shared_from_this(), r, h, v, mkt_normal));
add_key(_imp->keywords);
}
void
EbuildID::load_inherited(const std::string & r, const std::string & h, const std::string & v) const
{
- _imp->inherited.reset(new EInheritedKey(shared_from_this(), r, h, v));
+ _imp->inherited.reset(new EInheritedKey(shared_from_this(), r, h, v, mkt_internal));
add_key(_imp->inherited);
}
diff --git a/paludis/repositories/gentoo/vdb_id.cc b/paludis/repositories/gentoo/vdb_id.cc
index 7298f81..b88fd2d 100644
--- a/paludis/repositories/gentoo/vdb_id.cc
+++ b/paludis/repositories/gentoo/vdb_id.cc
@@ -120,82 +120,86 @@ VDBID::need_keys_added() const
if ((_imp->dir / "USE").exists())
{
- _imp->use.reset(new EUseKey(shared_from_this(), "USE", "Use flags", file_contents(_imp->dir / "USE")));
+ _imp->use.reset(new EUseKey(shared_from_this(), "USE", "Use flags", file_contents(_imp->dir / "USE"), mkt_internal));
add_key(_imp->use);
}
if ((_imp->dir / "INHERITED").exists())
{
- _imp->inherited.reset(new EInheritedKey(shared_from_this(), "INHERITED", "Inherited", file_contents(_imp->dir / "INHERITED")));
+ _imp->inherited.reset(new EInheritedKey(shared_from_this(), "INHERITED", "Inherited", file_contents(_imp->dir / "INHERITED"),
+ mkt_internal));
add_key(_imp->inherited);
}
if ((_imp->dir / "IUSE").exists())
{
- _imp->iuse.reset(new EIUseKey(shared_from_this(), "IUSE", "Used use flags", file_contents(_imp->dir / "IUSE")));
+ _imp->iuse.reset(new EIUseKey(shared_from_this(), "IUSE", "Used use flags", file_contents(_imp->dir / "IUSE"),
+ mkt_normal));
add_key(_imp->iuse);
}
if ((_imp->dir / "LICENSE").exists())
{
- _imp->license.reset(new ELicenseKey(shared_from_this(), "LICENSE", "License", file_contents(_imp->dir / "LICENSE")));
+ _imp->license.reset(new ELicenseKey(shared_from_this(), "LICENSE", "License", file_contents(_imp->dir / "LICENSE"),
+ mkt_normal));
add_key(_imp->license);
}
if ((_imp->dir / "PROVIDE").exists())
{
- _imp->provide.reset(new EProvideKey(shared_from_this(), "PROVIDE", "Provides", file_contents(_imp->dir / "PROVIDE")));
+ _imp->provide.reset(new EProvideKey(shared_from_this(), "PROVIDE", "Provides", file_contents(_imp->dir / "PROVIDE"),
+ mkt_internal));
add_key(_imp->provide);
}
if ((_imp->dir / "DEPEND").exists())
{
_imp->build_dependencies.reset(new EDependenciesKey(shared_from_this(), "DEPEND", "Build dependencies",
- file_contents(_imp->dir / "DEPEND")));
+ file_contents(_imp->dir / "DEPEND"), mkt_dependencies));
add_key(_imp->build_dependencies);
}
if ((_imp->dir / "RDEPEND").exists())
{
_imp->run_dependencies.reset(new EDependenciesKey(shared_from_this(), "RDEPEND", "Run dependencies",
- file_contents(_imp->dir / "RDEPEND")));
+ file_contents(_imp->dir / "RDEPEND"), mkt_dependencies));
add_key(_imp->run_dependencies);
}
if ((_imp->dir / "PDEPEND").exists())
{
_imp->post_dependencies.reset(new EDependenciesKey(shared_from_this(), "PDEPEND", "Post dependencies",
- file_contents(_imp->dir / "PDEPEND")));
+ file_contents(_imp->dir / "PDEPEND"), mkt_dependencies));
add_key(_imp->post_dependencies);
}
if ((_imp->dir / "RESTRICT").exists())
{
_imp->restrictions.reset(new ERestrictKey(shared_from_this(), "RESTRICT", "Restrictions",
- file_contents(_imp->dir / "RESTRICT")));
+ file_contents(_imp->dir / "RESTRICT"), mkt_internal));
add_key(_imp->restrictions);
}
if ((_imp->dir / "SRC_URI").exists())
{
_imp->src_uri.reset(new EURIKey(shared_from_this(), "SRC_URI", "Source URI",
- file_contents(_imp->dir / "SRC_URI")));
+ file_contents(_imp->dir / "SRC_URI"), mkt_dependencies));
add_key(_imp->src_uri);
}
- if ((_imp->dir / "HOMEPAGE").exists())
- {
- _imp->homepage.reset(new EURIKey(shared_from_this(), "HOMEPAGE", "Homepage",
- file_contents(_imp->dir / "HOMEPAGE")));
- add_key(_imp->homepage);
- }
-
if ((_imp->dir / "DESCRIPTION").exists())
{
_imp->short_description.reset(new EStringKey(shared_from_this(), "DESCRIPTION", "Description",
- file_contents(_imp->dir / "DESCRIPTION")));
+ file_contents(_imp->dir / "DESCRIPTION"), mkt_significant));
add_key(_imp->short_description);
}
+
+ if ((_imp->dir / "HOMEPAGE").exists())
+ {
+ _imp->homepage.reset(new EURIKey(shared_from_this(), "HOMEPAGE", "Homepage",
+ file_contents(_imp->dir / "HOMEPAGE"), mkt_significant));
+ add_key(_imp->homepage);
+ }
}
const std::string
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index 112b233..b1ed7bd 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -73,7 +73,7 @@ namespace paludis
}
VirtualsPackageIDKey::VirtualsPackageIDKey(const tr1::shared_ptr<const PackageID> & v) :
- MetadataPackageIDKey("VIRTUAL_FOR", "Virtual for"),
+ MetadataPackageIDKey("VIRTUAL_FOR", "Virtual for", mkt_normal),
PrivateImplementationPattern<VirtualsPackageIDKey>(new Implementation<VirtualsPackageIDKey>(v)),
_imp(PrivateImplementationPattern<VirtualsPackageIDKey>::_imp.get())
{
@@ -91,7 +91,7 @@ VirtualsPackageIDKey::value() const
VirtualsDepKey::VirtualsDepKey(const std::string & r, const std::string & h,
const tr1::shared_ptr<const PackageID> & v, const bool exact) :
- MetadataSpecTreeKey<DependencySpecTree>(r, h),
+ MetadataSpecTreeKey<DependencySpecTree>(r, h, mkt_dependencies),
PrivateImplementationPattern<VirtualsDepKey>(new Implementation<VirtualsDepKey>(v, exact)),
_imp(PrivateImplementationPattern<VirtualsDepKey>::_imp.get())
{