aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-07 09:27:52 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-07 11:32:57 +0000
commit12ffed7c10d7c51d8fe3abf2a36173e279d9c796 (patch)
tree33e8a01327d7a7c10ac9c3af347b46cceeebd0ef
parentaabea692cf3fee5b91b36acf25770159b317624b (diff)
downloadpaludis-12ffed7c10d7c51d8fe3abf2a36173e279d9c796.tar.gz
paludis-12ffed7c10d7c51d8fe3abf2a36173e279d9c796.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 1d902fd..9685434 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -281,8 +281,8 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->myoptions()->name().empty())
if ((_imp->dir / vars->myoptions()->name()).stat().exists())
{
- _imp->keys->raw_myoptions = std::make_shared<EMyOptionsKey>(_imp->environment, shared_from_this(), vars->myoptions()->name(),
- vars->myoptions()->description(), file_contents(_imp->dir / vars->myoptions()->name()), mkt_internal);
+ _imp->keys->raw_myoptions = std::make_shared<EMyOptionsKey>(_imp->environment, vars->myoptions(),
+ eapi(), file_contents(_imp->dir / vars->myoptions()->name()), mkt_internal);
add_metadata_key(_imp->keys->raw_myoptions);
}
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 3dd8645..fdf0735 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -559,32 +559,35 @@ namespace paludis
struct Imp<EMyOptionsKey>
{
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::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)
{
}
};
}
-EMyOptionsKey::EMyOptionsKey(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<EMyOptionsKey>(e, id, v, r, h, t)
+EMyOptionsKey::EMyOptionsKey(
+ 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<EMyOptionsKey>(e, v, m, p, t)
{
}
@@ -596,12 +599,11 @@ const std::shared_ptr<const PlainTextSpecTree>
EMyOptionsKey::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_myoptions(_imp->string_value, _imp->env, *_imp->id->eapi());
+ Context context("When parsing metadata key '" + raw_name() + "':");
+ _imp->value = parse_myoptions(_imp->string_value, _imp->env, *_imp->eapi);
return _imp->value;
}
@@ -618,13 +620,13 @@ EMyOptionsKey::pretty_print_value(
const std::string
EMyOptionsKey::raw_name() const
{
- return _imp->raw_name;
+ return _imp->variable->name();
}
const std::string
EMyOptionsKey::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 f2b19b9..c28b0b1 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -163,8 +163,9 @@ namespace paludis
{
public:
EMyOptionsKey(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);
~EMyOptionsKey();
virtual const std::shared_ptr<const PlainTextSpecTree> value() const
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 202f502..2c21f49 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -626,7 +626,7 @@ EbuildMetadataCommand::load(const std::shared_ptr<const EbuildID> & id)
id->load_iuse(m.iuse(), get(keys, m.iuse()->name()));
if (! m.myoptions()->name().empty())
- id->load_myoptions(m.myoptions()->name(), m.myoptions()->description(), get(keys, m.myoptions()->name()));
+ id->load_myoptions(m.myoptions(), get(keys, m.myoptions()->name()));
if (! m.required_use()->name().empty())
id->load_required_use(m.required_use(), get(keys, m.required_use()->name()));
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index 7b865a1..a0c1638 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -239,7 +239,7 @@ namespace
id->load_iuse(m.iuse(), lines.at(m.iuse()->flat_list_index()));
if (-1 != m.myoptions()->flat_list_index() && ! m.myoptions()->name().empty())
- id->load_myoptions(m.myoptions()->name(), m.myoptions()->description(), lines.at(m.myoptions()->flat_list_index()));
+ id->load_myoptions(m.myoptions(), 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(), lines.at(m.required_use()->flat_list_index()));
@@ -585,7 +585,7 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
id->load_iuse(m.iuse(), keys[m.iuse()->name()]);
if (! m.myoptions()->name().empty())
- id->load_myoptions(m.myoptions()->name(), m.myoptions()->description(), keys[m.myoptions()->name()]);
+ id->load_myoptions(m.myoptions(), keys[m.myoptions()->name()]);
if (! m.required_use()->name().empty())
id->load_required_use(m.required_use(), keys[m.required_use()->name()]);
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 2462c89..59df003 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1064,10 +1064,10 @@ EbuildID::load_iuse(const std::shared_ptr<const EAPIMetadataVariable> & k, const
}
void
-EbuildID::load_myoptions(const std::string & r, const std::string & h, const std::string & v) const
+EbuildID::load_myoptions(const std::shared_ptr<const EAPIMetadataVariable> & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->raw_myoptions = std::make_shared<EMyOptionsKey>(_imp->environment, shared_from_this(), r, h, v, mkt_internal);
+ _imp->raw_myoptions = std::make_shared<EMyOptionsKey>(_imp->environment, h, eapi(), v, mkt_internal);
add_metadata_key(_imp->raw_myoptions);
}
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index 7f64192..261332f 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -133,7 +133,7 @@ namespace paludis
void load_license(const std::shared_ptr<const EAPIMetadataVariable> &, 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_myoptions(const std::shared_ptr<const EAPIMetadataVariable> &, 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;