aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-02-28 10:23:45 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-02-28 10:23:45 +0000
commitcf4a665c98457f16eff4d9360ca840a907351e8a (patch)
tree12c6b7dc9d02853a94147f5f6b86e85b4988886f
parentc0227237033d48136df4e08209fbf03afd08c293 (diff)
downloadpaludis-cf4a665c98457f16eff4d9360ca840a907351e8a.tar.gz
paludis-cf4a665c98457f16eff4d9360ca840a907351e8a.tar.xz
Fix 3.4, 4.3, icc compiles
-rw-r--r--paludis/repositories/e/Makefile.am13
-rw-r--r--paludis/repositories/e/dep_parser.cc53
-rw-r--r--paludis/repositories/e/e_installed_repository.cc88
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc127
-rw-r--r--paludis/repositories/e/e_key.cc20
-rw-r--r--paludis/repositories/e/e_repository.cc28
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc2
-rw-r--r--paludis/repositories/e/e_repository_id.cc5
-rw-r--r--paludis/repositories/e/e_repository_profile.cc32
-rw-r--r--paludis/repositories/e/eapi-fwd.hh76
-rw-r--r--paludis/repositories/e/eapi.cc290
-rw-r--r--paludis/repositories/e/eapi.hh4
-rw-r--r--paludis/repositories/e/eapi.sr93
-rw-r--r--paludis/repositories/e/ebuild.cc436
-rw-r--r--paludis/repositories/e/ebuild.hh168
-rw-r--r--paludis/repositories/e/ebuild.sr229
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash3
-rw-r--r--paludis/repositories/e/ebuild_entries.cc294
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc12
-rw-r--r--paludis/repositories/e/ebuild_id.cc54
-rw-r--r--paludis/repositories/e/exndbam_id.cc1
-rw-r--r--paludis/repositories/e/exndbam_repository.cc58
-rw-r--r--paludis/repositories/e/fetch_visitor.cc2
-rw-r--r--paludis/repositories/e/package_dep_spec.cc35
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc14
-rw-r--r--paludis/repositories/e/qa/eapi_supported.cc7
-rw-r--r--paludis/repositories/e/qa/qa_checks_group.cc2
-rw-r--r--paludis/repositories/e/qa/qa_controller.cc14
-rw-r--r--paludis/repositories/e/qa/spec_keys.cc2
-rw-r--r--paludis/repositories/e/vdb_repository.cc58
-rw-r--r--paludis/repositories/fake/fake_package_id.cc5
-rw-r--r--paludis/util/keys.hh56
-rw-r--r--paludis/util/sha1.cc1
-rw-r--r--ruby/action.cc2
-rw-r--r--ruby/dep_spec.cc24
35 files changed, 1145 insertions, 1163 deletions
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index 0b1eb2f..55b919a 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -6,7 +6,6 @@ DISTCLEANFILES = \
e_repository_params-sr.hh e_repository_params-sr.cc \
e_repository_params-se.hh e_repository_params-se.cc \
vdb_repository-sr.hh vdb_repository-sr.cc \
- ebuild-sr.hh ebuild-sr.cc \
eapi-sr.hh eapi-sr.cc \
dep_parser-se.hh dep_parser-se.cc \
manifest2_entry-sr.hh manifest2_entry-sr.cc
@@ -63,7 +62,6 @@ paludis_repositories_e_include_HEADERS = \
eapi-sr.hh \
eapi-fwd.hh \
eapi_phase.hh \
- ebuild-sr.hh \
ebuild.hh \
ebuild_entries.hh \
ebuild_flat_metadata_cache.hh \
@@ -315,9 +313,6 @@ EXTRA_DIST = \
eapi.sr \
eapi-sr.hh \
eapi-sr.cc \
- ebuild.sr \
- ebuild-sr.hh \
- ebuild-sr.cc \
glsa.sr \
glsa-sr.hh \
glsa-sr.cc \
@@ -380,8 +375,6 @@ BUILT_SOURCES = \
exndbam_repository-sr.cc \
vdb_repository-sr.hh \
vdb_repository-sr.cc \
- ebuild-sr.hh \
- ebuild-sr.cc \
eapi-sr.hh \
eapi-sr.cc \
manifest2_entry-sr.hh \
@@ -433,12 +426,6 @@ manifest2_entry-sr.hh : manifest2_entry.sr $(top_srcdir)/misc/make_sr.bash
manifest2_entry-sr.cc : manifest2_entry.sr $(top_srcdir)/misc/make_sr.bash
$(top_srcdir)/misc/make_sr.bash --source $(srcdir)/manifest2_entry.sr > $@
-ebuild-sr.hh : ebuild.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/ebuild.sr > $@
-
-ebuild-sr.cc : ebuild.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/ebuild.sr > $@
-
eapi-sr.hh : eapi.sr $(top_srcdir)/misc/make_sr.bash
$(top_srcdir)/misc/make_sr.bash --header $(srcdir)/eapi.sr > $@
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index 7db94d9..2746191 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -30,6 +30,7 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/kc.hh>
#include <stack>
#include <set>
@@ -286,7 +287,7 @@ namespace
static void add(const std::string & s, tr1::function<void (tr1::shared_ptr<ConstAcceptInterface<H_> >)> & p,
const EAPI & e)
{
- if (e.supported && e.supported->uri_labels)
+ if (e[k::supported()])
p(tr1::shared_ptr<TreeLeaf<H_, URILabelsDepSpec> >(
new TreeLeaf<H_, URILabelsDepSpec>(parse_uri_label(s, e))));
else
@@ -300,7 +301,7 @@ namespace
static void add(const std::string & s, tr1::function<void (tr1::shared_ptr<ConstAcceptInterface<H_> >)> & p,
const EAPI & e)
{
- if (e.supported && e.supported->dependency_labels)
+ if (e[k::supported()])
p(tr1::shared_ptr<TreeLeaf<H_, DependencyLabelsDepSpec> >(
new TreeLeaf<H_, DependencyLabelsDepSpec>(parse_dependency_label(s, e))));
else
@@ -661,13 +662,13 @@ tr1::shared_ptr<DependencySpecTree::ConstItem>
paludis::erepository::parse_depend(const std::string & s, const Environment * const env,
const tr1::shared_ptr<const PackageID> & id, const EAPI & e)
{
- Context c("When parsing dependency string '" + s + "' using EAPI '" + e.name + "':");
+ Context c("When parsing dependency string '" + s + "' using EAPI '" + e[k::name()] + "':");
- if (! e.supported)
- throw DepStringParseError(s, "Don't know how to parse EAPI '" + e.name + "' dependencies");
+ if (! e[k::supported()])
+ throw DepStringParseError(s, "Don't know how to parse EAPI '" + e[k::name()] + "' dependencies");
return parse<DependencySpecTree, ParsePackageOrBlockDepSpec, true, true, LabelsAreDependency>(s,
- e.supported->dependency_spec_tree_parse_options[dstpo_disallow_any_use],
+ (*e[k::supported()])[k::dependency_spec_tree_parse_options()][dstpo_disallow_any_use],
ParsePackageOrBlockDepSpec(e, id), env, e, id);
}
@@ -675,10 +676,10 @@ tr1::shared_ptr<ProvideSpecTree::ConstItem>
paludis::erepository::parse_provide(const std::string & s, const Environment * const env,
const tr1::shared_ptr<const PackageID> & id, const EAPI & e)
{
- Context c("When parsing provide string '" + s + "' using EAPI '" + e.name + "':");
+ Context c("When parsing provide string '" + s + "' using EAPI '" + e[k::name()] + "':");
- if (! e.supported)
- throw DepStringParseError(s, "Don't know how to parse EAPI '" + e.name + "' provides");
+ if (! e[k::supported()])
+ throw DepStringParseError(s, "Don't know how to parse EAPI '" + e[k::name()] + "' provides");
return parse<ProvideSpecTree, ParsePackageDepSpec, false, true, void>(s, false,
ParsePackageDepSpec(e, tr1::shared_ptr<const PackageID>()), env, e, id);
@@ -688,10 +689,10 @@ tr1::shared_ptr<RestrictSpecTree::ConstItem>
paludis::erepository::parse_restrict(const std::string & s, const Environment * const env,
const tr1::shared_ptr<const PackageID> & id, const EAPI & e)
{
- Context c("When parsing restrict string '" + s + "' using EAPI '" + e.name + "':");
+ Context c("When parsing restrict string '" + s + "' using EAPI '" + e[k::name()] + "':");
- if (! e.supported)
- throw DepStringParseError(s, "Don't know how to parse EAPI '" + e.name + "' restrictions");
+ if (! e[k::supported()])
+ throw DepStringParseError(s, "Don't know how to parse EAPI '" + e[k::name()] + "' restrictions");
return parse<RestrictSpecTree, ParseTextDepSpec, false, true, void>(s, false,
ParseTextDepSpec(), env, e, id);
@@ -701,13 +702,13 @@ tr1::shared_ptr<FetchableURISpecTree::ConstItem>
paludis::erepository::parse_fetchable_uri(const std::string & s, const Environment * const env,
const tr1::shared_ptr<const PackageID> & id, const EAPI & e)
{
- Context c("When parsing fetchable URI string '" + s + "' using EAPI '" + e.name + "':");
+ Context c("When parsing fetchable URI string '" + s + "' using EAPI '" + e[k::name()] + "':");
- if (! e.supported)
- throw DepStringParseError(s, "Don't know how to parse EAPI '" + e.name + "' URIs");
+ if (! e[k::supported()])
+ throw DepStringParseError(s, "Don't know how to parse EAPI '" + e[k::name()] + "' URIs");
return parse<FetchableURISpecTree, ParseFetchableURIDepSpec, false, true, LabelsAreURI>(s, false,
- ParseFetchableURIDepSpec(e.supported->dependency_spec_tree_parse_options[dstpo_uri_supports_arrow]),
+ ParseFetchableURIDepSpec((*e[k::supported()])[k::dependency_spec_tree_parse_options()][dstpo_uri_supports_arrow]),
env, e, id);
}
@@ -715,10 +716,10 @@ tr1::shared_ptr<SimpleURISpecTree::ConstItem>
paludis::erepository::parse_simple_uri(const std::string & s, const Environment * const env,
const tr1::shared_ptr<const PackageID> & id, const EAPI & e)
{
- Context c("When parsing simple URI string '" + s + "' using EAPI '" + e.name + "':");
+ Context c("When parsing simple URI string '" + s + "' using EAPI '" + e[k::name()] + "':");
- if (! e.supported)
- throw DepStringParseError(s, "Don't know how to parse EAPI '" + e.name + "' URIs");
+ if (! e[k::supported()])
+ throw DepStringParseError(s, "Don't know how to parse EAPI '" + e[k::name()] + "' URIs");
return parse<SimpleURISpecTree, ParseSimpleURIDepSpec, false, true, void>(s, false,
ParseSimpleURIDepSpec(), env, e, id);
@@ -728,10 +729,10 @@ tr1::shared_ptr<LicenseSpecTree::ConstItem>
paludis::erepository::parse_license(const std::string & s, const Environment * const env,
const tr1::shared_ptr<const PackageID> & id, const EAPI & e)
{
- Context c("When parsing license string '" + s + "' using EAPI '" + e.name + "':");
+ Context c("When parsing license string '" + s + "' using EAPI '" + e[k::name()] + "':");
- if (! e.supported)
- throw DepStringParseError(s, "Don't know how to parse EAPI '" + e.name + "' licenses");
+ if (! e[k::supported()])
+ throw DepStringParseError(s, "Don't know how to parse EAPI '" + e[k::name()] + "' licenses");
return parse<LicenseSpecTree, ParseLicenseDepSpec, true, true, void>(s,
true, ParseLicenseDepSpec(), env, e, id);
@@ -740,12 +741,12 @@ paludis::erepository::parse_license(const std::string & s, const Environment * c
tr1::shared_ptr<URILabelsDepSpec>
paludis::erepository::parse_uri_label(const std::string & s, const EAPI & e)
{
- Context context("When parsing label string '" + s + "' using EAPI '" + e.name + "':");
+ Context context("When parsing label string '" + s + "' using EAPI '" + e[k::name()] + "':");
if (s.empty())
throw DepStringParseError(s, "Empty label");
- std::string c(e.supported->uri_labels->class_for_label(s.substr(0, s.length() - 1)));
+ std::string c((*e[k::supported()])[k::uri_labels()].class_for_label(s.substr(0, s.length() - 1)));
if (c.empty())
throw DepStringParseError(s, "Unknown label");
@@ -772,7 +773,7 @@ paludis::erepository::parse_uri_label(const std::string & s, const EAPI & e)
tr1::shared_ptr<DependencyLabelsDepSpec>
paludis::erepository::parse_dependency_label(const std::string & s, const EAPI & e)
{
- Context context("When parsing label string '" + s + "' using EAPI '" + e.name + "':");
+ Context context("When parsing label string '" + s + "' using EAPI '" + e[k::name()] + "':");
if (s.empty())
throw DepStringParseError(s, "Empty label");
@@ -785,7 +786,7 @@ paludis::erepository::parse_dependency_label(const std::string & s, const EAPI &
for (std::set<std::string>::iterator it = labels.begin(), it_e = labels.end(); it != it_e; ++it)
{
- std::string c(e.supported->dependency_labels->class_for_label(*it));
+ std::string c((*e[k::supported()])[k::dependency_labels()].class_for_label(*it));
if (c.empty())
throw DepStringParseError(s, "Unknown label '" + *it + "'");
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index bd69d43..70d11e7 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -370,7 +370,7 @@ EInstalledRepository::use_expand_separator(const PackageID & id) const
if (this != id.repository().get())
return '\0';
const tr1::shared_ptr<const EAPI> & eapi(static_cast<const ERepositoryID &>(id).eapi());
- return eapi->supported ? eapi->supported->ebuild_options->use_expand_separator : '\0';
+ return (*eapi)[k::supported()] ? (*(*eapi)[k::supported()])[k::ebuild_options()].use_expand_separator : '\0';
}
std::string
@@ -426,29 +426,29 @@ EInstalledRepository::perform_config(const tr1::shared_ptr<const ERepositoryID>
eclassdirs->push_back(ver_dir);
tr1::shared_ptr<FSEntry> load_env(new FSEntry(ver_dir / "environment.bz2"));
- EAPIPhases phases(id->eapi()->supported->ebuild_phases->ebuild_config);
+ EAPIPhases phases((*(*id->eapi())[k::supported()])[k::ebuild_phases()].ebuild_config);
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
phase != phase_end ; ++phase)
{
- EbuildConfigCommand config_cmd(EbuildCommandParams::create()
- .environment(_imp->params.environment)
- .package_id(id)
- .ebuild_dir(ver_dir)
- .ebuild_file(ver_dir / (stringify(id->name().package) + "-" + stringify(id->version()) + ".ebuild"))
- .files_dir(ver_dir)
- .eclassdirs(eclassdirs)
- .exlibsdirs(make_shared_ptr(new FSEntrySequence))
- .portdir(ver_dir)
- .distdir(ver_dir)
- .sandbox(phase->option("sandbox"))
- .userpriv(phase->option("userpriv"))
- .commands(join(phase->begin_commands(), phase->end_commands(), " "))
- .builddir(_imp->params.builddir),
-
- EbuildConfigCommandParams::create()
- .root(stringify(_imp->params.root))
- .load_environment(load_env.get()));
+ EbuildConfigCommand config_cmd(EbuildCommandParams::named_create()
+ (k::environment(), _imp->params.environment)
+ (k::package_id(), id)
+ (k::ebuild_dir(), ver_dir)
+ (k::ebuild_file(), ver_dir / (stringify(id->name().package) + "-" + stringify(id->version()) + ".ebuild"))
+ (k::files_dir(), ver_dir)
+ (k::eclassdirs(), eclassdirs)
+ (k::exlibsdirs(), make_shared_ptr(new FSEntrySequence))
+ (k::portdir(), ver_dir)
+ (k::distdir(), ver_dir)
+ (k::sandbox(), phase->option("sandbox"))
+ (k::userpriv(), phase->option("userpriv"))
+ (k::commands(), join(phase->begin_commands(), phase->end_commands(), " "))
+ (k::builddir(), _imp->params.builddir),
+
+ EbuildConfigCommandParams::named_create()
+ (k::root(), stringify(_imp->params.root))
+ (k::load_environment(), load_env.get()));
config_cmd();
}
@@ -470,7 +470,7 @@ EInstalledRepository::perform_info(const tr1::shared_ptr<const ERepositoryID> &
tr1::shared_ptr<FSEntry> load_env(new FSEntry(ver_dir / "environment.bz2"));
- EAPIPhases phases(id->eapi()->supported->ebuild_phases->ebuild_info);
+ EAPIPhases phases((*(*id->eapi())[k::supported()])[k::ebuild_phases()].ebuild_info);
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
phase != phase_end ; ++phase)
@@ -514,29 +514,29 @@ EInstalledRepository::perform_info(const tr1::shared_ptr<const ERepositoryID> &
}
}
- EbuildInfoCommand info_cmd(EbuildCommandParams::create()
- .environment(_imp->params.environment)
- .package_id(id)
- .ebuild_dir(ver_dir)
- .ebuild_file(ver_dir / (stringify(id->name().package) + "-" + stringify(id->version()) + ".ebuild"))
- .files_dir(ver_dir)
- .eclassdirs(eclassdirs)
- .exlibsdirs(make_shared_ptr(new FSEntrySequence))
- .portdir(ver_dir)
- .distdir(ver_dir)
- .sandbox(phase->option("sandbox"))
- .userpriv(phase->option("userpriv"))
- .commands(join(phase->begin_commands(), phase->end_commands(), " "))
- .builddir(_imp->params.builddir),
-
- EbuildInfoCommandParams::create()
- .root(stringify(_imp->params.root))
- .use("")
- .use_expand("")
- .expand_vars(make_shared_ptr(new Map<std::string, std::string>))
- .profiles(make_shared_ptr(new FSEntrySequence))
- .info_vars(i)
- .load_environment(load_env.get()));
+ EbuildInfoCommand info_cmd(EbuildCommandParams::named_create()
+ (k::environment(), _imp->params.environment)
+ (k::package_id(), id)
+ (k::ebuild_dir(), ver_dir)
+ (k::ebuild_file(), ver_dir / (stringify(id->name().package) + "-" + stringify(id->version()) + ".ebuild"))
+ (k::files_dir(), ver_dir)
+ (k::eclassdirs(), eclassdirs)
+ (k::exlibsdirs(), make_shared_ptr(new FSEntrySequence))
+ (k::portdir(), ver_dir)
+ (k::distdir(), ver_dir)
+ (k::sandbox(), phase->option("sandbox"))
+ (k::userpriv(), phase->option("userpriv"))
+ (k::commands(), join(phase->begin_commands(), phase->end_commands(), " "))
+ (k::builddir(), _imp->params.builddir),
+
+ EbuildInfoCommandParams::named_create()
+ (k::root(), stringify(_imp->params.root))
+ (k::use(), "")
+ (k::use_expand(), "")
+ (k::expand_vars(), make_shared_ptr(new Map<std::string, std::string>))
+ (k::profiles(), make_shared_ptr(new FSEntrySequence))
+ (k::info_vars(), i)
+ (k::load_environment(), load_env.get()));
info_cmd();
}
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index e600104..08a884c 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -162,140 +162,135 @@ EInstalledRepositoryID::need_keys_added() const
Context context("When loading ID keys from '" + stringify(_imp->dir) + "':");
- if (! eapi()->supported)
+ if (! (*eapi())[k::supported()])
{
Log::get_instance()->message(ll_debug, lc_context) << "Not loading further keys for '" << *this << "' because EAPI '"
- << eapi()->name << "' is not supported";
+ << (*eapi())[k::name()] << "' is not supported";
return;
}
- const tr1::shared_ptr<const EAPIEbuildMetadataVariables> vars(eapi()->supported->ebuild_metadata_variables);
- if (! vars)
- throw InternalError(PALUDIS_HERE, "EAPI '" + eapi()->name + "' supported but has no ebuild_metadata_variables");
+ const EAPIEbuildMetadataVariables & vars((*(*eapi())[k::supported()])[k::ebuild_metadata_variables()]);
+ const EAPIEbuildEnvironmentVariables & env((*(*eapi())[k::supported()])[k::ebuild_environment_variables()]);
- const tr1::shared_ptr<const EAPIEbuildEnvironmentVariables> env(eapi()->supported->ebuild_environment_variables);
- if (! env)
- throw InternalError(PALUDIS_HERE, "EAPI '" + eapi()->name + "' supported but has no ebuild_environment_variables");
-
- if (! env->env_use.empty())
- if ((_imp->dir / env->env_use).exists())
+ if (! env[k::env_use()].empty())
+ if ((_imp->dir / env[k::env_use()]).exists())
{
- _imp->use.reset(new EUseKey(_imp->environment, shared_from_this(), env->env_use, env->description_use,
- file_contents(_imp->dir / env->env_use), mkt_internal));
+ _imp->use.reset(new EUseKey(_imp->environment, shared_from_this(), env[k::env_use()], env[k::description_use()],
+ file_contents(_imp->dir / env[k::env_use()]), mkt_internal));
add_metadata_key(_imp->use);
}
- if (! vars->metadata_inherited.empty())
- if ((_imp->dir / vars->metadata_inherited).exists())
+ if (! vars.metadata_inherited.empty())
+ if ((_imp->dir / vars.metadata_inherited).exists())
{
- _imp->inherited.reset(new EInheritedKey(shared_from_this(), vars->metadata_inherited, vars->description_inherited,
- file_contents(_imp->dir / vars->metadata_inherited), mkt_internal));
+ _imp->inherited.reset(new EInheritedKey(shared_from_this(), vars.metadata_inherited, vars.description_inherited,
+ file_contents(_imp->dir / vars.metadata_inherited), mkt_internal));
add_metadata_key(_imp->inherited);
}
- if (! vars->metadata_iuse.empty())
- if ((_imp->dir / vars->metadata_iuse).exists())
+ if (! vars.metadata_iuse.empty())
+ if ((_imp->dir / vars.metadata_iuse).exists())
{
- _imp->iuse.reset(new EIUseKey(_imp->environment, shared_from_this(), vars->metadata_iuse, vars->description_iuse,
- file_contents(_imp->dir / vars->metadata_iuse), mkt_normal));
+ _imp->iuse.reset(new EIUseKey(_imp->environment, shared_from_this(), vars.metadata_iuse, vars.description_iuse,
+ file_contents(_imp->dir / vars.metadata_iuse), mkt_normal));
add_metadata_key(_imp->iuse);
}
- if (! vars->metadata_license.empty())
- if ((_imp->dir / vars->metadata_license).exists())
+ if (! vars.metadata_license.empty())
+ if ((_imp->dir / vars.metadata_license).exists())
{
- _imp->license.reset(new ELicenseKey(_imp->environment, shared_from_this(), vars->metadata_license, vars->description_license,
- file_contents(_imp->dir / vars->metadata_license), mkt_normal));
+ _imp->license.reset(new ELicenseKey(_imp->environment, shared_from_this(), vars.metadata_license, vars.description_license,
+ file_contents(_imp->dir / vars.metadata_license), mkt_normal));
add_metadata_key(_imp->license);
}
- if (! vars->metadata_provide.empty())
- if ((_imp->dir / vars->metadata_provide).exists())
+ if (! vars.metadata_provide.empty())
+ if ((_imp->dir / vars.metadata_provide).exists())
{
- _imp->provide.reset(new EProvideKey(_imp->environment, shared_from_this(), vars->metadata_provide, vars->description_provide,
- file_contents(_imp->dir / vars->metadata_provide), mkt_internal));
+ _imp->provide.reset(new EProvideKey(_imp->environment, shared_from_this(), vars.metadata_provide, vars.description_provide,
+ file_contents(_imp->dir / vars.metadata_provide), mkt_internal));
add_metadata_key(_imp->provide);
}
- if (! vars->metadata_dependencies.empty())
+ if (! vars.metadata_dependencies.empty())
{
- if ((_imp->dir / vars->metadata_dependencies).exists())
+ if ((_imp->dir / vars.metadata_dependencies).exists())
{
DependenciesRewriter rewriter;
- parse_depend(file_contents(_imp->dir / vars->metadata_dependencies), _imp->environment, shared_from_this(), *eapi())->accept(rewriter);
+ parse_depend(file_contents(_imp->dir / vars.metadata_dependencies), _imp->environment, shared_from_this(), *eapi())->accept(rewriter);
- _imp->build_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars->metadata_dependencies + ".DEPEND",
- vars->description_dependencies + " (build)", rewriter.depend(), _imp->build_dependencies_labels, mkt_dependencies));
+ _imp->build_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars.metadata_dependencies + ".DEPEND",
+ vars.description_dependencies + " (build)", rewriter.depend(), _imp->build_dependencies_labels, mkt_dependencies));
add_metadata_key(_imp->build_dependencies);
- _imp->run_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars->metadata_dependencies + ".RDEPEND",
- vars->description_dependencies + " (run)", rewriter.rdepend(), _imp->build_dependencies_labels, mkt_dependencies));
+ _imp->run_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars.metadata_dependencies + ".RDEPEND",
+ vars.description_dependencies + " (run)", rewriter.rdepend(), _imp->build_dependencies_labels, mkt_dependencies));
add_metadata_key(_imp->run_dependencies);
- _imp->post_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars->metadata_dependencies + ".PDEPEND",
- vars->description_dependencies + " (post)", rewriter.pdepend(), _imp->build_dependencies_labels, mkt_dependencies));
+ _imp->post_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars.metadata_dependencies + ".PDEPEND",
+ vars.description_dependencies + " (post)", rewriter.pdepend(), _imp->build_dependencies_labels, mkt_dependencies));
add_metadata_key(_imp->post_dependencies);
}
}
else
{
- if (! vars->metadata_build_depend.empty())
- if ((_imp->dir / vars->metadata_build_depend).exists())
+ if (! vars.metadata_build_depend.empty())
+ if ((_imp->dir / vars.metadata_build_depend).exists())
{
- _imp->build_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars->metadata_build_depend,
- vars->description_build_depend, file_contents(_imp->dir / vars->metadata_build_depend),
+ _imp->build_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars.metadata_build_depend,
+ vars.description_build_depend, file_contents(_imp->dir / vars.metadata_build_depend),
_imp->build_dependencies_labels, mkt_dependencies));
add_metadata_key(_imp->build_dependencies);
}
- if (! vars->metadata_run_depend.empty())
- if ((_imp->dir / vars->metadata_run_depend).exists())
+ if (! vars.metadata_run_depend.empty())
+ if ((_imp->dir / vars.metadata_run_depend).exists())
{
- _imp->run_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars->metadata_run_depend,
- vars->description_run_depend, file_contents(_imp->dir / vars->metadata_run_depend),
+ _imp->run_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars.metadata_run_depend,
+ vars.description_run_depend, file_contents(_imp->dir / vars.metadata_run_depend),
_imp->run_dependencies_labels, mkt_dependencies));
add_metadata_key(_imp->run_dependencies);
}
- if (! vars->metadata_pdepend.empty())
- if ((_imp->dir / vars->metadata_pdepend).exists())
+ if (! vars.metadata_pdepend.empty())
+ if ((_imp->dir / vars.metadata_pdepend).exists())
{
- _imp->post_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars->metadata_pdepend,
- vars->description_pdepend, file_contents(_imp->dir / vars->metadata_pdepend),
+ _imp->post_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars.metadata_pdepend,
+ vars.description_pdepend, file_contents(_imp->dir / vars.metadata_pdepend),
_imp->post_dependencies_labels, mkt_dependencies));
add_metadata_key(_imp->post_dependencies);
}
}
- if (! vars->metadata_restrict.empty())
- if ((_imp->dir / vars->metadata_restrict).exists())
+ if (! vars.metadata_restrict.empty())
+ if ((_imp->dir / vars.metadata_restrict).exists())
{
- _imp->restrictions.reset(new ERestrictKey(_imp->environment, shared_from_this(), vars->metadata_restrict, vars->description_restrict,
- file_contents(_imp->dir / vars->metadata_restrict), mkt_internal));
+ _imp->restrictions.reset(new ERestrictKey(_imp->environment, shared_from_this(), vars.metadata_restrict, vars.description_restrict,
+ file_contents(_imp->dir / vars.metadata_restrict), mkt_internal));
add_metadata_key(_imp->restrictions);
}
- if (! vars->metadata_src_uri.empty())
- if ((_imp->dir / vars->metadata_src_uri).exists())
+ if (! vars.metadata_src_uri.empty())
+ if ((_imp->dir / vars.metadata_src_uri).exists())
{
- _imp->src_uri.reset(new EFetchableURIKey(_imp->environment, shared_from_this(), vars->metadata_src_uri, vars->description_src_uri,
- file_contents(_imp->dir / vars->metadata_src_uri), mkt_dependencies));
+ _imp->src_uri.reset(new EFetchableURIKey(_imp->environment, shared_from_this(), vars.metadata_src_uri, vars.description_src_uri,
+ file_contents(_imp->dir / vars.metadata_src_uri), mkt_dependencies));
add_metadata_key(_imp->src_uri);
}
- if (! vars->metadata_description.empty())
- if ((_imp->dir / vars->metadata_description).exists())
+ if (! vars.metadata_description.empty())
+ if ((_imp->dir / vars.metadata_description).exists())
{
- _imp->short_description.reset(new LiteralMetadataValueKey<std::string> (vars->metadata_description,
- vars->description_description, mkt_significant, file_contents(_imp->dir / vars->metadata_description)));
+ _imp->short_description.reset(new LiteralMetadataValueKey<std::string> (vars.metadata_description,
+ vars.description_description, mkt_significant, file_contents(_imp->dir / vars.metadata_description)));
add_metadata_key(_imp->short_description);
}
- if (! vars->metadata_homepage.empty())
- if ((_imp->dir / vars->metadata_homepage).exists())
+ if (! vars.metadata_homepage.empty())
+ if ((_imp->dir / vars.metadata_homepage).exists())
{
- _imp->homepage.reset(new ESimpleURIKey(_imp->environment, shared_from_this(), vars->metadata_homepage, vars->description_homepage,
- file_contents(_imp->dir / vars->metadata_homepage), mkt_significant));
+ _imp->homepage.reset(new ESimpleURIKey(_imp->environment, shared_from_this(), vars.metadata_homepage, vars.description_homepage,
+ file_contents(_imp->dir / vars.metadata_homepage), mkt_significant));
add_metadata_key(_imp->homepage);
}
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index ac35165..4b4a284 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -309,19 +309,19 @@ EFetchableURIKey::initial_label() const
for (DepSpecFlattener<RestrictSpecTree, PlainTextDepSpec>::ConstIterator i(f.begin()), i_end(f.end()) ;
i != i_end ; ++i)
{
- if (_imp->id->eapi()->supported->ebuild_options->restrict_fetch->end() !=
- std::find(_imp->id->eapi()->supported->ebuild_options->restrict_fetch->begin(),
- _imp->id->eapi()->supported->ebuild_options->restrict_fetch->end(), (*i)->text()))
+ if ((*(*_imp->id->eapi())[k::supported()])[k::ebuild_options()].restrict_fetch->end() !=
+ std::find((*(*_imp->id->eapi())[k::supported()])[k::ebuild_options()].restrict_fetch->begin(),
+ (*(*_imp->id->eapi())[k::supported()])[k::ebuild_options()].restrict_fetch->end(), (*i)->text()))
_imp->initial_label = *parse_uri_label("default-restrict-fetch:", *_imp->id->eapi())->begin();
- else if (_imp->id->eapi()->supported->ebuild_options->restrict_fetch->end() !=
- std::find(_imp->id->eapi()->supported->ebuild_options->restrict_fetch->begin(),
- _imp->id->eapi()->supported->ebuild_options->restrict_fetch->end(), (*i)->text()))
+ else if ((*(*_imp->id->eapi())[k::supported()])[k::ebuild_options()].restrict_fetch->end() !=
+ std::find((*(*_imp->id->eapi())[k::supported()])[k::ebuild_options()].restrict_fetch->begin(),
+ (*(*_imp->id->eapi())[k::supported()])[k::ebuild_options()].restrict_fetch->end(), (*i)->text()))
_imp->initial_label = *parse_uri_label("default-restrict-mirror:", *_imp->id->eapi())->begin();
- else if (_imp->id->eapi()->supported->ebuild_options->restrict_primaryuri->end() !=
- std::find(_imp->id->eapi()->supported->ebuild_options->restrict_primaryuri->begin(),
- _imp->id->eapi()->supported->ebuild_options->restrict_primaryuri->end(), (*i)->text()))
+ else if ((*(*_imp->id->eapi())[k::supported()])[k::ebuild_options()].restrict_primaryuri->end() !=
+ std::find((*(*_imp->id->eapi())[k::supported()])[k::ebuild_options()].restrict_primaryuri->begin(),
+ (*(*_imp->id->eapi())[k::supported()])[k::ebuild_options()].restrict_primaryuri->end(), (*i)->text()))
_imp->initial_label = *parse_uri_label("default-restrict-primaryuri:", *_imp->id->eapi())->begin();
}
@@ -586,7 +586,7 @@ EIUseKey::value() const
for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
t != t_end ; ++t)
{
- IUseFlag f(*t, _imp->id->eapi()->supported->iuse_flag_parse_options, std::string::npos);
+ IUseFlag f(*t, (*(*_imp->id->eapi())[k::supported()])[k::iuse_flag_parse_options()], std::string::npos);
for (UseFlagNameSet::ConstIterator p(prefixes->begin()), p_end(prefixes->end()) ;
p != p_end ; ++p)
if (0 == stringify(f.flag).compare(0, stringify(*p).length(), stringify(*p), 0, stringify(*p).length()))
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index a194c86..44bb28f 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -357,8 +357,8 @@ namespace paludis
profile_ptr.reset(new ERepositoryProfile(
params.environment, repo, repo->name(), *params.profiles,
- erepository::EAPIData::get_instance()->eapi_from_string(
- params.eapi_when_unknown)->supported->ebuild_environment_variables->env_arch));
+ (*(*erepository::EAPIData::get_instance()->eapi_from_string(
+ params.eapi_when_unknown))[k::supported()])[k::ebuild_environment_variables()][k::env_arch()]));
}
void
@@ -400,8 +400,8 @@ namespace paludis
(k::status(), tokens.at(2))
(k::profile(), tr1::shared_ptr<ERepositoryProfile>(new ERepositoryProfile(
params.environment, repo, repo->name(), profiles,
- erepository::EAPIData::get_instance()->eapi_from_string(
- params.eapi_when_unknown)->supported->ebuild_environment_variables->env_arch))));
+ (*(*erepository::EAPIData::get_instance()->eapi_from_string(
+ params.eapi_when_unknown))[k::supported()])[k::ebuild_environment_variables()][k::env_arch()]))));
}
}
@@ -918,8 +918,8 @@ ERepository::use_expand_flags() const
{
_imp->need_profiles();
- std::string expand_sep(stringify(erepository::EAPIData::get_instance()->eapi_from_string(_imp->params.profile_eapi
- )->supported->ebuild_options->use_expand_separator));
+ std::string expand_sep(stringify((*(*erepository::EAPIData::get_instance()->eapi_from_string(
+ (_imp->params.profile_eapi)))[k::supported()])[k::ebuild_options()].use_expand_separator));
tr1::shared_ptr<UseFlagNameSet> result(new UseFlagNameSet);
for (ERepositoryProfile::UseExpandConstIterator i(_imp->profile_ptr->begin_use_expand()),
i_end(_imp->profile_ptr->end_use_expand()) ; i != i_end ; ++i)
@@ -979,7 +979,7 @@ ERepository::use_expand_separator(const PackageID & id) const
if (this != id.repository().get())
return '\0';
const tr1::shared_ptr<const erepository::EAPI> & eapi(static_cast<const erepository::ERepositoryID &>(id).eapi());
- return eapi->supported ? eapi->supported->ebuild_options->use_expand_separator : '\0';
+ return (*eapi)[k::supported()] ? (*(*eapi)[k::supported()])[k::ebuild_options()].use_expand_separator : '\0';
}
void
@@ -1071,8 +1071,8 @@ ERepository::describe_use_flag(const UseFlagName & f,
if (_imp->use_desc.empty())
{
- std::string expand_sep(stringify(erepository::EAPIData::get_instance()->eapi_from_string(
- _imp->params.profile_eapi)->supported->ebuild_options->use_expand_separator));
+ std::string expand_sep(stringify((*(*erepository::EAPIData::get_instance()->eapi_from_string(
+ _imp->params.profile_eapi))[k::supported()])[k::ebuild_options()].use_expand_separator));
tr1::shared_ptr<const FSEntrySequence> use_desc_dirs(_imp->layout->use_desc_dirs());
for (FSEntrySequence::ConstIterator p(use_desc_dirs->begin()), p_end(use_desc_dirs->end()) ;
p != p_end ; ++p)
@@ -1101,7 +1101,7 @@ ERepository::is_suitable_destination_for(const PackageID & e) const
{
std::string f(e.repository()->format_key() ? e.repository()->format_key()->value() : "");
if (f == "ebuild")
- return static_cast<const erepository::ERepositoryID &>(e).eapi()->supported->can_be_pbin;
+ return (*(*static_cast<const erepository::ERepositoryID &>(e).eapi())[k::supported()])[k::can_be_pbin()];
else
return false;
}
@@ -1377,15 +1377,15 @@ ERepository::make_manifest(const QualifiedPackageName & qpn)
std::string
ERepository::accept_keywords_variable() const
{
- return erepository::EAPIData::get_instance()->eapi_from_string(
- params().profile_eapi)->supported->ebuild_environment_variables->env_accept_keywords;
+ return (*(*erepository::EAPIData::get_instance()->eapi_from_string(params().profile_eapi))
+ [k::supported()])[k::ebuild_environment_variables()][k::env_accept_keywords()];
}
std::string
ERepository::arch_variable() const
{
- return erepository::EAPIData::get_instance()->eapi_from_string(
- params().profile_eapi)->supported->ebuild_environment_variables->env_arch;
+ return (*(*erepository::EAPIData::get_instance()->eapi_from_string(params().profile_eapi))
+ [k::supported()])[k::ebuild_environment_variables()][k::env_arch()];
}
FSEntry
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 62afe18..6dd0f8a 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -652,7 +652,7 @@ namespace test_cases
UserPackageDepSpecOptions()))), qo_require_exactly_one)->begin());
TEST_CHECK(id1->end_metadata() != id1->find_metadata("EAPI"));
- TEST_CHECK_EQUAL(tr1::static_pointer_cast<const erepository::ERepositoryID>(id1)->eapi()->name, "UNKNOWN");
+ TEST_CHECK_EQUAL((*tr1::static_pointer_cast<const erepository::ERepositoryID>(id1)->eapi())[k::name()], "UNKNOWN");
TEST_CHECK(! id1->short_description_key());
}
}
diff --git a/paludis/repositories/e/e_repository_id.cc b/paludis/repositories/e/e_repository_id.cc
index 12e6224..7975bdd 100644
--- a/paludis/repositories/e/e_repository_id.cc
+++ b/paludis/repositories/e/e_repository_id.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -20,6 +20,7 @@
#include <paludis/version_spec.hh>
#include <paludis/repositories/e/eapi.hh>
#include <paludis/repositories/e/e_repository_id.hh>
+#include <paludis/util/kc.hh>
using namespace paludis;
using namespace paludis::erepository;
@@ -28,6 +29,6 @@ bool
ERepositoryID::breaks_portage() const
{
return (version().has_try_part() || version().has_scm_part()
- || (! eapi()->supported) || (eapi()->supported->breaks_portage));
+ || (! (*eapi())[k::supported()]) || (*((*eapi())[k::supported()]))[k::breaks_portage()]);
}
diff --git a/paludis/repositories/e/e_repository_profile.cc b/paludis/repositories/e/e_repository_profile.cc
index 988300d..d96c528 100644
--- a/paludis/repositories/e/e_repository_profile.cc
+++ b/paludis/repositories/e/e_repository_profile.cc
@@ -333,8 +333,8 @@ Implementation<ERepositoryProfile>::load_profile_make_defaults(const FSEntry & d
environment_variables[k->first] = k->second;
}
- std::string use_expand_var(erepository::EAPIData::get_instance()->eapi_from_string(
- repository->params().profile_eapi)->supported->ebuild_environment_variables->env_use_expand);
+ std::string use_expand_var((*(*erepository::EAPIData::get_instance()->eapi_from_string(
+ repository->params().profile_eapi))[k::supported()])[k::ebuild_environment_variables()][k::env_use_expand()]);
try
{
use_expand.clear();
@@ -352,8 +352,8 @@ Implementation<ERepositoryProfile>::load_profile_make_defaults(const FSEntry & d
void
Implementation<ERepositoryProfile>::load_special_make_defaults_vars()
{
- std::string use_var(erepository::EAPIData::get_instance()->eapi_from_string(
- repository->params().profile_eapi)->supported->ebuild_environment_variables->env_use);
+ std::string use_var((*(*erepository::EAPIData::get_instance()->eapi_from_string(
+ repository->params().profile_eapi))[k::supported()])[k::ebuild_environment_variables()][k::env_use()]);
try
{
use.clear();
@@ -367,8 +367,8 @@ Implementation<ERepositoryProfile>::load_special_make_defaults_vars()
+ e.message() + " (" + e.what() + ")");
}
- std::string use_expand_var(erepository::EAPIData::get_instance()->eapi_from_string(
- repository->params().profile_eapi)->supported->ebuild_environment_variables->env_use_expand);
+ std::string use_expand_var((*(*erepository::EAPIData::get_instance()->eapi_from_string(
+ repository->params().profile_eapi))[k::supported()])[k::ebuild_environment_variables()][k::env_use_expand()]);
try
{
use_expand.clear();
@@ -382,8 +382,8 @@ Implementation<ERepositoryProfile>::load_special_make_defaults_vars()
+ e.message() + " (" + e.what() + ")");
}
- std::string use_expand_hidden_var(erepository::EAPIData::get_instance()->eapi_from_string(
- repository->params().profile_eapi)->supported->ebuild_environment_variables->env_use_expand_hidden);
+ std::string use_expand_hidden_var((*(*erepository::EAPIData::get_instance()->eapi_from_string(
+ repository->params().profile_eapi))[k::supported()])[k::ebuild_environment_variables()][k::env_use_expand_hidden()]);
try
{
use_expand_hidden.clear();
@@ -408,9 +408,9 @@ Implementation<ERepositoryProfile>::is_incremental(const std::string & s) const
Context c("When checking whether '" + s + "' is incremental:");
return (! s.empty()) &&
- (s == e->supported->ebuild_environment_variables->env_use
- || s == e->supported->ebuild_environment_variables->env_use_expand
- || s == e->supported->ebuild_environment_variables->env_use_expand_hidden
+ (s == (*(*e)[k::supported()])[k::ebuild_environment_variables()][k::env_use()]
+ || s == (*(*e)[k::supported()])[k::ebuild_environment_variables()][k::env_use_expand()]
+ || s == (*(*e)[k::supported()])[k::ebuild_environment_variables()][k::env_use_expand_hidden()]
|| s == "CONFIG_PROTECT"
|| s == "CONFIG_PROTECT_MASK"
|| use_expand.end() != use_expand.find(UseFlagName(s)));
@@ -421,9 +421,9 @@ Implementation<ERepositoryProfile>::is_incremental(const std::string & s) const
<< "), possibly due to weird variable name being used in profile";
return (! s.empty()) &&
- (s == e->supported->ebuild_environment_variables->env_use
- || s == e->supported->ebuild_environment_variables->env_use_expand
- || s == e->supported->ebuild_environment_variables->env_use_expand_hidden
+ (s == (*(*e)[k::supported()])[k::ebuild_environment_variables()][k::env_use()]
+ || s == (*(*e)[k::supported()])[k::ebuild_environment_variables()][k::env_use_expand()]
+ || s == (*(*e)[k::supported()])[k::ebuild_environment_variables()][k::env_use_expand_hidden()]
|| s == "CONFIG_PROTECT"
|| s == "CONFIG_PROTECT_MASK");
}
@@ -602,8 +602,8 @@ Implementation<ERepositoryProfile>::add_use_expand_to_use()
stacked_values_list.push_back(StackedValues("use_expand special values"));
- std::string expand_sep(stringify(erepository::EAPIData::get_instance()->eapi_from_string(
- repository->params().profile_eapi)->supported->ebuild_options->use_expand_separator));
+ std::string expand_sep(stringify((*(*erepository::EAPIData::get_instance()->eapi_from_string(
+ repository->params().profile_eapi))[k::supported()])[k::ebuild_options()].use_expand_separator));
for (UseFlagSet::const_iterator x(use_expand.begin()), x_end(use_expand.end()) ;
x != x_end ; ++x)
diff --git a/paludis/repositories/e/eapi-fwd.hh b/paludis/repositories/e/eapi-fwd.hh
index 7b1a9ae..57cced3 100644
--- a/paludis/repositories/e/eapi-fwd.hh
+++ b/paludis/repositories/e/eapi-fwd.hh
@@ -20,21 +20,89 @@
#ifndef PALUDIS_GUARD_PALUDIS_EAPI_FWD_HH
#define PALUDIS_GUARD_PALUDIS_EAPI_FWD_HH 1
+#include <paludis/util/kc-fwd.hh>
+#include <paludis/util/keys.hh>
+#include <paludis/util/tr1_memory.hh>
+#include <paludis/repositories/e/dep_parser-fwd.hh>
+#include <paludis/merger-fwd.hh>
+#include <paludis/name-fwd.hh>
+
namespace paludis
{
namespace erepository
{
- class EAPI;
- class SupportedEAPI;
class EAPIData;
class EAPIConfigurationError;
class EAPIEbuildPhases;
class EAPIEbuildMetadataVariables;
- class EAPIEbuildEnvironmentVariables;
class EAPIEbuildOptions;
class EAPILabels;
- class EAPIPipeCommands;
class EAPIToolsOptions;
+
+ typedef kc::KeyedClass<
+ kc::Field<k::rewrite_virtuals, bool>,
+ kc::Field<k::no_slot_or_repo, bool>
+ > EAPIPipeCommands;
+
+ /**
+ * Information about a supported EAPI's ebuild environment variables.
+ *
+ * \see EAPIData
+ * \see EAPI
+ * \ingroup grpeapi
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::env_use, std::string>,
+ kc::Field<k::env_use_expand, std::string>,
+ kc::Field<k::env_use_expand_hidden, std::string>,
+ kc::Field<k::env_aa, std::string>,
+ kc::Field<k::env_arch, std::string>,
+ kc::Field<k::env_kv, std::string>,
+ kc::Field<k::env_accept_keywords, std::string>,
+ kc::Field<k::env_distdir, std::string>,
+ kc::Field<k::env_portdir, std::string>,
+ kc::Field<k::description_use, std::string>
+ > EAPIEbuildEnvironmentVariables;
+
+ /**
+ * Information about a supported EAPI.
+ *
+ * \see EAPIData
+ * \see EAPI
+ * \ingroup grpeapi
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::package_dep_spec_parse_options, erepository::PackageDepSpecParseOptions>,
+ kc::Field<k::dependency_spec_tree_parse_options, erepository::DependencySpecTreeParseOptions>,
+ kc::Field<k::iuse_flag_parse_options, IUseFlagParseOptions>,
+ kc::Field<k::merger_options, MergerOptions>,
+ kc::Field<k::breaks_portage, bool>,
+ kc::Field<k::can_be_pbin, bool>,
+ kc::Field<k::ebuild_options, const EAPIEbuildOptions>,
+ kc::Field<k::ebuild_phases, const EAPIEbuildPhases>,
+ kc::Field<k::ebuild_metadata_variables, const EAPIEbuildMetadataVariables>,
+ kc::Field<k::ebuild_environment_variables, const EAPIEbuildEnvironmentVariables>,
+ kc::Field<k::uri_labels, const EAPILabels>,
+ kc::Field<k::dependency_labels, const EAPILabels>,
+ kc::Field<k::pipe_commands, EAPIPipeCommands>,
+ kc::Field<k::tools_options, const EAPIToolsOptions>
+ > SupportedEAPI;
+
+ /**
+ * Information about an EAPI.
+ *
+ * \see EAPIData
+ * \ingroup grpeapi
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::name, std::string>,
+ kc::Field<k::exported_name, std::string>,
+ kc::Field<k::supported, tr1::shared_ptr<const SupportedEAPI> >
+ > EAPI;
+
}
}
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 84653f2..7383f76 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -35,6 +35,7 @@
#include <paludis/util/instantiation_policy-impl.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/wrapped_output_iterator.hh>
+#include <paludis/util/kc.hh>
#include <map>
#include <vector>
@@ -114,151 +115,153 @@ namespace paludis
strip_trailing_string(d->basename(), ".conf"),
k.get("exported_name"),
make_shared_ptr(new SupportedEAPI(
- SupportedEAPI::create()
- .package_dep_spec_parse_options(package_dep_spec_parse_options)
- .dependency_spec_tree_parse_options(dependency_spec_tree_parse_options)
- .iuse_flag_parse_options(iuse_flag_parse_options)
- .merger_options(merger_options)
- .breaks_portage(destringify<bool>(k.get("breaks_portage")))
- .can_be_pbin(destringify<bool>(k.get("can_be_pbin")))
-
- .ebuild_options(make_shared_ptr(new EAPIEbuildOptions(
- EAPIEbuildOptions::create()
- .want_portage_emulation_vars(destringify<bool>(k.get("want_portage_emulation_vars")))
- .require_use_expand_in_iuse(destringify<bool>(k.get("require_use_expand_in_iuse")))
- .rdepend_defaults_to_depend(destringify<bool>(k.get("rdepend_defaults_to_depend")))
- .non_empty_variables(k.get("non_empty_variables"))
- .directory_variables(k.get("directory_variables"))
- .directory_if_exists_variables(k.get("directory_if_exists_variables"))
- .ebuild_must_not_set_variables(k.get("ebuild_must_not_set_variables"))
- .vdb_from_env_variables(k.get("vdb_from_env_variables"))
- .vdb_from_env_unless_empty_variables(k.get("vdb_from_env_unless_empty_variables"))
- .binary_from_env_variables(k.get("binary_from_env_variables"))
- .source_merged_variables(k.get("source_merged_variables"))
- .bracket_merged_variables(k.get("bracket_merged_variables"))
- .must_not_change_variables(k.get("must_not_change_variables"))
- .save_variables(k.get("save_variables"))
- .save_base_variables(k.get("save_base_variables"))
- .save_unmodifiable_variables(k.get("save_unmodifiable_variables"))
- .support_eclasses(destringify<bool>(k.get("support_eclasses")))
- .support_exlibs(destringify<bool>(k.get("support_exlibs")))
- .utility_path_suffixes(k.get("utility_path_suffixes"))
- .ebuild_module_suffixes(k.get("ebuild_module_suffixes"))
- .use_expand_separator(destringify<char>(k.get("use_expand_separator")))
- .restrict_fetch(make_shared_ptr(new Set<std::string>))
- .restrict_mirror(make_shared_ptr(new Set<std::string>))
- .restrict_primaryuri(make_shared_ptr(new Set<std::string>))
- .f_function_prefix(k.get("f_function_prefix"))
- .ignore_pivot_env_variables(k.get("ignore_pivot_env_variables"))
- .ignore_pivot_env_functions(k.get("ignore_pivot_env_functions"))
- )))
-
- .pipe_commands(make_shared_ptr(new EAPIPipeCommands(
- EAPIPipeCommands::create()
- .rewrite_virtuals(destringify<bool>(k.get("pipe_commands_rewrite_virtuals")))
- .no_slot_or_repo(destringify<bool>(k.get("pipe_commands_no_slot_or_repo"))))))
-
- .ebuild_phases(make_shared_ptr(new EAPIEbuildPhases(
- EAPIEbuildPhases::create()
- .ebuild_install(k.get("ebuild_install"))
- .ebuild_uninstall(k.get("ebuild_uninstall"))
- .ebuild_pretend(k.get("ebuild_pretend"))
- .ebuild_metadata(k.get("ebuild_metadata"))
- .ebuild_nofetch(k.get("ebuild_nofetch"))
- .ebuild_variable(k.get("ebuild_variable"))
- .ebuild_info(k.get("ebuild_info"))
- .ebuild_config(k.get("ebuild_config")))))
-
- .ebuild_metadata_variables(make_shared_ptr(new EAPIEbuildMetadataVariables(
- EAPIEbuildMetadataVariables::create()
- .metadata_build_depend(k.get("metadata_build_depend"))
- .metadata_run_depend(k.get("metadata_run_depend"))
- .metadata_slot(k.get("metadata_slot"))
- .metadata_src_uri(k.get("metadata_src_uri"))
- .metadata_restrict(k.get("metadata_restrict"))
- .metadata_homepage(k.get("metadata_homepage"))
- .metadata_license(k.get("metadata_license"))
- .metadata_description(k.get("metadata_description"))
- .metadata_keywords(k.get("metadata_keywords"))
- .metadata_eclass_keywords(k.get("metadata_eclass_keywords"))
- .metadata_inherited(k.get("metadata_inherited"))
- .metadata_iuse(k.get("metadata_iuse"))
- .metadata_pdepend(k.get("metadata_pdepend"))
- .metadata_provide(k.get("metadata_provide"))
- .metadata_eapi(k.get("metadata_eapi"))
- .metadata_dependencies(k.get("metadata_dependencies"))
- .metadata_use(k.get("metadata_use"))
- .description_build_depend(k.get("description_build_depend"))
- .description_run_depend(k.get("description_run_depend"))
- .description_slot(k.get("description_slot"))
- .description_src_uri(k.get("description_src_uri"))
- .description_restrict(k.get("description_restrict"))
- .description_homepage(k.get("description_homepage"))
- .description_license(k.get("description_license"))
- .description_description(k.get("description_description"))
- .description_keywords(k.get("description_keywords"))
- .description_eclass_keywords(k.get("description_eclass_keywords"))
- .description_inherited(k.get("description_inherited"))
- .description_iuse(k.get("description_iuse"))
- .description_pdepend(k.get("description_pdepend"))
- .description_provide(k.get("description_provide"))
- .description_eapi(k.get("description_eapi"))
- .description_dependencies(k.get("description_dependencies"))
- .description_use(k.get("description_use"))
- .flat_cache_build_depend(destringify<int>(k.get("flat_cache_build_depend")))
- .flat_cache_run_depend(destringify<int>(k.get("flat_cache_run_depend")))
- .flat_cache_slot(destringify<int>(k.get("flat_cache_slot")))
- .flat_cache_src_uri(destringify<int>(k.get("flat_cache_src_uri")))
- .flat_cache_restrict(destringify<int>(k.get("flat_cache_restrict")))
- .flat_cache_homepage(destringify<int>(k.get("flat_cache_homepage")))
- .flat_cache_license(destringify<int>(k.get("flat_cache_license")))
- .flat_cache_description(destringify<int>(k.get("flat_cache_description")))
- .flat_cache_keywords(destringify<int>(k.get("flat_cache_keywords")))
- .flat_cache_eclass_keywords(destringify<int>(k.get("flat_cache_eclass_keywords")))
- .flat_cache_inherited(destringify<int>(k.get("flat_cache_inherited")))
- .flat_cache_iuse(destringify<int>(k.get("flat_cache_iuse")))
- .flat_cache_pdepend(destringify<int>(k.get("flat_cache_pdepend")))
- .flat_cache_provide(destringify<int>(k.get("flat_cache_provide")))
- .flat_cache_eapi(destringify<int>(k.get("flat_cache_eapi")))
- .flat_cache_dependencies(destringify<int>(k.get("flat_cache_dependencies")))
- .flat_cache_use(destringify<int>(k.get("flat_cache_use")))
- .flat_cache_minimum_size(destringify<int>(k.get("flat_cache_minimum_size")))
- )))
-
- .ebuild_environment_variables(make_shared_ptr(new EAPIEbuildEnvironmentVariables(
- EAPIEbuildEnvironmentVariables::create()
- .env_use(k.get("env_use"))
- .env_use_expand(k.get("env_use_expand"))
- .env_use_expand_hidden(k.get("env_use_expand_hidden"))
- .env_aa(k.get("env_aa"))
- .env_arch(k.get("env_arch"))
- .env_kv(k.get("env_kv"))
- .env_portdir(k.get("env_portdir"))
- .env_distdir(k.get("env_distdir"))
- .env_accept_keywords(k.get("env_accept_keywords"))
- .description_use(k.get("description_use"))
- )))
-
- .uri_labels(make_shared_ptr(new EAPILabels(k.get("uri_labels"))))
-
- .dependency_labels(make_shared_ptr(new EAPILabels(k.get("dependency_labels"))))
-
- .tools_options(make_shared_ptr(new EAPIToolsOptions(
- EAPIToolsOptions::create()
- .unpack_unrecognised_is_fatal(destringify<bool>(
- k.get("unpack_unrecognised_is_fatal")))
- .unpack_fix_permissions(destringify<bool>(
- k.get("unpack_fix_permissions")))
- )))
-
- ))));
+ SupportedEAPI::named_create()
+ (k::package_dep_spec_parse_options(), package_dep_spec_parse_options)
+ (k::dependency_spec_tree_parse_options(), dependency_spec_tree_parse_options)
+ (k::iuse_flag_parse_options(), iuse_flag_parse_options)
+ (k::merger_options(), merger_options)
+ (k::breaks_portage(), destringify<bool>(k.get("breaks_portage")))
+ (k::can_be_pbin(), destringify<bool>(k.get("can_be_pbin")))
+
+ (k::ebuild_options(),
+ EAPIEbuildOptions(EAPIEbuildOptions::create()
+ .want_portage_emulation_vars(destringify<bool>(k.get("want_portage_emulation_vars")))
+ .require_use_expand_in_iuse(destringify<bool>(k.get("require_use_expand_in_iuse")))
+ .rdepend_defaults_to_depend(destringify<bool>(k.get("rdepend_defaults_to_depend")))
+ .non_empty_variables(k.get("non_empty_variables"))
+ .directory_variables(k.get("directory_variables"))
+ .directory_if_exists_variables(k.get("directory_if_exists_variables"))
+ .ebuild_must_not_set_variables(k.get("ebuild_must_not_set_variables"))
+ .vdb_from_env_variables(k.get("vdb_from_env_variables"))
+ .vdb_from_env_unless_empty_variables(k.get("vdb_from_env_unless_empty_variables"))
+ .binary_from_env_variables(k.get("binary_from_env_variables"))
+ .source_merged_variables(k.get("source_merged_variables"))
+ .bracket_merged_variables(k.get("bracket_merged_variables"))
+ .must_not_change_variables(k.get("must_not_change_variables"))
+ .save_variables(k.get("save_variables"))
+ .save_base_variables(k.get("save_base_variables"))
+ .save_unmodifiable_variables(k.get("save_unmodifiable_variables"))
+ .support_eclasses(destringify<bool>(k.get("support_eclasses")))
+ .support_exlibs(destringify<bool>(k.get("support_exlibs")))
+ .utility_path_suffixes(k.get("utility_path_suffixes"))
+ .ebuild_module_suffixes(k.get("ebuild_module_suffixes"))
+ .use_expand_separator(destringify<char>(k.get("use_expand_separator")))
+ .restrict_fetch(make_shared_ptr(new Set<std::string>))
+ .restrict_mirror(make_shared_ptr(new Set<std::string>))
+ .restrict_primaryuri(make_shared_ptr(new Set<std::string>))
+ .f_function_prefix(k.get("f_function_prefix"))
+ .ignore_pivot_env_variables(k.get("ignore_pivot_env_variables"))
+ .ignore_pivot_env_functions(k.get("ignore_pivot_env_functions"))
+ ))
+
+ (k::pipe_commands(),
+ EAPIPipeCommands(EAPIPipeCommands::named_create()
+ (k::rewrite_virtuals(), destringify<bool>(k.get("pipe_commands_rewrite_virtuals")))
+ (k::no_slot_or_repo(), destringify<bool>(k.get("pipe_commands_no_slot_or_repo")))
+ ))
+
+ (k::ebuild_phases(),
+ EAPIEbuildPhases(EAPIEbuildPhases::create()
+ .ebuild_install(k.get("ebuild_install"))
+ .ebuild_uninstall(k.get("ebuild_uninstall"))
+ .ebuild_pretend(k.get("ebuild_pretend"))
+ .ebuild_metadata(k.get("ebuild_metadata"))
+ .ebuild_nofetch(k.get("ebuild_nofetch"))
+ .ebuild_variable(k.get("ebuild_variable"))
+ .ebuild_info(k.get("ebuild_info"))
+ .ebuild_config(k.get("ebuild_config"))
+ ))
+
+ (k::ebuild_metadata_variables(),
+ EAPIEbuildMetadataVariables(EAPIEbuildMetadataVariables::create()
+ .metadata_build_depend(k.get("metadata_build_depend"))
+ .metadata_run_depend(k.get("metadata_run_depend"))
+ .metadata_slot(k.get("metadata_slot"))
+ .metadata_src_uri(k.get("metadata_src_uri"))
+ .metadata_restrict(k.get("metadata_restrict"))
+ .metadata_homepage(k.get("metadata_homepage"))
+ .metadata_license(k.get("metadata_license"))
+ .metadata_description(k.get("metadata_description"))
+ .metadata_keywords(k.get("metadata_keywords"))
+ .metadata_eclass_keywords(k.get("metadata_eclass_keywords"))
+ .metadata_inherited(k.get("metadata_inherited"))
+ .metadata_iuse(k.get("metadata_iuse"))
+ .metadata_pdepend(k.get("metadata_pdepend"))
+ .metadata_provide(k.get("metadata_provide"))
+ .metadata_eapi(k.get("metadata_eapi"))
+ .metadata_dependencies(k.get("metadata_dependencies"))
+ .metadata_use(k.get("metadata_use"))
+ .description_build_depend(k.get("description_build_depend"))
+ .description_run_depend(k.get("description_run_depend"))
+ .description_slot(k.get("description_slot"))
+ .description_src_uri(k.get("description_src_uri"))
+ .description_restrict(k.get("description_restrict"))
+ .description_homepage(k.get("description_homepage"))
+ .description_license(k.get("description_license"))
+ .description_description(k.get("description_description"))
+ .description_keywords(k.get("description_keywords"))
+ .description_eclass_keywords(k.get("description_eclass_keywords"))
+ .description_inherited(k.get("description_inherited"))
+ .description_iuse(k.get("description_iuse"))
+ .description_pdepend(k.get("description_pdepend"))
+ .description_provide(k.get("description_provide"))
+ .description_eapi(k.get("description_eapi"))
+ .description_dependencies(k.get("description_dependencies"))
+ .description_use(k.get("description_use"))
+ .flat_cache_build_depend(destringify<int>(k.get("flat_cache_build_depend")))
+ .flat_cache_run_depend(destringify<int>(k.get("flat_cache_run_depend")))
+ .flat_cache_slot(destringify<int>(k.get("flat_cache_slot")))
+ .flat_cache_src_uri(destringify<int>(k.get("flat_cache_src_uri")))
+ .flat_cache_restrict(destringify<int>(k.get("flat_cache_restrict")))
+ .flat_cache_homepage(destringify<int>(k.get("flat_cache_homepage")))
+ .flat_cache_license(destringify<int>(k.get("flat_cache_license")))
+ .flat_cache_description(destringify<int>(k.get("flat_cache_description")))
+ .flat_cache_keywords(destringify<int>(k.get("flat_cache_keywords")))
+ .flat_cache_eclass_keywords(destringify<int>(k.get("flat_cache_eclass_keywords")))
+ .flat_cache_inherited(destringify<int>(k.get("flat_cache_inherited")))
+ .flat_cache_iuse(destringify<int>(k.get("flat_cache_iuse")))
+ .flat_cache_pdepend(destringify<int>(k.get("flat_cache_pdepend")))
+ .flat_cache_provide(destringify<int>(k.get("flat_cache_provide")))
+ .flat_cache_eapi(destringify<int>(k.get("flat_cache_eapi")))
+ .flat_cache_dependencies(destringify<int>(k.get("flat_cache_dependencies")))
+ .flat_cache_use(destringify<int>(k.get("flat_cache_use")))
+ .flat_cache_minimum_size(destringify<int>(k.get("flat_cache_minimum_size")))
+ ))
+
+ (k::ebuild_environment_variables(),
+ EAPIEbuildEnvironmentVariables(EAPIEbuildEnvironmentVariables::named_create()
+ (k::env_use(), k.get("env_use"))
+ (k::env_use_expand(), k.get("env_use_expand"))
+ (k::env_use_expand_hidden(), k.get("env_use_expand_hidden"))
+ (k::env_aa(), k.get("env_aa"))
+ (k::env_arch(), k.get("env_arch"))
+ (k::env_kv(), k.get("env_kv"))
+ (k::env_portdir(), k.get("env_portdir"))
+ (k::env_distdir(), k.get("env_distdir"))
+ (k::env_accept_keywords(), k.get("env_accept_keywords"))
+ (k::description_use(), k.get("description_use"))
+ ))
+
+ (k::uri_labels(), EAPILabels(k.get("uri_labels")))
+
+ (k::dependency_labels(), EAPILabels(k.get("dependency_labels")))
+
+ (k::tools_options(),
+ EAPIToolsOptions(EAPIToolsOptions::create()
+ .unpack_unrecognised_is_fatal(destringify<bool>(
+ k.get("unpack_unrecognised_is_fatal")))
+ .unpack_fix_permissions(destringify<bool>(
+ k.get("unpack_fix_permissions")))
+ ))
+
+ ))));
tokenise_whitespace(k.get("restrict_fetch"),
- eapi->supported->ebuild_options->restrict_fetch->inserter());
+ (*(*eapi)[k::supported()])[k::ebuild_options()].restrict_fetch->inserter());
tokenise_whitespace(k.get("restrict_mirror"),
- eapi->supported->ebuild_options->restrict_mirror->inserter());
+ (*(*eapi)[k::supported()])[k::ebuild_options()].restrict_mirror->inserter());
tokenise_whitespace(k.get("restrict_primaryuri"),
- eapi->supported->ebuild_options->restrict_primaryuri->inserter());
+ (*(*eapi)[k::supported()])[k::ebuild_options()].restrict_primaryuri->inserter());
values.insert(std::make_pair(strip_trailing_string(d->basename(), ".conf"), eapi));
}
@@ -332,6 +335,11 @@ EAPILabels::EAPILabels(const std::string & s) :
}
}
+EAPILabels::EAPILabels(const EAPILabels & other) :
+ PrivateImplementationPattern<EAPILabels>(new Implementation<EAPILabels>(*other._imp.operator-> ()))
+{
+}
+
EAPILabels::~EAPILabels()
{
}
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index 71a425a..7407527 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -39,11 +39,11 @@ namespace paludis
#include <paludis/repositories/e/eapi-sr.hh>
class PALUDIS_VISIBLE EAPILabels :
- private InstantiationPolicy<EAPILabels, instantiation_method::NonCopyableTag>,
private PrivateImplementationPattern<EAPILabels>
{
public:
EAPILabels(const std::string &);
+ EAPILabels(const EAPILabels &);
~EAPILabels();
const std::string class_for_label(const std::string &) const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/eapi.sr b/paludis/repositories/e/eapi.sr
index 5ad9ce6..2f53b71 100644
--- a/paludis/repositories/e/eapi.sr
+++ b/paludis/repositories/e/eapi.sr
@@ -98,35 +98,6 @@ make_class_EAPIEbuildMetadataVariables()
END
}
-make_class_EAPIEbuildEnvironmentVariables()
-{
- visible
- allow_named_args cc
-
- key env_use std::string
- key env_use_expand std::string
- key env_use_expand_hidden std::string
- key env_aa std::string
- key env_arch std::string
- key env_kv std::string
- key env_accept_keywords std::string
- key env_distdir std::string
- key env_portdir std::string
-
- key description_use std::string
-
- doxygen_comment << "END"
- /**
- * Information about a supported EAPI's ebuild environment variables.
- *
- * \see EAPIData
- * \see EAPI
- * \ingroup grpeapi
- * \nosubgrouping
- */
-END
-}
-
make_class_EAPIToolsOptions()
{
visible
@@ -197,67 +168,3 @@ make_class_EAPIEbuildOptions()
END
}
-make_class_EAPIPipeCommands()
-{
- visible
- allow_named_args cc
-
- key rewrite_virtuals bool
- key no_slot_or_repo bool
-}
-
-make_class_SupportedEAPI()
-{
- visible
- allow_named_args cc
-
- key package_dep_spec_parse_options "erepository::PackageDepSpecParseOptions"
- key dependency_spec_tree_parse_options "erepository::DependencySpecTreeParseOptions"
- key iuse_flag_parse_options IUseFlagParseOptions
- key merger_options "MergerOptions"
-
- key breaks_portage bool
- key can_be_pbin bool
-
- key ebuild_options "tr1::shared_ptr<const EAPIEbuildOptions>"
- key ebuild_phases "tr1::shared_ptr<const EAPIEbuildPhases>"
- key ebuild_metadata_variables "tr1::shared_ptr<const EAPIEbuildMetadataVariables>"
- key ebuild_environment_variables "tr1::shared_ptr<const EAPIEbuildEnvironmentVariables>"
- key uri_labels "tr1::shared_ptr<const EAPILabels>"
- key dependency_labels "tr1::shared_ptr<const EAPILabels>"
- key pipe_commands "tr1::shared_ptr<const EAPIPipeCommands>"
- key tools_options "tr1::shared_ptr<const EAPIToolsOptions>"
-
- doxygen_comment << "END"
- /**
- * Information about a supported EAPI.
- *
- * \see EAPIData
- * \see EAPI
- * \ingroup grpeapi
- * \nosubgrouping
- */
-END
-}
-
-make_class_EAPI()
-{
- visible
-
- key name std::string
- key exported_name std::string
- key supported "tr1::shared_ptr<const SupportedEAPI>"
-
- allow_named_args
-
- doxygen_comment << "END"
- /**
- * Information about an EAPI.
- *
- * \see EAPIData
- * \ingroup grpeapi
- * \nosubgrouping
- */
-END
-}
-
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index f68afcc..4e71136 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -44,6 +44,7 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/set.hh>
#include <paludis/util/cookie.hh>
+#include <paludis/util/kc.hh>
#include <paludis/about.hh>
#include <paludis/environment.hh>
@@ -70,8 +71,6 @@
using namespace paludis;
using namespace paludis::erepository;
-#include <paludis/repositories/e/ebuild-sr.cc>
-
EbuildCommand::EbuildCommand(const EbuildCommandParams & p) :
params(p)
{
@@ -99,114 +98,116 @@ EbuildCommand::operator() ()
Command cmd(getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis") +
"/ebuild.bash '" + ebuild_file() + "' " + commands());
- if (params.sandbox)
+ if (params[k::sandbox()])
cmd.with_sandbox();
- if (params.userpriv)
- cmd.with_uid_gid(params.environment->reduced_uid(), params.environment->reduced_gid());
+ if (params[k::userpriv()])
+ cmd.with_uid_gid(params[k::environment()]->reduced_uid(), params[k::environment()]->reduced_gid());
using namespace tr1::placeholders;
- cmd.with_pipe_command_handler(tr1::bind(&pipe_command_handler, params.environment, params.package_id, _1));
+ cmd.with_pipe_command_handler(tr1::bind(&pipe_command_handler, params[k::environment()], params[k::package_id()], _1));
- tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params.environment->syncers_dirs());
- tr1::shared_ptr<const FSEntrySequence> bashrc_files(params.environment->bashrc_files());
- tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params.environment->fetchers_dirs());
- tr1::shared_ptr<const FSEntrySequence> hook_dirs(params.environment->hook_dirs());
+ tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params[k::environment()]->syncers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> bashrc_files(params[k::environment()]->bashrc_files());
+ tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params[k::environment()]->fetchers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> hook_dirs(params[k::environment()]->hook_dirs());
cmd = extend_command(cmd
- .with_setenv("P", stringify(params.package_id->name().package) + "-" +
- stringify(params.package_id->version().remove_revision()))
- .with_setenv("PV", stringify(params.package_id->version().remove_revision()))
- .with_setenv("PR", stringify(params.package_id->version().revision_only()))
- .with_setenv("PN", stringify(params.package_id->name().package))
- .with_setenv("PVR", stringify(params.package_id->version()))
- .with_setenv("PF", stringify(params.package_id->name().package) + "-" +
- stringify(params.package_id->version()))
- .with_setenv("CATEGORY", stringify(params.package_id->name().category))
- .with_setenv("REPOSITORY", stringify(params.package_id->repository()->name()))
- .with_setenv("FILESDIR", stringify(params.files_dir))
- .with_setenv("EAPI", stringify(params.package_id->eapi()->exported_name))
+ .with_setenv("P", stringify(params[k::package_id()]->name().package) + "-" +
+ stringify(params[k::package_id()]->version().remove_revision()))
+ .with_setenv("PV", stringify(params[k::package_id()]->version().remove_revision()))
+ .with_setenv("PR", stringify(params[k::package_id()]->version().revision_only()))
+ .with_setenv("PN", stringify(params[k::package_id()]->name().package))
+ .with_setenv("PVR", stringify(params[k::package_id()]->version()))
+ .with_setenv("PF", stringify(params[k::package_id()]->name().package) + "-" +
+ stringify(params[k::package_id()]->version()))
+ .with_setenv("CATEGORY", stringify(params[k::package_id()]->name().category))
+ .with_setenv("REPOSITORY", stringify(params[k::package_id()]->repository()->name()))
+ .with_setenv("FILESDIR", stringify(params[k::files_dir()]))
+ .with_setenv("EAPI", stringify((*params[k::package_id()]->eapi())[k::exported_name()]))
.with_setenv("PKGMANAGER", PALUDIS_PACKAGE "-" + stringify(PALUDIS_VERSION_MAJOR) + "." +
stringify(PALUDIS_VERSION_MINOR) + "." +
stringify(PALUDIS_VERSION_MICRO) + stringify(PALUDIS_VERSION_SUFFIX) +
(std::string(PALUDIS_SUBVERSION_REVISION).empty() ?
std::string("") : "-r" + std::string(PALUDIS_SUBVERSION_REVISION)))
- .with_setenv("PALUDIS_TMPDIR", stringify(params.builddir))
+ .with_setenv("PALUDIS_TMPDIR", stringify(params[k::builddir()]))
.with_setenv("PALUDIS_CONFIG_DIR", SYSCONFDIR "/paludis/")
.with_setenv("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "))
.with_setenv("PALUDIS_HOOK_DIRS", join(hook_dirs->begin(), hook_dirs->end(), " "))
.with_setenv("PALUDIS_FETCHERS_DIRS", join(fetchers_dirs->begin(), fetchers_dirs->end(), " "))
.with_setenv("PALUDIS_SYNCERS_DIRS", join(syncers_dirs->begin(), syncers_dirs->end(), " "))
- .with_setenv("PALUDIS_COMMAND", params.environment->paludis_command())
- .with_setenv("PALUDIS_REDUCED_GID", stringify(params.environment->reduced_gid()))
- .with_setenv("PALUDIS_REDUCED_UID", stringify(params.environment->reduced_uid()))
+ .with_setenv("PALUDIS_COMMAND", params[k::environment()]->paludis_command())
+ .with_setenv("PALUDIS_REDUCED_GID", stringify(params[k::environment()]->reduced_gid()))
+ .with_setenv("PALUDIS_REDUCED_UID", stringify(params[k::environment()]->reduced_uid()))
.with_setenv("PALUDIS_EBUILD_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
.with_setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
.with_setenv("PALUDIS_UTILITY_PATH_SUFFIXES",
- params.package_id->eapi()->supported->ebuild_options->utility_path_suffixes)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].utility_path_suffixes)
.with_setenv("PALUDIS_EBUILD_MODULE_SUFFIXES",
- params.package_id->eapi()->supported->ebuild_options->ebuild_module_suffixes)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].ebuild_module_suffixes)
.with_setenv("PALUDIS_NON_EMPTY_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->non_empty_variables)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].non_empty_variables)
.with_setenv("PALUDIS_DIRECTORY_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->directory_variables)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].directory_variables)
.with_setenv("PALUDIS_EBUILD_MUST_NOT_SET_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->ebuild_must_not_set_variables)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].ebuild_must_not_set_variables)
.with_setenv("PALUDIS_SAVE_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->save_variables)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].save_variables)
.with_setenv("PALUDIS_SAVE_BASE_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->save_base_variables)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].save_base_variables)
.with_setenv("PALUDIS_SAVE_UNMODIFIABLE_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->save_unmodifiable_variables)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].save_unmodifiable_variables)
.with_setenv("PALUDIS_DIRECTORY_IF_EXISTS_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->directory_if_exists_variables)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].directory_if_exists_variables)
.with_setenv("PALUDIS_SOURCE_MERGED_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->source_merged_variables)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].source_merged_variables)
.with_setenv("PALUDIS_BRACKET_MERGED_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->bracket_merged_variables)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].bracket_merged_variables)
.with_setenv("PALUDIS_MUST_NOT_CHANGE_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->must_not_change_variables)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].must_not_change_variables)
.with_setenv("PALUDIS_RDEPEND_DEFAULTS_TO_DEPEND",
- params.package_id->eapi()->supported->ebuild_options->rdepend_defaults_to_depend ? "yes" : "")
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].rdepend_defaults_to_depend ? "yes" : "")
.with_setenv("PALUDIS_F_FUNCTION_PREFIX",
- params.package_id->eapi()->supported->ebuild_options->f_function_prefix)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].f_function_prefix)
.with_setenv("PALUDIS_IGNORE_PIVOT_ENV_FUNCTIONS",
- params.package_id->eapi()->supported->ebuild_options->ignore_pivot_env_functions)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].ignore_pivot_env_functions)
.with_setenv("PALUDIS_IGNORE_PIVOT_ENV_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->ignore_pivot_env_variables)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].ignore_pivot_env_variables)
.with_setenv("PALUDIS_BINARY_DISTDIR_VARIABLE",
- params.package_id->eapi()->supported->ebuild_environment_variables->env_distdir)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_distdir()])
.with_setenv("PALUDIS_UNPACK_UNRECOGNISED_IS_FATAL",
- params.package_id->eapi()->supported->tools_options->unpack_unrecognised_is_fatal ? "yes" : "")
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::tools_options()].unpack_unrecognised_is_fatal ? "yes" : "")
.with_setenv("PALUDIS_UNPACK_FIX_PERMISSIONS",
- params.package_id->eapi()->supported->tools_options->unpack_fix_permissions ? "yes" : "")
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::tools_options()].unpack_fix_permissions ? "yes" : "")
.with_setenv("PALUDIS_UNPACK_FROM_VAR",
- params.package_id->eapi()->supported->ebuild_environment_variables->env_distdir)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_distdir()])
.with_setenv("PALUDIS_PIPE_COMMANDS_SUPPORTED", "yes")
)
.with_setenv("SLOT", "")
.with_setenv("PALUDIS_PROFILE_DIR", "")
.with_setenv("PALUDIS_PROFILE_DIRS", "");
- if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_kv.empty())
- cmd.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_kv, kernel_version());
- if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_portdir.empty())
- cmd.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_portdir, stringify(params.portdir));
- if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_distdir.empty())
- cmd.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_distdir, stringify(params.distdir));
+ if (! (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_kv()].empty())
+ cmd.with_setenv((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_kv()], kernel_version());
+ if (! (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_portdir()].empty())
+ cmd.with_setenv((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_portdir()],
+ stringify(params[k::portdir()]));
+ if (! (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_distdir()].empty())
+ cmd.with_setenv((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_distdir()],
+ stringify(params[k::distdir()]));
- if (params.package_id->eapi()->supported->ebuild_options->support_eclasses)
+ if ((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].support_eclasses)
cmd
- .with_setenv("ECLASSDIR", stringify(*params.eclassdirs->begin()))
- .with_setenv("ECLASSDIRS", join(params.eclassdirs->begin(),
- params.eclassdirs->end(), " "));
+ .with_setenv("ECLASSDIR", stringify(*params[k::eclassdirs()]->begin()))
+ .with_setenv("ECLASSDIRS", join(params[k::eclassdirs()]->begin(),
+ params[k::eclassdirs()]->end(), " "));
- if (params.package_id->eapi()->supported->ebuild_options->support_exlibs)
+ if ((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].support_exlibs)
cmd
- .with_setenv("EXLIBSDIRS", join(params.exlibsdirs->begin(),
- params.exlibsdirs->end(), " "));
+ .with_setenv("EXLIBSDIRS", join(params[k::exlibsdirs()]->begin(),
+ params[k::exlibsdirs()]->end(), " "));
- if (params.package_id->eapi()->supported->ebuild_options->want_portage_emulation_vars)
+ if ((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].want_portage_emulation_vars)
cmd = add_portage_vars(cmd);
if (do_run_command(cmd))
@@ -218,26 +219,26 @@ EbuildCommand::operator() ()
std::string
EbuildCommand::ebuild_file() const
{
- return stringify(params.ebuild_file);
+ return stringify(params[k::ebuild_file()]);
}
Command
EbuildCommand::add_portage_vars(const Command & cmd) const
{
return Command(cmd)
- .with_setenv("PORTAGE_ACTUAL_DISTDIR", stringify(params.distdir))
+ .with_setenv("PORTAGE_ACTUAL_DISTDIR", stringify(params[k::distdir()]))
.with_setenv("PORTAGE_BASHRC", "/dev/null")
- .with_setenv("PORTAGE_BUILDDIR", stringify(params.builddir) + "/" +
- stringify(params.package_id->name().category) + "/" +
- stringify(params.package_id->name().package) + "-" +
- stringify(params.package_id->version()))
- .with_setenv("PORTAGE_CALLER", params.environment->paludis_command())
+ .with_setenv("PORTAGE_BUILDDIR", stringify(params[k::builddir()]) + "/" +
+ stringify(params[k::package_id()]->name().category) + "/" +
+ stringify(params[k::package_id()]->name().package) + "-" +
+ stringify(params[k::package_id()]->version()))
+ .with_setenv("PORTAGE_CALLER", params[k::environment()]->paludis_command())
.with_setenv("PORTAGE_GID", "0")
.with_setenv("PORTAGE_INST_GID", "0")
.with_setenv("PORTAGE_INST_UID", "0")
.with_setenv("PORTAGE_MASTER_PID", stringify(::getpid()))
.with_setenv("PORTAGE_NICENCESS", stringify(::getpriority(PRIO_PROCESS, 0)))
- .with_setenv("PORTAGE_TMPDIR", stringify(params.builddir))
+ .with_setenv("PORTAGE_TMPDIR", stringify(params[k::builddir()]))
.with_setenv("PORTAGE_TMPFS", "/dev/shm")
.with_setenv("PORTAGE_WORKDIR_MODE", "0700");
}
@@ -260,7 +261,7 @@ EbuildMetadataCommand::~EbuildMetadataCommand()
std::string
EbuildMetadataCommand::commands() const
{
- return params.commands;
+ return params[k::commands()];
}
bool
@@ -273,9 +274,9 @@ Command
EbuildMetadataCommand::extend_command(const Command & cmd)
{
return Command(cmd)
- .with_uid_gid(params.environment->reduced_uid(), params.environment->reduced_gid())
- .with_stderr_prefix(stringify(params.package_id->name().package) + "-" +
- stringify(params.package_id->version()) + "> ");
+ .with_uid_gid(params[k::environment()]->reduced_uid(), params[k::environment()]->reduced_gid())
+ .with_stderr_prefix(stringify(params[k::package_id()]->name().package) + "-" +
+ stringify(params[k::package_id()]->version()) + "> ");
}
namespace
@@ -297,7 +298,7 @@ EbuildMetadataCommand::do_run_command(const Command & cmd)
std::string input;
try
{
- Context context("When running ebuild command to generate metadata for '" + stringify(*params.package_id) + "':");
+ Context context("When running ebuild command to generate metadata for '" + stringify(*params[k::package_id()]) + "':");
std::stringstream prog;
Command real_cmd(cmd);
@@ -316,7 +317,7 @@ EbuildMetadataCommand::do_run_command(const Command & cmd)
{
Log::get_instance()->message(ll_warning, lc_context, "Caught exception '" +
stringify(e.message()) + "' (" + stringify(e.what()) +
- ") when generating cache for '" + stringify(*params.package_id) + "', input is '" + purdy(input) + "'");
+ ") when generating cache for '" + stringify(*params[k::package_id()]) + "', input is '" + purdy(input) + "'");
}
if (ok)
@@ -324,9 +325,9 @@ EbuildMetadataCommand::do_run_command(const Command & cmd)
else
{
Log::get_instance()->message(ll_warning, lc_context) << "Could not generate cache for '"
- << *params.package_id << "'";
+ << *params[k::package_id()] << "'";
keys.reset(new Map<std::string, std::string>);
- keys->insert("EAPI", EAPIData::get_instance()->unknown_eapi()->name);
+ keys->insert("EAPI", (*EAPIData::get_instance()->unknown_eapi())[k::name()]);
return false;
}
@@ -346,36 +347,36 @@ namespace
void
EbuildMetadataCommand::load(const tr1::shared_ptr<const EbuildID> & id)
{
- Context context("When loading generated metadata for '" + stringify(*params.package_id) + "':");
+ Context context("When loading generated metadata for '" + stringify(*params[k::package_id()]) + "':");
if (! keys)
throw InternalError(PALUDIS_HERE, "keys is 0");
- if (! id->eapi()->supported)
+ if (! (*id->eapi())[k::supported()])
{
- Log::get_instance()->message(ll_debug, lc_context) << "ID pre-load EAPI '" << id->eapi()->name << "' not supported";
+ Log::get_instance()->message(ll_debug, lc_context) << "ID pre-load EAPI '" << (*id->eapi())[k::name()] << "' not supported";
id->set_slot(SlotName("UNKNOWN"));
return;
}
else
- Log::get_instance()->message(ll_debug, lc_context) << "ID pre-load EAPI '" << id->eapi()->name << "' is supported";
+ Log::get_instance()->message(ll_debug, lc_context) << "ID pre-load EAPI '" << (*id->eapi())[k::name()] << "' is supported";
std::string s;
- if (! ((s = get(keys, id->eapi()->supported->ebuild_metadata_variables->metadata_eapi))).empty())
+ if (! ((s = get(keys, (*(*id->eapi())[k::supported()])[k::ebuild_metadata_variables()].metadata_eapi))).empty())
id->set_eapi(s);
else
id->set_eapi(id->e_repository()->params().eapi_when_unspecified);
- if (! id->eapi()->supported)
+ if (! (*id->eapi())[k::supported()])
{
- Log::get_instance()->message(ll_debug, lc_context) << "ID post-load EAPI '" << id->eapi()->name << "' not supported";
+ Log::get_instance()->message(ll_debug, lc_context) << "ID post-load EAPI '" << (*id->eapi())[k::name()] << "' not supported";
id->set_slot(SlotName("UNKNOWN"));
return;
}
else
- Log::get_instance()->message(ll_debug, lc_context) << "ID post-load EAPI '" << id->eapi()->name << "' is supported";
+ Log::get_instance()->message(ll_debug, lc_context) << "ID post-load EAPI '" << (*id->eapi())[k::name()] << "' is supported";
- const EAPIEbuildMetadataVariables & m(*id->eapi()->supported->ebuild_metadata_variables);
+ const EAPIEbuildMetadataVariables & m((*(*id->eapi())[k::supported()])[k::ebuild_metadata_variables()]);
if (! m.metadata_description.empty())
id->load_short_description(m.metadata_description, m.description_description, get(keys, m.metadata_description));
@@ -384,7 +385,7 @@ EbuildMetadataCommand::load(const tr1::shared_ptr<const EbuildID> & id)
if (! m.metadata_dependencies.empty())
{
DependenciesRewriter rewriter;
- parse_depend(get(keys, m.metadata_dependencies), params.environment, id, *id->eapi())->accept(rewriter);
+ parse_depend(get(keys, m.metadata_dependencies), params[k::environment()], id, *id->eapi())->accept(rewriter);
id->load_build_depend(m.metadata_dependencies + ".DEPEND", m.description_dependencies + " (build)", rewriter.depend());
id->load_run_depend(m.metadata_dependencies + ".RDEPEND", m.description_dependencies + " (run)", rewriter.rdepend());
id->load_post_depend(m.metadata_dependencies + ".PDEPEND", m.description_dependencies + " (post)", rewriter.pdepend());
@@ -463,7 +464,7 @@ EbuildVariableCommand::EbuildVariableCommand(const EbuildCommandParams & p,
std::string
EbuildVariableCommand::commands() const
{
- return params.commands;
+ return params[k::commands()];
}
bool
@@ -477,7 +478,7 @@ EbuildVariableCommand::extend_command(const Command & cmd)
{
return Command(cmd)
.with_setenv("PALUDIS_VARIABLE", _var)
- .with_uid_gid(params.environment->reduced_uid(), params.environment->reduced_gid());
+ .with_uid_gid(params[k::environment()]->reduced_uid(), params[k::environment()]->reduced_gid());
}
bool
@@ -496,35 +497,38 @@ EbuildVariableCommand::do_run_command(const Command & cmd)
std::string
EbuildNoFetchCommand::commands() const
{
- return params.commands;
+ return params[k::commands()];
}
bool
EbuildNoFetchCommand::failure()
{
- throw FetchActionError("Fetch failed for '" + stringify(*params.package_id) + "'");
+ throw FetchActionError("Fetch failed for '" + stringify(*params[k::package_id()]) + "'");
}
Command
EbuildNoFetchCommand::extend_command(const Command & cmd)
{
Command result(Command(cmd)
- .with_setenv("A", fetch_params.a)
- .with_setenv("ROOT", fetch_params.root)
- .with_setenv("PALUDIS_PROFILE_DIR", stringify(*fetch_params.profiles->begin()))
- .with_setenv("PALUDIS_PROFILE_DIRS", join(fetch_params.profiles->begin(),
- fetch_params.profiles->end(), " ")));
-
- if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_aa.empty())
- result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_aa, fetch_params.aa);
- if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_use.empty())
- result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_use, fetch_params.use);
- if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_use_expand.empty())
- result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_use_expand, fetch_params.use_expand);
+ .with_setenv("A", fetch_params[k::a()])
+ .with_setenv("ROOT", fetch_params[k::root()])
+ .with_setenv("PALUDIS_PROFILE_DIR", stringify(*fetch_params[k::profiles()]->begin()))
+ .with_setenv("PALUDIS_PROFILE_DIRS", join(fetch_params[k::profiles()]->begin(),
+ fetch_params[k::profiles()]->end(), " ")));
+
+ if (! (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_aa()].empty())
+ result.with_setenv((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_aa()],
+ fetch_params[k::aa()]);
+ if (! (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use()].empty())
+ result.with_setenv((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use()],
+ fetch_params[k::use()]);
+ if (! (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use_expand()].empty())
+ result.with_setenv((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use_expand()],
+ fetch_params[k::use_expand()]);
for (Map<std::string, std::string>::ConstIterator
- i(fetch_params.expand_vars->begin()),
- j(fetch_params.expand_vars->end()) ; i != j ; ++i)
+ i(fetch_params[k::expand_vars()]->begin()),
+ j(fetch_params[k::expand_vars()]->end()) ; i != j ; ++i)
result.with_setenv(i->first, i->second);
return result;
@@ -540,13 +544,13 @@ EbuildNoFetchCommand::EbuildNoFetchCommand(const EbuildCommandParams & p,
std::string
EbuildInstallCommand::commands() const
{
- return params.commands;
+ return params[k::commands()];
}
bool
EbuildInstallCommand::failure()
{
- throw InstallActionError("Install failed for '" + stringify(*params.package_id) + "'");
+ throw InstallActionError("Install failed for '" + stringify(*params[k::package_id()]) + "'");
}
Command
@@ -555,7 +559,7 @@ EbuildInstallCommand::extend_command(const Command & cmd)
std::string debug_build;
do
{
- switch (install_params.debug_build)
+ switch (install_params[k::debug_build()])
{
case iado_none:
debug_build = "none";
@@ -578,29 +582,32 @@ EbuildInstallCommand::extend_command(const Command & cmd)
while (false);
Command result(Command(cmd)
- .with_setenv("A", install_params.a)
- .with_setenv("ROOT", install_params.root)
- .with_setenv("PALUDIS_LOADSAVEENV_DIR", stringify(install_params.loadsaveenv_dir))
- .with_setenv("PALUDIS_CONFIG_PROTECT", install_params.config_protect)
- .with_setenv("PALUDIS_CONFIG_PROTECT_MASK", install_params.config_protect_mask)
+ .with_setenv("A", install_params[k::a()])
+ .with_setenv("ROOT", install_params[k::root()])
+ .with_setenv("PALUDIS_LOADSAVEENV_DIR", stringify(install_params[k::loadsaveenv_dir()]))
+ .with_setenv("PALUDIS_CONFIG_PROTECT", install_params[k::config_protect()])
+ .with_setenv("PALUDIS_CONFIG_PROTECT_MASK", install_params[k::config_protect_mask()])
.with_setenv("PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT_MASK",
- install_params.disable_cfgpro ? "/" : "")
+ install_params[k::disable_cfgpro()] ? "/" : "")
.with_setenv("PALUDIS_DEBUG_BUILD", debug_build)
- .with_setenv("PALUDIS_PROFILE_DIR", stringify(*install_params.profiles->begin()))
- .with_setenv("PALUDIS_PROFILE_DIRS", join(install_params.profiles->begin(),
- install_params.profiles->end(), " "))
- .with_setenv("SLOT", stringify(install_params.slot)));
-
- if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_aa.empty())
- result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_aa, install_params.aa);
- if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_use.empty())
- result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_use, install_params.use);
- if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_use_expand.empty())
- result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_use_expand, install_params.use_expand);
+ .with_setenv("PALUDIS_PROFILE_DIR", stringify(*install_params[k::profiles()]->begin()))
+ .with_setenv("PALUDIS_PROFILE_DIRS", join(install_params[k::profiles()]->begin(),
+ install_params[k::profiles()]->end(), " "))
+ .with_setenv("SLOT", stringify(install_params[k::slot()])));
+
+ if (! (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_aa()].empty())
+ result.with_setenv((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_aa()],
+ install_params[k::aa()]);
+ if (! (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use()].empty())
+ result.with_setenv((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use()],
+ install_params[k::use()]);
+ if (! (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use_expand()].empty())
+ result.with_setenv((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use_expand()],
+ install_params[k::use_expand()]);
for (Map<std::string, std::string>::ConstIterator
- i(install_params.expand_vars->begin()),
- j(install_params.expand_vars->end()) ; i != j ; ++i)
+ i(install_params[k::expand_vars()]->begin()),
+ j(install_params[k::expand_vars()]->end()) ; i != j ; ++i)
result.with_setenv(i->first, i->second);
return result;
@@ -616,7 +623,7 @@ EbuildInstallCommand::EbuildInstallCommand(const EbuildCommandParams & p,
std::string
EbuildUninstallCommand::commands() const
{
- return params.commands;
+ return params[k::commands()];
}
std::string
@@ -628,21 +635,21 @@ EbuildUninstallCommand::ebuild_file() const
bool
EbuildUninstallCommand::failure()
{
- throw UninstallActionError("Uninstall failed for '" + stringify(*params.package_id) + "'");
+ throw UninstallActionError("Uninstall failed for '" + stringify(*params[k::package_id()]) + "'");
}
Command
EbuildUninstallCommand::extend_command(const Command & cmd)
{
Command result(Command(cmd)
- .with_setenv("ROOT", uninstall_params.root)
- .with_setenv("PALUDIS_LOADSAVEENV_DIR", stringify(uninstall_params.loadsaveenv_dir))
+ .with_setenv("ROOT", uninstall_params[k::root()])
+ .with_setenv("PALUDIS_LOADSAVEENV_DIR", stringify(uninstall_params[k::loadsaveenv_dir()]))
.with_setenv("PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT_MASK",
- uninstall_params.disable_cfgpro ? "/" : ""));
+ uninstall_params[k::disable_cfgpro()] ? "/" : ""));
- if (uninstall_params.load_environment)
+ if (uninstall_params[k::load_environment()])
result
- .with_setenv("PALUDIS_LOAD_ENVIRONMENT", stringify(*uninstall_params.load_environment))
+ .with_setenv("PALUDIS_LOAD_ENVIRONMENT", stringify(*uninstall_params[k::load_environment()]))
.with_setenv("PALUDIS_SKIP_INHERIT", "yes");
return result;
@@ -658,24 +665,24 @@ EbuildUninstallCommand::EbuildUninstallCommand(const EbuildCommandParams & p,
std::string
EbuildConfigCommand::commands() const
{
- return params.commands;
+ return params[k::commands()];
}
bool
EbuildConfigCommand::failure()
{
- throw ConfigActionError("Configure failed for '" + stringify(*params.package_id) + "'");
+ throw ConfigActionError("Configure failed for '" + stringify(*params[k::package_id()]) + "'");
}
Command
EbuildConfigCommand::extend_command(const Command & cmd)
{
Command result(Command(cmd)
- .with_setenv("ROOT", config_params.root));
+ .with_setenv("ROOT", config_params[k::root()]));
- if (config_params.load_environment)
+ if (config_params[k::load_environment()])
result
- .with_setenv("PALUDIS_LOAD_ENVIRONMENT", stringify(*config_params.load_environment))
+ .with_setenv("PALUDIS_LOAD_ENVIRONMENT", stringify(*config_params[k::load_environment()]))
.with_setenv("PALUDIS_SKIP_INHERIT", "yes");
return result;
@@ -700,13 +707,13 @@ WriteVDBEntryCommand::operator() ()
std::string ebuild_cmd(getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis") +
"/write_vdb_entry.bash '" +
- stringify(params.output_directory) + "' '" +
- stringify(params.environment_file) + "'");
+ stringify(params[k::output_directory()]) + "' '" +
+ stringify(params[k::environment_file()]) + "'");
- tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params.environment->syncers_dirs());
- tr1::shared_ptr<const FSEntrySequence> bashrc_files(params.environment->bashrc_files());
- tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params.environment->fetchers_dirs());
- tr1::shared_ptr<const FSEntrySequence> hook_dirs(params.environment->hook_dirs());
+ tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params[k::environment()]->syncers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> bashrc_files(params[k::environment()]->bashrc_files());
+ tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params[k::environment()]->fetchers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> hook_dirs(params[k::environment()]->hook_dirs());
Command cmd(Command(ebuild_cmd)
.with_setenv("PKGMANAGER", PALUDIS_PACKAGE "-" + stringify(PALUDIS_VERSION_MAJOR) + "." +
@@ -714,26 +721,26 @@ WriteVDBEntryCommand::operator() ()
stringify(PALUDIS_VERSION_MICRO) +
(std::string(PALUDIS_SUBVERSION_REVISION).empty() ?
std::string("") : "-r" + std::string(PALUDIS_SUBVERSION_REVISION)))
- .with_setenv("EAPI", stringify(params.package_id->eapi()->exported_name))
+ .with_setenv("EAPI", stringify((*params[k::package_id()]->eapi())[k::exported_name()]))
.with_setenv("PALUDIS_CONFIG_DIR", SYSCONFDIR "/paludis/")
.with_setenv("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "))
.with_setenv("PALUDIS_HOOK_DIRS", join(hook_dirs->begin(), hook_dirs->end(), " "))
.with_setenv("PALUDIS_FETCHERS_DIRS", join(fetchers_dirs->begin(), fetchers_dirs->end(), " "))
.with_setenv("PALUDIS_SYNCERS_DIRS", join(syncers_dirs->begin(), syncers_dirs->end(), " "))
- .with_setenv("PALUDIS_COMMAND", params.environment->paludis_command())
+ .with_setenv("PALUDIS_COMMAND", params[k::environment()]->paludis_command())
.with_setenv("PALUDIS_EBUILD_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
.with_setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
.with_setenv("PALUDIS_VDB_FROM_ENV_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->vdb_from_env_variables)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].vdb_from_env_variables)
.with_setenv("PALUDIS_VDB_FROM_ENV_UNLESS_EMPTY_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->vdb_from_env_unless_empty_variables)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].vdb_from_env_unless_empty_variables)
.with_setenv("PALUDIS_F_FUNCTION_PREFIX",
- params.package_id->eapi()->supported->ebuild_options->f_function_prefix)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].f_function_prefix)
.with_setenv("PALUDIS_IGNORE_PIVOT_ENV_FUNCTIONS",
- params.package_id->eapi()->supported->ebuild_options->ignore_pivot_env_functions)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].ignore_pivot_env_functions)
.with_setenv("PALUDIS_IGNORE_PIVOT_ENV_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->ignore_pivot_env_variables)
- .with_pipe_command_handler(tr1::bind(&pipe_command_handler, params.environment, params.package_id, _1))
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].ignore_pivot_env_variables)
+ .with_pipe_command_handler(tr1::bind(&pipe_command_handler, params[k::environment()], params[k::package_id()], _1))
);
if (0 != (run_command(cmd)))
@@ -752,7 +759,7 @@ VDBPostMergeCommand::operator() ()
return;
Command cmd(getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis") +
- "/utils/wrapped_ldconfig '" + stringify(params.root) + "'");
+ "/utils/wrapped_ldconfig '" + stringify(params[k::root()]) + "'");
if (0 != (run_command(cmd)))
throw InstallActionError("VDB Entry post merge commands failed");
@@ -761,7 +768,7 @@ VDBPostMergeCommand::operator() ()
std::string
EbuildPretendCommand::commands() const
{
- return params.commands;
+ return params[k::commands()];
}
bool
@@ -774,28 +781,30 @@ Command
EbuildPretendCommand::extend_command(const Command & cmd)
{
Command result(Command(cmd)
- .with_stdout_prefix(stringify(params.package_id->name().package) + "-" +
- stringify(params.package_id->version()) + "> ")
- .with_stderr_prefix(stringify(params.package_id->name().package) + "-" +
- stringify(params.package_id->version()) + "> ")
+ .with_stdout_prefix(stringify(params[k::package_id()]->name().package) + "-" +
+ stringify(params[k::package_id()]->version()) + "> ")
+ .with_stderr_prefix(stringify(params[k::package_id()]->name().package) + "-" +
+ stringify(params[k::package_id()]->version()) + "> ")
.with_prefix_discard_blank_output()
.with_prefix_blank_lines()
- .with_setenv("ROOT", pretend_params.root)
- .with_setenv("PALUDIS_PROFILE_DIR", stringify(*pretend_params.profiles->begin()))
- .with_setenv("PALUDIS_PROFILE_DIRS", join(pretend_params.profiles->begin(),
- pretend_params.profiles->end(), " ")));
-
- if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_use.empty())
- result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_use, pretend_params.use);
- if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_use_expand.empty())
- result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_use_expand, pretend_params.use_expand);
+ .with_setenv("ROOT", pretend_params[k::root()])
+ .with_setenv("PALUDIS_PROFILE_DIR", stringify(*pretend_params[k::profiles()]->begin()))
+ .with_setenv("PALUDIS_PROFILE_DIRS", join(pretend_params[k::profiles()]->begin(),
+ pretend_params[k::profiles()]->end(), " ")));
+
+ if (! (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use()].empty())
+ result.with_setenv((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use()],
+ pretend_params[k::use()]);
+ if (! (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use_expand()].empty())
+ result.with_setenv((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use_expand()],
+ pretend_params[k::use_expand()]);
for (Map<std::string, std::string>::ConstIterator
- i(pretend_params.expand_vars->begin()),
- j(pretend_params.expand_vars->end()) ; i != j ; ++i)
+ i(pretend_params[k::expand_vars()]->begin()),
+ j(pretend_params[k::expand_vars()]->end()) ; i != j ; ++i)
result.with_setenv(i->first, i->second);
- result.with_uid_gid(params.environment->reduced_uid(), params.environment->reduced_gid());
+ result.with_uid_gid(params[k::environment()]->reduced_uid(), params[k::environment()]->reduced_gid());
return result;
}
@@ -810,7 +819,7 @@ EbuildPretendCommand::EbuildPretendCommand(const EbuildCommandParams & p,
std::string
EbuildInfoCommand::commands() const
{
- return params.commands;
+ return params[k::commands()];
}
bool
@@ -823,9 +832,9 @@ Command
EbuildInfoCommand::extend_command(const Command & cmd)
{
std::string info_vars;
- if (info_params.info_vars.is_regular_file_or_symlink_to_regular_file())
+ if (info_params[k::info_vars()].is_regular_file_or_symlink_to_regular_file())
{
- LineConfigFile info_vars_f(info_params.info_vars, LineConfigFileOptions());
+ LineConfigFile info_vars_f(info_params[k::info_vars()], LineConfigFileOptions());
info_vars = join(info_vars_f.begin(), info_vars_f.end(), " ");
}
@@ -834,28 +843,30 @@ EbuildInfoCommand::extend_command(const Command & cmd)
.with_stderr_prefix(" ")
.with_prefix_discard_blank_output()
.with_prefix_blank_lines()
- .with_setenv("ROOT", info_params.root)
+ .with_setenv("ROOT", info_params[k::root()])
.with_setenv("PALUDIS_INFO_VARS", info_vars)
.with_setenv("PALUDIS_PROFILE_DIR",
- info_params.profiles->empty() ? std::string("") : stringify(*info_params.profiles->begin()))
- .with_setenv("PALUDIS_PROFILE_DIRS", join(info_params.profiles->begin(),
- info_params.profiles->end(), " ")));
+ info_params[k::profiles()]->empty() ? std::string("") : stringify(*info_params[k::profiles()]->begin()))
+ .with_setenv("PALUDIS_PROFILE_DIRS", join(info_params[k::profiles()]->begin(),
+ info_params[k::profiles()]->end(), " ")));
- if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_use.empty())
- result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_use, info_params.use);
- if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_use_expand.empty())
- result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_use_expand, info_params.use_expand);
+ if (! (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use()].empty())
+ result.with_setenv((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use()],
+ info_params[k::use()]);
+ if (! (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use_expand()].empty())
+ result.with_setenv((*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_use_expand()],
+ info_params[k::use_expand()]);
for (Map<std::string, std::string>::ConstIterator
- i(info_params.expand_vars->begin()),
- j(info_params.expand_vars->end()) ; i != j ; ++i)
+ i(info_params[k::expand_vars()]->begin()),
+ j(info_params[k::expand_vars()]->end()) ; i != j ; ++i)
result.with_setenv(i->first, i->second);
- result.with_uid_gid(params.environment->reduced_uid(), params.environment->reduced_gid());
+ result.with_uid_gid(params[k::environment()]->reduced_uid(), params[k::environment()]->reduced_gid());
- if (info_params.load_environment)
+ if (info_params[k::load_environment()])
result
- .with_setenv("PALUDIS_LOAD_ENVIRONMENT", stringify(*info_params.load_environment))
+ .with_setenv("PALUDIS_LOAD_ENVIRONMENT", stringify(*info_params[k::load_environment()]))
.with_setenv("PALUDIS_SKIP_INHERIT", "yes");
return result;
@@ -878,24 +889,25 @@ WriteBinaryEbuildCommand::operator() ()
{
using namespace tr1::placeholders;
- if (! EAPIData::get_instance()->eapi_from_string("pbin-1+" + params.package_id->eapi()->exported_name)->supported)
- throw InstallActionError("Don't know how to write binary ebuilds using EAPI 'pbin-1+" + params.package_id->eapi()->exported_name);
+ if (! (*EAPIData::get_instance()->eapi_from_string("pbin-1+" + (*params[k::package_id()]->eapi())[k::exported_name()]))[k::supported()])
+ throw InstallActionError("Don't know how to write binary ebuilds using EAPI 'pbin-1+" +
+ (*params[k::package_id()]->eapi())[k::exported_name()]);
- std::string bindistfile(stringify(params.destination_repository->name()) + "--" + stringify(params.package_id->name().category)
- + "--" + stringify(params.package_id->name().package) + "-" + stringify(params.package_id->version())
+ std::string bindistfile(stringify(params[k::destination_repository()]->name()) + "--" + stringify(params[k::package_id()]->name().category)
+ + "--" + stringify(params[k::package_id()]->name().package) + "-" + stringify(params[k::package_id()]->version())
+ "--" + cookie());
std::string ebuild_cmd(getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis") +
"/write_binary_ebuild.bash '" +
- stringify(params.binary_ebuild_location) + "' '" +
- stringify(params.binary_distdir / bindistfile) + "' '" +
- stringify(params.environment_file) + "' '" +
- stringify(params.image) + "'");
+ stringify(params[k::binary_ebuild_location()]) + "' '" +
+ stringify(params[k::binary_distdir()] / bindistfile) + "' '" +
+ stringify(params[k::environment_file()]) + "' '" +
+ stringify(params[k::image()]) + "'");
- tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params.environment->syncers_dirs());
- tr1::shared_ptr<const FSEntrySequence> bashrc_files(params.environment->bashrc_files());
- tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params.environment->fetchers_dirs());
- tr1::shared_ptr<const FSEntrySequence> hook_dirs(params.environment->hook_dirs());
+ tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params[k::environment()]->syncers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> bashrc_files(params[k::environment()]->bashrc_files());
+ tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params[k::environment()]->fetchers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> hook_dirs(params[k::environment()]->hook_dirs());
Command cmd(Command(ebuild_cmd)
.with_setenv("PKGMANAGER", PALUDIS_PACKAGE "-" + stringify(PALUDIS_VERSION_MAJOR) + "." +
@@ -903,31 +915,31 @@ WriteBinaryEbuildCommand::operator() ()
stringify(PALUDIS_VERSION_MICRO) +
(std::string(PALUDIS_SUBVERSION_REVISION).empty() ?
std::string("") : "-r" + std::string(PALUDIS_SUBVERSION_REVISION)))
- .with_setenv("EAPI", stringify(params.package_id->eapi()->exported_name))
+ .with_setenv("EAPI", stringify((*params[k::package_id()]->eapi())[k::exported_name()]))
.with_setenv("PALUDIS_CONFIG_DIR", SYSCONFDIR "/paludis/")
- .with_setenv("PALUDIS_TMPDIR", stringify(params.builddir))
+ .with_setenv("PALUDIS_TMPDIR", stringify(params[k::builddir()]))
.with_setenv("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "))
.with_setenv("PALUDIS_HOOK_DIRS", join(hook_dirs->begin(), hook_dirs->end(), " "))
.with_setenv("PALUDIS_FETCHERS_DIRS", join(fetchers_dirs->begin(), fetchers_dirs->end(), " "))
.with_setenv("PALUDIS_SYNCERS_DIRS", join(syncers_dirs->begin(), syncers_dirs->end(), " "))
- .with_setenv("PALUDIS_COMMAND", params.environment->paludis_command())
+ .with_setenv("PALUDIS_COMMAND", params[k::environment()]->paludis_command())
.with_setenv("PALUDIS_EBUILD_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
.with_setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
.with_setenv("PALUDIS_BINARY_FROM_ENV_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->binary_from_env_variables)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].binary_from_env_variables)
.with_setenv("PALUDIS_F_FUNCTION_PREFIX",
- params.package_id->eapi()->supported->ebuild_options->f_function_prefix)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].f_function_prefix)
.with_setenv("PALUDIS_IGNORE_PIVOT_ENV_FUNCTIONS",
- params.package_id->eapi()->supported->ebuild_options->ignore_pivot_env_functions)
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].ignore_pivot_env_functions)
.with_setenv("PALUDIS_IGNORE_PIVOT_ENV_VARIABLES",
- params.package_id->eapi()->supported->ebuild_options->ignore_pivot_env_variables)
- .with_setenv("PALUDIS_BINARY_URI_PREFIX", params.destination_repository->params().binary_uri_prefix)
- .with_setenv("PALUDIS_BINARY_KEYWORDS", params.destination_repository->params().binary_keywords)
- .with_setenv("PALUDIS_BINARY_KEYWORDS_VARIABLE", EAPIData::get_instance()->eapi_from_string("pbin-1+"
- + params.package_id->eapi()->exported_name)->supported->ebuild_metadata_variables->metadata_keywords)
- .with_setenv("PALUDIS_BINARY_DISTDIR_VARIABLE", EAPIData::get_instance()->eapi_from_string("pbin-1+"
- + params.package_id->eapi()->exported_name)->supported->ebuild_environment_variables->env_distdir)
- .with_pipe_command_handler(tr1::bind(&pipe_command_handler, params.environment, params.package_id, _1))
+ (*(*params[k::package_id()]->eapi())[k::supported()])[k::ebuild_options()].ignore_pivot_env_variables)
+ .with_setenv("PALUDIS_BINARY_URI_PREFIX", params[k::destination_repository()]->params().binary_uri_prefix)
+ .with_setenv("PALUDIS_BINARY_KEYWORDS", params[k::destination_repository()]->params().binary_keywords)
+ .with_setenv("PALUDIS_BINARY_KEYWORDS_VARIABLE", (*(*EAPIData::get_instance()->eapi_from_string("pbin-1+"
+ + (*params[k::package_id()]->eapi())[k::exported_name()]))[k::supported()])[k::ebuild_metadata_variables()].metadata_keywords)
+ .with_setenv("PALUDIS_BINARY_DISTDIR_VARIABLE", (*(*EAPIData::get_instance()->eapi_from_string("pbin-1+"
+ + (*params[k::package_id()]->eapi())[k::exported_name()]))[k::supported()])[k::ebuild_environment_variables()][k::env_distdir()])
+ .with_pipe_command_handler(tr1::bind(&pipe_command_handler, params[k::environment()], params[k::package_id()], _1))
);
if (0 != (run_command(cmd)))
diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh
index 44d070e..012f9cc 100644
--- a/paludis/repositories/e/ebuild.hh
+++ b/paludis/repositories/e/ebuild.hh
@@ -24,6 +24,8 @@
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/map-fwd.hh>
+#include <paludis/util/kc.hh>
+#include <paludis/util/keys.hh>
#include <paludis/package_database.hh>
#include <paludis/action-fwd.hh>
#include <paludis/merger-fwd.hh>
@@ -46,7 +48,171 @@ namespace paludis
class EbuildID;
class ERepositoryID;
-#include <paludis/repositories/e/ebuild-sr.hh>
+ /**
+ * Parameters for an EbuildCommand.
+ *
+ * \see EbuildCommand
+ * \ingroup grpebuildinterface
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::environment, const Environment *>,
+ kc::Field<k::package_id, tr1::shared_ptr<const erepository::ERepositoryID> >,
+ kc::Field<k::ebuild_dir, FSEntry>,
+ kc::Field<k::ebuild_file, FSEntry>,
+ kc::Field<k::files_dir, FSEntry>,
+ kc::Field<k::eclassdirs, tr1::shared_ptr<const FSEntrySequence> >,
+ kc::Field<k::exlibsdirs, tr1::shared_ptr<const FSEntrySequence> >,
+ kc::Field<k::portdir, FSEntry>,
+ kc::Field<k::distdir, FSEntry>,
+ kc::Field<k::builddir, FSEntry>,
+ kc::Field<k::userpriv, bool>,
+ kc::Field<k::sandbox, bool>,
+ kc::Field<k::commands, std::string>
+ > EbuildCommandParams;
+
+ /**
+ * Parameters for an EbuildNoFetchCommand.
+ *
+ * \see EbuildNoFetchCommand
+ * \ingroup grpebuildinterface
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::a, std::string>,
+ kc::Field<k::aa, std::string>,
+ kc::Field<k::use, std::string>,
+ kc::Field<k::use_expand, std::string>,
+ kc::Field<k::root, std::string>,
+ kc::Field<k::profiles, tr1::shared_ptr<const FSEntrySequence> >,
+ kc::Field<k::expand_vars, tr1::shared_ptr<const Map<std::string, std::string> > >
+ > EbuildNoFetchCommandParams;
+
+ /**
+ * Parameters for an EbuildInstallCommand.
+ *
+ * \see EbuildInstallCommand
+ * \ingroup grpebuildinterface
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::a, std::string>,
+ kc::Field<k::aa, std::string>,
+ kc::Field<k::use, std::string>,
+ kc::Field<k::use_expand, std::string>,
+ kc::Field<k::root, std::string>,
+ kc::Field<k::profiles, tr1::shared_ptr<const FSEntrySequence> >,
+ kc::Field<k::expand_vars, tr1::shared_ptr<const Map<std::string, std::string> > >,
+ kc::Field<k::disable_cfgpro, bool>,
+ kc::Field<k::debug_build, InstallActionDebugOption>,
+ kc::Field<k::slot, SlotName>,
+ kc::Field<k::config_protect, std::string>,
+ kc::Field<k::config_protect_mask, std::string>,
+ kc::Field<k::loadsaveenv_dir, FSEntry>
+ > EbuildInstallCommandParams;
+
+ /**
+ * Parameters for an EbuildPretendCommand.
+ *
+ * \see EbuildPretendCommand
+ * \ingroup grpebuildinterface
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::use, std::string>,
+ kc::Field<k::use_expand, std::string>,
+ kc::Field<k::root, std::string>,
+ kc::Field<k::profiles, tr1::shared_ptr<const FSEntrySequence> >,
+ kc::Field<k::expand_vars, tr1::shared_ptr<const Map<std::string, std::string> > >
+ > EbuildPretendCommandParams;
+
+ /**
+ * Parameters for an EbuildUninstallCommand.
+ *
+ * \see EbuildUninstallCommand
+ * \ingroup grpebuildinterface
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::root, std::string>,
+ kc::Field<k::disable_cfgpro, bool>,
+ kc::Field<k::unmerge_only, bool>,
+ kc::Field<k::load_environment, const FSEntry *>,
+ kc::Field<k::loadsaveenv_dir, FSEntry>
+ > EbuildUninstallCommandParams;
+
+ /**
+ * Parameters for an EbuildConfigCommand.
+ *
+ * \see EbuildConfigCommand
+ * \ingroup grpebuildinterface
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::root, std::string>,
+ kc::Field<k::load_environment, const FSEntry *>
+ > EbuildConfigCommandParams;
+
+ /**
+ * Parameters for an EbuildInfoCommand.
+ *
+ * \see EbuildInfoCommand
+ * \ingroup grpebuildinterface
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::use, std::string>,
+ kc::Field<k::use_expand, std::string>,
+ kc::Field<k::root, std::string>,
+ kc::Field<k::profiles, tr1::shared_ptr<const FSEntrySequence> >,
+ kc::Field<k::expand_vars, tr1::shared_ptr<const Map<std::string, std::string> > >,
+ kc::Field<k::load_environment, const FSEntry *>,
+ kc::Field<k::info_vars, FSEntry>
+ > EbuildInfoCommandParams;
+
+ /**
+ * Parameters for writing a VDB entry.
+ *
+ * \see WriteVDBEntryCommand
+ * \ingroup grpebuildinterface
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::environment, const Environment *>,
+ kc::Field<k::package_id, tr1::shared_ptr<const erepository::ERepositoryID> >,
+ kc::Field<k::output_directory, FSEntry>,
+ kc::Field<k::environment_file, FSEntry>
+ > WriteVDBEntryParams;
+
+ /**
+ * Parameters for writing a binary ebuild.
+ *
+ * \see WriteBinaryEbuildCommand
+ * \ingroup grpebuildinterface
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::environment, const Environment *>,
+ kc::Field<k::destination_repository, const ERepository *>,
+ kc::Field<k::package_id, tr1::shared_ptr<const erepository::ERepositoryID> >,
+ kc::Field<k::binary_ebuild_location, FSEntry>,
+ kc::Field<k::binary_distdir, FSEntry>,
+ kc::Field<k::environment_file, FSEntry>,
+ kc::Field<k::image, FSEntry>,
+ kc::Field<k::merger_options, MergerOptions>,
+ kc::Field<k::builddir, FSEntry>
+ > WriteBinaryEbuildCommandParams;
+
+ /**
+ * Parameters for a VDBPostMergeCommand.
+ *
+ * \see VDBPostMergeCommand
+ * \ingroup grpebuildinterface
+ * \nosubgrouping
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::root, FSEntry>
+ > VDBPostMergeCommandParams;
/**
* An EbuildCommand is the base class from which specific ebuild
diff --git a/paludis/repositories/e/ebuild.sr b/paludis/repositories/e/ebuild.sr
deleted file mode 100644
index 6f7b216..0000000
--- a/paludis/repositories/e/ebuild.sr
+++ /dev/null
@@ -1,229 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-make_class_EbuildCommandParams()
-{
- key environment "const Environment *"
- key package_id "tr1::shared_ptr<const erepository::ERepositoryID>"
- key ebuild_dir FSEntry
- key ebuild_file FSEntry
- key files_dir FSEntry
- key eclassdirs "tr1::shared_ptr<const FSEntrySequence>"
- key exlibsdirs "tr1::shared_ptr<const FSEntrySequence>"
- key portdir FSEntry
- key distdir FSEntry
- key builddir FSEntry
- key userpriv bool
- key sandbox bool
- key commands std::string
-
- doxygen_comment << "END"
- /**
- * Parameters for an EbuildCommand.
- *
- * \see EbuildCommand
- * \ingroup grpebuildinterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
-make_class_EbuildNoFetchCommandParams()
-{
- key a std::string
- key aa std::string
- key use std::string
- key use_expand std::string
- key root std::string
- key profiles "tr1::shared_ptr<const FSEntrySequence>"
- key expand_vars "tr1::shared_ptr<const Map<std::string, std::string> >"
-
- doxygen_comment << "END"
- /**
- * Parameters for an EbuildNoFetchCommand.
- *
- * \see EbuildNoFetchCommand
- * \ingroup grpebuildinterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
-make_class_EbuildInstallCommandParams()
-{
- key a std::string
- key aa std::string
- key use std::string
- key use_expand std::string
- key root std::string
- key profiles "tr1::shared_ptr<const FSEntrySequence>"
- key expand_vars "tr1::shared_ptr<const Map<std::string, std::string> >"
- key disable_cfgpro bool
- key debug_build InstallActionDebugOption
- key slot SlotName
- key config_protect std::string
- key config_protect_mask std::string
- key loadsaveenv_dir FSEntry
-
- doxygen_comment << "END"
- /**
- * Parameters for an EbuildInstallCommand.
- *
- * \see EbuildInstallCommand
- * \ingroup grpebuildinterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
-make_class_EbuildPretendCommandParams()
-{
- key use std::string
- key use_expand std::string
- key root std::string
- key profiles "tr1::shared_ptr<const FSEntrySequence>"
- key expand_vars "tr1::shared_ptr<const Map<std::string, std::string> >"
-
- doxygen_comment << "END"
- /**
- * Parameters for an EbuildPretendCommand.
- *
- * \see EbuildPretendCommand
- * \ingroup grpebuildinterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
-make_class_EbuildUninstallCommandParams()
-{
- key root std::string
- key disable_cfgpro bool
- key unmerge_only bool
- key load_environment "const FSEntry *"
- key loadsaveenv_dir FSEntry
-
- doxygen_comment << "END"
- /**
- * Parameters for an EbuildUninstallCommand.
- *
- * \see EbuildUninstallCommand
- * \ingroup grpebuildinterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
-make_class_EbuildConfigCommandParams()
-{
- key root std::string
- key load_environment "const FSEntry *"
-
- doxygen_comment << "END"
- /**
- * Parameters for an EbuildConfigCommand.
- *
- * \see EbuildConfigCommand
- * \ingroup grpebuildinterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
-make_class_EbuildInfoCommandParams()
-{
- key use std::string
- key use_expand std::string
- key root std::string
- key profiles "tr1::shared_ptr<const FSEntrySequence>"
- key expand_vars "tr1::shared_ptr<const Map<std::string, std::string> >"
- key load_environment "const FSEntry *"
- key info_vars "FSEntry"
-
- doxygen_comment << "END"
- /**
- * Parameters for an EbuildInfoCommand.
- *
- * \see EbuildInfoCommand
- * \ingroup grpebuildinterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
-make_class_WriteVDBEntryParams()
-{
- key environment "const Environment *"
- key package_id "tr1::shared_ptr<const erepository::ERepositoryID>"
- key output_directory "FSEntry"
- key environment_file "FSEntry"
-
- doxygen_comment << "END"
- /**
- * Parameters for writing a VDB entry.
- *
- * \see WriteVDBEntryCommand
- * \ingroup grpebuildinterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
-make_class_WriteBinaryEbuildCommandParams()
-{
- key environment "const Environment *"
- key destination_repository "const ERepository *"
- key package_id "tr1::shared_ptr<const erepository::ERepositoryID>"
- key binary_ebuild_location "FSEntry"
- key binary_distdir "FSEntry"
- key environment_file "FSEntry"
- key image "FSEntry"
- key merger_options "MergerOptions"
- key builddir FSEntry
-
- doxygen_comment << "END"
- /**
- * Parameters for writing a binary ebuild.
- *
- * \see WriteBinaryEbuildCommand
- * \ingroup grpebuildinterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
-make_class_VDBPostMergeCommandParams()
-{
- key root "FSEntry"
-
- doxygen_comment << "END"
- /**
- * Parameters for a VDBPostMergeCommand.
- *
- * \see VDBPostMergeCommand
- * \ingroup grpebuildinterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index edef803..a571427 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -226,6 +226,7 @@ export REAL_CHOST="${CHOST}"
ebuild_scrub_environment()
{
+ local save_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
(
ebuild_safe_source "${1}" PATH PALUDIS_SOURCE_MERGED_VARIABLES \
PALUDIS_BRACKET_MERGED_VARIABLES || exit 1
@@ -275,7 +276,7 @@ ebuild_scrub_environment()
done )
set >"${1}"
- print_exports >>"${1}"
+ LD_LIBRARY_PATH="${save_LD_LIBRARY_PATH}" print_exports >>"${1}"
)
}
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index e752218..d21550a 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -195,9 +195,9 @@ namespace
if (env->query_use(i->flag, id))
use += stringify(i->flag) + " ";
- if (id.eapi()->supported)
- if (! id.eapi()->supported->ebuild_environment_variables->env_arch.empty())
- use += profile->environment_variable(id.eapi()->supported->ebuild_environment_variables->env_arch) + " ";
+ if ((*id.eapi())[k::supported()])
+ if (! (*(*id.eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_arch()].empty())
+ use += profile->environment_variable((*(*id.eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_arch()]) + " ";
return use;
}
@@ -238,7 +238,7 @@ namespace
if (! env->query_use(UseFlagName(lower_x + expand_sep + stringify(*u)), e))
continue;
- if (! e.eapi()->supported->ebuild_options->require_use_expand_in_iuse)
+ if (! (*(*e.eapi())[k::supported()])[k::ebuild_options()].require_use_expand_in_iuse)
use.append(lower_x + expand_sep + stringify(*u) + " ");
std::string value;
@@ -275,9 +275,9 @@ EbuildEntries::fetch(const tr1::shared_ptr<const ERepositoryID> & id,
for (DepSpecFlattener<RestrictSpecTree, PlainTextDepSpec>::ConstIterator i(restricts.begin()), i_end(restricts.end()) ;
i != i_end ; ++i)
- if (id->eapi()->supported->ebuild_options->restrict_fetch->end() !=
- std::find(id->eapi()->supported->ebuild_options->restrict_fetch->begin(),
- id->eapi()->supported->ebuild_options->restrict_fetch->end(), (*i)->text()))
+ if ((*(*id->eapi())[k::supported()])[k::ebuild_options()].restrict_fetch->end() !=
+ std::find((*(*id->eapi())[k::supported()])[k::ebuild_options()].restrict_fetch->begin(),
+ (*(*id->eapi())[k::supported()])[k::ebuild_options()].restrict_fetch->end(), (*i)->text()))
fetch_restrict = true;
}
@@ -330,7 +330,7 @@ EbuildEntries::fetch(const tr1::shared_ptr<const ERepositoryID> & id,
}
/* make AA */
- if (! id->eapi()->supported->ebuild_environment_variables->env_aa.empty())
+ if (! (*(*id->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_aa()].empty())
{
AAVisitor g;
if (id->fetches_key())
@@ -375,41 +375,41 @@ EbuildEntries::fetch(const tr1::shared_ptr<const ERepositoryID> & id,
if (c.need_nofetch())
{
std::string use(make_use(_imp->params.environment, *id, p));
- std::string expand_sep(stringify(id->eapi()->supported->ebuild_options->use_expand_separator));
+ std::string expand_sep(stringify((*(*id->eapi())[k::supported()])[k::ebuild_options()].use_expand_separator));
tr1::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment, *id, p, use, expand_sep));
tr1::shared_ptr<const FSEntrySequence> exlibsdirs(_imp->e_repository->layout()->exlibsdirs(id->name()));
- EAPIPhases phases(id->eapi()->supported->ebuild_phases->ebuild_nofetch);
+ EAPIPhases phases((*(*id->eapi())[k::supported()])[k::ebuild_phases()].ebuild_nofetch);
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
phase != phase_end ; ++phase)
{
- EbuildCommandParams command_params(EbuildCommandParams::create()
- .environment(_imp->params.environment)
- .package_id(id)
- .ebuild_dir(_imp->e_repository->layout()->package_directory(id->name()))
- .ebuild_file(_imp->e_repository->layout()->package_file(*id))
- .files_dir(_imp->e_repository->layout()->package_directory(id->name()) / "files")
- .eclassdirs(_imp->params.eclassdirs)
- .exlibsdirs(exlibsdirs)
- .portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
- _imp->params.location)
- .distdir(_imp->params.distdir)
- .userpriv(phase->option("userpriv"))
- .sandbox(phase->option("sandbox"))
- .commands(join(phase->begin_commands(), phase->end_commands(), " "))
- .builddir(_imp->params.builddir));
+ EbuildCommandParams command_params(EbuildCommandParams::named_create()
+ (k::environment(), _imp->params.environment)
+ (k::package_id(), id)
+ (k::ebuild_dir(), _imp->e_repository->layout()->package_directory(id->name()))
+ (k::ebuild_file(), _imp->e_repository->layout()->package_file(*id))
+ (k::files_dir(), _imp->e_repository->layout()->package_directory(id->name()) / "files")
+ (k::eclassdirs(), _imp->params.eclassdirs)
+ (k::exlibsdirs(), exlibsdirs)
+ (k::portdir(), _imp->params.master_repository ? _imp->params.master_repository->params().location :
+ _imp->params.location)
+ (k::distdir(), _imp->params.distdir)
+ (k::userpriv(), phase->option("userpriv"))
+ (k::sandbox(), phase->option("sandbox"))
+ (k::commands(), join(phase->begin_commands(), phase->end_commands(), " "))
+ (k::builddir(), _imp->params.builddir));
EbuildNoFetchCommand nofetch_cmd(command_params,
- EbuildNoFetchCommandParams::create()
- .a(archives)
- .aa(all_archives)
- .use(use)
- .use_expand(join(p->begin_use_expand(), p->end_use_expand(), " "))
- .expand_vars(expand_vars)
- .root("/")
- .profiles(_imp->params.profiles));
+ EbuildNoFetchCommandParams::named_create()
+ (k::a(), archives)
+ (k::aa(), all_archives)
+ (k::use(), use)
+ (k::use_expand(), join(p->begin_use_expand(), p->end_use_expand(), " "))
+ (k::expand_vars(), expand_vars)
+ (k::root(), "/")
+ (k::profiles(), _imp->params.profiles));
if (! nofetch_cmd())
throw FetchActionError("Fetch of '" + stringify(*id) + "' failed", c.failures());
@@ -464,7 +464,7 @@ EbuildEntries::install(const tr1::shared_ptr<const ERepositoryID> & id,
}
/* make AA */
- if (! id->eapi()->supported->ebuild_environment_variables->env_aa.empty())
+ if (! (*(*id->eapi())[k::supported()])[k::ebuild_environment_variables()][k::env_aa()].empty())
{
AAVisitor g;
if (id->fetches_key())
@@ -497,7 +497,7 @@ EbuildEntries::install(const tr1::shared_ptr<const ERepositoryID> & id,
/* add expand to use (iuse isn't reliable for use_expand things), and make the expand
* environment variables */
- std::string expand_sep(stringify(id->eapi()->supported->ebuild_options->use_expand_separator));
+ std::string expand_sep(stringify((*(*id->eapi())[k::supported()])[k::ebuild_options()].use_expand_separator));
tr1::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment, *id, p, use, expand_sep));
@@ -529,7 +529,7 @@ EbuildEntries::install(const tr1::shared_ptr<const ERepositoryID> & id,
}
}
- EAPIPhases phases(id->eapi()->supported->ebuild_phases->ebuild_install);
+ EAPIPhases phases((*(*id->eapi())[k::supported()])[k::ebuild_phases()].ebuild_install);
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
phase != phase_end ; ++phase)
{
@@ -547,7 +547,7 @@ EbuildEntries::install(const tr1::shared_ptr<const ERepositoryID> & id,
+ stringify(id->version())) / "image")
(k::environment_file(), _imp->params.builddir / stringify(id->name().category) / (stringify(id->name().package) + "-"
+ stringify(id->version())) / "temp" / "loadsaveenv")
- (k::options(), id->eapi()->supported->merger_options)
+ (k::options(), (*(*id->eapi())[k::supported()])[k::merger_options()])
);
}
else if ((! phase->option("prepost")) ||
@@ -578,38 +578,39 @@ EbuildEntries::install(const tr1::shared_ptr<const ERepositoryID> & id,
}
}
- EbuildCommandParams command_params(EbuildCommandParams::create()
- .environment(_imp->params.environment)
- .package_id(id)
- .ebuild_dir(_imp->e_repository->layout()->package_directory(id->name()))
- .ebuild_file(_imp->e_repository->layout()->package_file(*id))
- .files_dir(_imp->e_repository->layout()->package_directory(id->name()) / "files")
- .eclassdirs(_imp->params.eclassdirs)
- .exlibsdirs(exlibsdirs)
- .portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
- _imp->params.location)
- .distdir(_imp->params.distdir)
- .commands(join(phase->begin_commands(), phase->end_commands(), " "))
- .sandbox(phase->option("sandbox"))
- .userpriv(phase->option("userpriv") && userpriv_ok)
- .builddir(_imp->params.builddir));
+ EbuildCommandParams command_params(EbuildCommandParams::named_create()
+ (k::environment(), _imp->params.environment)
+ (k::package_id(), id)
+ (k::ebuild_dir(), _imp->e_repository->layout()->package_directory(id->name()))
+ (k::ebuild_file(), _imp->e_repository->layout()->package_file(*id))
+ (k::files_dir(), _imp->e_repository->layout()->package_directory(id->name()) / "files")
+ (k::eclassdirs(), _imp->params.eclassdirs)
+ (k::exlibsdirs(), exlibsdirs)
+ (k::portdir(), _imp->params.master_repository ? _imp->params.master_repository->params().location :
+ _imp->params.location)
+ (k::distdir(), _imp->params.distdir)
+ (k::commands(), join(phase->begin_commands(), phase->end_commands(), " "))
+ (k::sandbox(), phase->option("sandbox"))
+ (k::userpriv(), phase->option("userpriv") && userpriv_ok)
+ (k::builddir(), _imp->params.builddir));
EbuildInstallCommandParams install_params(
- EbuildInstallCommandParams::create()
- .use(use)
- .a(archives)
- .aa(all_archives)
- .use_expand(join(p->begin_use_expand(), p->end_use_expand(), " "))
- .expand_vars(expand_vars)
- .root(o[k::destination()]->installed_root_key() ? stringify(o[k::destination()]->installed_root_key()->value()) : "/")
- .profiles(_imp->params.profiles)
- .disable_cfgpro(o[k::no_config_protect()])
- .debug_build(o[k::debug_build()])
- .config_protect(_imp->e_repository->profile_variable("CONFIG_PROTECT"))
- .config_protect_mask(_imp->e_repository->profile_variable("CONFIG_PROTECT_MASK"))
- .loadsaveenv_dir(_imp->params.builddir / stringify(id->name().category) / (
- stringify(id->name().package) + "-" + stringify(id->version())) / "temp")
- .slot(SlotName(id->slot())));
+ EbuildInstallCommandParams::named_create()
+ (k::use(), use)
+ (k::a(), archives)
+ (k::aa(), all_archives)
+ (k::use_expand(), join(p->begin_use_expand(), p->end_use_expand(), " "))
+ (k::expand_vars(), expand_vars)
+ (k::root(), o[k::destination()]->installed_root_key() ?
+ stringify(o[k::destination()]->installed_root_key()->value()) : "/")
+ (k::profiles(), _imp->params.profiles)
+ (k::disable_cfgpro(), o[k::no_config_protect()])
+ (k::debug_build(), o[k::debug_build()])
+ (k::config_protect(), _imp->e_repository->profile_variable("CONFIG_PROTECT"))
+ (k::config_protect_mask(), _imp->e_repository->profile_variable("CONFIG_PROTECT_MASK"))
+ (k::loadsaveenv_dir(), _imp->params.builddir / stringify(id->name().category) / (
+ stringify(id->name().package) + "-" + stringify(id->version())) / "temp")
+ (k::slot(), SlotName(id->slot())));
EbuildInstallCommand cmd(command_params, install_params);
cmd();
@@ -630,34 +631,34 @@ EbuildEntries::info(const tr1::shared_ptr<const ERepositoryID> & id,
/* add expand to use (iuse isn't reliable for use_expand things), and make the expand
* environment variables */
- std::string expand_sep(stringify(id->eapi()->supported->ebuild_options->use_expand_separator));
+ std::string expand_sep(stringify((*(*id->eapi())[k::supported()])[k::ebuild_options()].use_expand_separator));
tr1::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment, *id, p, use, expand_sep));
tr1::shared_ptr<const FSEntrySequence> exlibsdirs(_imp->e_repository->layout()->exlibsdirs(id->name()));
- EAPIPhases phases(id->eapi()->supported->ebuild_phases->ebuild_info);
+ EAPIPhases phases((*(*id->eapi())[k::supported()])[k::ebuild_phases()].ebuild_info);
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
phase != phase_end ; ++phase)
{
if (phase->option("installed=true"))
continue;
- EbuildCommandParams command_params(EbuildCommandParams::create()
- .environment(_imp->params.environment)
- .package_id(id)
- .ebuild_dir(_imp->e_repository->layout()->package_directory(id->name()))
- .ebuild_file(_imp->e_repository->layout()->package_file(*id))
- .files_dir(_imp->e_repository->layout()->package_directory(id->name()) / "files")
- .eclassdirs(_imp->params.eclassdirs)
- .exlibsdirs(exlibsdirs)
- .portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
- _imp->params.location)
- .distdir(_imp->params.distdir)
- .commands(join(phase->begin_commands(), phase->end_commands(), " "))
- .sandbox(phase->option("sandbox"))
- .userpriv(phase->option("userpriv"))
- .builddir(_imp->params.builddir));
+ EbuildCommandParams command_params(EbuildCommandParams::named_create()
+ (k::environment(), _imp->params.environment)
+ (k::package_id(), id)
+ (k::ebuild_dir(), _imp->e_repository->layout()->package_directory(id->name()))
+ (k::ebuild_file(), _imp->e_repository->layout()->package_file(*id))
+ (k::files_dir(), _imp->e_repository->layout()->package_directory(id->name()) / "files")
+ (k::eclassdirs(), _imp->params.eclassdirs)
+ (k::exlibsdirs(), exlibsdirs)
+ (k::portdir(), _imp->params.master_repository ? _imp->params.master_repository->params().location :
+ _imp->params.location)
+ (k::distdir(), _imp->params.distdir)
+ (k::commands(), join(phase->begin_commands(), phase->end_commands(), " "))
+ (k::sandbox(), phase->option("sandbox"))
+ (k::userpriv(), phase->option("userpriv"))
+ (k::builddir(), _imp->params.builddir));
FSEntry i(_imp->e_repository->layout()->info_variables_file(
_imp->e_repository->params().location / "profiles"));
@@ -667,14 +668,14 @@ EbuildEntries::info(const tr1::shared_ptr<const ERepositoryID> & id,
_imp->e_repository->params().master_repository->params().location / "profiles");
EbuildInfoCommandParams info_params(
- EbuildInfoCommandParams::create()
- .use(use)
- .use_expand(join(p->begin_use_expand(), p->end_use_expand(), " "))
- .expand_vars(expand_vars)
- .root(stringify(_imp->params.environment->root()))
- .profiles(_imp->params.profiles)
- .load_environment(0)
- .info_vars(i)
+ EbuildInfoCommandParams::named_create()
+ (k::use(), use)
+ (k::use_expand(), join(p->begin_use_expand(), p->end_use_expand(), " "))
+ (k::expand_vars(), expand_vars)
+ (k::root(), stringify(_imp->params.environment->root()))
+ (k::profiles(), _imp->params.profiles)
+ (k::load_environment(), static_cast<const FSEntry *>(0))
+ (k::info_vars(), i)
);
EbuildInfoCommand cmd(command_params, info_params);
@@ -686,30 +687,30 @@ std::string
EbuildEntries::get_environment_variable(const tr1::shared_ptr<const ERepositoryID> & id,
const std::string & var, tr1::shared_ptr<const ERepositoryProfile>) const
{
- EAPIPhases phases(id->eapi()->supported->ebuild_phases->ebuild_variable);
+ EAPIPhases phases((*(*id->eapi())[k::supported()])[k::ebuild_phases()].ebuild_variable);
int c(std::distance(phases.begin_phases(), phases.end_phases()));
if (1 != c)
- throw EAPIConfigurationError("EAPI '" + id->eapi()->name + "' defines "
+ throw EAPIConfigurationError("EAPI '" + (*id->eapi())[k::name()] + "' defines "
+ (c == 0 ? "no" : stringify(c)) + " ebuild variable phases but expected exactly one");
tr1::shared_ptr<const FSEntrySequence> exlibsdirs(_imp->e_repository->layout()->exlibsdirs(id->name()));
- EbuildVariableCommand cmd(EbuildCommandParams::create()
- .environment(_imp->params.environment)
- .package_id(id)
- .ebuild_dir(_imp->e_repository->layout()->package_directory(id->name()))
- .ebuild_file(_imp->e_repository->layout()->package_file(*id))
- .files_dir(_imp->e_repository->layout()->package_directory(id->name()) / "files")
- .eclassdirs(_imp->params.eclassdirs)
- .exlibsdirs(exlibsdirs)
- .portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
- _imp->params.location)
- .distdir(_imp->params.distdir)
- .sandbox(phases.begin_phases()->option("sandbox"))
- .userpriv(phases.begin_phases()->option("userpriv"))
- .commands(join(phases.begin_phases()->begin_commands(), phases.begin_phases()->end_commands(), " "))
- .builddir(_imp->params.builddir),
+ EbuildVariableCommand cmd(EbuildCommandParams::named_create()
+ (k::environment(), _imp->params.environment)
+ (k::package_id(), id)
+ (k::ebuild_dir(), _imp->e_repository->layout()->package_directory(id->name()))
+ (k::ebuild_file(), _imp->e_repository->layout()->package_file(*id))
+ (k::files_dir(), _imp->e_repository->layout()->package_directory(id->name()) / "files")
+ (k::eclassdirs(), _imp->params.eclassdirs)
+ (k::exlibsdirs(), exlibsdirs)
+ (k::portdir(), _imp->params.master_repository ? _imp->params.master_repository->params().location :
+ _imp->params.location)
+ (k::distdir(), _imp->params.distdir)
+ (k::sandbox(), phases.begin_phases()->option("sandbox"))
+ (k::userpriv(), phases.begin_phases()->option("userpriv"))
+ (k::commands(), join(phases.begin_phases()->begin_commands(), phases.begin_phases()->end_commands(), " "))
+ (k::builddir(), _imp->params.builddir),
var);
@@ -737,23 +738,24 @@ EbuildEntries::merge(const MergeParams & m)
FSEntry binary_ebuild_location(_imp->e_repository->layout()->binary_ebuild_location(
m[k::package_id()]->name(), m[k::package_id()]->version(),
- "pbin-1+" + tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()])->eapi()->name));
+ "pbin-1+" + (*tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()])->eapi())[k::name()]));
binary_ebuild_location.dirname().dirname().mkdir();
binary_ebuild_location.dirname().mkdir();
WriteBinaryEbuildCommand write_binary_ebuild_command(
- WriteBinaryEbuildCommandParams::create()
- .environment(_imp->params.environment)
- .package_id(tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()]))
- .binary_ebuild_location(binary_ebuild_location)
- .binary_distdir(_imp->params.binary_distdir)
- .environment_file(m[k::environment_file()])
- .image(m[k::image_dir()])
- .destination_repository(_imp->e_repository)
- .builddir(_imp->params.builddir)
- .merger_options(tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()])
- ->eapi()->supported->merger_options));
+ WriteBinaryEbuildCommandParams::named_create()
+ (k::environment(), _imp->params.environment)
+ (k::package_id(), tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()]))
+ (k::binary_ebuild_location(), binary_ebuild_location)
+ (k::binary_distdir(), _imp->params.binary_distdir)
+ (k::environment_file(), m[k::environment_file()])
+ (k::image(), m[k::image_dir()])
+ (k::destination_repository(), _imp->e_repository)
+ (k::builddir(), _imp->params.builddir)
+ (k::merger_options(), (*(*tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()])->eapi())[k::supported()])
+ [k::merger_options()])
+ );
write_binary_ebuild_command();
}
@@ -791,45 +793,45 @@ EbuildEntries::pretend(const tr1::shared_ptr<const ERepositoryID> & id,
Context context("When running pretend for '" + stringify(*id) + "':");
- if (! id->eapi()->supported)
+ if (! (*id->eapi())[k::supported()])
return true;
- if (id->eapi()->supported->ebuild_phases->ebuild_pretend.empty())
+ if ((*(*id->eapi())[k::supported()])[k::ebuild_phases()].ebuild_pretend.empty())
return true;
std::string use(make_use(_imp->params.environment, *id, p));
- std::string expand_sep(stringify(id->eapi()->supported->ebuild_options->use_expand_separator));
+ std::string expand_sep(stringify((*(*id->eapi())[k::supported()])[k::ebuild_options()].use_expand_separator));
tr1::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment, *id, p, use, expand_sep));
tr1::shared_ptr<const FSEntrySequence> exlibsdirs(_imp->e_repository->layout()->exlibsdirs(id->name()));
- EAPIPhases phases(id->eapi()->supported->ebuild_phases->ebuild_pretend);
+ EAPIPhases phases((*(*id->eapi())[k::supported()])[k::ebuild_phases()].ebuild_pretend);
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
phase != phase_end ; ++phase)
{
- EbuildCommandParams command_params(EbuildCommandParams::create()
- .environment(_imp->params.environment)
- .package_id(id)
- .ebuild_dir(_imp->e_repository->layout()->package_directory(id->name()))
- .ebuild_file(_imp->e_repository->layout()->package_file(*id))
- .files_dir(_imp->e_repository->layout()->package_directory(id->name()) / "files")
- .eclassdirs(_imp->params.eclassdirs)
- .exlibsdirs(exlibsdirs)
- .portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
- _imp->params.location)
- .distdir(_imp->params.distdir)
- .userpriv(phase->option("userpriv"))
- .sandbox(phase->option("sandbox"))
- .commands(join(phase->begin_commands(), phase->end_commands(), " "))
- .builddir(_imp->params.builddir));
+ EbuildCommandParams command_params(EbuildCommandParams::named_create()
+ (k::environment(), _imp->params.environment)
+ (k::package_id(), id)
+ (k::ebuild_dir(), _imp->e_repository->layout()->package_directory(id->name()))
+ (k::ebuild_file(), _imp->e_repository->layout()->package_file(*id))
+ (k::files_dir(), _imp->e_repository->layout()->package_directory(id->name()) / "files")
+ (k::eclassdirs(), _imp->params.eclassdirs)
+ (k::exlibsdirs(), exlibsdirs)
+ (k::portdir(), _imp->params.master_repository ? _imp->params.master_repository->params().location :
+ _imp->params.location)
+ (k::distdir(), _imp->params.distdir)
+ (k::userpriv(), phase->option("userpriv"))
+ (k::sandbox(), phase->option("sandbox"))
+ (k::commands(), join(phase->begin_commands(), phase->end_commands(), " "))
+ (k::builddir(), _imp->params.builddir));
EbuildPretendCommand pretend_cmd(command_params,
- EbuildPretendCommandParams::create()
- .use(use)
- .use_expand(join(p->begin_use_expand(), p->end_use_expand(), " "))
- .expand_vars(expand_vars)
- .root(stringify(_imp->params.environment->root()))
- .profiles(_imp->params.profiles));
+ EbuildPretendCommandParams::named_create()
+ (k::use(), use)
+ (k::use_expand(), join(p->begin_use_expand(), p->end_use_expand(), " "))
+ (k::expand_vars(), expand_vars)
+ (k::root(), stringify(_imp->params.environment->root()))
+ (k::profiles(), _imp->params.profiles));
if (! pretend_cmd())
return false;
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index 5a6dd7d..c71ccc1 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -75,9 +75,9 @@ EbuildFlatMetadataCache::load(const tr1::shared_ptr<const EbuildID> & id)
id->set_eapi(lines[14]);
bool ok(true);
- if (id->eapi()->supported)
+ if ((*id->eapi())[k::supported()])
{
- const EAPIEbuildMetadataVariables & m(*id->eapi()->supported->ebuild_metadata_variables);
+ const EAPIEbuildMetadataVariables & m((*(*id->eapi())[k::supported()])[k::ebuild_metadata_variables()]);
{
time_t cache_time(std::max(_master_mtime, _filename.mtime()));
@@ -227,10 +227,10 @@ EbuildFlatMetadataCache::save(const tr1::shared_ptr<const EbuildID> & id)
return;
}
- if (! id->eapi()->supported)
+ if (! (*id->eapi())[k::supported()])
{
Log::get_instance()->message(ll_warning, lc_no_context) << "Not writing cache file to '"
- << _filename << "' because EAPI '" << id->eapi()->name << "' is not supported";
+ << _filename << "' because EAPI '" << (*id->eapi())[k::name()] << "' is not supported";
return;
}
@@ -238,7 +238,7 @@ EbuildFlatMetadataCache::save(const tr1::shared_ptr<const EbuildID> & id)
try
{
- const EAPIEbuildMetadataVariables & m(*id->eapi()->supported->ebuild_metadata_variables);
+ const EAPIEbuildMetadataVariables & m((*(*id->eapi())[k::supported()])[k::ebuild_metadata_variables()]);
for (int x(0), x_end(m.flat_cache_minimum_size) ; x != x_end ; ++x)
{
if (x == m.flat_cache_dependencies)
@@ -358,7 +358,7 @@ EbuildFlatMetadataCache::save(const tr1::shared_ptr<const EbuildID> & id)
}
else if (x == m.flat_cache_eapi)
{
- cache << normalise(id->eapi()->name) << std::endl;
+ cache << normalise((*id->eapi())[k::name()]) << std::endl;
}
else
cache << std::endl;
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 9076832..97434eb 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -205,33 +205,33 @@ EbuildID::need_keys_added() const
eapi_str = _imp->repository->params().eapi_when_unknown;
_imp->eapi = EAPIData::get_instance()->eapi_from_string(eapi_str);
- if (_imp->eapi->supported)
+ if ((*_imp->eapi)[k::supported()])
{
Log::get_instance()->message(ll_debug, lc_context) << "Generating metadata command for '"
- << canonical_form(idcf_full) << "' using EAPI '" << _imp->eapi->name << "'";
+ << canonical_form(idcf_full) << "' using EAPI '" << (*_imp->eapi)[k::name()] << "'";
- EAPIPhases phases(_imp->eapi->supported->ebuild_phases->ebuild_metadata);
+ EAPIPhases phases((*(*_imp->eapi)[k::supported()])[k::ebuild_phases()].ebuild_metadata);
int count(std::distance(phases.begin_phases(), phases.end_phases()));
if (1 != count)
- throw EAPIConfigurationError("EAPI '" + _imp->eapi->name + "' defines "
+ throw EAPIConfigurationError("EAPI '" + (*_imp->eapi)[k::name()] + "' defines "
+ (count == 0 ? "no" : stringify(count)) + " ebuild variable phases but expected exactly one");
- EbuildMetadataCommand cmd(EbuildCommandParams::create()
- .environment(_imp->environment)
- .package_id(shared_from_this())
- .ebuild_dir(_imp->repository->layout()->package_directory(name()))
- .ebuild_file(_imp->ebuild)
- .files_dir(_imp->repository->layout()->package_directory(name()) / "files")
- .eclassdirs(_imp->repository->params().eclassdirs)
- .exlibsdirs(_imp->repository->layout()->exlibsdirs(name()))
- .portdir(_imp->repository->params().master_repository ? _imp->repository->params().master_repository->params().location :
- _imp->repository->params().location)
- .distdir(_imp->repository->params().distdir)
- .builddir(_imp->repository->params().builddir)
- .commands(join(phases.begin_phases()->begin_commands(), phases.begin_phases()->end_commands(), " "))
- .sandbox(phases.begin_phases()->option("sandbox"))
- .userpriv(phases.begin_phases()->option("userpriv")));
+ EbuildMetadataCommand cmd(EbuildCommandParams::named_create()
+ (k::environment(), _imp->environment)
+ (k::package_id(), shared_from_this())
+ (k::ebuild_dir(), _imp->repository->layout()->package_directory(name()))
+ (k::ebuild_file(), _imp->ebuild)
+ (k::files_dir(), _imp->repository->layout()->package_directory(name()) / "files")
+ (k::eclassdirs(), _imp->repository->params().eclassdirs)
+ (k::exlibsdirs(), _imp->repository->layout()->exlibsdirs(name()))
+ (k::portdir(), _imp->repository->params().master_repository ? _imp->repository->params().master_repository->params().location :
+ _imp->repository->params().location)
+ (k::distdir(), _imp->repository->params().distdir)
+ (k::builddir(), _imp->repository->params().builddir)
+ (k::commands(), join(phases.begin_phases()->begin_commands(), phases.begin_phases()->end_commands(), " "))
+ (k::sandbox(), phases.begin_phases()->option("sandbox"))
+ (k::userpriv(), phases.begin_phases()->option("userpriv")));
if (! cmd())
Log::get_instance()->message(ll_warning, lc_no_context) << "No usable metadata for '" +
@@ -240,9 +240,9 @@ EbuildID::need_keys_added() const
cmd.load(shared_from_this());
Log::get_instance()->message(ll_debug, lc_context) << "Generated metadata for '"
- << canonical_form(idcf_full) << "' has EAPI '" << _imp->eapi->name << "'";
+ << canonical_form(idcf_full) << "' has EAPI '" << (*_imp->eapi)[k::name()] << "'";
- if (_imp->repository->params().write_cache.basename() != "empty" && _imp->eapi->supported)
+ if (_imp->repository->params().write_cache.basename() != "empty" && (*_imp->eapi)[k::supported()])
{
EbuildFlatMetadataCache metadata_cache(_imp->environment, write_cache_file, _imp->ebuild, _imp->master_mtime,
_imp->eclass_mtimes, false);
@@ -252,11 +252,11 @@ EbuildID::need_keys_added() const
else
{
Log::get_instance()->message(ll_debug, lc_context) << "Can't run metadata command for '"
- << canonical_form(idcf_full) << "' because EAPI '" << _imp->eapi->name << "' is unknown";
+ << canonical_form(idcf_full) << "' because EAPI '" << (*_imp->eapi)[k::name()] << "' is unknown";
}
}
- add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string> ("EAPI", "EAPI", mkt_internal, _imp->eapi->name)));
+ add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string>("EAPI", "EAPI", mkt_internal, (*_imp->eapi)[k::name()])));
_imp->repository_mask = make_shared_ptr(new EMutableRepositoryMaskInfoKey(shared_from_this(), "repository_mask", "Repository masked",
tr1::static_pointer_cast<const ERepository>(repository())->repository_masked(*this), mkt_internal));
@@ -365,9 +365,9 @@ EbuildID::need_masks_added() const
Context context("When generating masks for ID '" + canonical_form(idcf_full) + "':");
- if (! eapi()->supported)
+ if (! (*eapi())[k::supported()])
{
- add_mask(make_shared_ptr(new EUnsupportedMask('E', "eapi", eapi()->name)));
+ add_mask(make_shared_ptr(new EUnsupportedMask('E', "eapi", (*eapi())[k::name()])));
return;
}
@@ -867,7 +867,7 @@ EbuildID::supports_action(const SupportsActionTestBase & b) const
SupportsActionQuery q;
b.accept(q);
- return q.result && eapi()->supported;
+ return q.result && (*eapi())[k::supported()];
}
namespace
@@ -936,7 +936,7 @@ namespace
void
EbuildID::perform_action(Action & a) const
{
- if (! eapi()->supported)
+ if (! (*eapi())[k::supported()])
throw UnsupportedActionError(*this, a);
PerformAction b(shared_from_this());
diff --git a/paludis/repositories/e/exndbam_id.cc b/paludis/repositories/e/exndbam_id.cc
index b036575..b78ba5c 100644
--- a/paludis/repositories/e/exndbam_id.cc
+++ b/paludis/repositories/e/exndbam_id.cc
@@ -22,6 +22,7 @@
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/visitor-impl.hh>
#include <paludis/contents.hh>
#include <paludis/ndbam.hh>
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 2332678..b4d9367 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -308,11 +308,11 @@ ExndbamRepository::merge(const MergeParams & m)
target_ver_dir.mkdir();
WriteVDBEntryCommand write_vdb_entry_command(
- WriteVDBEntryParams::create()
- .environment(_imp->params.environment)
- .package_id(tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()]))
- .output_directory(target_ver_dir)
- .environment_file(m[k::environment_file()]));
+ WriteVDBEntryParams::named_create()
+ (k::environment(), _imp->params.environment)
+ (k::package_id(), tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()]))
+ (k::output_directory(), target_ver_dir)
+ (k::environment_file(), m[k::environment_file()]));
write_vdb_entry_command();
@@ -357,8 +357,8 @@ ExndbamRepository::merge(const MergeParams & m)
}
VDBPostMergeCommand post_merge_command(
- VDBPostMergeCommandParams::create()
- .root(installed_root_key()->value()));
+ VDBPostMergeCommandParams::named_create()
+ (k::root(), installed_root_key()->value()));
post_merge_command();
}
@@ -392,7 +392,7 @@ ExndbamRepository::perform_uninstall(const tr1::shared_ptr<const ERepositoryID>
tr1::shared_ptr<FSEntrySequence> eclassdirs(new FSEntrySequence);
eclassdirs->push_back(ver_dir);
- EAPIPhases phases(id->eapi()->supported->ebuild_phases->ebuild_uninstall);
+ EAPIPhases phases((*(*id->eapi())[k::supported()])[k::ebuild_phases()].ebuild_uninstall);
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
phase != phase_end ; ++phase)
{
@@ -425,27 +425,27 @@ ExndbamRepository::perform_uninstall(const tr1::shared_ptr<const ERepositoryID>
}
else
{
- EbuildCommandParams params(EbuildCommandParams::create()
- .environment(_imp->params.environment)
- .package_id(id)
- .ebuild_dir(ver_dir)
- .ebuild_file(ver_dir / (stringify(id->name().package) + "-" + stringify(id->version()) + ".ebuild"))
- .files_dir(ver_dir)
- .eclassdirs(eclassdirs)
- .exlibsdirs(make_shared_ptr(new FSEntrySequence))
- .portdir(_imp->params.location)
- .distdir(ver_dir)
- .sandbox(phase->option("sandbox"))
- .userpriv(phase->option("userpriv"))
- .commands(join(phase->begin_commands(), phase->end_commands(), " "))
- .builddir(_imp->params.builddir));
-
- EbuildUninstallCommandParams uninstall_params(EbuildUninstallCommandParams::create()
- .root(stringify(_imp->params.root))
- .disable_cfgpro(o[k::no_config_protect()])
- .unmerge_only(false)
- .loadsaveenv_dir(ver_dir)
- .load_environment(load_env.get()));
+ EbuildCommandParams params(EbuildCommandParams::named_create()
+ (k::environment(), _imp->params.environment)
+ (k::package_id(), id)
+ (k::ebuild_dir(), ver_dir)
+ (k::ebuild_file(), ver_dir / (stringify(id->name().package) + "-" + stringify(id->version()) + ".ebuild"))
+ (k::files_dir(), ver_dir)
+ (k::eclassdirs(), eclassdirs)
+ (k::exlibsdirs(), make_shared_ptr(new FSEntrySequence))
+ (k::portdir(), _imp->params.location)
+ (k::distdir(), ver_dir)
+ (k::sandbox(), phase->option("sandbox"))
+ (k::userpriv(), phase->option("userpriv"))
+ (k::commands(), join(phase->begin_commands(), phase->end_commands(), " "))
+ (k::builddir(), _imp->params.builddir));
+
+ EbuildUninstallCommandParams uninstall_params(EbuildUninstallCommandParams::named_create()
+ (k::root(), stringify(_imp->params.root))
+ (k::disable_cfgpro(), o[k::no_config_protect()])
+ (k::unmerge_only(), false)
+ (k::loadsaveenv_dir(), ver_dir)
+ (k::load_environment(), load_env.get()));
EbuildUninstallCommand uninstall_cmd_pre(params, uninstall_params);
uninstall_cmd_pre();
diff --git a/paludis/repositories/e/fetch_visitor.cc b/paludis/repositories/e/fetch_visitor.cc
index 232fd01..7b06a30 100644
--- a/paludis/repositories/e/fetch_visitor.cc
+++ b/paludis/repositories/e/fetch_visitor.cc
@@ -209,7 +209,7 @@ FetchVisitor::visit_leaf(const FetchableURIDepSpec & u)
stringify(_imp->id->version()))
.with_setenv("CATEGORY", stringify(_imp->id->name().category))
.with_setenv("REPOSITORY", stringify(_imp->id->repository()->name()))
- .with_setenv("EAPI", stringify(_imp->eapi.name))
+ .with_setenv("EAPI", stringify(_imp->eapi[k::name()]))
.with_setenv("SLOT", "")
.with_setenv("PKGMANAGER", PALUDIS_PACKAGE "-" + stringify(PALUDIS_VERSION_MAJOR) + "." +
stringify(PALUDIS_VERSION_MINOR) + "." +
diff --git a/paludis/repositories/e/package_dep_spec.cc b/paludis/repositories/e/package_dep_spec.cc
index 623f112..86bd262 100644
--- a/paludis/repositories/e/package_dep_spec.cc
+++ b/paludis/repositories/e/package_dep_spec.cc
@@ -22,6 +22,7 @@
#include <paludis/repositories/e/use_requirements.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/kc.hh>
#include <paludis/dep_spec.hh>
#include <paludis/version_operator.hh>
#include <paludis/version_spec.hh>
@@ -33,13 +34,13 @@ using namespace paludis::erepository;
PackageDepSpec
paludis::erepository::parse_e_package_dep_spec(const std::string & ss, const EAPI & eapi, const tr1::shared_ptr<const PackageID> & id)
{
- Context context("When parsing package dep spec '" + ss + "' with eapi '" + stringify(eapi.name) + "':");
+ Context context("When parsing package dep spec '" + ss + "' with eapi '" + stringify(eapi[k::name()]) + "':");
if (ss.empty())
throw PackageDepSpecError("Got empty dep spec");
- if (! eapi.supported)
- throw PackageDepSpecError("Don't know how to parse dep specs using EAPI '" + eapi.name + "'");
+ if (! eapi[k::supported()])
+ throw PackageDepSpecError("Don't know how to parse dep specs using EAPI '" + eapi[k::name()] + "'");
PartiallyMadePackageDepSpec result;
std::string s(ss);
@@ -48,9 +49,9 @@ paludis::erepository::parse_e_package_dep_spec(const std::string & ss, const EAP
std::string::size_type use_group_p;
while (std::string::npos != ((use_group_p = s.rfind('['))))
{
- if (! eapi.supported->package_dep_spec_parse_options[pdspo_allow_square_bracket_deps])
+ if (! (*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_allow_square_bracket_deps])
{
- if (eapi.supported->package_dep_spec_parse_options[pdspo_strict_parsing])
+ if ((*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_strict_parsing])
throw PackageDepSpecError("[] dependencies not safe for use with this EAPI");
else
Log::get_instance()->message(ll_warning, lc_context, "[] dependencies not safe for use with this EAPI");
@@ -213,9 +214,9 @@ paludis::erepository::parse_e_package_dep_spec(const std::string & ss, const EAP
std::string::size_type repo_p;
if (std::string::npos != ((repo_p = s.rfind("::"))))
{
- if (! eapi.supported->package_dep_spec_parse_options[pdspo_allow_repository_deps])
+ if (! (*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_allow_repository_deps])
{
- if (eapi.supported->package_dep_spec_parse_options[pdspo_strict_parsing])
+ if ((*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_strict_parsing])
throw PackageDepSpecError("Repository dependencies not safe for use with this EAPI");
else
Log::get_instance()->message(ll_warning, lc_context, "Repository dependencies not safe for use with this EAPI");
@@ -228,9 +229,9 @@ paludis::erepository::parse_e_package_dep_spec(const std::string & ss, const EAP
std::string::size_type slot_p;
if (std::string::npos != ((slot_p = s.rfind(':'))))
{
- if (! eapi.supported->package_dep_spec_parse_options[pdspo_allow_slot_deps])
+ if (! (*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_allow_slot_deps])
{
- if (eapi.supported->package_dep_spec_parse_options[pdspo_strict_parsing])
+ if ((*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_strict_parsing])
throw PackageDepSpecError("Slot dependencies not safe for use with this EAPI");
else
Log::get_instance()->message(ll_warning, lc_context, "Slot dependencies not safe for use with this EAPI");
@@ -251,9 +252,9 @@ paludis::erepository::parse_e_package_dep_spec(const std::string & ss, const EAP
VersionOperator op(s.substr(0, p));
if (op == vo_tilde_greater)
- if (! eapi.supported->package_dep_spec_parse_options[pdspo_allow_tilde_greater_deps])
+ if (! (*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_allow_tilde_greater_deps])
{
- if (eapi.supported->package_dep_spec_parse_options[pdspo_strict_parsing])
+ if ((*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_strict_parsing])
throw PackageDepSpecError("~> dependencies not safe for use with this EAPI");
else
Log::get_instance()->message(ll_warning, lc_context, "~> dependencies not safe for use with this EAPI");
@@ -288,7 +289,7 @@ paludis::erepository::parse_e_package_dep_spec(const std::string & ss, const EAP
if (t.length() >= 3 && (0 == t.compare(0, 2, "*/")))
{
throw PackageDepSpecError("Wildcard '*' not allowed in '" + stringify(ss) + "' with eapi '"
- + stringify(eapi.name) + "'");
+ + stringify(eapi[k::name()]) + "'");
if (0 != t.compare(t.length() - 2, 2, "/*"))
result.package_name_part(PackageNamePart(t.substr(2)));
@@ -296,7 +297,7 @@ paludis::erepository::parse_e_package_dep_spec(const std::string & ss, const EAP
else if (t.length() >= 3 && (0 == t.compare(t.length() - 2, 2, "/*")))
{
throw PackageDepSpecError("Wildcard '*' not allowed in '" + stringify(ss) + "' with eapi '"
- + stringify(eapi.name) + "'");
+ + stringify(eapi[k::name()]) + "'");
result.category_name_part(CategoryNamePart(t.substr(0, t.length() - 2)));
}
@@ -307,9 +308,9 @@ paludis::erepository::parse_e_package_dep_spec(const std::string & ss, const EAP
{
if (op != vo_equal)
{
- if (! eapi.supported->package_dep_spec_parse_options[pdspo_strict_star_operator])
+ if (! (*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_strict_star_operator])
{
- if (eapi.supported->package_dep_spec_parse_options[pdspo_strict_parsing])
+ if ((*eapi[k::supported()])[k::package_dep_spec_parse_options()][pdspo_strict_parsing])
throw PackageDepSpecError(
"Package dep spec '" + ss + "' uses * "
"with operator '" + stringify(op) + "'");
@@ -332,7 +333,7 @@ paludis::erepository::parse_e_package_dep_spec(const std::string & ss, const EAP
if (s.length() >= 3 && (0 == s.compare(0, 2, "*/")))
{
throw PackageDepSpecError("Wildcard '*' not allowed in '" + stringify(ss) + "' with parse eapi '"
- + stringify(eapi.name) + "'");
+ + stringify(eapi[k::name()]) + "'");
if (0 != s.compare(s.length() - 2, 2, "/*"))
result.package_name_part(PackageNamePart(s.substr(2)));
@@ -340,7 +341,7 @@ paludis::erepository::parse_e_package_dep_spec(const std::string & ss, const EAP
else if (s.length() >= 3 && (0 == s.compare(s.length() - 2, 2, "/*")))
{
throw PackageDepSpecError("Wildcard '*' not allowed in '" + stringify(ss) + "' with EAPI '"
- + stringify(eapi.name) + "'");
+ + stringify(eapi[k::name()]) + "'");
result.category_name_part(CategoryNamePart(s.substr(0, s.length() - 2)));
}
diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc
index b4d3744..f6a4cba 100644
--- a/paludis/repositories/e/pipe_command_handler.cc
+++ b/paludis/repositories/e/pipe_command_handler.cc
@@ -97,13 +97,13 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
else
{
tr1::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(tokens[1]));
- if (! eapi->supported)
+ if (! (*eapi)[k::supported()])
return "EBEST_VERSION EAPI " + tokens[1] + " unsupported";
PackageDepSpec spec(erepository::parse_e_package_dep_spec(tokens[2], *eapi, package_id));
tr1::shared_ptr<const PackageIDSequence> entries(environment->package_database()->query(
query::Matches(spec) & query::InstalledAtRoot(environment->root()), qo_order_by_version));
- if (eapi->supported->pipe_commands->rewrite_virtuals && (! entries->empty()) &&
+ if ((*(*eapi)[k::supported()])[k::pipe_commands()][k::rewrite_virtuals()] && (! entries->empty()) &&
(*entries->last())->virtual_for_key())
{
Log::get_instance()->message(ll_qa, lc_context) << "best-version of '" << spec <<
@@ -119,7 +119,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
return "O1;";
else
{
- if (eapi->supported->pipe_commands->no_slot_or_repo)
+ if ((*(*eapi)[k::supported()])[k::pipe_commands()][k::no_slot_or_repo()])
return "O0;" + name_and_version(**entries->last());
else
return "O0;" + stringify(**entries->last());
@@ -136,7 +136,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
else
{
tr1::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(tokens[1]));
- if (! eapi->supported)
+ if (! (*eapi)[k::supported()])
return "EHAS_VERSION EAPI " + tokens[1] + " unsupported";
PackageDepSpec spec(erepository::parse_e_package_dep_spec(tokens[2], *eapi, package_id));
@@ -158,13 +158,13 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
else
{
tr1::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(tokens[1]));
- if (! eapi->supported)
+ if (! (*eapi)[k::supported()])
return "EMATCH EAPI " + tokens[1] + " unsupported";
PackageDepSpec spec(erepository::parse_e_package_dep_spec(tokens[2], *eapi, package_id));
tr1::shared_ptr<const PackageIDSequence> entries(environment->package_database()->query(
query::Matches(spec) & query::InstalledAtRoot(environment->root()), qo_order_by_version));
- if (eapi->supported->pipe_commands->rewrite_virtuals && (! entries->empty()))
+ if ((*(*eapi)[k::supported()])[k::pipe_commands()][k::rewrite_virtuals()] && (! entries->empty()))
{
tr1::shared_ptr<PackageIDSequence> new_entries(new PackageIDSequence);
for (PackageIDSequence::ConstIterator i(entries->begin()), i_end(entries->end()) ;
@@ -188,7 +188,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
return "O1;";
else
{
- if (eapi->supported->pipe_commands->no_slot_or_repo)
+ if ((*(*eapi)[k::supported()])[k::pipe_commands()][k::no_slot_or_repo()])
return "O0;" + join(indirect_iterator(entries->begin()), indirect_iterator(entries->end()), "\n", &name_and_version);
else
return "O0;" + join(indirect_iterator(entries->begin()), indirect_iterator(entries->end()), "\n");
diff --git a/paludis/repositories/e/qa/eapi_supported.cc b/paludis/repositories/e/qa/eapi_supported.cc
index 4c56c23..66a960a 100644
--- a/paludis/repositories/e/qa/eapi_supported.cc
+++ b/paludis/repositories/e/qa/eapi_supported.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -23,6 +23,7 @@
#include <paludis/repositories/e/eapi.hh>
#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/kc.hh>
bool
paludis::erepository::eapi_supported_check(
@@ -33,10 +34,10 @@ paludis::erepository::eapi_supported_check(
{
Context context("When performing check '" + name + "' using eapi_supported_check on ID '" + stringify(*id) + "':");
- if (! id->eapi()->supported)
+ if (! (*id->eapi())[k::supported()])
{
reporter.message(QAMessage(entry, qaml_severe, name,
- "EAPI '" + stringify(id->eapi()->name) + "' not supported")
+ "EAPI '" + stringify((*id->eapi())[k::name()]) + "' not supported")
.with_associated_id(id));
return false;
}
diff --git a/paludis/repositories/e/qa/qa_checks_group.cc b/paludis/repositories/e/qa/qa_checks_group.cc
index 2a8bab6..2bbfc1a 100644
--- a/paludis/repositories/e/qa/qa_checks_group.cc
+++ b/paludis/repositories/e/qa/qa_checks_group.cc
@@ -27,7 +27,7 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/hashed_containers.hh>
-
+#include <algorithm>
#include <list>
using namespace paludis;
diff --git a/paludis/repositories/e/qa/qa_controller.cc b/paludis/repositories/e/qa/qa_controller.cc
index a1adebb..70b2967 100644
--- a/paludis/repositories/e/qa/qa_controller.cc
+++ b/paludis/repositories/e/qa/qa_controller.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -318,12 +318,12 @@ QAController::_check_package(const QualifiedPackageName p)
if (_above_base_dir(p_dir) || _under_base_dir(p_dir))
{
std::find_if(
- QAChecks::get_instance()->package_dir_checks_group()->begin(),
- QAChecks::get_instance()->package_dir_checks_group()->end(),
- tr1::bind(std::equal_to<bool>(), false,
- tr1::bind<bool>(&PackageDirCheckFunction::operator(),
- _1, _imp->repo->layout()->package_directory(p),
- tr1::ref(_imp->reporter), _imp->env, _imp->repo, p)));
+ QAChecks::get_instance()->package_dir_checks_group()->begin(),
+ QAChecks::get_instance()->package_dir_checks_group()->end(),
+ tr1::bind(std::equal_to<bool>(), false,
+ tr1::bind<bool>(tr1::mem_fn(&PackageDirCheckFunction::operator()),
+ _1, _imp->repo->layout()->package_directory(p),
+ tr1::ref(_imp->reporter), _imp->env, _imp->repo, p)));
tr1::shared_ptr<const PackageIDSequence> ids(_imp->repo->package_ids(p));
std::for_each(ids->begin(), ids->end(), tr1::bind(&QAController::_check_id, this, _1));
diff --git a/paludis/repositories/e/qa/spec_keys.cc b/paludis/repositories/e/qa/spec_keys.cc
index 67ec291..656bfa1 100644
--- a/paludis/repositories/e/qa/spec_keys.cc
+++ b/paludis/repositories/e/qa/spec_keys.cc
@@ -207,7 +207,7 @@ namespace
{
if (iuse_flags.end() == iuse_flags.find(conditional_dep_spec_flag(u)))
{
- std::tr1::shared_ptr<const UseFlagNameSet> c(
+ tr1::shared_ptr<const UseFlagNameSet> c(
(*id->repository())[k::use_interface()]->use_expand_hidden_prefixes());
std::string flag(stringify(conditional_dep_spec_flag(u)));
bool is_hidden(false);
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index db451de..1a61c2e 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -377,7 +377,7 @@ VDBRepository::perform_uninstall(const tr1::shared_ptr<const ERepositoryID> & id
tr1::shared_ptr<FSEntry> load_env(new FSEntry(pkg_dir / "environment.bz2"));
- EAPIPhases phases(id->eapi()->supported->ebuild_phases->ebuild_uninstall);
+ EAPIPhases phases((*(*id->eapi())[k::supported()])[k::ebuild_phases()].ebuild_uninstall);
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
phase != phase_end ; ++phase)
{
@@ -409,27 +409,27 @@ VDBRepository::perform_uninstall(const tr1::shared_ptr<const ERepositoryID> & id
}
else
{
- EbuildCommandParams params(EbuildCommandParams::create()
- .environment(_imp->params.environment)
- .package_id(id)
- .ebuild_dir(pkg_dir)
- .ebuild_file(pkg_dir / (stringify(id->name().package) + "-" + stringify(id->version()) + ".ebuild"))
- .files_dir(pkg_dir)
- .eclassdirs(eclassdirs)
- .exlibsdirs(make_shared_ptr(new FSEntrySequence))
- .portdir(_imp->params.location)
- .distdir(pkg_dir)
- .sandbox(phase->option("sandbox"))
- .userpriv(phase->option("userpriv"))
- .commands(join(phase->begin_commands(), phase->end_commands(), " "))
- .builddir(_imp->params.builddir));
-
- EbuildUninstallCommandParams uninstall_params(EbuildUninstallCommandParams::create()
- .root(stringify(_imp->params.root))
- .disable_cfgpro(o[k::no_config_protect()])
- .unmerge_only(false)
- .loadsaveenv_dir(pkg_dir)
- .load_environment(load_env.get()));
+ EbuildCommandParams params(EbuildCommandParams::named_create()
+ (k::environment(), _imp->params.environment)
+ (k::package_id(), id)
+ (k::ebuild_dir(), pkg_dir)
+ (k::ebuild_file(), pkg_dir / (stringify(id->name().package) + "-" + stringify(id->version()) + ".ebuild"))
+ (k::files_dir(), pkg_dir)
+ (k::eclassdirs(), eclassdirs)
+ (k::exlibsdirs(), make_shared_ptr(new FSEntrySequence))
+ (k::portdir(), _imp->params.location)
+ (k::distdir(), pkg_dir)
+ (k::sandbox(), phase->option("sandbox"))
+ (k::userpriv(), phase->option("userpriv"))
+ (k::commands(), join(phase->begin_commands(), phase->end_commands(), " "))
+ (k::builddir(), _imp->params.builddir));
+
+ EbuildUninstallCommandParams uninstall_params(EbuildUninstallCommandParams::named_create()
+ (k::root(), stringify(_imp->params.root))
+ (k::disable_cfgpro(), o[k::no_config_protect()])
+ (k::unmerge_only(), false)
+ (k::loadsaveenv_dir(), pkg_dir)
+ (k::load_environment(), load_env.get()));
EbuildUninstallCommand uninstall_cmd_pre(params, uninstall_params);
uninstall_cmd_pre();
@@ -714,11 +714,11 @@ VDBRepository::merge(const MergeParams & m)
tmp_vdb_dir.mkdir();
WriteVDBEntryCommand write_vdb_entry_command(
- WriteVDBEntryParams::create()
- .environment(_imp->params.environment)
- .package_id(tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()]))
- .output_directory(tmp_vdb_dir)
- .environment_file(m[k::environment_file()]));
+ WriteVDBEntryParams::named_create()
+ (k::environment(), _imp->params.environment)
+ (k::package_id(), tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()]))
+ (k::output_directory(), tmp_vdb_dir)
+ (k::environment_file(), m[k::environment_file()]));
write_vdb_entry_command();
@@ -776,8 +776,8 @@ VDBRepository::merge(const MergeParams & m)
}
VDBPostMergeCommand post_merge_command(
- VDBPostMergeCommandParams::create()
- .root(installed_root_key()->value()));
+ VDBPostMergeCommandParams::named_create()
+ (k::root(), installed_root_key()->value()));
post_merge_command();
}
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index bbb0d90..ba02001 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -402,7 +402,8 @@ namespace paludis
suggested_dependencies_labels(new DependencyLabelSequence),
keywords(new FakeMetadataKeywordSetKey("KEYWORDS", "Keywords", "test", mkt_normal, id, env)),
iuse(new FakeMetadataIUseSetKey("IUSE", "Used USE flags", "",
- erepository::EAPIData::get_instance()->eapi_from_string(eapi)->supported->iuse_flag_parse_options, mkt_normal, id, env)),
+ (*(*erepository::EAPIData::get_instance()->eapi_from_string(eapi))[k::supported()])[k::iuse_flag_parse_options()],
+ mkt_normal, id, env)),
has_masks(false)
{
build_dependencies_labels->push_back(make_shared_ptr(new DependencyBuildLabel("DEPEND")));
@@ -957,7 +958,7 @@ FakePackageID::transient_key() const
char
FakePackageID::use_expand_separator() const
{
- return erepository::EAPIData::get_instance()->eapi_from_string(_imp->eapi)->supported->ebuild_options->use_expand_separator;
+ return (*(*erepository::EAPIData::get_instance()->eapi_from_string(_imp->eapi))[k::supported()])[k::ebuild_options()].use_expand_separator;
}
std::string
diff --git a/paludis/util/keys.hh b/paludis/util/keys.hh
index 67cb16b..6e08e95 100644
--- a/paludis/util/keys.hh
+++ b/paludis/util/keys.hh
@@ -95,6 +95,62 @@ namespace paludis
typedef kc::Key<67> output_prefix;
typedef kc::Key<68> local;
typedef kc::Key<69> remote;
+ typedef kc::Key<69> ebuild_dir;
+ typedef kc::Key<70> ebuild_file;
+ typedef kc::Key<71> eclassdirs;
+ typedef kc::Key<72> exlibsdirs;
+ typedef kc::Key<73> portdir;
+ typedef kc::Key<74> distdir;
+ typedef kc::Key<75> builddir;
+ typedef kc::Key<76> userpriv;
+ typedef kc::Key<77> sandbox;
+ typedef kc::Key<78> commands;
+ typedef kc::Key<79> a;
+ typedef kc::Key<80> aa;
+ typedef kc::Key<81> use;
+ typedef kc::Key<82> use_expand;
+ typedef kc::Key<83> profiles;
+ typedef kc::Key<84> expand_vars;
+ typedef kc::Key<85> files_dir;
+ typedef kc::Key<86> name;
+ typedef kc::Key<87> exported_name;
+ typedef kc::Key<88> supported;
+ typedef kc::Key<89> package_dep_spec_parse_options;
+ typedef kc::Key<90> dependency_spec_tree_parse_options;
+ typedef kc::Key<91> iuse_flag_parse_options;
+ typedef kc::Key<92> merger_options;
+ typedef kc::Key<93> breaks_portage;
+ typedef kc::Key<94> can_be_pbin;
+ typedef kc::Key<95> ebuild_options;
+ typedef kc::Key<96> ebuild_phases;
+ typedef kc::Key<97> ebuild_metadata_variables;
+ typedef kc::Key<98> ebuild_environment_variables;
+ typedef kc::Key<99> uri_labels;
+ typedef kc::Key<100> dependency_labels;
+ typedef kc::Key<101> pipe_commands;
+ typedef kc::Key<102> tools_options;
+ typedef kc::Key<103> rewrite_virtuals;
+ typedef kc::Key<104> no_slot_or_repo;
+ typedef kc::Key<105> disable_cfgpro;
+ typedef kc::Key<106> slot;
+ typedef kc::Key<107> loadsaveenv_dir;
+ typedef kc::Key<108> unmerge_only;
+ typedef kc::Key<109> load_environment;
+ typedef kc::Key<110> info_vars;
+ typedef kc::Key<111> output_directory;
+ typedef kc::Key<112> destination_repository;
+ typedef kc::Key<113> binary_ebuild_location;
+ typedef kc::Key<114> binary_distdir;
+ typedef kc::Key<115> env_use;
+ typedef kc::Key<116> env_use_expand;
+ typedef kc::Key<117> env_use_expand_hidden;
+ typedef kc::Key<118> env_aa;
+ typedef kc::Key<119> env_arch;
+ typedef kc::Key<120> env_kv;
+ typedef kc::Key<121> env_accept_keywords;
+ typedef kc::Key<122> env_portdir;
+ typedef kc::Key<123> env_distdir;
+ typedef kc::Key<124> description_use;
}
}
diff --git a/paludis/util/sha1.cc b/paludis/util/sha1.cc
index 506ed46..e3df4f8 100644
--- a/paludis/util/sha1.cc
+++ b/paludis/util/sha1.cc
@@ -24,6 +24,7 @@
#include <sstream>
#include <istream>
#include <iomanip>
+#include <algorithm>
using namespace paludis;
diff --git a/ruby/action.cc b/ruby/action.cc
index ebc50a1..d7f481e 100644
--- a/ruby/action.cc
+++ b/ruby/action.cc
@@ -58,7 +58,7 @@ namespace
static VALUE c_pretend_action;
- const bool
+ bool
value_to_bool(VALUE v)
{
if (Qfalse == v || Qnil == v)
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index eb3bbcb..d289873 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -274,9 +274,11 @@ namespace
tr1::shared_ptr<typename H_::ConstItem> result;
tr1::function<void (const tr1::shared_ptr<ConstAcceptInterface<H_> > &)> adder;
- ValueToTree(VALUE val) :
- adder(tr1::bind(&ValueToTree<H_>::set_result, this, tr1::placeholders::_1))
+ ValueToTree(VALUE val)
{
+ using namespace tr1::placeholders;
+ adder = tr1::bind(tr1::mem_fn(&ValueToTree<H_>::set_result), this, _1);
+
tr1::shared_ptr<WrappedSpecBase> * p;
Data_Get_Struct(val, tr1::shared_ptr<WrappedSpecBase>, p);
(*p)->accept(*this);
@@ -298,7 +300,7 @@ namespace
adder(a);
Save<tr1::function<void (const tr1::shared_ptr<ConstAcceptInterface<H_> > &)> > s(
- &adder, tr1::bind(&ConstTreeSequence<H_, T_>::add, a, _1));
+ &adder, tr1::bind(tr1::mem_fn(&ConstTreeSequence<H_, T_>::add), a.get(), _1));
std::for_each(indirect_iterator(second_iterator(item.children()->begin())),
indirect_iterator(second_iterator(item.children()->end())),
accept_visitor(*this));
@@ -1226,15 +1228,15 @@ paludis::ruby::uri_label_to_value(const tr1::shared_ptr<const URILabel> & m)
}
}
-template VALUE dep_tree_to_value <SetSpecTree> (const tr1::shared_ptr<const SetSpecTree::ConstItem> &);
-template VALUE dep_tree_to_value <DependencySpecTree> (const tr1::shared_ptr<const DependencySpecTree::ConstItem> &);
-template VALUE dep_tree_to_value <FetchableURISpecTree> (const tr1::shared_ptr<const FetchableURISpecTree::ConstItem> &);
-template VALUE dep_tree_to_value <SimpleURISpecTree> (const tr1::shared_ptr<const SimpleURISpecTree::ConstItem> &);
-template VALUE dep_tree_to_value <RestrictSpecTree> (const tr1::shared_ptr<const RestrictSpecTree::ConstItem> &);
-template VALUE dep_tree_to_value <ProvideSpecTree> (const tr1::shared_ptr<const ProvideSpecTree::ConstItem> &);
-template VALUE dep_tree_to_value <LicenseSpecTree> (const tr1::shared_ptr<const LicenseSpecTree::ConstItem> &);
+template VALUE paludis::ruby::dep_tree_to_value<SetSpecTree> (const tr1::shared_ptr<const SetSpecTree::ConstItem> &);
+template VALUE paludis::ruby::dep_tree_to_value<DependencySpecTree> (const tr1::shared_ptr<const DependencySpecTree::ConstItem> &);
+template VALUE paludis::ruby::dep_tree_to_value<FetchableURISpecTree> (const tr1::shared_ptr<const FetchableURISpecTree::ConstItem> &);
+template VALUE paludis::ruby::dep_tree_to_value<SimpleURISpecTree> (const tr1::shared_ptr<const SimpleURISpecTree::ConstItem> &);
+template VALUE paludis::ruby::dep_tree_to_value<RestrictSpecTree> (const tr1::shared_ptr<const RestrictSpecTree::ConstItem> &);
+template VALUE paludis::ruby::dep_tree_to_value<ProvideSpecTree> (const tr1::shared_ptr<const ProvideSpecTree::ConstItem> &);
+template VALUE paludis::ruby::dep_tree_to_value<LicenseSpecTree> (const tr1::shared_ptr<const LicenseSpecTree::ConstItem> &);
-template tr1::shared_ptr<const SetSpecTree::ConstItem> value_to_dep_tree <SetSpecTree> (VALUE);
+template tr1::shared_ptr<const SetSpecTree::ConstItem> paludis::ruby::value_to_dep_tree <SetSpecTree> (VALUE);
RegisterRubyClass::Register paludis_ruby_register_dep_spec PALUDIS_ATTRIBUTE((used))
(&do_register_dep_spec);