aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-07 08:57:53 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-07 11:32:57 +0000
commit7198b4499808f1f0fbee20b452c6a6d3e80abee9 (patch)
treef8b12eda51a8a02e2b076d7d5414ec9f3e84071a
parent3ea2abf9c474dda8581c7ff5ae10178dd98641e9 (diff)
downloadpaludis-7198b4499808f1f0fbee20b452c6a6d3e80abee9.tar.gz
paludis-7198b4499808f1f0fbee20b452c6a6d3e80abee9.tar.xz
ID isn't needed
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc2
-rw-r--r--paludis/repositories/e/e_key.cc35
-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, 29 insertions, 25 deletions
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 1b34141..4aad61b 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -321,7 +321,7 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->provide()->name().empty())
if ((_imp->dir / vars->provide()->name()).stat().exists())
{
- _imp->keys->provide = std::make_shared<EProvideKey>(_imp->environment, shared_from_this(), vars->provide()->name(), vars->provide()->description(),
+ _imp->keys->provide = std::make_shared<EProvideKey>(_imp->environment, vars->provide(), eapi(),
file_contents(_imp->dir / vars->provide()->name()), mkt_internal);
add_metadata_key(_imp->keys->provide);
}
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index fea62c8..bbb12e4 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -719,31 +719,35 @@ namespace paludis
struct Imp<EProvideKey>
{
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 ProvideSpecTree> 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)
{
}
};
}
-EProvideKey::EProvideKey(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<EProvideKey>(e, id, v, r, h, t)
+EProvideKey::EProvideKey(
+ 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<EProvideKey>(e, v, m, p, t)
{
}
@@ -755,12 +759,11 @@ const std::shared_ptr<const ProvideSpecTree>
EProvideKey::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_provide(_imp->string_value, _imp->env, *_imp->id->eapi());
+ Context context("When parsing metadata key '" + raw_name() + "':");
+ _imp->value = parse_provide(_imp->string_value, _imp->env, *_imp->eapi);
return _imp->value;
}
@@ -777,13 +780,13 @@ EProvideKey::pretty_print_value(
const std::string
EProvideKey::raw_name() const
{
- return _imp->raw_name;
+ return _imp->variable->name();
}
const std::string
EProvideKey::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 fcc1c81..243b0fd 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -207,8 +207,9 @@ namespace paludis
{
public:
EProvideKey(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);
~EProvideKey();
virtual const std::shared_ptr<const ProvideSpecTree> value() const
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 631650e..34583b4 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -620,7 +620,7 @@ EbuildMetadataCommand::load(const std::shared_ptr<const EbuildID> & id)
id->load_license(m.license(), get(keys, m.license()->name()));
if (! m.provide()->name().empty())
- id->load_provide(m.provide()->name(), m.provide()->description(), get(keys, m.provide()->name()));
+ id->load_provide(m.provide(), get(keys, m.provide()->name()));
if (! m.iuse()->name().empty())
id->load_iuse(m.iuse(), get(keys, m.iuse()->name()));
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index 36c79da..df7eea5 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -248,7 +248,7 @@ namespace
id->load_post_depend(m.pdepend()->name(), m.pdepend()->description(), lines.at(m.pdepend()->flat_list_index()), false);
if (-1 != m.provide()->flat_list_index() && ! m.provide()->name().empty())
- id->load_provide(m.provide()->name(), m.provide()->description(), lines.at(m.provide()->flat_list_index()));
+ id->load_provide(m.provide(), lines.at(m.provide()->flat_list_index()));
if (-1 != m.use()->flat_list_index() && ! m.use()->name().empty())
id->load_use(m.use(), lines.at(m.use()->flat_list_index()));
@@ -594,7 +594,7 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
id->load_post_depend(m.pdepend()->name(), m.pdepend()->description(), keys[m.pdepend()->name()], false);
if (! m.provide()->name().empty())
- id->load_provide(m.provide()->name(), m.provide()->description(), keys[m.provide()->name()]);
+ id->load_provide(m.provide(), keys[m.provide()->name()]);
if (! m.use()->name().empty())
id->load_use(m.use(), keys[m.use()->name()]);
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 7be634d..d0cb9b4 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1048,10 +1048,10 @@ EbuildID::load_properties(const std::shared_ptr<const EAPIMetadataVariable> & m,
}
void
-EbuildID::load_provide(const std::string & r, const std::string & h, const std::string & v) const
+EbuildID::load_provide(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->provide = std::make_shared<EProvideKey>(_imp->environment, shared_from_this(), r, h, v, mkt_dependencies);
+ _imp->provide = std::make_shared<EProvideKey>(_imp->environment, m, eapi(), v, mkt_internal);
add_metadata_key(_imp->provide);
}
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index 8b339eb..b9e29ed 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -131,7 +131,7 @@ namespace paludis
void load_src_uri(const std::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::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
- void load_provide(const std::string &, const std::string &, const std::string &) const;
+ 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;