aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-07 10:01:04 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-07 11:32:57 +0000
commit07bd74e326564103424a1488e3f688b858c02c96 (patch)
tree40076bba8d8921097619f8a7e5746af8e5ca1133
parent4d63e4274e65f15770a290c6cde919dc6b95a73c (diff)
downloadpaludis-07bd74e326564103424a1488e3f688b858c02c96.tar.gz
paludis-07bd74e326564103424a1488e3f688b858c02c96.tar.xz
ID isn't needed
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc18
-rw-r--r--paludis/repositories/e/e_key.cc32
-rw-r--r--paludis/repositories/e/e_key.hh5
-rw-r--r--paludis/repositories/e/ebuild.cc8
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc22
-rw-r--r--paludis/repositories/e/ebuild_id.cc16
-rw-r--r--paludis/repositories/e/ebuild_id.hh8
7 files changed, 50 insertions, 59 deletions
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 14075c7..839a817 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -436,9 +436,8 @@ EInstalledRepositoryID::need_keys_added() const
std::string value(file_contents(_imp->dir / vars->upstream_changelog()->name()));
if (! value.empty())
{
- _imp->keys->upstream_changelog = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(),
- vars->upstream_changelog()->name(),
- vars->upstream_changelog()->description(), value, mkt_normal);
+ _imp->keys->upstream_changelog = std::make_shared<ESimpleURIKey>(_imp->environment,
+ vars->upstream_changelog(), eapi(), value, mkt_normal);
add_metadata_key(_imp->keys->upstream_changelog);
}
}
@@ -449,9 +448,8 @@ EInstalledRepositoryID::need_keys_added() const
std::string value(file_contents(_imp->dir / vars->upstream_release_notes()->name()));
if (! value.empty())
{
- _imp->keys->upstream_release_notes = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(),
- vars->upstream_release_notes()->name(),
- vars->upstream_release_notes()->description(), value, mkt_normal);
+ _imp->keys->upstream_release_notes = std::make_shared<ESimpleURIKey>(_imp->environment,
+ vars->upstream_release_notes(), eapi(), value, mkt_normal);
add_metadata_key(_imp->keys->upstream_release_notes);
}
}
@@ -462,9 +460,8 @@ EInstalledRepositoryID::need_keys_added() const
std::string value(file_contents(_imp->dir / vars->upstream_documentation()->name()));
if (! value.empty())
{
- _imp->keys->upstream_documentation = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(),
- vars->upstream_documentation()->name(),
- vars->upstream_documentation()->description(), value, mkt_normal);
+ _imp->keys->upstream_documentation = std::make_shared<ESimpleURIKey>(_imp->environment,
+ vars->upstream_documentation(), eapi(), value, mkt_normal);
add_metadata_key(_imp->keys->upstream_documentation);
}
}
@@ -495,8 +492,7 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->homepage()->name().empty())
if ((_imp->dir / vars->homepage()->name()).stat().exists())
{
- _imp->keys->homepage = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(), vars->homepage()->name(),
- vars->homepage()->description(),
+ _imp->keys->homepage = std::make_shared<ESimpleURIKey>(_imp->environment, vars->homepage(), eapi(),
file_contents(_imp->dir / vars->homepage()->name()), mkt_significant);
add_metadata_key(_imp->keys->homepage);
}
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index ece53a8..59205a4 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -399,23 +399,22 @@ namespace paludis
struct Imp<ESimpleURIKey>
{
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 SimpleURISpecTree> 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)
{
}
@@ -423,9 +422,10 @@ namespace paludis
}
ESimpleURIKey::ESimpleURIKey(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<ESimpleURIKey>(e, id, v, r, h, t)
+ const std::shared_ptr<const EAPIMetadataVariable> & m,
+ const std::shared_ptr<const EAPI> & p,
+ const std::string & v, const MetadataKeyType t) :
+ Pimp<ESimpleURIKey>(e, v, m, p, t)
{
}
@@ -441,8 +441,8 @@ ESimpleURIKey::value() const
if (_imp->value)
return _imp->value;
- Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
- _imp->value = parse_simple_uri(_imp->string_value, _imp->env, *_imp->id->eapi());
+ Context context("When parsing metadata key '" + raw_name() + "':");
+ _imp->value = parse_simple_uri(_imp->string_value, _imp->env, *_imp->eapi);
return _imp->value;
}
@@ -459,13 +459,13 @@ ESimpleURIKey::pretty_print_value(
const std::string
ESimpleURIKey::raw_name() const
{
- return _imp->raw_name;
+ return _imp->variable->name();
}
const std::string
ESimpleURIKey::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 c8228e8..3da58a1 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -118,8 +118,9 @@ namespace paludis
{
public:
ESimpleURIKey(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);
~ESimpleURIKey();
virtual const std::shared_ptr<const SimpleURISpecTree> value() const
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 2c21f49..256c024 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -614,7 +614,7 @@ EbuildMetadataCommand::load(const std::shared_ptr<const EbuildID> & id)
id->load_src_uri(m.src_uri(), get(keys, m.src_uri()->name()));
if (! m.homepage()->name().empty())
- id->load_homepage(m.homepage()->name(), m.homepage()->description(), get(keys, m.homepage()->name()));
+ id->load_homepage(m.homepage(), get(keys, m.homepage()->name()));
if (! m.license()->name().empty())
id->load_license(m.license(), get(keys, m.license()->name()));
@@ -659,21 +659,21 @@ EbuildMetadataCommand::load(const std::shared_ptr<const EbuildID> & id)
{
std::string value(get(keys, m.upstream_changelog()->name()));
if (! value.empty())
- id->load_upstream_changelog(m.upstream_changelog()->name(), m.upstream_changelog()->description(), value);
+ id->load_upstream_changelog(m.upstream_changelog(), value);
}
if (! m.upstream_documentation()->name().empty())
{
std::string value(get(keys, m.upstream_documentation()->name()));
if (! value.empty())
- id->load_upstream_documentation(m.upstream_documentation()->name(), m.upstream_documentation()->description(), value);
+ id->load_upstream_documentation(m.upstream_documentation(), value);
}
if (! m.upstream_release_notes()->name().empty())
{
std::string value(get(keys, m.upstream_release_notes()->name()));
if (! value.empty())
- id->load_upstream_release_notes(m.upstream_release_notes()->name(), m.upstream_release_notes()->description(), value);
+ id->load_upstream_release_notes(m.upstream_release_notes(), value);
}
if (! m.bugs_to()->name().empty())
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index a0c1638..ceb13c3 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -207,7 +207,7 @@ namespace
id->load_properties(m.properties(), lines.at(m.properties()->flat_list_index()));
if (-1 != m.homepage()->flat_list_index() && ! m.homepage()->name().empty())
- id->load_homepage(m.homepage()->name(), m.homepage()->description(), lines.at(m.homepage()->flat_list_index()));
+ id->load_homepage(m.homepage(), lines.at(m.homepage()->flat_list_index()));
if (-1 != m.license()->flat_list_index() && ! m.license()->name().empty())
id->load_license(m.license(), lines.at(m.license()->flat_list_index()));
@@ -266,24 +266,21 @@ namespace
{
std::string value(lines.at(m.upstream_changelog()->flat_list_index()));
if (! value.empty())
- id->load_upstream_changelog(m.upstream_changelog()->name(),
- m.upstream_changelog()->description(), value);
+ id->load_upstream_changelog(m.upstream_changelog(), value);
}
if (-1 != m.upstream_documentation()->flat_list_index() && ! m.upstream_documentation()->name().empty())
{
std::string value(lines.at(m.upstream_documentation()->flat_list_index()));
if (! value.empty())
- id->load_upstream_documentation(m.upstream_documentation()->name(),
- m.upstream_documentation()->description(), value);
+ id->load_upstream_documentation(m.upstream_documentation(), value);
}
if (-1 != m.upstream_release_notes()->flat_list_index() && ! m.upstream_release_notes()->name().empty())
{
std::string value(lines.at(m.upstream_release_notes()->flat_list_index()));
if (! value.empty())
- id->load_upstream_release_notes(m.upstream_release_notes()->name(),
- m.upstream_release_notes()->description(), value);
+ id->load_upstream_release_notes(m.upstream_release_notes(), value);
}
if (-1 != m.bugs_to()->flat_list_index() && ! m.bugs_to()->name().empty())
@@ -553,7 +550,7 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
id->load_properties(m.properties(), keys[m.properties()->name()]);
if (! m.homepage()->name().empty())
- id->load_homepage(m.homepage()->name(), m.homepage()->description(), keys[m.homepage()->name()]);
+ id->load_homepage(m.homepage(), keys[m.homepage()->name()]);
if (! m.license()->name().empty())
id->load_license(m.license(), keys[m.license()->name()]);
@@ -612,24 +609,21 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
{
std::string value(keys[m.upstream_changelog()->name()]);
if (! value.empty())
- id->load_upstream_changelog(m.upstream_changelog()->name(),
- m.upstream_changelog()->description(), value);
+ id->load_upstream_changelog(m.upstream_changelog(), value);
}
if (! m.upstream_documentation()->name().empty())
{
std::string value(keys[m.upstream_documentation()->name()]);
if (! value.empty())
- id->load_upstream_documentation(m.upstream_documentation()->name(),
- m.upstream_documentation()->description(), value);
+ id->load_upstream_documentation(m.upstream_documentation(), value);
}
if (! m.upstream_release_notes()->name().empty())
{
std::string value(keys[m.upstream_release_notes()->name()]);
if (! value.empty())
- id->load_upstream_release_notes(m.upstream_release_notes()->name(),
- m.upstream_release_notes()->description(), value);
+ id->load_upstream_release_notes(m.upstream_release_notes(), value);
}
if (! m.bugs_to()->name().empty())
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index bc250e7..7f73dab 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1016,10 +1016,10 @@ EbuildID::load_src_uri(const std::shared_ptr<const EAPIMetadataVariable> & m, co
}
void
-EbuildID::load_homepage(const std::string & r, const std::string & h, const std::string & v) const
+EbuildID::load_homepage(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->homepage = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(), r, h, v, mkt_significant);
+ _imp->homepage = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_significant);
add_metadata_key(_imp->homepage);
}
@@ -1115,26 +1115,26 @@ EbuildID::load_defined_phases(const std::shared_ptr<const EAPIMetadataVariable>
}
void
-EbuildID::load_upstream_changelog(const std::string & r, const std::string & h, const std::string & v) const
+EbuildID::load_upstream_changelog(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->upstream_changelog = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(), r, h, v, mkt_normal);
+ _imp->upstream_changelog = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_normal);
add_metadata_key(_imp->upstream_changelog);
}
void
-EbuildID::load_upstream_documentation(const std::string & r, const std::string & h, const std::string & v) const
+EbuildID::load_upstream_documentation(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->upstream_documentation = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(), r, h, v, mkt_normal);
+ _imp->upstream_documentation = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_normal);
add_metadata_key(_imp->upstream_documentation);
}
void
-EbuildID::load_upstream_release_notes(const std::string & r, const std::string & h, const std::string & v) const
+EbuildID::load_upstream_release_notes(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->upstream_release_notes = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(), r, h, v, mkt_normal);
+ _imp->upstream_release_notes = std::make_shared<ESimpleURIKey>(_imp->environment, m, eapi(), v, mkt_normal);
add_metadata_key(_imp->upstream_release_notes);
}
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index 261332f..df793e1 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -129,7 +129,7 @@ namespace paludis
void load_post_depend(const std::string &, const std::string &, const std::string &,
const bool rewritten) const;
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_homepage(const std::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
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;
@@ -141,9 +141,9 @@ namespace paludis
void load_restrict(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const;
void load_properties(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string &) const;
void load_long_description(const std::string &, const std::string &, const std::string &) const;
- void load_upstream_changelog(const std::string &, const std::string &, const std::string &) const;
- void load_upstream_documentation(const std::string &, const std::string &, const std::string &) const;
- void load_upstream_release_notes(const std::string &, const std::string &, const std::string &) const;
+ void load_upstream_changelog(const std::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
+ void load_upstream_documentation(const std::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
+ void load_upstream_release_notes(const std::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
void load_bugs_to(const std::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
void load_remote_ids(const std::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;
void load_defined_phases(const std::shared_ptr<const EAPIMetadataVariable> &, const std::string &) const;