aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e/e_key.cc
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories/e/e_key.cc')
-rw-r--r--paludis/repositories/e/e_key.cc36
1 files changed, 19 insertions, 17 deletions
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index bbb12e472..3dd86455b 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -639,32 +639,35 @@ namespace paludis
struct Imp<ERequiredUseKey>
{
const Environment * const env;
- const std::shared_ptr<const ERepositoryID> id;
const std::string string_value;
mutable Mutex value_mutex;
mutable std::shared_ptr<const RequiredUseSpecTree> value;
- const std::string raw_name;
- const std::string human_name;
+ const std::shared_ptr<const EAPIMetadataVariable> variable;
+ const std::shared_ptr<const EAPI> eapi;
const MetadataKeyType type;
- Imp(const Environment * const e, const std::shared_ptr<const ERepositoryID> & i, const std::string & v,
- const std::string & r, const std::string & h, const MetadataKeyType t) :
+ Imp(const Environment * const e,
+ const std::string & v,
+ const std::shared_ptr<const EAPIMetadataVariable> & m,
+ const std::shared_ptr<const EAPI> & p,
+ const MetadataKeyType t) :
env(e),
- id(i),
string_value(v),
- raw_name(r),
- human_name(h),
+ variable(m),
+ eapi(p),
type(t)
{
}
};
}
-ERequiredUseKey::ERequiredUseKey(const Environment * const e,
- const std::shared_ptr<const ERepositoryID> & id,
- const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
- Pimp<ERequiredUseKey>(e, id, v, r, h, t)
+ERequiredUseKey::ERequiredUseKey(
+ const Environment * const e,
+ const std::shared_ptr<const EAPIMetadataVariable> & m,
+ const std::shared_ptr<const EAPI> & p,
+ const std::string & v, const MetadataKeyType t) :
+ Pimp<ERequiredUseKey>(e, v, m, p, t)
{
}
@@ -676,12 +679,11 @@ const std::shared_ptr<const RequiredUseSpecTree>
ERequiredUseKey::value() const
{
Lock l(_imp->value_mutex);
-
if (_imp->value)
return _imp->value;
- Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
- _imp->value = parse_required_use(_imp->string_value, _imp->env, *_imp->id->eapi());
+ Context context("When parsing metadata key '" + raw_name() + "':");
+ _imp->value = parse_required_use(_imp->string_value, _imp->env, *_imp->eapi);
return _imp->value;
}
@@ -698,13 +700,13 @@ ERequiredUseKey::pretty_print_value(
const std::string
ERequiredUseKey::raw_name() const
{
- return _imp->raw_name;
+ return _imp->variable->name();
}
const std::string
ERequiredUseKey::human_name() const
{
- return _imp->human_name;
+ return _imp->variable->description();
}
MetadataKeyType