aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-07 09:13:45 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-07 11:32:57 +0000
commitaabea692cf3fee5b91b36acf25770159b317624b (patch)
tree78549a907fe25547fc63553d7c76806d4f2bce06
parent7198b4499808f1f0fbee20b452c6a6d3e80abee9 (diff)
downloadpaludis-aabea692cf3fee5b91b36acf25770159b317624b.tar.gz
paludis-aabea692cf3fee5b91b36acf25770159b317624b.tar.xz
ID isn't needed
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc4
-rw-r--r--paludis/repositories/e/e_key.cc36
-rw-r--r--paludis/repositories/e/e_key.hh5
-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.hh2
7 files changed, 30 insertions, 27 deletions
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 4aad61b..1d902fd 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -289,8 +289,8 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->required_use()->name().empty())
if ((_imp->dir / vars->required_use()->name()).stat().exists())
{
- _imp->keys->required_use = std::make_shared<ERequiredUseKey>(_imp->environment, shared_from_this(), vars->required_use()->name(),
- vars->required_use()->description(), file_contents(_imp->dir / vars->required_use()->name()), mkt_internal);
+ _imp->keys->required_use = std::make_shared<ERequiredUseKey>(_imp->environment, vars->required_use(),
+ eapi(), file_contents(_imp->dir / vars->required_use()->name()), mkt_internal);
add_metadata_key(_imp->keys->required_use);
}
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index bbb12e4..3dd8645 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
diff --git a/paludis/repositories/e/e_key.hh b/paludis/repositories/e/e_key.hh
index 243b0fd..f2b19b9 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -185,8 +185,9 @@ namespace paludis
{
public:
ERequiredUseKey(const Environment * const,
- const std::shared_ptr<const ERepositoryID> &,
- const std::string &, const std::string &, const std::string &, const MetadataKeyType);
+ const std::shared_ptr<const EAPIMetadataVariable> &,
+ const std::shared_ptr<const EAPI> &,
+ const std::string &, const MetadataKeyType);
~ERequiredUseKey();
virtual const std::shared_ptr<const RequiredUseSpecTree> value() const
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 34583b4..202f502 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -629,7 +629,7 @@ EbuildMetadataCommand::load(const std::shared_ptr<const EbuildID> & id)
id->load_myoptions(m.myoptions()->name(), m.myoptions()->description(), get(keys, m.myoptions()->name()));
if (! m.required_use()->name().empty())
- id->load_required_use(m.required_use()->name(), m.required_use()->description(), get(keys, m.required_use()->name()));
+ id->load_required_use(m.required_use(), get(keys, m.required_use()->name()));
if (! m.inherited()->name().empty())
id->load_inherited(m.inherited(), get(keys, m.inherited()->name()));
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index df7eea5..7b865a1 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -242,7 +242,7 @@ namespace
id->load_myoptions(m.myoptions()->name(), m.myoptions()->description(), lines.at(m.myoptions()->flat_list_index()));
if (-1 != m.required_use()->flat_list_index() && ! m.required_use()->name().empty())
- id->load_required_use(m.required_use()->name(), m.required_use()->description(), lines.at(m.required_use()->flat_list_index()));
+ id->load_required_use(m.required_use(), lines.at(m.required_use()->flat_list_index()));
if (-1 != m.pdepend()->flat_list_index() && ! m.pdepend()->name().empty())
id->load_post_depend(m.pdepend()->name(), m.pdepend()->description(), lines.at(m.pdepend()->flat_list_index()), false);
@@ -588,7 +588,7 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
id->load_myoptions(m.myoptions()->name(), m.myoptions()->description(), keys[m.myoptions()->name()]);
if (! m.required_use()->name().empty())
- id->load_required_use(m.required_use()->name(), m.required_use()->description(), keys[m.required_use()->name()]);
+ id->load_required_use(m.required_use(), keys[m.required_use()->name()]);
if (! m.pdepend()->name().empty())
id->load_post_depend(m.pdepend()->name(), m.pdepend()->description(), keys[m.pdepend()->name()], false);
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index d0cb9b4..2462c89 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1072,10 +1072,10 @@ EbuildID::load_myoptions(const std::string & r, const std::string & h, const std
}
void
-EbuildID::load_required_use(const std::string & r, const std::string & h, const std::string & v) const
+EbuildID::load_required_use(const std::shared_ptr<const EAPIMetadataVariable> & k, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->required_use = std::make_shared<ERequiredUseKey>(_imp->environment, shared_from_this(), r, h, v, mkt_internal);
+ _imp->required_use = std::make_shared<ERequiredUseKey>(_imp->environment, k, eapi(), v, mkt_internal);
add_metadata_key(_imp->required_use);
}
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index b9e29ed..7f64192 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -134,7 +134,7 @@ namespace paludis
void load_provide(const std::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
void load_iuse(const std::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
void load_myoptions(const std::string &, const std::string &, const std::string &) const;
- void load_required_use(const std::string &, const std::string &, const std::string &) const;
+ void load_required_use(const std::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
void load_use(const std::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
void load_inherited(const std::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
void load_keywords(const std::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;