aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-07 09:43:17 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-07 11:32:57 +0000
commit4d63e4274e65f15770a290c6cde919dc6b95a73c (patch)
tree05176668b8f305c02649183afb07fcb2a4f1e319
parent12ffed7c10d7c51d8fe3abf2a36173e279d9c796 (diff)
downloadpaludis-4d63e4274e65f15770a290c6cde919dc6b95a73c.tar.gz
paludis-4d63e4274e65f15770a290c6cde919dc6b95a73c.tar.xz
ID isn't needed
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc15
-rw-r--r--paludis/repositories/e/e_key.cc18
-rw-r--r--paludis/repositories/e/e_key.hh2
-rw-r--r--paludis/repositories/e/ebuild_id.cc8
4 files changed, 22 insertions, 21 deletions
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 9685434..14075c7 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -389,16 +389,16 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->restrictions()->name().empty())
if ((_imp->dir / vars->restrictions()->name()).stat().exists())
{
- _imp->keys->restrictions = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), vars->restrictions(),
- file_contents(_imp->dir / vars->restrictions()->name()), mkt_internal);
+ _imp->keys->restrictions = std::make_shared<EPlainTextSpecKey>(_imp->environment, vars->restrictions(),
+ eapi(), file_contents(_imp->dir / vars->restrictions()->name()), mkt_internal);
add_metadata_key(_imp->keys->restrictions);
}
if (! vars->properties()->name().empty())
if ((_imp->dir / vars->properties()->name()).stat().exists())
{
- _imp->keys->properties = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), vars->properties(),
- file_contents(_imp->dir / vars->properties()->name()), mkt_internal);
+ _imp->keys->properties = std::make_shared<EPlainTextSpecKey>(_imp->environment, vars->properties(),
+ eapi(), file_contents(_imp->dir / vars->properties()->name()), mkt_internal);
add_metadata_key(_imp->keys->properties);
}
@@ -475,8 +475,7 @@ EInstalledRepositoryID::need_keys_added() const
std::string value(file_contents(_imp->dir / vars->bugs_to()->name()));
if (! value.empty())
{
- _imp->keys->bugs_to = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(),
- vars->bugs_to(), value, mkt_normal);
+ _imp->keys->bugs_to = std::make_shared<EPlainTextSpecKey>(_imp->environment, vars->bugs_to(), eapi(), value, mkt_normal);
add_metadata_key(_imp->keys->bugs_to);
}
}
@@ -487,8 +486,8 @@ EInstalledRepositoryID::need_keys_added() const
std::string value(file_contents(_imp->dir / vars->remote_ids()->name()));
if (! value.empty())
{
- _imp->keys->remote_ids = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(),
- vars->remote_ids(), value, mkt_internal);
+ _imp->keys->remote_ids = std::make_shared<EPlainTextSpecKey>(_imp->environment,
+ vars->remote_ids(), eapi(), value, mkt_internal);
add_metadata_key(_imp->keys->remote_ids);
}
}
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index fdf0735..ece53a8 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -480,21 +480,22 @@ namespace paludis
struct Imp<EPlainTextSpecKey>
{
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 PlainTextSpecTree> value;
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,
+ 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),
variable(m),
+ eapi(p),
type(t)
{
}
@@ -502,9 +503,10 @@ namespace paludis
}
EPlainTextSpecKey::EPlainTextSpecKey(const Environment * const e,
- const std::shared_ptr<const ERepositoryID> & id,
- const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v, const MetadataKeyType t) :
- Pimp<EPlainTextSpecKey>(e, id, v, m, t)
+ const std::shared_ptr<const EAPIMetadataVariable> & m,
+ const std::shared_ptr<const EAPI> & p,
+ const std::string & v, const MetadataKeyType t) :
+ Pimp<EPlainTextSpecKey>(e, v, m, p, t)
{
}
@@ -520,8 +522,8 @@ EPlainTextSpecKey::value() const
if (_imp->value)
return _imp->value;
- Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
- _imp->value = parse_plain_text(_imp->string_value, _imp->env, *_imp->id->eapi());
+ Context context("When parsing metadata key '" + raw_name() + "':");
+ _imp->value = parse_plain_text(_imp->string_value, _imp->env, *_imp->eapi);
return _imp->value;
}
diff --git a/paludis/repositories/e/e_key.hh b/paludis/repositories/e/e_key.hh
index c28b0b1..c8228e8 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -140,8 +140,8 @@ namespace paludis
{
public:
EPlainTextSpecKey(const Environment * const,
- const std::shared_ptr<const ERepositoryID> &,
const std::shared_ptr<const EAPIMetadataVariable> &,
+ const std::shared_ptr<const EAPI> &,
const std::string &, const MetadataKeyType);
~EPlainTextSpecKey();
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 59df003..bc250e7 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1035,7 +1035,7 @@ void
EbuildID::load_restrict(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->restrictions = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), m, v, mkt_internal);
+ _imp->restrictions = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_internal);
add_metadata_key(_imp->restrictions);
}
@@ -1043,7 +1043,7 @@ void
EbuildID::load_properties(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->properties = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), m, v, mkt_internal);
+ _imp->properties = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_internal);
add_metadata_key(_imp->properties);
}
@@ -1142,7 +1142,7 @@ void
EbuildID::load_bugs_to(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->bugs_to = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), m, v, mkt_normal);
+ _imp->bugs_to = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_normal);
add_metadata_key(_imp->bugs_to);
}
@@ -1150,7 +1150,7 @@ void
EbuildID::load_remote_ids(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->remote_ids = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), m, v, mkt_internal);
+ _imp->remote_ids = std::make_shared<EPlainTextSpecKey>(_imp->environment, m, eapi(), v, mkt_internal);
add_metadata_key(_imp->remote_ids);
}