aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-01-18 23:55:50 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-01-18 23:55:50 +0000
commitb12a4f151e0c16e18c08de5929922e4cd4d35165 (patch)
treecd410e5e465c10881752a718734554547d039e8d /paludis/repositories
parentcfbe6ed8eb60a9096d32856a8442a477137edb96 (diff)
downloadpaludis-b12a4f151e0c16e18c08de5929922e4cd4d35165.tar.gz
paludis-b12a4f151e0c16e18c08de5929922e4cd4d35165.tar.xz
Make metadata key general methods pure virtual.
Diffstat (limited to 'paludis/repositories')
-rw-r--r--paludis/repositories/cran/keys.cc81
-rw-r--r--paludis/repositories/cran/keys.hh22
-rw-r--r--paludis/repositories/e/dep_parser.cc18
-rw-r--r--paludis/repositories/e/e_choices_key.cc34
-rw-r--r--paludis/repositories/e/e_choices_key.hh9
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc3
-rw-r--r--paludis/repositories/e/e_key.cc400
-rw-r--r--paludis/repositories/e/e_key.hh91
-rw-r--r--paludis/repositories/e/eapi-fwd.hh4
-rw-r--r--paludis/repositories/e/ebuild.cc2
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc4
-rw-r--r--paludis/repositories/e/ebuild_id.cc4
-rw-r--r--paludis/repositories/e/ebuild_id.hh4
-rw-r--r--paludis/repositories/e/exndbam_id.cc18
-rw-r--r--paludis/repositories/e/info_metadata_key.cc44
-rw-r--r--paludis/repositories/e/info_metadata_key.hh13
-rw-r--r--paludis/repositories/fake/fake_package_id.cc159
-rw-r--r--paludis/repositories/fake/fake_package_id.hh22
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc121
-rw-r--r--paludis/repositories/unpackaged/unpackaged_key.cc68
-rw-r--r--paludis/repositories/unpackaged/unpackaged_key.hh16
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_file.cc25
-rw-r--r--paludis/repositories/virtuals/package_id.cc30
-rw-r--r--paludis/repositories/virtuals/package_id.hh6
24 files changed, 1013 insertions, 185 deletions
diff --git a/paludis/repositories/cran/keys.cc b/paludis/repositories/cran/keys.cc
index a8ad2bf21..7a1ee4b45 100644
--- a/paludis/repositories/cran/keys.cc
+++ b/paludis/repositories/cran/keys.cc
@@ -39,9 +39,11 @@ using namespace paludis::cranrepository;
PackageIDSequenceKey::PackageIDSequenceKey(const Environment * const e,
const std::string & r, const std::string & h, const MetadataKeyType t) :
- MetadataCollectionKey<PackageIDSequence>(r, h, t),
_env(e),
- _v(new PackageIDSequence)
+ _v(new PackageIDSequence),
+ _r(r),
+ _h(h),
+ _t(t)
{
}
@@ -51,6 +53,24 @@ PackageIDSequenceKey::value() const
return _v;
}
+const std::string
+PackageIDSequenceKey::raw_name() const
+{
+ return _r;
+}
+
+const std::string
+PackageIDSequenceKey::human_name() const
+{
+ return _h;
+}
+
+MetadataKeyType
+PackageIDSequenceKey::type() const
+{
+ return _t;
+}
+
void
PackageIDSequenceKey::push_back(const std::tr1::shared_ptr<const PackageID> & i)
{
@@ -69,8 +89,10 @@ PackageIDSequenceKey::pretty_print_flat(const Formatter<PackageID> & f) const
PackageIDKey::PackageIDKey(const std::string & r, const std::string & h,
const CRANPackageID * const v, const MetadataKeyType t) :
- MetadataValueKey<std::tr1::shared_ptr<const PackageID> >(r, h, t),
- _v(v)
+ _v(v),
+ _r(r),
+ _h(h),
+ _t(t)
{
}
@@ -80,6 +102,24 @@ PackageIDKey::value() const
return _v->shared_from_this();
}
+const std::string
+PackageIDKey::raw_name() const
+{
+ return _r;
+}
+
+const std::string
+PackageIDKey::human_name() const
+{
+ return _h;
+}
+
+MetadataKeyType
+PackageIDKey::type() const
+{
+ return _t;
+}
+
std::string
PackageIDKey::pretty_print(const Formatter<PackageID> & f) const
{
@@ -108,11 +148,19 @@ namespace paludis
mutable std::tr1::shared_ptr<const DependencySpecTree> c;
const std::tr1::shared_ptr<const DependencyLabelSequence> labels;
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
Implementation(const Environment * const e, const std::string & vv,
- const std::tr1::shared_ptr<const DependencyLabelSequence> & s) :
+ const std::tr1::shared_ptr<const DependencyLabelSequence> & s,
+ const std::string & r, const std::string & h, const MetadataKeyType & t) :
env(e),
v(vv),
- labels(s)
+ labels(s),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -120,8 +168,7 @@ namespace paludis
DepKey::DepKey(const Environment * const e, const std::string & r, const std::string & h, const std::string & v,
const std::tr1::shared_ptr<const DependencyLabelSequence> & s, const MetadataKeyType t) :
- MetadataSpecTreeKey<DependencySpecTree>(r, h, t),
- PrivateImplementationPattern<DepKey>(new Implementation<DepKey>(e, v, s)),
+ PrivateImplementationPattern<DepKey>(new Implementation<DepKey>(e, v, s, r, h, t)),
_imp(PrivateImplementationPattern<DepKey>::_imp)
{
}
@@ -130,6 +177,24 @@ DepKey::~DepKey()
{
}
+const std::string
+DepKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+DepKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+DepKey::type() const
+{
+ return _imp->type;
+}
+
const std::tr1::shared_ptr<const DependencySpecTree>
DepKey::value() const
{
diff --git a/paludis/repositories/cran/keys.hh b/paludis/repositories/cran/keys.hh
index 004c5a896..f488579dc 100644
--- a/paludis/repositories/cran/keys.hh
+++ b/paludis/repositories/cran/keys.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -38,6 +38,10 @@ namespace paludis
const Environment * const _env;
const std::tr1::shared_ptr<PackageIDSequence> _v;
+ const std::string _r;
+ const std::string _h;
+ const MetadataKeyType _t;
+
public:
PackageIDSequenceKey(const Environment * const,
const std::string &, const std::string &, const MetadataKeyType);
@@ -49,6 +53,10 @@ namespace paludis
virtual std::string pretty_print_flat(const Formatter<PackageID> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class PackageIDKey :
@@ -57,6 +65,10 @@ namespace paludis
private:
const CRANPackageID * const _v;
+ const std::string _r;
+ const std::string _h;
+ const MetadataKeyType _t;
+
public:
PackageIDKey(const std::string &, const std::string &, const CRANPackageID * const, const MetadataKeyType);
@@ -65,6 +77,10 @@ namespace paludis
virtual std::string pretty_print(const Formatter<PackageID> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class DepKey :
@@ -92,6 +108,10 @@ namespace paludis
virtual const std::tr1::shared_ptr<const DependencyLabelSequence> initial_labels() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
}
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index 46a46c6ce..c65205183 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -288,8 +288,7 @@ namespace
struct AnnotationsKey :
MetadataSectionKey
{
- AnnotationsKey(const std::tr1::shared_ptr<const Map<std::string, std::string> > & m) :
- MetadataSectionKey("Annotations", "Annotations", mkt_normal)
+ AnnotationsKey(const std::tr1::shared_ptr<const Map<std::string, std::string> > & m)
{
for (Map<std::string, std::string>::ConstIterator k(m->begin()), k_end(m->end()) ;
k != k_end ; ++k)
@@ -299,6 +298,21 @@ namespace
void need_keys_added() const
{
}
+
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return "Annotations";
+ }
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return "Annotations";
+ }
+
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return mkt_normal;
+ }
};
void set_annotations(std::tr1::shared_ptr<DepSpec> & spec, const std::tr1::shared_ptr<const Map<std::string, std::string> > & m)
diff --git a/paludis/repositories/e/e_choices_key.cc b/paludis/repositories/e/e_choices_key.cc
index 9fba4dd64..c2ca3e6c5 100644
--- a/paludis/repositories/e/e_choices_key.cc
+++ b/paludis/repositories/e/e_choices_key.cc
@@ -64,13 +64,21 @@ namespace paludis
const std::tr1::shared_ptr<const ERepository> maybe_e_repository;
const std::tr1::shared_ptr<const Map<ChoiceNameWithPrefix, std::string> > maybe_descriptions;
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i,
const std::tr1::shared_ptr<const ERepository> & p,
- const std::tr1::shared_ptr<const Map<ChoiceNameWithPrefix, std::string> > & d) :
+ const std::tr1::shared_ptr<const Map<ChoiceNameWithPrefix, std::string> > & d,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
env(e),
id(i),
maybe_e_repository(p),
- maybe_descriptions(d)
+ maybe_descriptions(d),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -82,9 +90,7 @@ EChoicesKey::EChoicesKey(
const std::string & r, const std::string & h, const MetadataKeyType t,
const std::tr1::shared_ptr<const ERepository> & p,
const std::tr1::shared_ptr<const Map<ChoiceNameWithPrefix, std::string> > & d) :
- MetadataValueKey<std::tr1::shared_ptr<const Choices> > (r, h, t),
- PrivateImplementationPattern<EChoicesKey>(new Implementation<EChoicesKey>(e, i, p, d)),
- _imp(PrivateImplementationPattern<EChoicesKey>::_imp)
+ PrivateImplementationPattern<EChoicesKey>(new Implementation<EChoicesKey>(e, i, p, d, r, h, t))
{
}
@@ -481,3 +487,21 @@ EChoicesKey::value() const
return _imp->value;
}
+const std::string
+EChoicesKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EChoicesKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EChoicesKey::type() const
+{
+ return _imp->type;
+}
+
diff --git a/paludis/repositories/e/e_choices_key.hh b/paludis/repositories/e/e_choices_key.hh
index 6d48372ab..c5f4eb7e2 100644
--- a/paludis/repositories/e/e_choices_key.hh
+++ b/paludis/repositories/e/e_choices_key.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -37,9 +37,6 @@ namespace paludis
public MetadataValueKey<std::tr1::shared_ptr<const Choices> >,
private PrivateImplementationPattern<EChoicesKey>
{
- private:
- PrivateImplementationPattern<EChoicesKey>::ImpPtr & _imp;
-
public:
EChoicesKey(
const Environment * const,
@@ -53,6 +50,10 @@ namespace paludis
~EChoicesKey();
const std::tr1::shared_ptr<const Choices> value() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
}
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index fa90edc52..f05cd824d 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -339,8 +339,7 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->src_uri()->name().empty())
if ((_imp->dir / vars->src_uri()->name()).exists())
{
- _imp->src_uri.reset(new EFetchableURIKey(_imp->environment, shared_from_this(), vars->src_uri()->name(),
- vars->src_uri()->description(),
+ _imp->src_uri.reset(new EFetchableURIKey(_imp->environment, shared_from_this(), vars->src_uri(),
file_contents(_imp->dir / vars->src_uri()->name()), mkt_dependencies));
add_metadata_key(_imp->src_uri);
}
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 6fd9877d0..e72c141c2 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -57,8 +57,10 @@ using namespace paludis::erepository;
EMutableRepositoryMaskInfoKey::EMutableRepositoryMaskInfoKey(const std::tr1::shared_ptr<const ERepositoryID> &,
const std::string & r, const std::string & h, const std::tr1::shared_ptr<const RepositoryMaskInfo> & v, const MetadataKeyType t) :
- MetadataValueKey<std::tr1::shared_ptr<const RepositoryMaskInfo> > (r, h, t),
- _value(v)
+ _value(v),
+ _r(r),
+ _h(h),
+ _t(t)
{
}
@@ -78,6 +80,24 @@ EMutableRepositoryMaskInfoKey::set_value(const std::tr1::shared_ptr<const Reposi
_value = v;
}
+const std::string
+EMutableRepositoryMaskInfoKey::raw_name() const
+{
+ return _r;
+}
+
+const std::string
+EMutableRepositoryMaskInfoKey::human_name() const
+{
+ return _h;
+}
+
+MetadataKeyType
+EMutableRepositoryMaskInfoKey::type() const
+{
+ return _t;
+}
+
namespace paludis
{
template <>
@@ -91,14 +111,22 @@ namespace paludis
mutable std::tr1::function<void () throw ()> value_used;
const std::tr1::shared_ptr<const DependencyLabelSequence> labels;
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
Implementation(
const Environment * const e,
const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v,
- const std::tr1::shared_ptr<const DependencyLabelSequence> & s) :
+ const std::tr1::shared_ptr<const DependencyLabelSequence> & s,
+ const std::string & r, const std::string & h, const MetadataKeyType & t) :
env(e),
id(i),
string_value(v),
- labels(s)
+ labels(s),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -109,9 +137,7 @@ EDependenciesKey::EDependenciesKey(
const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v,
const std::tr1::shared_ptr<const DependencyLabelSequence> & l, const MetadataKeyType t) :
- MetadataSpecTreeKey<DependencySpecTree>(r, h, t),
- PrivateImplementationPattern<EDependenciesKey>(new Implementation<EDependenciesKey>(e, id, v, l)),
- _imp(PrivateImplementationPattern<EDependenciesKey>::_imp)
+ PrivateImplementationPattern<EDependenciesKey>(new Implementation<EDependenciesKey>(e, id, v, l, r, h, t))
{
}
@@ -162,6 +188,24 @@ EDependenciesKey::pretty_print_flat(const DependencySpecTree::ItemFormatter & f)
return stringify(p);
}
+const std::string
+EDependenciesKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EDependenciesKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EDependenciesKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -174,11 +218,19 @@ namespace paludis
mutable std::tr1::shared_ptr<const LicenseSpecTree> value;
mutable std::tr1::function<void () throw ()> value_used;
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
Implementation(const Environment * const e,
- const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
+ const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
env(e),
id(i),
- string_value(v)
+ string_value(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -188,9 +240,7 @@ ELicenseKey::ELicenseKey(
const Environment * const e,
const std::tr1::shared_ptr<const ERepositoryID> & id,
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>(e, id, v)),
- _imp(PrivateImplementationPattern<ELicenseKey>::_imp)
+ PrivateImplementationPattern<ELicenseKey>(new Implementation<ELicenseKey>(e, id, v, r, h, t))
{
}
@@ -235,6 +285,24 @@ ELicenseKey::pretty_print_flat(const LicenseSpecTree::ItemFormatter & f) const
return stringify(p);
}
+const std::string
+ELicenseKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+ELicenseKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+ELicenseKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -242,15 +310,22 @@ namespace paludis
{
const Environment * const env;
const std::tr1::shared_ptr<const ERepositoryID> id;
+ const std::tr1::shared_ptr<const EAPIMetadataVariable> variable;
const std::string string_value;
+ const MetadataKeyType type;
+
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<const FetchableURISpecTree> value;
mutable std::tr1::shared_ptr<const URILabel> initial_label;
- Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
+ Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i,
+ const std::tr1::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v,
+ const MetadataKeyType t) :
env(e),
id(i),
- string_value(v)
+ variable(m),
+ string_value(v),
+ type(t)
{
}
};
@@ -258,10 +333,8 @@ namespace paludis
EFetchableURIKey::EFetchableURIKey(const Environment * const e,
const std::tr1::shared_ptr<const ERepositoryID> & id,
- const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataSpecTreeKey<FetchableURISpecTree>(r, h, t),
- PrivateImplementationPattern<EFetchableURIKey>(new Implementation<EFetchableURIKey>(e, id, v)),
- _imp(PrivateImplementationPattern<EFetchableURIKey>::_imp)
+ const std::tr1::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v, const MetadataKeyType t) :
+ PrivateImplementationPattern<EFetchableURIKey>(new Implementation<EFetchableURIKey>(e, id, m, v, t))
{
}
@@ -336,6 +409,24 @@ EFetchableURIKey::initial_label() const
return _imp->initial_label;
}
+const std::string
+EFetchableURIKey::raw_name() const
+{
+ return _imp->variable->name();
+}
+
+const std::string
+EFetchableURIKey::human_name() const
+{
+ return _imp->variable->description();
+}
+
+MetadataKeyType
+EFetchableURIKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -347,10 +438,19 @@ namespace paludis
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<const SimpleURISpecTree> value;
- Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i,
+ const std::string & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
env(e),
id(i),
- string_value(v)
+ string_value(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -359,9 +459,7 @@ namespace paludis
ESimpleURIKey::ESimpleURIKey(const Environment * const e,
const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataSpecTreeKey<SimpleURISpecTree>(r, h, t),
- PrivateImplementationPattern<ESimpleURIKey>(new Implementation<ESimpleURIKey>(e, id, v)),
- _imp(PrivateImplementationPattern<ESimpleURIKey>::_imp)
+ PrivateImplementationPattern<ESimpleURIKey>(new Implementation<ESimpleURIKey>(e, id, v, r, h, t))
{
}
@@ -400,6 +498,24 @@ ESimpleURIKey::pretty_print_flat(const SimpleURISpecTree::ItemFormatter & f) con
return stringify(p);
}
+const std::string
+ESimpleURIKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+ESimpleURIKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+ESimpleURIKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -411,10 +527,18 @@ namespace paludis
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<const PlainTextSpecTree> value;
- Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
env(e),
id(i),
- string_value(v)
+ string_value(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -423,9 +547,7 @@ namespace paludis
EPlainTextSpecKey::EPlainTextSpecKey(const Environment * const e,
const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataSpecTreeKey<PlainTextSpecTree>(r, h, t),
- PrivateImplementationPattern<EPlainTextSpecKey>(new Implementation<EPlainTextSpecKey>(e, id, v)),
- _imp(PrivateImplementationPattern<EPlainTextSpecKey>::_imp)
+ PrivateImplementationPattern<EPlainTextSpecKey>(new Implementation<EPlainTextSpecKey>(e, id, v, r, h, t))
{
}
@@ -464,6 +586,24 @@ EPlainTextSpecKey::pretty_print_flat(const PlainTextSpecTree::ItemFormatter & f)
return stringify(p);
}
+const std::string
+EPlainTextSpecKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EPlainTextSpecKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EPlainTextSpecKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -475,10 +615,18 @@ namespace paludis
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<const PlainTextSpecTree> value;
- Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
env(e),
id(i),
- string_value(v)
+ string_value(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -487,9 +635,7 @@ namespace paludis
EMyOptionsKey::EMyOptionsKey(const Environment * const e,
const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataSpecTreeKey<PlainTextSpecTree>(r, h, t),
- PrivateImplementationPattern<EMyOptionsKey>(new Implementation<EMyOptionsKey>(e, id, v)),
- _imp(PrivateImplementationPattern<EMyOptionsKey>::_imp)
+ PrivateImplementationPattern<EMyOptionsKey>(new Implementation<EMyOptionsKey>(e, id, v, r, h, t))
{
}
@@ -528,6 +674,24 @@ EMyOptionsKey::pretty_print_flat(const PlainTextSpecTree::ItemFormatter & f) con
return stringify(p);
}
+const std::string
+EMyOptionsKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EMyOptionsKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EMyOptionsKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -539,10 +703,18 @@ namespace paludis
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<const ProvideSpecTree> value;
- Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
env(e),
id(i),
- string_value(v)
+ string_value(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -550,9 +722,7 @@ namespace paludis
EProvideKey::EProvideKey(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & id,
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>(e, id, v)),
- _imp(PrivateImplementationPattern<EProvideKey>::_imp)
+ PrivateImplementationPattern<EProvideKey>(new Implementation<EProvideKey>(e, id, v, r, h, t))
{
}
@@ -591,6 +761,24 @@ EProvideKey::pretty_print_flat(const ProvideSpecTree::ItemFormatter & f) const
return stringify(p);
}
+const std::string
+EProvideKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EProvideKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EProvideKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -603,10 +791,18 @@ namespace paludis
mutable std::tr1::shared_ptr<KeywordNameSet> value;
mutable std::tr1::function<void () throw ()> value_used;
- Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const Environment * const e, const std::string & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const Environment * const e, const std::string & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
id(i),
env(e),
- string_value(v)
+ string_value(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -614,9 +810,7 @@ namespace paludis
EKeywordsKey::EKeywordsKey(const Environment * const e, const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataCollectionKey<KeywordNameSet>(r, h, t),
- PrivateImplementationPattern<EKeywordsKey>(new Implementation<EKeywordsKey>(id, e, v)),
- _imp(PrivateImplementationPattern<EKeywordsKey>::_imp)
+ PrivateImplementationPattern<EKeywordsKey>(new Implementation<EKeywordsKey>(id, e, v, r, h, t))
{
}
@@ -665,6 +859,24 @@ EKeywordsKey::pretty_print_flat(const Formatter<KeywordName> & f) const
return result;
}
+const std::string
+EKeywordsKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EKeywordsKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EKeywordsKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -675,9 +887,17 @@ namespace paludis
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<Set<std::string> > value;
- Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const std::string & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
id(i),
- string_value(v)
+ string_value(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -685,9 +905,7 @@ namespace paludis
EStringSetKey::EStringSetKey(const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- MetadataCollectionKey<Set<std::string> >(r, h, t),
- PrivateImplementationPattern<EStringSetKey>(new Implementation<EStringSetKey>(id, v)),
- _imp(PrivateImplementationPattern<EStringSetKey>::_imp)
+ PrivateImplementationPattern<EStringSetKey>(new Implementation<EStringSetKey>(id, v, r, h, t))
{
}
@@ -709,6 +927,24 @@ EStringSetKey::value() const
return _imp->value;
}
+const std::string
+EStringSetKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EStringSetKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EStringSetKey::type() const
+{
+ return _imp->type;
+}
+
namespace
{
std::string format_string(const std::string & i, const Formatter<std::string> & f)
@@ -734,9 +970,17 @@ namespace paludis
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<Contents> value;
- Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const FSEntry & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const FSEntry & v,
+ const std::string & r, const std::string & h, const MetadataKeyType & t) :
id(i),
- filename(v)
+ filename(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -744,9 +988,7 @@ namespace paludis
EContentsKey::EContentsKey(const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const FSEntry & v, const MetadataKeyType t) :
- MetadataValueKey<std::tr1::shared_ptr<const Contents> > (r, h, t),
- PrivateImplementationPattern<EContentsKey>(new Implementation<EContentsKey>(id, v)),
- _imp(PrivateImplementationPattern<EContentsKey>::_imp)
+ PrivateImplementationPattern<EContentsKey>(new Implementation<EContentsKey>(id, v, r, h, t))
{
}
@@ -809,6 +1051,24 @@ EContentsKey::value() const
return _imp->value;
}
+const std::string
+EContentsKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EContentsKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EContentsKey::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -819,9 +1079,17 @@ namespace paludis
mutable Mutex value_mutex;
mutable std::tr1::shared_ptr<time_t> value;
- Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const FSEntry & v) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const std::tr1::shared_ptr<const ERepositoryID> & i, const FSEntry & v,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
id(i),
- filename(v)
+ filename(v),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -829,9 +1097,7 @@ namespace paludis
EMTimeKey::EMTimeKey(const std::tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const FSEntry & v, const MetadataKeyType t) :
- MetadataTimeKey(r, h, t),
- PrivateImplementationPattern<EMTimeKey>(new Implementation<EMTimeKey>(id, v)),
- _imp(PrivateImplementationPattern<EMTimeKey>::_imp)
+ PrivateImplementationPattern<EMTimeKey>(new Implementation<EMTimeKey>(id, v, r, h, t))
{
}
@@ -863,3 +1129,21 @@ EMTimeKey::value() const
return *_imp->value;
}
+const std::string
+EMTimeKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+EMTimeKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+EMTimeKey::type() const
+{
+ return _imp->type;
+}
+
diff --git a/paludis/repositories/e/e_key.hh b/paludis/repositories/e/e_key.hh
index cd7c6299f..65e830b36 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -24,6 +24,7 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/set.hh>
#include <paludis/util/map-fwd.hh>
+#include <paludis/repositories/e/eapi-fwd.hh>
namespace paludis
{
@@ -38,6 +39,9 @@ namespace paludis
{
private:
std::tr1::shared_ptr<const RepositoryMaskInfo> _value;
+ const std::string _r;
+ const std::string _h;
+ const MetadataKeyType _t;
public:
EMutableRepositoryMaskInfoKey(const std::tr1::shared_ptr<const ERepositoryID> &,
@@ -48,15 +52,16 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result));
void set_value(const std::tr1::shared_ptr<const RepositoryMaskInfo> &);
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EDependenciesKey :
public MetadataSpecTreeKey<DependencySpecTree>,
private PrivateImplementationPattern<EDependenciesKey>
{
- private:
- PrivateImplementationPattern<EDependenciesKey>::ImpPtr & _imp;
-
public:
EDependenciesKey(
const Environment * const,
@@ -77,19 +82,22 @@ namespace paludis
virtual const std::tr1::shared_ptr<const DependencyLabelSequence> initial_labels() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EFetchableURIKey :
public MetadataSpecTreeKey<FetchableURISpecTree>,
private PrivateImplementationPattern<EFetchableURIKey>
{
- private:
- PrivateImplementationPattern<EFetchableURIKey>::ImpPtr & _imp;
-
public:
EFetchableURIKey(const Environment * const,
const std::tr1::shared_ptr<const ERepositoryID> &,
- const std::string &, const std::string &, const std::string &, const MetadataKeyType);
+ const std::tr1::shared_ptr<const EAPIMetadataVariable> &,
+ const std::string &,
+ const MetadataKeyType);
~EFetchableURIKey();
virtual const std::tr1::shared_ptr<const FetchableURISpecTree> value() const
@@ -103,15 +111,16 @@ namespace paludis
virtual const std::tr1::shared_ptr<const URILabel> initial_label() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class ESimpleURIKey :
public MetadataSpecTreeKey<SimpleURISpecTree>,
private PrivateImplementationPattern<ESimpleURIKey>
{
- private:
- PrivateImplementationPattern<ESimpleURIKey>::ImpPtr & _imp;
-
public:
ESimpleURIKey(const Environment * const,
const std::tr1::shared_ptr<const ERepositoryID> &,
@@ -126,15 +135,16 @@ namespace paludis
virtual std::string pretty_print_flat(const SimpleURISpecTree::ItemFormatter &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EPlainTextSpecKey :
public MetadataSpecTreeKey<PlainTextSpecTree>,
private PrivateImplementationPattern<EPlainTextSpecKey>
{
- private:
- PrivateImplementationPattern<EPlainTextSpecKey>::ImpPtr & _imp;
-
public:
EPlainTextSpecKey(const Environment * const,
const std::tr1::shared_ptr<const ERepositoryID> &,
@@ -149,15 +159,16 @@ namespace paludis
virtual std::string pretty_print_flat(const PlainTextSpecTree::ItemFormatter &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EMyOptionsKey :
public MetadataSpecTreeKey<PlainTextSpecTree>,
private PrivateImplementationPattern<EMyOptionsKey>
{
- private:
- PrivateImplementationPattern<EMyOptionsKey>::ImpPtr & _imp;
-
public:
EMyOptionsKey(const Environment * const,
const std::tr1::shared_ptr<const ERepositoryID> &,
@@ -172,15 +183,16 @@ namespace paludis
virtual std::string pretty_print_flat(const PlainTextSpecTree::ItemFormatter &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EProvideKey :
public MetadataSpecTreeKey<ProvideSpecTree>,
private PrivateImplementationPattern<EProvideKey>
{
- private:
- PrivateImplementationPattern<EProvideKey>::ImpPtr & _imp;
-
public:
EProvideKey(const Environment * const,
const std::tr1::shared_ptr<const ERepositoryID> &,
@@ -195,15 +207,16 @@ namespace paludis
virtual std::string pretty_print_flat(const ProvideSpecTree::ItemFormatter &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class ELicenseKey :
public MetadataSpecTreeKey<LicenseSpecTree>,
private PrivateImplementationPattern<ELicenseKey>
{
- private:
- PrivateImplementationPattern<ELicenseKey>::ImpPtr & _imp;
-
public:
ELicenseKey(
const Environment * const,
@@ -219,15 +232,16 @@ namespace paludis
virtual std::string pretty_print_flat(const LicenseSpecTree::ItemFormatter &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EKeywordsKey :
public MetadataCollectionKey<KeywordNameSet>,
private PrivateImplementationPattern<EKeywordsKey>
{
- private:
- PrivateImplementationPattern<EKeywordsKey>::ImpPtr & _imp;
-
public:
EKeywordsKey(
const Environment * const,
@@ -240,15 +254,16 @@ namespace paludis
virtual std::string pretty_print_flat(const Formatter<KeywordName> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EStringSetKey :
public MetadataCollectionKey<Set<std::string> >,
private PrivateImplementationPattern<EStringSetKey>
{
- private:
- PrivateImplementationPattern<EStringSetKey>::ImpPtr & _imp;
-
public:
EStringSetKey(const std::tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
@@ -259,15 +274,16 @@ namespace paludis
virtual std::string pretty_print_flat(const Formatter<std::string> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EContentsKey :
public MetadataValueKey<std::tr1::shared_ptr<const Contents> >,
private PrivateImplementationPattern<EContentsKey>
{
- private:
- PrivateImplementationPattern<EContentsKey>::ImpPtr & _imp;
-
public:
EContentsKey(
const std::tr1::shared_ptr<const ERepositoryID> &,
@@ -276,15 +292,16 @@ namespace paludis
const std::tr1::shared_ptr<const Contents> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EMTimeKey :
public MetadataTimeKey,
private PrivateImplementationPattern<EMTimeKey>
{
- private:
- PrivateImplementationPattern<EMTimeKey>::ImpPtr & _imp;
-
public:
EMTimeKey(const std::tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const FSEntry &, const MetadataKeyType);
@@ -292,6 +309,10 @@ namespace paludis
time_t value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
}
diff --git a/paludis/repositories/e/eapi-fwd.hh b/paludis/repositories/e/eapi-fwd.hh
index 27611bcb4..8dcfe9b67 100644
--- a/paludis/repositories/e/eapi-fwd.hh
+++ b/paludis/repositories/e/eapi-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -43,6 +43,8 @@ namespace paludis
class EAPIEbuildEnvironmentVariables;
class SupportedEAPI;
class EAPI;
+
+ class EAPIMetadataVariable;
}
}
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index e234098f8..bc854a4c8 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -490,7 +490,7 @@ EbuildMetadataCommand::load(const std::tr1::shared_ptr<const EbuildID> & id)
}
if (! m.src_uri()->name().empty())
- id->load_src_uri(m.src_uri()->name(), m.src_uri()->description(), get(keys, m.src_uri()->name()));
+ id->load_src_uri(m.src_uri(), get(keys, m.src_uri()->name()));
if (! m.homepage()->name().empty())
id->load_homepage(m.homepage()->name(), m.homepage()->description(), get(keys, m.homepage()->name()));
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index f7fbdf1be..493dcf2a4 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -178,7 +178,7 @@ namespace
id->set_slot(SlotName(lines.at(m.slot()->flat_list_index())));
if (-1 != m.src_uri()->flat_list_index() && ! m.src_uri()->name().empty())
- id->load_src_uri(m.src_uri()->name(), m.src_uri()->description(), lines.at(m.src_uri()->flat_list_index()));
+ id->load_src_uri(m.src_uri(), lines.at(m.src_uri()->flat_list_index()));
if (-1 != m.restrictions()->flat_list_index() && ! m.restrictions()->name().empty())
id->load_restrict(m.restrictions()->name(), m.restrictions()->description(), lines.at(m.restrictions()->flat_list_index()));
@@ -492,7 +492,7 @@ EbuildFlatMetadataCache::load(const std::tr1::shared_ptr<const EbuildID> & id)
id->set_slot(SlotName(keys[m.slot()->name()]));
if (! m.src_uri()->name().empty())
- id->load_src_uri(m.src_uri()->name(), m.src_uri()->description(), keys[m.src_uri()->name()]);
+ id->load_src_uri(m.src_uri(), keys[m.src_uri()->name()]);
if (! m.restrictions()->name().empty())
id->load_restrict(m.restrictions()->name(), m.restrictions()->description(), keys[m.restrictions()->name()]);
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 4dc62e7ee..09764755a 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -842,10 +842,10 @@ EbuildID::load_post_depend(const std::string & r, const std::string & h, const s
}
void
-EbuildID::load_src_uri(const std::string & r, const std::string & h, const std::string & v) const
+EbuildID::load_src_uri(const std::tr1::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->src_uri.reset(new EFetchableURIKey(_imp->environment, shared_from_this(), r, h, v, mkt_dependencies));
+ _imp->src_uri.reset(new EFetchableURIKey(_imp->environment, shared_from_this(), m, v, mkt_dependencies));
add_metadata_key(_imp->src_uri);
}
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index 5b5b73a3d..b6461f6f7 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -118,7 +118,7 @@ namespace paludis
void load_build_depend(const std::string &, const std::string &, const std::string &) const;
void load_run_depend(const std::string &, const std::string &, const std::string &) const;
void load_post_depend(const std::string &, const std::string &, const std::string &) const;
- void load_src_uri(const std::string &, const std::string &, const std::string &) const;
+ void load_src_uri(const std::tr1::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
void load_homepage(const std::string &, const std::string &, const std::string &) const;
void load_license(const std::string &, const std::string &, const std::string &) const;
void load_provide(const std::string &, const std::string &, const std::string &) const;
diff --git a/paludis/repositories/e/exndbam_id.cc b/paludis/repositories/e/exndbam_id.cc
index 270a4a049..073781f9e 100644
--- a/paludis/repositories/e/exndbam_id.cc
+++ b/paludis/repositories/e/exndbam_id.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -58,7 +58,6 @@ namespace
public:
ExndbamContentsKey(const PackageID * const i, const NDBAM * const d) :
- MetadataValueKey<std::tr1::shared_ptr<const Contents> > ("contents", "Contents", mkt_internal),
_id(i),
_db(d)
{
@@ -79,6 +78,21 @@ namespace
);
return _v;
}
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return "contents";
+ }
+
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return "Contents";
+ }
+
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return mkt_internal;
+ }
};
}
diff --git a/paludis/repositories/e/info_metadata_key.cc b/paludis/repositories/e/info_metadata_key.cc
index 8bd84eb96..32ae6b833 100644
--- a/paludis/repositories/e/info_metadata_key.cc
+++ b/paludis/repositories/e/info_metadata_key.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -85,9 +85,7 @@ namespace paludis
}
InfoVarsMetadataKey::InfoVarsMetadataKey(const std::tr1::shared_ptr<const FSEntrySequence> & f) :
- MetadataCollectionKey<Set<std::string> >("info_vars", "Variable information names", mkt_internal),
- PrivateImplementationPattern<InfoVarsMetadataKey>(new Implementation<InfoVarsMetadataKey>(f)),
- _imp(PrivateImplementationPattern<InfoVarsMetadataKey>::_imp)
+ PrivateImplementationPattern<InfoVarsMetadataKey>(new Implementation<InfoVarsMetadataKey>(f))
{
}
@@ -121,10 +119,27 @@ InfoVarsMetadataKey::value() const
return _imp->value;
}
+const std::string
+InfoVarsMetadataKey::raw_name() const
+{
+ return "info_vars";
+}
+
+const std::string
+InfoVarsMetadataKey::human_name() const
+{
+ return "Variable information names";
+}
+
+MetadataKeyType
+InfoVarsMetadataKey::type() const
+{
+ return mkt_internal;
+}
+
InfoPkgsMetadataKey::InfoPkgsMetadataKey(const Environment * const e,
const std::tr1::shared_ptr<const FSEntrySequence> & f,
const ERepository * const r) :
- MetadataSectionKey("info_pkgs", "Package information", mkt_normal),
PrivateImplementationPattern<InfoPkgsMetadataKey>(new Implementation<InfoPkgsMetadataKey>(e, f, r)),
_imp(PrivateImplementationPattern<InfoPkgsMetadataKey>::_imp)
{
@@ -205,6 +220,25 @@ InfoVarsMetadataKey::pretty_print_flat(const Formatter<std::string> & f) const
return join(value()->begin(), value()->end(), " ", std::tr1::bind(&format_string, _1, f));
}
+const std::string
+InfoPkgsMetadataKey::raw_name() const
+{
+ return "info_pkgs";
+}
+
+const std::string
+InfoPkgsMetadataKey::human_name() const
+{
+ return "Package information";
+}
+
+MetadataKeyType
+InfoPkgsMetadataKey::type() const
+{
+ return mkt_internal;
+}
+
+
template class PrivateImplementationPattern<InfoPkgsMetadataKey>;
template class PrivateImplementationPattern<InfoVarsMetadataKey>;
diff --git a/paludis/repositories/e/info_metadata_key.hh b/paludis/repositories/e/info_metadata_key.hh
index 3010c431c..be1495ddd 100644
--- a/paludis/repositories/e/info_metadata_key.hh
+++ b/paludis/repositories/e/info_metadata_key.hh
@@ -30,22 +30,27 @@ namespace paludis
const std::tr1::shared_ptr<const FSEntrySequence> & f,
const ERepository * const);
~InfoPkgsMetadataKey();
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class InfoVarsMetadataKey :
public MetadataCollectionKey<Set<std::string> >,
private PrivateImplementationPattern<InfoVarsMetadataKey>
{
- private:
- PrivateImplementationPattern<InfoVarsMetadataKey>::ImpPtr & _imp;
-
public:
InfoVarsMetadataKey(const std::tr1::shared_ptr<const FSEntrySequence> &);
~InfoVarsMetadataKey();
const std::tr1::shared_ptr<const Set<std::string> > value() const;
- std::string pretty_print_flat(const Formatter<std::string> &) const;
+ std::string pretty_print_flat(const Formatter<std::string> &) const;
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 495917262..f4eddcb86 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -58,9 +58,17 @@ namespace paludis
const PackageID * const id;
const Environment * const env;
- Implementation(const PackageID * const i, const Environment * const e) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const PackageID * const i, const Environment * const e,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
id(i),
- env(e)
+ env(e),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -70,8 +78,7 @@ template <typename C_>
FakeMetadataCollectionKey<C_>::FakeMetadataCollectionKey(
const std::string & r, const std::string & h, const MetadataKeyType t, const PackageID * const i,
const Environment * const e) :
- MetadataCollectionKey<C_>(r, h, t),
- PrivateImplementationPattern<FakeMetadataCollectionKey<C_> >(new Implementation<FakeMetadataCollectionKey<C_> >(i, e)),
+ PrivateImplementationPattern<FakeMetadataCollectionKey<C_> >(new Implementation<FakeMetadataCollectionKey<C_> >(i, e, r, h, t)),
_imp(PrivateImplementationPattern<FakeMetadataCollectionKey<C_> >::_imp)
{
}
@@ -85,7 +92,28 @@ template <typename C_>
const std::tr1::shared_ptr<const C_>
FakeMetadataCollectionKey<C_>::value() const
{
- return _imp->collection;
+ return this->_imp->collection;
+}
+
+template <typename C_>
+const std::string
+FakeMetadataCollectionKey<C_>::raw_name() const
+{
+ return this->_imp->raw_name;
+}
+
+template <typename C_>
+const std::string
+FakeMetadataCollectionKey<C_>::human_name() const
+{
+ return this->_imp->human_name;
+}
+
+template <typename C_>
+MetadataKeyType
+FakeMetadataCollectionKey<C_>::type() const
+{
+ return this->_imp->type;
}
FakeMetadataKeywordSetKey::FakeMetadataKeywordSetKey(const std::string & r,
@@ -115,8 +143,16 @@ namespace paludis
std::string string_value;
const std::tr1::function<const std::tr1::shared_ptr<const C_> (const std::string &)> func;
- Implementation(const std::tr1::function<const std::tr1::shared_ptr<const C_> (const std::string &)> & f) :
- func(f)
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const std::tr1::function<const std::tr1::shared_ptr<const C_> (const std::string &)> & f,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
+ func(f),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -129,9 +165,17 @@ namespace paludis
const std::tr1::function<const std::tr1::shared_ptr<const FetchableURISpecTree> (const std::string &)> func;
std::tr1::shared_ptr<const URILabel> initial_label;
- Implementation(const std::tr1::function<const std::tr1::shared_ptr<const FetchableURISpecTree> (const std::string &)> & f) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const std::tr1::function<const std::tr1::shared_ptr<const FetchableURISpecTree> (const std::string &)> & f,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
func(f),
- initial_label(new URIListedThenMirrorsLabel("listed-then-mirrors"))
+ initial_label(new URIListedThenMirrorsLabel("listed-then-mirrors")),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -144,10 +188,18 @@ namespace paludis
const std::tr1::function<const std::tr1::shared_ptr<const DependencySpecTree> (const std::string &)> func;
std::tr1::shared_ptr<const DependencyLabelSequence> labels;
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
Implementation(const std::tr1::function<const std::tr1::shared_ptr<const DependencySpecTree> (const std::string &)> & f,
- const std::tr1::shared_ptr<const DependencyLabelSequence> & s) :
+ const std::tr1::shared_ptr<const DependencyLabelSequence> & s,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
func(f),
- labels(s)
+ labels(s),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -156,8 +208,7 @@ namespace paludis
template <typename C_>
FakeMetadataSpecTreeKey<C_>::FakeMetadataSpecTreeKey(const std::string & r, const std::string & h, const std::string & v,
const std::tr1::function<const std::tr1::shared_ptr<const C_> (const std::string &)> & f, const MetadataKeyType t) :
- MetadataSpecTreeKey<C_>(r, h, t),
- PrivateImplementationPattern<FakeMetadataSpecTreeKey<C_> >(new Implementation<FakeMetadataSpecTreeKey<C_> >(f)),
+ PrivateImplementationPattern<FakeMetadataSpecTreeKey<C_> >(new Implementation<FakeMetadataSpecTreeKey<C_> >(f, r, h, t)),
_imp(PrivateImplementationPattern<FakeMetadataSpecTreeKey<C_> >::_imp)
{
set_from_string(v);
@@ -184,6 +235,27 @@ FakeMetadataSpecTreeKey<C_>::value() const
}
template <typename C_>
+const std::string
+FakeMetadataSpecTreeKey<C_>::raw_name() const
+{
+ return this->_imp->raw_name;
+}
+
+template <typename C_>
+const std::string
+FakeMetadataSpecTreeKey<C_>::human_name() const
+{
+ return this->_imp->human_name;
+}
+
+template <typename C_>
+MetadataKeyType
+FakeMetadataSpecTreeKey<C_>::type() const
+{
+ return this->_imp->type;
+}
+
+template <typename C_>
std::string
FakeMetadataSpecTreeKey<C_>::pretty_print(const typename C_::ItemFormatter &) const
{
@@ -199,9 +271,8 @@ FakeMetadataSpecTreeKey<C_>::pretty_print_flat(const typename C_::ItemFormatter
FakeMetadataSpecTreeKey<FetchableURISpecTree>::FakeMetadataSpecTreeKey(const std::string & r, const std::string & h, const std::string & v,
const std::tr1::function<const std::tr1::shared_ptr<const FetchableURISpecTree> (const std::string &)> & f, const MetadataKeyType t) :
- MetadataSpecTreeKey<FetchableURISpecTree>(r, h, t),
PrivateImplementationPattern<FakeMetadataSpecTreeKey<FetchableURISpecTree> >(
- new Implementation<FakeMetadataSpecTreeKey<FetchableURISpecTree> >(f)),
+ new Implementation<FakeMetadataSpecTreeKey<FetchableURISpecTree> >(f, r, h, t)),
_imp(PrivateImplementationPattern<FakeMetadataSpecTreeKey<FetchableURISpecTree> >::_imp)
{
set_from_string(v);
@@ -218,6 +289,24 @@ FakeMetadataSpecTreeKey<FetchableURISpecTree>::set_from_string(const std::string
_imp->value = _imp->func(s);
}
+const std::string
+FakeMetadataSpecTreeKey<FetchableURISpecTree>::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+FakeMetadataSpecTreeKey<FetchableURISpecTree>::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+FakeMetadataSpecTreeKey<FetchableURISpecTree>::type() const
+{
+ return _imp->type;
+}
+
const std::tr1::shared_ptr<const FetchableURISpecTree>
FakeMetadataSpecTreeKey<FetchableURISpecTree>::value() const
{
@@ -245,9 +334,8 @@ FakeMetadataSpecTreeKey<FetchableURISpecTree>::initial_label() const
FakeMetadataSpecTreeKey<DependencySpecTree>::FakeMetadataSpecTreeKey(const std::string & r, const std::string & h, const std::string & v,
const std::tr1::function<const std::tr1::shared_ptr<const DependencySpecTree> (const std::string &)> & f,
const std::tr1::shared_ptr<const DependencyLabelSequence> & s, const MetadataKeyType t) :
- MetadataSpecTreeKey<DependencySpecTree>(r, h, t),
PrivateImplementationPattern<FakeMetadataSpecTreeKey<DependencySpecTree> >(
- new Implementation<FakeMetadataSpecTreeKey<DependencySpecTree> >(f, s)),
+ new Implementation<FakeMetadataSpecTreeKey<DependencySpecTree> >(f, s, r, h, t)),
_imp(PrivateImplementationPattern<FakeMetadataSpecTreeKey<DependencySpecTree> >::_imp)
{
set_from_string(v);
@@ -288,6 +376,24 @@ FakeMetadataSpecTreeKey<DependencySpecTree>::initial_labels() const
return _imp->labels;
}
+const std::string
+FakeMetadataSpecTreeKey<DependencySpecTree>::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+FakeMetadataSpecTreeKey<DependencySpecTree>::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+FakeMetadataSpecTreeKey<DependencySpecTree>::type() const
+{
+ return _imp->type;
+}
+
namespace paludis
{
template <>
@@ -368,7 +474,6 @@ namespace
FakeMetadataChoicesKey::FakeMetadataChoicesKey(const Environment * const e,
const std::tr1::shared_ptr<const PackageID> & i) :
- MetadataValueKey<std::tr1::shared_ptr<const Choices> >("Choices", "Choices", mkt_normal),
PrivateImplementationPattern<FakeMetadataChoicesKey>(new Implementation<FakeMetadataChoicesKey>(e, i)),
_imp(PrivateImplementationPattern<FakeMetadataChoicesKey>::_imp)
{
@@ -399,6 +504,24 @@ FakeMetadataChoicesKey::value() const
return _imp->value;
}
+const std::string
+FakeMetadataChoicesKey::raw_name() const
+{
+ return "PALUDIS_CHOICES";
+}
+
+const std::string
+FakeMetadataChoicesKey::human_name() const
+{
+ return "Choices";
+}
+
+MetadataKeyType
+FakeMetadataChoicesKey::type() const
+{
+ return mkt_internal;
+}
+
namespace paludis
{
template <>
diff --git a/paludis/repositories/fake/fake_package_id.hh b/paludis/repositories/fake/fake_package_id.hh
index c9aef6834..7f43ee902 100644
--- a/paludis/repositories/fake/fake_package_id.hh
+++ b/paludis/repositories/fake/fake_package_id.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -45,6 +45,10 @@ namespace paludis
~FakeMetadataCollectionKey();
virtual const std::tr1::shared_ptr<const C_> value() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class PALUDIS_VISIBLE FakeMetadataKeywordSetKey :
@@ -83,6 +87,10 @@ namespace paludis
virtual std::string pretty_print_flat(const typename C_::ItemFormatter &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
template <>
@@ -112,6 +120,10 @@ namespace paludis
virtual const std::tr1::shared_ptr<const URILabel> initial_label() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
template <>
@@ -142,6 +154,10 @@ namespace paludis
virtual const std::tr1::shared_ptr<const DependencyLabelSequence> initial_labels() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class PALUDIS_VISIBLE FakeMetadataChoicesKey :
@@ -159,6 +175,10 @@ namespace paludis
void add(const std::string &, const std::string &);
const std::tr1::shared_ptr<const Choices> value() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class PALUDIS_VISIBLE FakeUnacceptedMask :
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index f8f021534..33cafdc98 100644
--- a/paludis/repositories/unpackaged/installed_id.cc
+++ b/paludis/repositories/unpackaged/installed_id.cc
@@ -62,7 +62,6 @@ namespace
public:
InstalledUnpackagedFSEntryKey(const FSEntry & l) :
- MetadataValueKey<FSEntry> ("location", "Location", mkt_internal),
_location(l)
{
}
@@ -71,6 +70,21 @@ namespace
{
return _location;
}
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return "location";
+ }
+
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return "Location";
+ }
+
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return mkt_internal;
+ }
};
void create_file(Contents & c, const FSEntry & f)
@@ -99,7 +113,6 @@ namespace
public:
InstalledUnpackagedContentsKey(const PackageID * const i, const NDBAM * const d) :
- MetadataValueKey<std::tr1::shared_ptr<const Contents> > ("contents", "Contents", mkt_internal),
_id(i),
_db(d)
{
@@ -120,6 +133,21 @@ namespace
);
return _v;
}
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return "contents";
+ }
+
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return "Contents";
+ }
+
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return mkt_internal;
+ }
};
class InstalledUnpackagedTimeKey :
@@ -130,7 +158,6 @@ namespace
public:
InstalledUnpackagedTimeKey(const FSEntry & f) :
- MetadataTimeKey("installed_time", "Installed time", mkt_normal),
_time(f.mtime())
{
}
@@ -139,6 +166,21 @@ namespace
{
return _time;
}
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return "installed_time";
+ }
+
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return "Installed time";
+ }
+
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return mkt_normal;
+ }
};
class InstalledUnpackagedStringKey :
@@ -149,10 +191,16 @@ namespace
mutable Mutex _mutex;
const FSEntry _f;
+ const std::string _raw_name;
+ const std::string _human_name;
+ const MetadataKeyType _type;
+
public:
InstalledUnpackagedStringKey(const std::string & r, const std::string & h, const FSEntry & f, const MetadataKeyType t) :
- MetadataValueKey<std::string> (r, h, t),
- _f(f)
+ _f(f),
+ _raw_name(r),
+ _human_name(h),
+ _type(t)
{
}
@@ -171,6 +219,21 @@ namespace
strip_trailing(std::string((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>()), "\n")));
return *_v;
}
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return _raw_name;
+ }
+
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return _human_name;
+ }
+
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return _type;
+ }
};
class InstalledUnpackagedStringSetKey :
@@ -181,9 +244,15 @@ namespace
mutable Mutex _mutex;
FSEntrySequence _f;
+ const std::string _raw_name;
+ const std::string _human_name;
+ const MetadataKeyType _type;
+
public:
InstalledUnpackagedStringSetKey(const std::string & r, const std::string & h, const MetadataKeyType t) :
- MetadataCollectionKey<Set<std::string> > (r, h, t)
+ _raw_name(r),
+ _human_name(h),
+ _type(t)
{
}
@@ -219,6 +288,21 @@ namespace
using namespace std::tr1::placeholders;
return join(value()->begin(), value()->end(), " ", std::tr1::bind(&format_string, _1, f));
}
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return _raw_name;
+ }
+
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return _human_name;
+ }
+
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return _type;
+ }
};
class InstalledUnpackagedDependencyKey :
@@ -231,14 +315,20 @@ namespace
const FSEntry _f;
const std::tr1::shared_ptr<const DependencyLabelSequence> _labels;
+ const std::string _raw_name;
+ const std::string _human_name;
+ const MetadataKeyType _type;
+
public:
InstalledUnpackagedDependencyKey(const Environment * const e,
const std::string & r, const std::string & h, const FSEntry & f,
const std::tr1::shared_ptr<const DependencyLabelSequence> & l, const MetadataKeyType t) :
- MetadataSpecTreeKey<DependencySpecTree>(r, h, t),
_env(e),
_f(f),
- _labels(l)
+ _labels(l),
+ _raw_name(r),
+ _human_name(h),
+ _type(t)
{
}
@@ -279,6 +369,21 @@ namespace
{
return _labels;
}
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return _raw_name;
+ }
+
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return _human_name;
+ }
+
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return _type;
+ }
};
}
diff --git a/paludis/repositories/unpackaged/unpackaged_key.cc b/paludis/repositories/unpackaged/unpackaged_key.cc
index 8d0f5b84f..408620515 100644
--- a/paludis/repositories/unpackaged/unpackaged_key.cc
+++ b/paludis/repositories/unpackaged/unpackaged_key.cc
@@ -43,11 +43,19 @@ namespace paludis
const std::tr1::shared_ptr<const DependencySpecTree> value;
const std::tr1::shared_ptr<const DependencyLabelSequence> labels;
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
Implementation(const Environment * const e, const std::string & v,
- const std::tr1::shared_ptr<const DependencyLabelSequence> & l) :
+ const std::tr1::shared_ptr<const DependencyLabelSequence> & l,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
env(e),
value(DepParser::parse(env, v)),
- labels(l)
+ labels(l),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -57,9 +65,7 @@ UnpackagedDependencyKey::UnpackagedDependencyKey(const Environment * const env,
const std::string & r, const std::string & h, const MetadataKeyType t,
const std::tr1::shared_ptr<const DependencyLabelSequence> & l,
const std::string & v) :
- MetadataSpecTreeKey<DependencySpecTree>(r, h, t),
- PrivateImplementationPattern<UnpackagedDependencyKey>(new Implementation<UnpackagedDependencyKey>(env, v, l)),
- _imp(PrivateImplementationPattern<UnpackagedDependencyKey>::_imp)
+ PrivateImplementationPattern<UnpackagedDependencyKey>(new Implementation<UnpackagedDependencyKey>(env, v, l, r, h, t))
{
}
@@ -73,6 +79,24 @@ UnpackagedDependencyKey::value() const
return _imp->value;
}
+const std::string
+UnpackagedDependencyKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+UnpackagedDependencyKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+UnpackagedDependencyKey::type() const
+{
+ return _imp->type;
+}
+
std::string
UnpackagedDependencyKey::pretty_print(const DependencySpecTree::ItemFormatter & f) const
{
@@ -106,9 +130,17 @@ namespace paludis
mutable Mutex mutex;
mutable std::tr1::shared_ptr<Choices> value;
- Implementation(const Environment * const e, const UnpackagedID * const i) :
+ const std::string raw_name;
+ const std::string human_name;
+ const MetadataKeyType type;
+
+ Implementation(const Environment * const e, const UnpackagedID * const i,
+ const std::string & r, const std::string & h, const MetadataKeyType t) :
env(e),
- id(i)
+ id(i),
+ raw_name(r),
+ human_name(h),
+ type(t)
{
}
};
@@ -116,9 +148,7 @@ namespace paludis
UnpackagedChoicesKey::UnpackagedChoicesKey(const Environment * const env, const std::string & r, const std::string & h,
const MetadataKeyType t, const UnpackagedID * const id) :
- MetadataValueKey<std::tr1::shared_ptr<const Choices> >(r, h, t),
- PrivateImplementationPattern<UnpackagedChoicesKey>(new Implementation<UnpackagedChoicesKey>(env, id)),
- _imp(PrivateImplementationPattern<UnpackagedChoicesKey>::_imp)
+ PrivateImplementationPattern<UnpackagedChoicesKey>(new Implementation<UnpackagedChoicesKey>(env, id, r, h, t))
{
}
@@ -143,3 +173,21 @@ UnpackagedChoicesKey::value() const
return _imp->value;
}
+const std::string
+UnpackagedChoicesKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+UnpackagedChoicesKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+UnpackagedChoicesKey::type() const
+{
+ return _imp->type;
+}
+
diff --git a/paludis/repositories/unpackaged/unpackaged_key.hh b/paludis/repositories/unpackaged/unpackaged_key.hh
index 5896e0523..16ea2fca1 100644
--- a/paludis/repositories/unpackaged/unpackaged_key.hh
+++ b/paludis/repositories/unpackaged/unpackaged_key.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -33,9 +33,6 @@ namespace paludis
public MetadataSpecTreeKey<DependencySpecTree>,
private PrivateImplementationPattern<UnpackagedDependencyKey>
{
- private:
- PrivateImplementationPattern<UnpackagedDependencyKey>::ImpPtr & _imp;
-
public:
UnpackagedDependencyKey(const Environment * const env,
const std::string & r, const std::string & h, const MetadataKeyType t,
@@ -51,15 +48,16 @@ namespace paludis
virtual const std::tr1::shared_ptr<const DependencyLabelSequence> initial_labels() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class UnpackagedChoicesKey :
public MetadataValueKey<std::tr1::shared_ptr<const Choices> >,
private PrivateImplementationPattern<UnpackagedChoicesKey>
{
- private:
- PrivateImplementationPattern<UnpackagedChoicesKey>::ImpPtr & _imp;
-
public:
UnpackagedChoicesKey(const Environment * const env,
const std::string & r, const std::string & h, const MetadataKeyType t,
@@ -67,6 +65,10 @@ namespace paludis
~UnpackagedChoicesKey();
virtual const std::tr1::shared_ptr<const Choices> value() const;
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
}
diff --git a/paludis/repositories/unwritten/unwritten_repository_file.cc b/paludis/repositories/unwritten/unwritten_repository_file.cc
index 5297a291f..d3fe389eb 100644
--- a/paludis/repositories/unwritten/unwritten_repository_file.cc
+++ b/paludis/repositories/unwritten/unwritten_repository_file.cc
@@ -106,10 +106,16 @@ namespace
{
const std::tr1::shared_ptr<const SimpleURISpecTree> vv;
+ const std::string _raw_name;
+ const std::string _human_name;
+ const MetadataKeyType _type;
+
UnwrittenHomepageKey(const std::string & r, const std::string & h, const MetadataKeyType t,
const std::tr1::shared_ptr<const SimpleURISpecTree> & v) :
- MetadataSpecTreeKey<SimpleURISpecTree>(r, h, t),
- vv(v)
+ vv(v),
+ _raw_name(r),
+ _human_name(h),
+ _type(t)
{
}
@@ -131,6 +137,21 @@ namespace
value()->root()->accept(p);
return p.s.str();
}
+
+ virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return _raw_name;
+ }
+
+ virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return _human_name;
+ }
+
+ virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result))
+ {
+ return _type;
+ }
};
}
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index b6504023c..99654af27 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -56,9 +56,12 @@ namespace paludis
const std::tr1::shared_ptr<const DependencyLabelSequence> labels;
const std::tr1::shared_ptr<const PackageDepSpec> spec;
+ const std::string raw_name;
+ const std::string human_name;
+
Implementation(const Environment * const e, const std::tr1::shared_ptr<const PackageID> & v,
const std::tr1::shared_ptr<const DependencyLabelSequence> & l,
- bool exact) :
+ bool exact, const std::string & h, const std::string & r) :
env(e),
value(new DependencySpecTree(make_shared_ptr(new AllDepSpec))),
labels(l),
@@ -76,7 +79,9 @@ namespace paludis
make_package_dep_spec()
.package(v->name())
))
- )
+ ),
+ raw_name(r),
+ human_name(h)
{
value->root()->append(spec);
}
@@ -87,8 +92,7 @@ VirtualsDepKey::VirtualsDepKey(const Environment * const e, const std::string &
const std::tr1::shared_ptr<const PackageID> & v,
const std::tr1::shared_ptr<const DependencyLabelSequence> & l,
const bool exact) :
- MetadataSpecTreeKey<DependencySpecTree>(r, h, mkt_dependencies),
- PrivateImplementationPattern<VirtualsDepKey>(new Implementation<VirtualsDepKey>(e, v, l, exact)),
+ PrivateImplementationPattern<VirtualsDepKey>(new Implementation<VirtualsDepKey>(e, v, l, exact, r, h)),
_imp(PrivateImplementationPattern<VirtualsDepKey>::_imp)
{
}
@@ -103,6 +107,24 @@ VirtualsDepKey::value() const
return _imp->value;
}
+const std::string
+VirtualsDepKey::raw_name() const
+{
+ return _imp->raw_name;
+}
+
+const std::string
+VirtualsDepKey::human_name() const
+{
+ return _imp->human_name;
+}
+
+MetadataKeyType
+VirtualsDepKey::type() const
+{
+ return mkt_dependencies;
+}
+
std::string
VirtualsDepKey::pretty_print(const DependencySpecTree::ItemFormatter & f) const
{
diff --git a/paludis/repositories/virtuals/package_id.hh b/paludis/repositories/virtuals/package_id.hh
index 91786a9b0..95c2ee7a8 100644
--- a/paludis/repositories/virtuals/package_id.hh
+++ b/paludis/repositories/virtuals/package_id.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -53,6 +53,10 @@ namespace paludis
virtual const std::tr1::shared_ptr<const DependencyLabelSequence> initial_labels() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ 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 MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class VirtualsPackageID :