aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-29 21:47:08 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-08-03 21:20:26 +0100
commit77be16f5c2de2ebcd7ce78084755f83c522edc39 (patch)
tree7f46de7cf0f1cd9ec9cd2c4b342446cd0c4d567c /paludis/repositories
parent5c42e4800f4e6edd91dc6d8cdf54afb3d1fb34df (diff)
downloadpaludis-77be16f5c2de2ebcd7ce78084755f83c522edc39.tar.gz
paludis-77be16f5c2de2ebcd7ce78084755f83c522edc39.tar.xz
Kill kc. Breaks python.
Diffstat (limited to 'paludis/repositories')
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc36
-rw-r--r--paludis/repositories/cran/cran_repository.cc30
-rw-r--r--paludis/repositories/e/check_fetched_files_visitor.cc134
-rw-r--r--paludis/repositories/e/dep_parser.cc273
-rw-r--r--paludis/repositories/e/e_installed_repository.cc89
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc3
-rw-r--r--paludis/repositories/e/e_key.cc24
-rw-r--r--paludis/repositories/e/e_repository.cc88
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc88
-rw-r--r--paludis/repositories/e/e_repository_id.cc1
-rw-r--r--paludis/repositories/e/e_repository_mask_file.cc5
-rw-r--r--paludis/repositories/e/e_repository_profile.cc5
-rw-r--r--paludis/repositories/e/e_repository_sets_TEST.cc8
-rw-r--r--paludis/repositories/e/e_stripper.cc22
-rw-r--r--paludis/repositories/e/e_stripper.hh24
-rw-r--r--paludis/repositories/e/eapi-fwd.hh2
-rw-r--r--paludis/repositories/e/eapi.cc1
-rw-r--r--paludis/repositories/e/ebuild.cc425
-rw-r--r--paludis/repositories/e/ebuild.hh219
-rw-r--r--paludis/repositories/e/ebuild_entries.cc320
-rw-r--r--paludis/repositories/e/ebuild_id.cc32
-rw-r--r--paludis/repositories/e/exndbam_repository.cc161
-rw-r--r--paludis/repositories/e/info_metadata_key.cc1
-rw-r--r--paludis/repositories/e/make_ebuild_repository.cc17
-rw-r--r--paludis/repositories/e/qa/eapi_supported.cc1
-rw-r--r--paludis/repositories/e/qa/fetches_key.cc2
-rw-r--r--paludis/repositories/e/qa/iuse_key.cc2
-rw-r--r--paludis/repositories/e/qa/spec_keys.cc6
-rw-r--r--paludis/repositories/e/qa/visibility.cc24
-rw-r--r--paludis/repositories/e/source_uri_finder.cc12
-rw-r--r--paludis/repositories/e/vdb_merger.cc54
-rw-r--r--paludis/repositories/e/vdb_merger.hh35
-rw-r--r--paludis/repositories/e/vdb_merger_TEST.cc20
-rw-r--r--paludis/repositories/e/vdb_repository.cc157
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc101
-rw-r--r--paludis/repositories/e/vdb_unmerger.cc62
-rw-r--r--paludis/repositories/e/vdb_unmerger.hh29
-rw-r--r--paludis/repositories/e/vdb_unmerger_TEST.cc16
-rw-r--r--paludis/repositories/fake/dep_parser.cc231
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc37
-rw-r--r--paludis/repositories/fake/fake_package_id.cc8
-rw-r--r--paludis/repositories/fake/fake_repository.cc69
-rw-r--r--paludis/repositories/gems/gems_repository.cc30
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc30
-rw-r--r--paludis/repositories/gems/registration.cc5
-rw-r--r--paludis/repositories/unavailable/registration.cc15
-rw-r--r--paludis/repositories/unavailable/unavailable_id.cc19
-rw-r--r--paludis/repositories/unavailable/unavailable_id.hh37
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc67
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.hh24
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_TEST.cc29
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_file-fwd.hh28
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_file.cc14
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_store.cc44
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc18
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc104
-rw-r--r--paludis/repositories/unpackaged/installed_repository_TEST.cc101
-rw-r--r--paludis/repositories/unpackaged/registration.cc24
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc36
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc50
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.hh41
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository_TEST.cc166
-rw-r--r--paludis/repositories/unpackaged/unpackaged_stripper.cc22
-rw-r--r--paludis/repositories/unpackaged/unpackaged_stripper.hh23
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc40
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc46
-rw-r--r--paludis/repositories/virtuals/virtuals_repository_TEST.cc2
67 files changed, 2051 insertions, 1838 deletions
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index e2a4030da..479c6d080 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -44,6 +44,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/make_named_values.hh>
#include <tr1/functional>
#include <tr1/unordered_map>
#include <functional>
@@ -157,20 +158,21 @@ Implementation<CRANInstalledRepository>::need_ids() const
CRANInstalledRepository::CRANInstalledRepository(const CRANInstalledRepositoryParams & p) :
Repository(RepositoryName("installed-cran"),
- RepositoryCapabilities::named_create()
- (k::sets_interface(), this)
- (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
- (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
- (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
- (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
- (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
- (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
- (k::destination_interface(), this)
- (k::e_interface(), static_cast<RepositoryEInterface *>(0))
- (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
- (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
- (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
- (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
+ make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(this),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
+ value_for<n::hook_interface>(static_cast<RepositoryHookInterface *>(0)),
+ value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
+ value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(this),
+ value_for<n::syncable_interface>(static_cast<RepositorySyncableInterface *>(0)),
+ value_for<n::use_interface>(static_cast<RepositoryUseInterface *>(0)),
+ value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ )),
PrivateImplementationPattern<CRANInstalledRepository>(new Implementation<CRANInstalledRepository>(p)),
_imp(PrivateImplementationPattern<CRANInstalledRepository>::_imp)
{
@@ -498,11 +500,11 @@ CRANInstalledRepository::want_pre_post_phases() const
void
CRANInstalledRepository::merge(const MergeParams & m)
{
- Context context("When merging '" + stringify(*m[k::package_id()]) + "' at '" + stringify(m[k::image_dir()])
+ Context context("When merging '" + stringify(*m.package_id()) + "' at '" + stringify(m.image_dir())
+ "' to repository '" + stringify(name()) + "':");
- if (! is_suitable_destination_for(*m[k::package_id()]))
- throw InstallActionError("Not a suitable destination for '" + stringify(*m[k::package_id()]) + "'");
+ if (! is_suitable_destination_for(*m.package_id()))
+ throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
}
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index d6e840dce..b09b72d9b 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -45,6 +45,7 @@
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/make_named_values.hh>
#include <tr1/unordered_map>
#include <tr1/functional>
#include <functional>
@@ -103,20 +104,21 @@ Implementation<CRANRepository>::~Implementation()
CRANRepository::CRANRepository(const CRANRepositoryParams & p) :
Repository(CRANRepository::fetch_repo_name(stringify(p.location)),
- RepositoryCapabilities::named_create()
- (k::sets_interface(), this)
- (k::syncable_interface(), this)
- (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
- (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
- (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
- (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
- (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
- (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
- (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
- (k::e_interface(), static_cast<RepositoryEInterface *>(0))
- (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
- (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
- (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
+ make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
+ value_for<n::hook_interface>(static_cast<RepositoryHookInterface *>(0)),
+ value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
+ value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(this),
+ value_for<n::syncable_interface>(this),
+ value_for<n::use_interface>(static_cast<RepositoryUseInterface *>(0)),
+ value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ )),
PrivateImplementationPattern<CRANRepository>(new Implementation<CRANRepository>(p, make_shared_ptr(new Mutex))),
_imp(PrivateImplementationPattern<CRANRepository>::_imp)
{
diff --git a/paludis/repositories/e/check_fetched_files_visitor.cc b/paludis/repositories/e/check_fetched_files_visitor.cc
index 627daf024..669232fbc 100644
--- a/paludis/repositories/e/check_fetched_files_visitor.cc
+++ b/paludis/repositories/e/check_fetched_files_visitor.cc
@@ -35,11 +35,11 @@
#include <paludis/util/join.hh>
#include <paludis/util/save.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/kc.hh>
#include <paludis/util/rmd160.hh>
#include <paludis/util/sha1.hh>
#include <paludis/util/sha256.hh>
#include <paludis/util/md5.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/repositories/e/manifest2_reader.hh>
@@ -188,12 +188,12 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
case manifest_require:
case last_manifest:
- _imp->failures->push_back(FetchActionFailure::named_create()
- (k::target_file(), stringify(distfile.basename()))
- (k::failed_integrity_checks(), "No Manifest available")
- (k::requires_manual_fetching(), false)
- (k::failed_automatic_fetching(), false)
- );
+ _imp->failures->push_back(make_named_values<FetchActionFailure>(
+ value_for<n::failed_automatic_fetching>(false),
+ value_for<n::failed_integrity_checks>("No Manifest available"),
+ value_for<n::requires_manual_fetching>(false),
+ value_for<n::target_file>(stringify(distfile.basename()))
+ ));
return false;
}
@@ -219,12 +219,12 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
Log::get_instance()->message("e.manifest.no_size", ll_debug, lc_context)
<< "Malformed Manifest: no file size found";
std::cout << "incorrect size";
- _imp->failures->push_back(FetchActionFailure::named_create()
- (k::target_file(), stringify(distfile.basename()))
- (k::requires_manual_fetching(), false)
- (k::failed_integrity_checks(), "Incorrect file size")
- (k::failed_automatic_fetching(), false)
- );
+ _imp->failures->push_back(make_named_values<FetchActionFailure>(
+ value_for<n::failed_automatic_fetching>(false),
+ value_for<n::failed_integrity_checks>("Incorrect file size"),
+ value_for<n::requires_manual_fetching>(false),
+ value_for<n::target_file>(stringify(distfile.basename()))
+ ));
return false;
}
@@ -232,12 +232,12 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
if (! file_stream)
{
std::cout << "unreadable file";
- _imp->failures->push_back(FetchActionFailure::named_create()
- (k::target_file(), stringify(distfile.basename()))
- (k::requires_manual_fetching(), false)
- (k::failed_integrity_checks(), "Unreadable file")
- (k::failed_automatic_fetching(), false)
- );
+ _imp->failures->push_back(make_named_values<FetchActionFailure>(
+ value_for<n::failed_automatic_fetching>(false),
+ value_for<n::failed_integrity_checks>("Unreadable file"),
+ value_for<n::requires_manual_fetching>(false),
+ value_for<n::target_file>(stringify(distfile.basename()))
+ ));
return false;
}
@@ -249,12 +249,12 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
Log::get_instance()->message("e.manifest.rmd160.failure", ll_debug, lc_context)
<< "Malformed Manifest: failed RMD160 checksum";
std::cout << "failed RMD160";
- _imp->failures->push_back(FetchActionFailure::named_create()
- (k::target_file(), stringify(distfile.basename()))
- (k::requires_manual_fetching(), false)
- (k::failed_integrity_checks(), "Failed RMD160 checksum")
- (k::failed_automatic_fetching(), false)
- );
+ _imp->failures->push_back(make_named_values<FetchActionFailure>(
+ value_for<n::failed_automatic_fetching>(false),
+ value_for<n::failed_integrity_checks>("Failed RMD160 checksum"),
+ value_for<n::requires_manual_fetching>(false),
+ value_for<n::target_file>(stringify(distfile.basename()))
+ ));
return false;
}
Log::get_instance()->message("e.manifest.rmd160.result", ll_debug, lc_context)
@@ -271,12 +271,12 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
Log::get_instance()->message("e.manifest.sha1.failure", ll_debug, lc_context)
<< "Malformed Manifest: failed SHA1 checksum";
std::cout << "failed SHA1";
- _imp->failures->push_back(FetchActionFailure::named_create()
- (k::target_file(), stringify(distfile.basename()))
- (k::requires_manual_fetching(), false)
- (k::failed_integrity_checks(), "Failed SHA1 checksum")
- (k::failed_automatic_fetching(), false)
- );
+ _imp->failures->push_back(make_named_values<FetchActionFailure>(
+ value_for<n::failed_automatic_fetching>(false),
+ value_for<n::failed_integrity_checks>("Failed SHA1 checksum"),
+ value_for<n::requires_manual_fetching>(false),
+ value_for<n::target_file>(stringify(distfile.basename()))
+ ));
return false;
}
Log::get_instance()->message("e.manifest.sha1.result", ll_debug, lc_context)
@@ -293,12 +293,12 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
Log::get_instance()->message("e.manifest.sha256.failure", ll_debug, lc_context)
<< "Malformed Manifest: failed SHA256 checksum";
std::cout << "failed SHA256";
- _imp->failures->push_back(FetchActionFailure::named_create()
- (k::target_file(), stringify(distfile.basename()))
- (k::requires_manual_fetching(), false)
- (k::failed_integrity_checks(), "Failed SHA256 checksum")
- (k::failed_automatic_fetching(), false)
- );
+ _imp->failures->push_back(make_named_values<FetchActionFailure>(
+ value_for<n::failed_automatic_fetching>(false),
+ value_for<n::failed_integrity_checks>("Failed SHA256 checksum"),
+ value_for<n::requires_manual_fetching>(false),
+ value_for<n::target_file>(stringify(distfile.basename()))
+ ));
return false;
}
Log::get_instance()->message("e.manifest.sha256.result", ll_debug, lc_context)
@@ -315,12 +315,12 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
Log::get_instance()->message("e.manifest.md5.failure", ll_debug, lc_context)
<< "Malformed Manifest: failed MD5 checksum";
std::cout << "failed MD5";
- _imp->failures->push_back(FetchActionFailure::named_create()
- (k::target_file(), stringify(distfile.basename()))
- (k::requires_manual_fetching(), false)
- (k::failed_integrity_checks(), "Failed MD5 checksum")
- (k::failed_automatic_fetching(), false)
- );
+ _imp->failures->push_back(make_named_values<FetchActionFailure>(
+ value_for<n::failed_automatic_fetching>(false),
+ value_for<n::failed_integrity_checks>("Failed MD5 checksum"),
+ value_for<n::requires_manual_fetching>(false),
+ value_for<n::target_file>(stringify(distfile.basename()))
+ ));
return false;
}
Log::get_instance()->message("e.manifest.md5.result", ll_debug, lc_context)
@@ -331,12 +331,12 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
if (! found)
{
std::cout << "not in Manifest";
- _imp->failures->push_back(FetchActionFailure::named_create()
- (k::target_file(), stringify(distfile.basename()))
- (k::requires_manual_fetching(), false)
- (k::failed_integrity_checks(), "Not in Manifest")
- (k::failed_automatic_fetching(), false)
- );
+ _imp->failures->push_back(make_named_values<FetchActionFailure>(
+ value_for<n::failed_automatic_fetching>(false),
+ value_for<n::failed_integrity_checks>("Not in Manifest"),
+ value_for<n::requires_manual_fetching>(false),
+ value_for<n::target_file>(stringify(distfile.basename()))
+ ));
return false;
}
@@ -366,36 +366,36 @@ CheckFetchedFilesVisitor::visit_leaf(const FetchableURIDepSpec & u)
<< "Manual fetch required for '" << u.filename() << "'";
std::cout << "requires manual fetch";
_imp->need_nofetch = true;
- _imp->failures->push_back(FetchActionFailure::named_create()
- (k::target_file(), u.filename())
- (k::requires_manual_fetching(), true)
- (k::failed_automatic_fetching(), false)
- (k::failed_integrity_checks(), "")
- );
+ _imp->failures->push_back(make_named_values<FetchActionFailure>(
+ value_for<n::failed_automatic_fetching>(false),
+ value_for<n::failed_integrity_checks>(""),
+ value_for<n::requires_manual_fetching>(true),
+ value_for<n::target_file>(u.filename())
+ ));
}
else
{
Log::get_instance()->message("e.check_fetched_files.does_not_exist", ll_debug, lc_context)
<< "Automatic fetch failed for '" << u.filename() << "'";
std::cout << "does not exist";
- _imp->failures->push_back(FetchActionFailure::named_create()
- (k::target_file(), u.filename())
- (k::requires_manual_fetching(), false)
- (k::failed_automatic_fetching(), true)
- (k::failed_integrity_checks(), "")
- );
+ _imp->failures->push_back(make_named_values<FetchActionFailure>(
+ value_for<n::failed_automatic_fetching>(true),
+ value_for<n::failed_integrity_checks>(""),
+ value_for<n::requires_manual_fetching>(false),
+ value_for<n::target_file>(u.filename())
+ ));
}
}
else if (0 == (_imp->distdir / u.filename()).file_size())
{
Log::get_instance()->message("e.check_fetched_files.empty", ll_debug, lc_context) << "Empty file for '" << u.filename() << "'";
std::cout << "empty file";
- _imp->failures->push_back(FetchActionFailure::named_create()
- (k::target_file(), u.filename())
- (k::requires_manual_fetching(), false)
- (k::failed_integrity_checks(), "SIZE (empty file)")
- (k::failed_automatic_fetching(), false)
- );
+ _imp->failures->push_back(make_named_values<FetchActionFailure>(
+ value_for<n::failed_automatic_fetching>(false),
+ value_for<n::failed_integrity_checks>("SIZE (empty file)"),
+ value_for<n::requires_manual_fetching>(false),
+ value_for<n::target_file>(u.filename())
+ ));
}
else if (! check_distfile_manifest(_imp->distdir / u.filename()))
{
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index f87fb78ff..f1df99aef 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -20,12 +20,11 @@
#include <paludis/repositories/e/dep_parser.hh>
#include <paludis/repositories/e/eapi.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/kc.hh>
-#include <paludis/util/keys.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/options.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/elike_dep_parser.hh>
#include <paludis/elike_conditional_dep_spec.hh>
#include <paludis/elike_package_dep_spec.hh>
@@ -47,6 +46,15 @@ EDepParseError::EDepParseError(const std::string & s, const std::string & t) thr
{
}
+namespace paludis
+{
+ namespace n
+ {
+ struct add_handler;
+ struct item;
+ }
+}
+
namespace
{
template <typename T_>
@@ -54,10 +62,11 @@ namespace
{
typedef std::tr1::function<void (const std::tr1::shared_ptr<const typename T_::ConstItem> &)> AddHandler;
- typedef kc::KeyedClass<
- kc::Field<k::add_handler, AddHandler>,
- kc::Field<k::item, const std::tr1::shared_ptr<const typename T_::ConstItem> >
- > Item;
+ struct Item
+ {
+ NamedValue<n::add_handler, AddHandler> add_handler;
+ NamedValue<n::item, const std::tr1::shared_ptr<const typename T_::ConstItem> > item;
+ };
typedef std::list<Item> Stack;
};
@@ -67,7 +76,7 @@ namespace
const EAPI & eapi, const std::tr1::shared_ptr<const PackageID> & id)
{
PackageDepSpec p(parse_elike_package_dep_spec(s, eapi.supported()->package_dep_spec_parse_options(), id));
- (*h.begin())[k::add_handler()](make_shared_ptr(new TreeLeaf<T_, PackageDepSpec>(make_shared_ptr(new PackageDepSpec(p)))));
+ (*h.begin()).add_handler()(make_shared_ptr(new TreeLeaf<T_, PackageDepSpec>(make_shared_ptr(new PackageDepSpec(p)))));
}
template <typename T_>
@@ -79,7 +88,7 @@ namespace
std::tr1::shared_ptr<BlockDepSpec> b(new BlockDepSpec(
make_shared_ptr(new PackageDepSpec(parse_elike_package_dep_spec(s.substr(1),
eapi.supported()->package_dep_spec_parse_options(), id)))));
- (*h.begin())[k::add_handler()](make_shared_ptr(new TreeLeaf<T_, BlockDepSpec>(b)));
+ (*h.begin()).add_handler()(make_shared_ptr(new TreeLeaf<T_, BlockDepSpec>(b)));
}
else
package_dep_spec_string_handler<T_>(h, s, eapi, id);
@@ -88,19 +97,19 @@ namespace
template <typename T_>
void license_handler(const typename ParseStackTypes<T_>::Stack & h, const std::string & s)
{
- (*h.begin())[k::add_handler()](make_shared_ptr(new TreeLeaf<T_, LicenseDepSpec>(make_shared_ptr(new LicenseDepSpec(s)))));
+ (*h.begin()).add_handler()(make_shared_ptr(new TreeLeaf<T_, LicenseDepSpec>(make_shared_ptr(new LicenseDepSpec(s)))));
}
template <typename T_>
void restrict_handler(const typename ParseStackTypes<T_>::Stack & h, const std::string & s)
{
- (*h.begin())[k::add_handler()](make_shared_ptr(new TreeLeaf<T_, PlainTextDepSpec>(make_shared_ptr(new PlainTextDepSpec(s)))));
+ (*h.begin()).add_handler()(make_shared_ptr(new TreeLeaf<T_, PlainTextDepSpec>(make_shared_ptr(new PlainTextDepSpec(s)))));
}
template <typename T_>
void simple_uri_handler(const typename ParseStackTypes<T_>::Stack & h, const std::string & s)
{
- (*h.begin())[k::add_handler()](make_shared_ptr(new TreeLeaf<T_, SimpleURIDepSpec>(make_shared_ptr(new SimpleURIDepSpec(s)))));
+ (*h.begin()).add_handler()(make_shared_ptr(new TreeLeaf<T_, SimpleURIDepSpec>(make_shared_ptr(new SimpleURIDepSpec(s)))));
}
template <typename T_>
@@ -108,7 +117,7 @@ namespace
const EAPI & eapi)
{
if (t.empty() || eapi.supported()->dependency_spec_tree_parse_options()[dstpo_uri_supports_arrow])
- (*h.begin())[k::add_handler()](make_shared_ptr(new TreeLeaf<T_, FetchableURIDepSpec>(make_shared_ptr(
+ (*h.begin()).add_handler()(make_shared_ptr(new TreeLeaf<T_, FetchableURIDepSpec>(make_shared_ptr(
new FetchableURIDepSpec(t.empty() ? f : f + " -> " + t)))));
else
throw EDepParseError(s, "arrows in this EAPI");
@@ -146,7 +155,7 @@ namespace
void dependency_label_handler(const typename ParseStackTypes<T_>::Stack & h, const std::string & s,
const EAPI & eapi)
{
- (*h.begin())[k::add_handler()](make_shared_ptr(new TreeLeaf<T_, DependencyLabelsDepSpec>(
+ (*h.begin()).add_handler()(make_shared_ptr(new TreeLeaf<T_, DependencyLabelsDepSpec>(
parse_dependency_label(s, eapi))));
}
@@ -154,7 +163,7 @@ namespace
void fetchable_label_handler(const typename ParseStackTypes<T_>::Stack & h, const std::string & s,
const EAPI & eapi)
{
- (*h.begin())[k::add_handler()](make_shared_ptr(new TreeLeaf<T_, URILabelsDepSpec>(
+ (*h.begin()).add_handler()(make_shared_ptr(new TreeLeaf<T_, URILabelsDepSpec>(
parse_uri_label(s, eapi))));
}
@@ -164,11 +173,11 @@ namespace
using namespace std::tr1::placeholders;
std::tr1::shared_ptr<ConstTreeSequence<T_, A_> > item(
new ConstTreeSequence<T_, A_>(make_shared_ptr(new A_)));
- (*stack.begin())[k::add_handler()](item);
- stack.push_front(ParseStackTypes<T_>::Item::named_create()
- (k::add_handler(), std::tr1::bind(&ConstTreeSequence<T_, A_>::add, item.get(), _1))
- (k::item(), item)
- );
+ (*stack.begin()).add_handler()(item);
+ stack.push_front(make_named_values<typename ParseStackTypes<T_>::Item>(
+ value_for<n::add_handler>(std::tr1::bind(&ConstTreeSequence<T_, A_>::add, item.get(), _1)),
+ value_for<n::item>(item)
+ ));
}
template <typename T_>
@@ -179,11 +188,11 @@ namespace
std::tr1::shared_ptr<ConstTreeSequence<T_, ConditionalDepSpec> > item(
new ConstTreeSequence<T_, ConditionalDepSpec>(make_shared_ptr(new ConditionalDepSpec(
parse_elike_conditional_dep_spec(u, env, id)))));
- (*stack.begin())[k::add_handler()](item);
- stack.push_front(ParseStackTypes<T_>::Item::named_create()
- (k::add_handler(), std::tr1::bind(&ConstTreeSequence<T_, ConditionalDepSpec>::add, item.get(), _1))
- (k::item(), item)
- );
+ (*stack.begin()).add_handler()(item);
+ stack.push_front(make_named_values<typename ParseStackTypes<T_>::Item>(
+ value_for<n::add_handler>(std::tr1::bind(&ConstTreeSequence<T_, ConditionalDepSpec>::add, item.get(), _1)),
+ value_for<n::item>(item)
+ ));
}
template <typename T_>
@@ -225,29 +234,29 @@ paludis::erepository::parse_depend(const std::string & s,
ParseStackTypes<DependencySpecTree>::Stack stack;
std::tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> > top(
new ConstTreeSequence<DependencySpecTree, AllDepSpec>(make_shared_ptr(new AllDepSpec)));
- stack.push_front(ParseStackTypes<DependencySpecTree>::Item::named_create()
- (k::add_handler(), std::tr1::bind(&ConstTreeSequence<DependencySpecTree, AllDepSpec>::add, top.get(), _1))
- (k::item(), top)
- );
+ stack.push_front(make_named_values<ParseStackTypes<DependencySpecTree>::Item>(
+ value_for<n::add_handler>(std::tr1::bind(&ConstTreeSequence<DependencySpecTree, AllDepSpec>::add, top.get(), _1)),
+ value_for<n::item>(top)
+ ));
ELikeDepParserCallbacks callbacks(
- ELikeDepParserCallbacks::named_create()
- (k::on_string(), std::tr1::bind(&package_or_block_dep_spec_string_handler<DependencySpecTree>, std::tr1::ref(stack), _1, eapi, id))
- (k::on_arrow(), std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2))
- (k::on_any(), std::tr1::bind(&any_all_handler<DependencySpecTree, AnyDepSpec>, std::tr1::ref(stack)))
- (k::on_all(), std::tr1::bind(&any_all_handler<DependencySpecTree, AllDepSpec>, std::tr1::ref(stack)))
- (k::on_use(), std::tr1::bind(&use_handler<DependencySpecTree>, std::tr1::ref(stack), _1, env, id))
- (k::on_label(), std::tr1::bind(&dependency_label_handler<DependencySpecTree>, std::tr1::ref(stack), _1, eapi))
- (k::on_pop(), std::tr1::bind(&pop_handler<DependencySpecTree>, std::tr1::ref(stack), s))
- (k::on_error(), std::tr1::bind(&error_handler, s, _1))
- (k::on_should_be_empty(), std::tr1::bind(&should_be_empty_handler<DependencySpecTree>, std::tr1::ref(stack), s))
- (k::on_use_under_any(), std::tr1::bind(&use_under_any_handler, s, eapi))
- (k::on_annotations(), &discard_annotations)
- );
+ make_named_values<ELikeDepParserCallbacks>(
+ value_for<n::on_all>(std::tr1::bind(&any_all_handler<DependencySpecTree, AllDepSpec>, std::tr1::ref(stack))),
+ value_for<n::on_annotations>(&discard_annotations),
+ value_for<n::on_any>(std::tr1::bind(&any_all_handler<DependencySpecTree, AnyDepSpec>, std::tr1::ref(stack))),
+ value_for<n::on_arrow>(std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2)),
+ value_for<n::on_error>(std::tr1::bind(&error_handler, s, _1)),
+ value_for<n::on_label>(std::tr1::bind(&dependency_label_handler<DependencySpecTree>, std::tr1::ref(stack), _1, eapi)),
+ value_for<n::on_pop>(std::tr1::bind(&pop_handler<DependencySpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_should_be_empty>(std::tr1::bind(&should_be_empty_handler<DependencySpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_string>(std::tr1::bind(&package_or_block_dep_spec_string_handler<DependencySpecTree>, std::tr1::ref(stack), _1, eapi, id)),
+ value_for<n::on_use>(std::tr1::bind(&use_handler<DependencySpecTree>, std::tr1::ref(stack), _1, env, id)),
+ value_for<n::on_use_under_any>(std::tr1::bind(&use_under_any_handler, s, eapi))
+ ));
parse_elike_dependencies(s, callbacks);
- return (*stack.begin())[k::item()];
+ return (*stack.begin()).item();
}
std::tr1::shared_ptr<ProvideSpecTree::ConstItem>
@@ -259,29 +268,29 @@ paludis::erepository::parse_provide(const std::string & s,
ParseStackTypes<ProvideSpecTree>::Stack stack;
std::tr1::shared_ptr<ConstTreeSequence<ProvideSpecTree, AllDepSpec> > top(
new ConstTreeSequence<ProvideSpecTree, AllDepSpec>(make_shared_ptr(new AllDepSpec)));
- stack.push_front(ParseStackTypes<ProvideSpecTree>::Item::named_create()
- (k::add_handler(), std::tr1::bind(&ConstTreeSequence<ProvideSpecTree, AllDepSpec>::add, top.get(), _1))
- (k::item(), top)
- );
+ stack.push_front(make_named_values<ParseStackTypes<ProvideSpecTree>::Item>(
+ value_for<n::add_handler>(std::tr1::bind(&ConstTreeSequence<ProvideSpecTree, AllDepSpec>::add, top.get(), _1)),
+ value_for<n::item>(top)
+ ));
ELikeDepParserCallbacks callbacks(
- ELikeDepParserCallbacks::named_create()
- (k::on_string(), std::tr1::bind(&package_dep_spec_string_handler<ProvideSpecTree>, std::tr1::ref(stack), _1, eapi, id))
- (k::on_arrow(), std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2))
- (k::on_any(), std::tr1::bind(&any_not_allowed_handler, s))
- (k::on_all(), std::tr1::bind(&any_all_handler<ProvideSpecTree, AllDepSpec>, std::tr1::ref(stack)))
- (k::on_use(), std::tr1::bind(&use_handler<ProvideSpecTree>, std::tr1::ref(stack), _1, env, id))
- (k::on_label(), std::tr1::bind(&labels_not_allowed_handler, s, _1))
- (k::on_pop(), std::tr1::bind(&pop_handler<ProvideSpecTree>, std::tr1::ref(stack), s))
- (k::on_error(), std::tr1::bind(&error_handler, s, _1))
- (k::on_should_be_empty(), std::tr1::bind(&should_be_empty_handler<ProvideSpecTree>, std::tr1::ref(stack), s))
- (k::on_use_under_any(), std::tr1::bind(&use_under_any_handler, s, eapi))
- (k::on_annotations(), &discard_annotations)
- );
+ make_named_values<ELikeDepParserCallbacks>(
+ value_for<n::on_all>(std::tr1::bind(&any_all_handler<ProvideSpecTree, AllDepSpec>, std::tr1::ref(stack))),
+ value_for<n::on_annotations>(&discard_annotations),
+ value_for<n::on_any>(std::tr1::bind(&any_not_allowed_handler, s)),
+ value_for<n::on_arrow>(std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2)),
+ value_for<n::on_error>(std::tr1::bind(&error_handler, s, _1)),
+ value_for<n::on_label>(std::tr1::bind(&labels_not_allowed_handler, s, _1)),
+ value_for<n::on_pop>(std::tr1::bind(&pop_handler<ProvideSpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_should_be_empty>(std::tr1::bind(&should_be_empty_handler<ProvideSpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_string>(std::tr1::bind(&package_dep_spec_string_handler<ProvideSpecTree>, std::tr1::ref(stack), _1, eapi, id)),
+ value_for<n::on_use>(std::tr1::bind(&use_handler<ProvideSpecTree>, std::tr1::ref(stack), _1, env, id)),
+ value_for<n::on_use_under_any>(std::tr1::bind(&use_under_any_handler, s, eapi))
+ ));
parse_elike_dependencies(s, callbacks);
- return (*stack.begin())[k::item()];
+ return (*stack.begin()).item();
}
std::tr1::shared_ptr<FetchableURISpecTree::ConstItem>
@@ -293,29 +302,29 @@ paludis::erepository::parse_fetchable_uri(const std::string & s,
ParseStackTypes<FetchableURISpecTree>::Stack stack;
std::tr1::shared_ptr<ConstTreeSequence<FetchableURISpecTree, AllDepSpec> > top(
new ConstTreeSequence<FetchableURISpecTree, AllDepSpec>(make_shared_ptr(new AllDepSpec)));
- stack.push_front(ParseStackTypes<FetchableURISpecTree>::Item::named_create()
- (k::add_handler(), std::tr1::bind(&ConstTreeSequence<FetchableURISpecTree, AllDepSpec>::add, top.get(), _1))
- (k::item(), top)
- );
+ stack.push_front(make_named_values<ParseStackTypes<FetchableURISpecTree>::Item>(
+ value_for<n::add_handler>(std::tr1::bind(&ConstTreeSequence<FetchableURISpecTree, AllDepSpec>::add, top.get(), _1)),
+ value_for<n::item>(top)
+ ));
ELikeDepParserCallbacks callbacks(
- ELikeDepParserCallbacks::named_create()
- (k::on_string(), std::tr1::bind(&arrow_handler<FetchableURISpecTree>, std::tr1::ref(stack), s, _1, "", eapi))
- (k::on_arrow(), std::tr1::bind(&arrow_handler<FetchableURISpecTree>, std::tr1::ref(stack), s, _1, _2, eapi))
- (k::on_any(), std::tr1::bind(&any_not_allowed_handler, s))
- (k::on_all(), std::tr1::bind(&any_all_handler<FetchableURISpecTree, AllDepSpec>, std::tr1::ref(stack)))
- (k::on_use(), std::tr1::bind(&use_handler<FetchableURISpecTree>, std::tr1::ref(stack), _1, env, id))
- (k::on_label(), std::tr1::bind(&fetchable_label_handler<FetchableURISpecTree>, std::tr1::ref(stack), _1, eapi))
- (k::on_pop(), std::tr1::bind(&pop_handler<FetchableURISpecTree>, std::tr1::ref(stack), s))
- (k::on_error(), std::tr1::bind(&error_handler, s, _1))
- (k::on_should_be_empty(), std::tr1::bind(&should_be_empty_handler<FetchableURISpecTree>, std::tr1::ref(stack), s))
- (k::on_use_under_any(), std::tr1::bind(&use_under_any_handler, s, eapi))
- (k::on_annotations(), &discard_annotations)
- );
+ make_named_values<ELikeDepParserCallbacks>(
+ value_for<n::on_all>(std::tr1::bind(&any_all_handler<FetchableURISpecTree, AllDepSpec>, std::tr1::ref(stack))),
+ value_for<n::on_annotations>(&discard_annotations),
+ value_for<n::on_any>(std::tr1::bind(&any_not_allowed_handler, s)),
+ value_for<n::on_arrow>(std::tr1::bind(&arrow_handler<FetchableURISpecTree>, std::tr1::ref(stack), s, _1, _2, eapi)),
+ value_for<n::on_error>(std::tr1::bind(&error_handler, s, _1)),
+ value_for<n::on_label>(std::tr1::bind(&fetchable_label_handler<FetchableURISpecTree>, std::tr1::ref(stack), _1, eapi)),
+ value_for<n::on_pop>(std::tr1::bind(&pop_handler<FetchableURISpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_should_be_empty>(std::tr1::bind(&should_be_empty_handler<FetchableURISpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_string>(std::tr1::bind(&arrow_handler<FetchableURISpecTree>, std::tr1::ref(stack), s, _1, "", eapi)),
+ value_for<n::on_use>(std::tr1::bind(&use_handler<FetchableURISpecTree>, std::tr1::ref(stack), _1, env, id)),
+ value_for<n::on_use_under_any>(std::tr1::bind(&use_under_any_handler, s, eapi))
+ ));
parse_elike_dependencies(s, callbacks);
- return (*stack.begin())[k::item()];
+ return (*stack.begin()).item();
}
std::tr1::shared_ptr<SimpleURISpecTree::ConstItem>
@@ -327,29 +336,29 @@ paludis::erepository::parse_simple_uri(const std::string & s,
ParseStackTypes<SimpleURISpecTree>::Stack stack;
std::tr1::shared_ptr<ConstTreeSequence<SimpleURISpecTree, AllDepSpec> > top(
new ConstTreeSequence<SimpleURISpecTree, AllDepSpec>(make_shared_ptr(new AllDepSpec)));
- stack.push_front(ParseStackTypes<SimpleURISpecTree>::Item::named_create()
- (k::add_handler(), std::tr1::bind(&ConstTreeSequence<SimpleURISpecTree, AllDepSpec>::add, top.get(), _1))
- (k::item(), top)
- );
+ stack.push_front(make_named_values<ParseStackTypes<SimpleURISpecTree>::Item>(
+ value_for<n::add_handler>(std::tr1::bind(&ConstTreeSequence<SimpleURISpecTree, AllDepSpec>::add, top.get(), _1)),
+ value_for<n::item>(top)
+ ));
ELikeDepParserCallbacks callbacks(
- ELikeDepParserCallbacks::named_create()
- (k::on_string(), std::tr1::bind(&simple_uri_handler<SimpleURISpecTree>, std::tr1::ref(stack), _1))
- (k::on_arrow(), std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2))
- (k::on_any(), std::tr1::bind(&any_not_allowed_handler, s))
- (k::on_all(), std::tr1::bind(&any_all_handler<SimpleURISpecTree, AllDepSpec>, std::tr1::ref(stack)))
- (k::on_use(), std::tr1::bind(&use_handler<SimpleURISpecTree>, std::tr1::ref(stack), _1, env, id))
- (k::on_label(), std::tr1::bind(&labels_not_allowed_handler, s, _1))
- (k::on_pop(), std::tr1::bind(&pop_handler<SimpleURISpecTree>, std::tr1::ref(stack), s))
- (k::on_error(), std::tr1::bind(&error_handler, s, _1))
- (k::on_should_be_empty(), std::tr1::bind(&should_be_empty_handler<SimpleURISpecTree>, std::tr1::ref(stack), s))
- (k::on_use_under_any(), &do_nothing)
- (k::on_annotations(), &discard_annotations)
- );
+ make_named_values<ELikeDepParserCallbacks>(
+ value_for<n::on_all>(std::tr1::bind(&any_all_handler<SimpleURISpecTree, AllDepSpec>, std::tr1::ref(stack))),
+ value_for<n::on_annotations>(&discard_annotations),
+ value_for<n::on_any>(std::tr1::bind(&any_not_allowed_handler, s)),
+ value_for<n::on_arrow>(std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2)),
+ value_for<n::on_error>(std::tr1::bind(&error_handler, s, _1)),
+ value_for<n::on_label>(std::tr1::bind(&labels_not_allowed_handler, s, _1)),
+ value_for<n::on_pop>(std::tr1::bind(&pop_handler<SimpleURISpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_should_be_empty>(std::tr1::bind(&should_be_empty_handler<SimpleURISpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_string>(std::tr1::bind(&simple_uri_handler<SimpleURISpecTree>, std::tr1::ref(stack), _1)),
+ value_for<n::on_use>(std::tr1::bind(&use_handler<SimpleURISpecTree>, std::tr1::ref(stack), _1, env, id)),
+ value_for<n::on_use_under_any>(&do_nothing)
+ ));
parse_elike_dependencies(s, callbacks);
- return (*stack.begin())[k::item()];
+ return (*stack.begin()).item();
}
std::tr1::shared_ptr<LicenseSpecTree::ConstItem>
@@ -361,29 +370,29 @@ paludis::erepository::parse_license(const std::string & s,
ParseStackTypes<LicenseSpecTree>::Stack stack;
std::tr1::shared_ptr<ConstTreeSequence<LicenseSpecTree, AllDepSpec> > top(
new ConstTreeSequence<LicenseSpecTree, AllDepSpec>(make_shared_ptr(new AllDepSpec)));
- stack.push_front(ParseStackTypes<LicenseSpecTree>::Item::named_create()
- (k::add_handler(), std::tr1::bind(&ConstTreeSequence<LicenseSpecTree, AllDepSpec>::add, top.get(), _1))
- (k::item(), top)
- );
+ stack.push_front(make_named_values<ParseStackTypes<LicenseSpecTree>::Item>(
+ value_for<n::add_handler>(std::tr1::bind(&ConstTreeSequence<LicenseSpecTree, AllDepSpec>::add, top.get(), _1)),
+ value_for<n::item>(top)
+ ));
ELikeDepParserCallbacks callbacks(
- ELikeDepParserCallbacks::named_create()
- (k::on_string(), std::tr1::bind(&license_handler<LicenseSpecTree>, std::tr1::ref(stack), _1))
- (k::on_arrow(), std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2))
- (k::on_any(), std::tr1::bind(&any_all_handler<LicenseSpecTree, AnyDepSpec>, std::tr1::ref(stack)))
- (k::on_all(), std::tr1::bind(&any_all_handler<LicenseSpecTree, AllDepSpec>, std::tr1::ref(stack)))
- (k::on_use(), std::tr1::bind(&use_handler<LicenseSpecTree>, std::tr1::ref(stack), _1, env, id))
- (k::on_label(), std::tr1::bind(&labels_not_allowed_handler, s, _1))
- (k::on_pop(), std::tr1::bind(&pop_handler<LicenseSpecTree>, std::tr1::ref(stack), s))
- (k::on_error(), std::tr1::bind(&error_handler, s, _1))
- (k::on_should_be_empty(), std::tr1::bind(&should_be_empty_handler<LicenseSpecTree>, std::tr1::ref(stack), s))
- (k::on_use_under_any(), std::tr1::bind(&use_under_any_handler, s, eapi))
- (k::on_annotations(), &discard_annotations)
- );
+ make_named_values<ELikeDepParserCallbacks>(
+ value_for<n::on_all>(std::tr1::bind(&any_all_handler<LicenseSpecTree, AllDepSpec>, std::tr1::ref(stack))),
+ value_for<n::on_annotations>(&discard_annotations),
+ value_for<n::on_any>(std::tr1::bind(&any_all_handler<LicenseSpecTree, AnyDepSpec>, std::tr1::ref(stack))),
+ value_for<n::on_arrow>(std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2)),
+ value_for<n::on_error>(std::tr1::bind(&error_handler, s, _1)),
+ value_for<n::on_label>(std::tr1::bind(&labels_not_allowed_handler, s, _1)),
+ value_for<n::on_pop>(std::tr1::bind(&pop_handler<LicenseSpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_should_be_empty>(std::tr1::bind(&should_be_empty_handler<LicenseSpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_string>(std::tr1::bind(&license_handler<LicenseSpecTree>, std::tr1::ref(stack), _1)),
+ value_for<n::on_use>(std::tr1::bind(&use_handler<LicenseSpecTree>, std::tr1::ref(stack), _1, env, id)),
+ value_for<n::on_use_under_any>(std::tr1::bind(&use_under_any_handler, s, eapi))
+ ));
parse_elike_dependencies(s, callbacks);
- return (*stack.begin())[k::item()];
+ return (*stack.begin()).item();
}
std::tr1::shared_ptr<RestrictSpecTree::ConstItem>
@@ -395,29 +404,29 @@ paludis::erepository::parse_restrict(const std::string & s,
ParseStackTypes<RestrictSpecTree>::Stack stack;
std::tr1::shared_ptr<ConstTreeSequence<RestrictSpecTree, AllDepSpec> > top(
new ConstTreeSequence<RestrictSpecTree, AllDepSpec>(make_shared_ptr(new AllDepSpec)));
- stack.push_front(ParseStackTypes<RestrictSpecTree>::Item::named_create()
- (k::add_handler(), std::tr1::bind(&ConstTreeSequence<RestrictSpecTree, AllDepSpec>::add, top.get(), _1))
- (k::item(), top)
- );
+ stack.push_front(make_named_values<ParseStackTypes<RestrictSpecTree>::Item>(
+ value_for<n::add_handler>(std::tr1::bind(&ConstTreeSequence<RestrictSpecTree, AllDepSpec>::add, top.get(), _1)),
+ value_for<n::item>(top)
+ ));
ELikeDepParserCallbacks callbacks(
- ELikeDepParserCallbacks::named_create()
- (k::on_string(), std::tr1::bind(&restrict_handler<RestrictSpecTree>, std::tr1::ref(stack), _1))
- (k::on_arrow(), std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2))
- (k::on_any(), std::tr1::bind(&any_not_allowed_handler, s))
- (k::on_all(), std::tr1::bind(&any_all_handler<RestrictSpecTree, AllDepSpec>, std::tr1::ref(stack)))
- (k::on_use(), std::tr1::bind(&use_handler<RestrictSpecTree>, std::tr1::ref(stack), _1, env, id))
- (k::on_label(), std::tr1::bind(&labels_not_allowed_handler, s, _1))
- (k::on_pop(), std::tr1::bind(&pop_handler<RestrictSpecTree>, std::tr1::ref(stack), s))
- (k::on_error(), std::tr1::bind(&error_handler, s, _1))
- (k::on_should_be_empty(), std::tr1::bind(&should_be_empty_handler<RestrictSpecTree>, std::tr1::ref(stack), s))
- (k::on_use_under_any(), &do_nothing)
- (k::on_annotations(), &discard_annotations)
- );
+ make_named_values<ELikeDepParserCallbacks>(
+ value_for<n::on_all>(std::tr1::bind(&any_all_handler<RestrictSpecTree, AllDepSpec>, std::tr1::ref(stack))),
+ value_for<n::on_annotations>(&discard_annotations),
+ value_for<n::on_any>(std::tr1::bind(&any_not_allowed_handler, s)),
+ value_for<n::on_arrow>(std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2)),
+ value_for<n::on_error>(std::tr1::bind(&error_handler, s, _1)),
+ value_for<n::on_label>(std::tr1::bind(&labels_not_allowed_handler, s, _1)),
+ value_for<n::on_pop>(std::tr1::bind(&pop_handler<RestrictSpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_should_be_empty>(std::tr1::bind(&should_be_empty_handler<RestrictSpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_string>(std::tr1::bind(&restrict_handler<RestrictSpecTree>, std::tr1::ref(stack), _1)),
+ value_for<n::on_use>(std::tr1::bind(&use_handler<RestrictSpecTree>, std::tr1::ref(stack), _1, env, id)),
+ value_for<n::on_use_under_any>(&do_nothing)
+ ));
parse_elike_dependencies(s, callbacks);
- return (*stack.begin())[k::item()];
+ return (*stack.begin()).item();
}
std::tr1::shared_ptr<URILabelsDepSpec>
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index 841b78b46..0b62a6ed4 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -35,6 +35,7 @@
#include <paludis/util/strip.hh>
#include <paludis/util/system.hh>
#include <paludis/util/map.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/action.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
@@ -360,24 +361,26 @@ EInstalledRepository::perform_config(const std::tr1::shared_ptr<const ERepositor
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
phase != phase_end ; ++phase)
{
- 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()));
+ EbuildConfigCommand config_cmd(make_named_values<EbuildCommandParams>(
+ value_for<n::builddir>(_imp->params.builddir),
+ value_for<n::commands>(join(phase->begin_commands(), phase->end_commands(), " ")),
+ value_for<n::distdir>(ver_dir),
+ value_for<n::ebuild_dir>(ver_dir),
+ value_for<n::ebuild_file>(ver_dir / (stringify(id->name().package) + "-" + stringify(id->version()) + ".ebuild")),
+ value_for<n::eclassdirs>(eclassdirs),
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::exlibsdirs>(make_shared_ptr(new FSEntrySequence)),
+ value_for<n::files_dir>(ver_dir),
+ value_for<n::package_id>(id),
+ value_for<n::portdir>(ver_dir),
+ value_for<n::sandbox>(phase->option("sandbox")),
+ value_for<n::userpriv>(phase->option("userpriv"))
+ ),
+
+ make_named_values<EbuildConfigCommandParams>(
+ value_for<n::load_environment>(load_env.get()),
+ value_for<n::root>(stringify(_imp->params.root))
+ ));
config_cmd();
}
@@ -457,30 +460,32 @@ EInstalledRepository::perform_info(const std::tr1::shared_ptr<const ERepositoryI
}
}
- 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 ? i : make_shared_ptr(new const Set<std::string>))
- (k::use_ebuild_file(), false)
- (k::load_environment(), load_env.get()));
+ EbuildInfoCommand info_cmd(make_named_values<EbuildCommandParams>(
+ value_for<n::builddir>(_imp->params.builddir),
+ value_for<n::commands>(join(phase->begin_commands(), phase->end_commands(), " ")),
+ value_for<n::distdir>(ver_dir),
+ value_for<n::ebuild_dir>(ver_dir),
+ value_for<n::ebuild_file>(ver_dir / (stringify(id->name().package) + "-" + stringify(id->version()) + ".ebuild")),
+ value_for<n::eclassdirs>(eclassdirs),
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::exlibsdirs>(make_shared_ptr(new FSEntrySequence)),
+ value_for<n::files_dir>(ver_dir),
+ value_for<n::package_id>(id),
+ value_for<n::portdir>(ver_dir),
+ value_for<n::sandbox>(phase->option("sandbox")),
+ value_for<n::userpriv>(phase->option("userpriv"))
+ ),
+
+ make_named_values<EbuildInfoCommandParams>(
+ value_for<n::expand_vars>(make_shared_ptr(new Map<std::string, std::string>)),
+ value_for<n::info_vars>(i ? i : make_shared_ptr(new const Set<std::string>)),
+ value_for<n::load_environment>(load_env.get()),
+ value_for<n::profiles>(make_shared_ptr(new FSEntrySequence)),
+ value_for<n::root>(stringify(_imp->params.root)),
+ value_for<n::use>(""),
+ value_for<n::use_ebuild_file>(false),
+ value_for<n::use_expand>("")
+ ));
info_cmd();
}
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 838f21c86..fb1e94f83 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -38,7 +38,6 @@
#include <paludis/util/strip.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/make_shared_ptr.hh>
-#include <paludis/util/kc.hh>
#include <paludis/literal_metadata_key.hh>
#include <iterator>
#include <fstream>
@@ -466,7 +465,7 @@ EInstalledRepositoryID::eapi() const
<< _imp->environment->distribution() << "'";
_imp->eapi = EAPIData::get_instance()->eapi_from_string(
(*DistributionData::get_instance()->distribution_from_string(
- _imp->environment->distribution()))[k::default_ebuild_eapi_when_unspecified()]);
+ _imp->environment->distribution())).default_ebuild_eapi_when_unspecified());
}
return _imp->eapi;
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 1b0b1e406..df4e30c10 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -578,8 +578,8 @@ EIUseKey::value() const
tokenise_whitespace(_imp->string_value, std::back_inserter(tokens));
std::tr1::shared_ptr<const UseFlagNameSet> prefixes;
- if ((*_imp->id->repository())[k::use_interface()])
- prefixes = (*_imp->id->repository())[k::use_interface()]->use_expand_prefixes();
+ if ((*_imp->id->repository()).use_interface())
+ prefixes = (*_imp->id->repository()).use_interface()->use_expand_prefixes();
else
prefixes.reset(new UseFlagNameSet);
@@ -614,9 +614,9 @@ EIUseKey::pretty_print_flat(const Formatter<IUseFlag> & f) const
if (! result.empty())
result.append(" ");
- if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_mask(i->flag, *_imp->id))
+ if ((*_imp->id->repository()).use_interface() && (*_imp->id->repository()).use_interface()->query_use_mask(i->flag, *_imp->id))
result.append(f.format(*i, format::Masked()));
- else if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_force(i->flag, *_imp->id))
+ else if ((*_imp->id->repository()).use_interface() && (*_imp->id->repository()).use_interface()->query_use_force(i->flag, *_imp->id))
result.append(f.format(*i, format::Forced()));
else if (_imp->env->query_use(i->flag, *_imp->id))
result.append(f.format(*i, format::Enabled()));
@@ -630,9 +630,9 @@ EIUseKey::pretty_print_flat(const Formatter<IUseFlag> & f) const
if (! result.empty())
result.append(" ");
- if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_mask(j->second.flag, *_imp->id))
+ if ((*_imp->id->repository()).use_interface() && (*_imp->id->repository()).use_interface()->query_use_mask(j->second.flag, *_imp->id))
result.append(f.format(j->second, format::Masked()));
- else if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_force(j->second.flag, *_imp->id))
+ else if ((*_imp->id->repository()).use_interface() && (*_imp->id->repository()).use_interface()->query_use_force(j->second.flag, *_imp->id))
result.append(f.format(j->second, format::Forced()));
else if (_imp->env->query_use(j->second.flag, *_imp->id))
result.append(f.format(j->second, format::Enabled()));
@@ -666,12 +666,12 @@ EIUseKey::pretty_print_flat_with_comparison(
std::string l;
bool n;
- if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_mask(i->flag, *_imp->id))
+ if ((*_imp->id->repository()).use_interface() && (*_imp->id->repository()).use_interface()->query_use_mask(i->flag, *_imp->id))
{
l = f.format(*i, format::Masked());
n = false;
}
- else if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_force(i->flag, *_imp->id))
+ else if ((*_imp->id->repository()).use_interface() && (*_imp->id->repository()).use_interface()->query_use_force(i->flag, *_imp->id))
{
l = f.format(*i, format::Forced());
n = true;
@@ -713,12 +713,12 @@ EIUseKey::pretty_print_flat_with_comparison(
std::string l;
bool n;
- if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_mask(j->second.flag, *_imp->id))
+ if ((*_imp->id->repository()).use_interface() && (*_imp->id->repository()).use_interface()->query_use_mask(j->second.flag, *_imp->id))
{
l = f.format(j->second, format::Masked());
n = false;
}
- else if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_force(j->second.flag, *_imp->id))
+ else if ((*_imp->id->repository()).use_interface() && (*_imp->id->repository()).use_interface()->query_use_force(j->second.flag, *_imp->id))
{
l = f.format(j->second, format::Forced());
n = true;
@@ -902,9 +902,9 @@ EUseKey::pretty_print_flat(const Formatter<UseFlagName> & f) const
if (! result.empty())
result.append(" ");
- if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_mask(*i, *_imp->id))
+ if ((*_imp->id->repository()).use_interface() && (*_imp->id->repository()).use_interface()->query_use_mask(*i, *_imp->id))
result.append(f.format(*i, format::Masked()));
- else if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_force(*i, *_imp->id))
+ else if ((*_imp->id->repository()).use_interface() && (*_imp->id->repository()).use_interface()->query_use_force(*i, *_imp->id))
result.append(f.format(*i, format::Forced()));
else if (_imp->env->query_use(*i, *_imp->id))
result.append(f.format(*i, format::Enabled()));
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 05b679be6..9e974cac9 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -71,11 +71,11 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/is_file_with_extension.hh>
-#include <paludis/util/kc.hh>
#include <paludis/util/rmd160.hh>
#include <paludis/util/sha1.hh>
#include <paludis/util/sha256.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/make_named_values.hh>
#include <tr1/functional>
#include <tr1/unordered_map>
@@ -337,14 +337,15 @@ namespace paludis
profiles.push_back(layout->profiles_base_dir() / tokens.at(1));
try
{
- profiles_desc.push_back(RepositoryEInterface::ProfilesDescLine::named_create()
- (k::arch(), tokens.at(0))
- (k::path(), *profiles.begin())
- (k::status(), tokens.at(2))
- (k::profile(), std::tr1::shared_ptr<ERepositoryProfile>(new ERepositoryProfile(
+ profiles_desc.push_back(make_named_values<RepositoryEInterface::ProfilesDescLine>(
+ value_for<n::arch>(tokens.at(0)),
+ value_for<n::path>(*profiles.begin()),
+ value_for<n::profile>(std::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()))));
+ params.eapi_when_unknown)->supported()->ebuild_environment_variables()->env_arch()))),
+ value_for<n::status>(tokens.at(2))
+ ));
}
catch (const InternalError &)
{
@@ -415,25 +416,25 @@ namespace
ERepository::ERepository(const ERepositoryParams & p) :
Repository(fetch_repo_name(p.location),
- RepositoryCapabilities::named_create()
- (k::sets_interface(), this)
- (k::syncable_interface(), this)
- (k::use_interface(), this)
- (k::environment_variable_interface(), this)
- (k::mirrors_interface(), this)
- (k::virtuals_interface(), (*DistributionData::get_instance()->distribution_from_string(
- p.environment->distribution()))[k::support_old_style_virtuals()] ? this : 0)
- (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
- (k::destination_interface(), p.binary_destination ? this : 0)
- (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
- (k::e_interface(), this)
+ make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(p.binary_destination ? this : 0),
+ value_for<n::e_interface>(this),
+ value_for<n::environment_variable_interface>(this),
+ value_for<n::hook_interface>(this),
+ value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
+ value_for<n::manifest_interface>(this),
+ value_for<n::mirrors_interface>(this),
+ value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
#ifdef ENABLE_QA
- (k::qa_interface(), this)
+ value_for<n::qa_interface>(this),
#else
- (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
#endif
- (k::hook_interface(), this)
- (k::manifest_interface(), this)),
+ value_for<n::sets_interface>(this),
+ value_for<n::syncable_interface>(this),
+ value_for<n::use_interface>(this),
+ value_for<n::virtuals_interface>((*DistributionData::get_instance()->distribution_from_string(p.environment->distribution())).support_old_style_virtuals() ? this : 0)
+ )),
PrivateImplementationPattern<ERepository>(new Implementation<ERepository>(this, p)),
_imp(PrivateImplementationPattern<ERepository>::_imp)
{
@@ -799,16 +800,16 @@ ERepository::sync() const
for (std::list<std::string>::const_iterator s(sync_list.begin()),
s_end(sync_list.end()) ; s != s_end ; ++s)
{
- DefaultSyncer syncer(SyncerParams::named_create()
- (k::environment(), _imp->params.environment)
- (k::local(), stringify(_imp->params.location))
- (k::remote(), *s)
- );
- SyncOptions opts(
- _imp->params.sync_options,
- _imp->layout->sync_filter_file(),
- "sync " + stringify(name()) + "> "
- );
+ DefaultSyncer syncer(make_named_values<SyncerParams>(
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::local>(stringify(_imp->params.location)),
+ value_for<n::remote>(*s)
+ ));
+ SyncOptions opts(make_named_values<SyncOptions>(
+ value_for<n::filter_file>(_imp->layout->sync_filter_file()),
+ value_for<n::options>(_imp->params.sync_options),
+ value_for<n::output_prefix>("sync " + stringify(name()) + "> ")
+ ));
try
{
syncer.sync(opts);
@@ -841,7 +842,7 @@ ERepository::invalidate_masks()
_imp->layout->invalidate_masks();
if ((*DistributionData::get_instance()->distribution_from_string(_imp->params.environment->distribution()))
- [k::support_old_style_virtuals()])
+ .support_old_style_virtuals())
if (_imp->params.environment->package_database()->has_repository_named(RepositoryName("virtuals")))
_imp->params.environment->package_database()->fetch_repository(
RepositoryName("virtuals"))->invalidate_masks();
@@ -925,9 +926,10 @@ ERepository::virtual_packages() const
for (ERepositoryProfile::VirtualsConstIterator i(_imp->profile_ptr->begin_virtuals()),
i_end(_imp->profile_ptr->end_virtuals()) ; i != i_end ; ++i)
- result->push_back(RepositoryVirtualsEntry::named_create()
- (k::provided_by_spec(), i->second)
- (k::virtual_name(), i->first));
+ result->push_back(make_named_values<RepositoryVirtualsEntry>(
+ value_for<n::provided_by_spec>(i->second),
+ value_for<n::virtual_name>(i->first)
+ ));
return result;
}
@@ -1039,7 +1041,7 @@ ERepository::find_profile(const FSEntry & location) const
_imp->need_profiles_desc();
for (ProfilesDesc::const_iterator i(_imp->profiles_desc.begin()),
i_end(_imp->profiles_desc.end()) ; i != i_end ; ++i)
- if ((*i)[k::path()] == location)
+ if ((*i).path() == location)
return ProfilesConstIterator(i);
return ProfilesConstIterator(_imp->profiles_desc.end());
}
@@ -1050,11 +1052,11 @@ ERepository::set_profile(const ProfilesConstIterator & iter)
Context context("When setting profile by iterator:");
Log::get_instance()->message("e.profile.using", ll_debug, lc_context)
- << "Using profile '" << ((*iter)[k::path()]) << "'";
- _imp->profile_ptr = (*iter)[k::profile()];
+ << "Using profile '" << ((*iter).path()) << "'";
+ _imp->profile_ptr = (*iter).profile();
if ((*DistributionData::get_instance()->distribution_from_string(_imp->params.environment->distribution()))
- [k::support_old_style_virtuals()])
+ .support_old_style_virtuals())
if (_imp->params.environment->package_database()->has_repository_named(RepositoryName("virtuals")))
_imp->params.environment->package_database()->fetch_repository(
RepositoryName("virtuals"))->invalidate();
@@ -1068,14 +1070,14 @@ ERepository::set_profile_by_arch(const UseFlagName & arch)
Context context("When setting profile by arch '" + stringify(arch) + "':");
for (ProfilesConstIterator p(begin_profiles()), p_end(end_profiles()) ; p != p_end ; ++p)
- if ((*p)[k::arch()] == stringify(arch) && (*p)[k::status()] == "stable")
+ if ((*p).arch() == stringify(arch) && (*p).status() == "stable")
{
set_profile(p);
return;
}
for (ProfilesConstIterator p(begin_profiles()), p_end(end_profiles()) ; p != p_end ; ++p)
- if ((*p)[k::arch()] == stringify(arch))
+ if ((*p).arch() == stringify(arch))
{
set_profile(p);
return;
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 24a24aac5..c795497a1 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -33,8 +33,8 @@
#include <paludis/util/visitor_cast.hh>
#include <paludis/util/map.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/kc.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
@@ -828,16 +828,16 @@ namespace test_cases
std::tr1::shared_ptr<const RepositoryVirtualsInterface::VirtualsSequence> seq(repo->virtual_packages());
for (RepositoryVirtualsInterface::VirtualsSequence::ConstIterator it(seq->begin()),
it_end(seq->end()); it_end != it; ++it, ++count)
- if ("virtual/one" == stringify((*it)[k::virtual_name()]))
+ if ("virtual/one" == stringify(it->virtual_name()))
{
has_one = true;
- TEST_CHECK_STRINGIFY_EQUAL(*(*it)[k::provided_by_spec()], "cat-one/pkg-one");
+ TEST_CHECK_STRINGIFY_EQUAL(*it->provided_by_spec(), "cat-one/pkg-one");
}
else
{
- TEST_CHECK_STRINGIFY_EQUAL((*it)[k::virtual_name()], "virtual/two");
+ TEST_CHECK_STRINGIFY_EQUAL(it->virtual_name(), "virtual/two");
has_two = true;
- TEST_CHECK_STRINGIFY_EQUAL(*(*it)[k::provided_by_spec()], "cat-two/pkg-two");
+ TEST_CHECK_STRINGIFY_EQUAL(*it->provided_by_spec(), "cat-two/pkg-two");
}
TEST_CHECK(has_one);
@@ -852,21 +852,21 @@ namespace test_cases
seq = repo->virtual_packages();
for (RepositoryVirtualsInterface::VirtualsSequence::ConstIterator it(seq->begin()),
it_end(seq->end()); it_end != it; ++it, ++count)
- if ("virtual/one" == stringify((*it)[k::virtual_name()]))
+ if ("virtual/one" == stringify(it->virtual_name()))
{
has_one = true;
- TEST_CHECK_STRINGIFY_EQUAL(*(*it)[k::provided_by_spec()], "cat-two/pkg-two");
+ TEST_CHECK_STRINGIFY_EQUAL(*it->provided_by_spec(), "cat-two/pkg-two");
}
- else if ("virtual/two" == stringify((*it)[k::virtual_name()]))
+ else if ("virtual/two" == stringify(it->virtual_name()))
{
has_two = true;
- TEST_CHECK_STRINGIFY_EQUAL(*(*it)[k::provided_by_spec()], "cat-one/pkg-one");
+ TEST_CHECK_STRINGIFY_EQUAL(*it->provided_by_spec(), "cat-one/pkg-one");
}
else
{
- TEST_CHECK_STRINGIFY_EQUAL((*it)[k::virtual_name()], "virtual/three");
+ TEST_CHECK_STRINGIFY_EQUAL(it->virtual_name(), "virtual/three");
has_three = true;
- TEST_CHECK_STRINGIFY_EQUAL(*(*it)[k::provided_by_spec()], "cat-three/pkg-three");
+ TEST_CHECK_STRINGIFY_EQUAL(*it->provided_by_spec(), "cat-three/pkg-three");
}
TEST_CHECK(has_one);
@@ -943,10 +943,10 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- FetchAction action(FetchActionOptions::named_create()
- (k::fetch_unneeded(), false)
- (k::safe_resume(), true)
- );
+ FetchAction action(make_named_values<FetchActionOptions>(
+ value_for<n::fetch_unneeded>(false),
+ value_for<n::safe_resume>(true)
+ ));
{
TestMessageSuffix suffix("no files", true);
@@ -1045,10 +1045,10 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- FetchAction action(FetchActionOptions::named_create()
- (k::fetch_unneeded(), false)
- (k::safe_resume(), true)
- );
+ FetchAction action(make_named_values<FetchActionOptions>(
+ value_for<n::fetch_unneeded>(false),
+ value_for<n::safe_resume>(true)
+ ));
const std::tr1::shared_ptr<const PackageID> id(*env[selection::AllVersionsSorted(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("category/package",
@@ -1113,11 +1113,11 @@ namespace test_cases
std::tr1::bind(from_keys, make_shared_ptr(new Map<std::string, std::string>), std::tr1::placeholders::_1)));
#endif
- InstallAction action(InstallActionOptions::named_create()
- (k::debug_build(), iado_none)
- (k::checks(), iaco_default)
- (k::destination(), installed_repo)
- );
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::checks>(iaco_default),
+ value_for<n::debug_build>(iado_none),
+ value_for<n::destination>(installed_repo)
+ ));
#ifdef ENABLE_VIRTUALS_REPOSITORY
{
@@ -1338,11 +1338,11 @@ namespace test_cases
std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
env.package_database()->add_repository(2, installed_repo);
- InstallAction action(InstallActionOptions::named_create()
- (k::debug_build(), iado_none)
- (k::checks(), iaco_default)
- (k::destination(), installed_repo)
- );
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::checks>(iaco_default),
+ value_for<n::debug_build>(iado_none),
+ value_for<n::destination>(installed_repo)
+ ));
{
TestMessageSuffix suffix("econf source 1", true);
@@ -1402,11 +1402,11 @@ namespace test_cases
std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
env.package_database()->add_repository(2, installed_repo);
- InstallAction action(InstallActionOptions::named_create()
- (k::debug_build(), iado_none)
- (k::checks(), iaco_default)
- (k::destination(), installed_repo)
- );
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::checks>(iaco_default),
+ value_for<n::debug_build>(iado_none),
+ value_for<n::destination>(installed_repo)
+ ));
{
TestMessageSuffix suffix("econf source kdebuild-1", true);
@@ -1571,11 +1571,11 @@ namespace test_cases
std::tr1::bind(from_keys, make_shared_ptr(new Map<std::string, std::string>), std::tr1::placeholders::_1)));
#endif
- InstallAction action(InstallActionOptions::named_create()
- (k::debug_build(), iado_none)
- (k::checks(), iaco_default)
- (k::destination(), installed_repo)
- );
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::checks>(iaco_default),
+ value_for<n::debug_build>(iado_none),
+ value_for<n::destination>(installed_repo)
+ ));
{
TestMessageSuffix suffix("in-ebuild die", true);
@@ -2028,11 +2028,11 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, installed_repo);
- InstallAction action(InstallActionOptions::named_create()
- (k::debug_build(), iado_none)
- (k::checks(), iaco_default)
- (k::destination(), installed_repo)
- );
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::checks>(iaco_default),
+ value_for<n::debug_build>(iado_none),
+ value_for<n::destination>(installed_repo)
+ ));
const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/pkg",
diff --git a/paludis/repositories/e/e_repository_id.cc b/paludis/repositories/e/e_repository_id.cc
index d6325fd45..850c24503 100644
--- a/paludis/repositories/e/e_repository_id.cc
+++ b/paludis/repositories/e/e_repository_id.cc
@@ -20,7 +20,6 @@
#include <paludis/version_spec.hh>
#include <paludis/repositories/e/eapi.hh>
#include <paludis/repositories/e/e_repository_id.hh>
-#include <paludis/util/kc.hh>
#include <paludis/util/set.hh>
using namespace paludis;
diff --git a/paludis/repositories/e/e_repository_mask_file.cc b/paludis/repositories/e/e_repository_mask_file.cc
index 57875d909..9e443f9d3 100644
--- a/paludis/repositories/e/e_repository_mask_file.cc
+++ b/paludis/repositories/e/e_repository_mask_file.cc
@@ -25,7 +25,7 @@
#include <paludis/util/strip.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/wrapped_output_iterator.hh>
-#include <paludis/util/kc.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/mask.hh>
#include <list>
@@ -77,7 +77,8 @@ MaskFile::MaskFile(const FSEntry & f, const LineConfigFileOptions & opts) :
continue;
}
- _imp->lines.push_back(std::make_pair(*it, std::tr1::shared_ptr<RepositoryMaskInfo>(new RepositoryMaskInfo(f, comment))));
+ _imp->lines.push_back(std::make_pair(*it, std::tr1::shared_ptr<RepositoryMaskInfo>(new RepositoryMaskInfo(
+ make_named_values<RepositoryMaskInfo>(value_for<n::comment>(comment), value_for<n::mask_file>(f))))));
comment_used = true;
}
}
diff --git a/paludis/repositories/e/e_repository_profile.cc b/paludis/repositories/e/e_repository_profile.cc
index 18ccda2ed..f214a1b7f 100644
--- a/paludis/repositories/e/e_repository_profile.cc
+++ b/paludis/repositories/e/e_repository_profile.cc
@@ -37,7 +37,6 @@
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/create_iterator-impl.hh>
#include <paludis/util/config_file.hh>
-#include <paludis/util/kc.hh>
#include <paludis/util/hashes.hh>
#include <paludis/dep_tag.hh>
#include <paludis/environment.hh>
@@ -246,7 +245,7 @@ Implementation<ERepositoryProfile>::load_profile_directory_recursively(const FSE
load_spec_use_file(dir / "package.use.force", stacked_values_list.back().package_use_force);
packages_file.add_file(dir / "packages");
- if ((*DistributionData::get_instance()->distribution_from_string(env->distribution()))[k::support_old_style_virtuals()])
+ if ((*DistributionData::get_instance()->distribution_from_string(env->distribution())).support_old_style_virtuals())
virtuals_file.add_file(dir / "virtuals");
package_mask_file.add_file(dir / "package.mask");
}
@@ -489,7 +488,7 @@ Implementation<ERepositoryProfile>::make_vars_from_file_vars()
}
if ((*DistributionData::get_instance()->distribution_from_string(
- env->distribution()))[k::support_old_style_virtuals()])
+ env->distribution())).support_old_style_virtuals())
try
{
for (erepository::ProfileFile<LineConfigFile>::ConstIterator line(virtuals_file.begin()), line_end(virtuals_file.end()) ;
diff --git a/paludis/repositories/e/e_repository_sets_TEST.cc b/paludis/repositories/e/e_repository_sets_TEST.cc
index 82a73ed65..da88d55da 100644
--- a/paludis/repositories/e/e_repository_sets_TEST.cc
+++ b/paludis/repositories/e/e_repository_sets_TEST.cc
@@ -64,7 +64,7 @@ namespace test_cases
std::tr1::shared_ptr<ERepository> repo(make_ebuild_repository(&env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
- std::tr1::shared_ptr<const SetNameSet> sets_list((*repo)[k::sets_interface()]->sets_list());
+ std::tr1::shared_ptr<const SetNameSet> sets_list(repo->sets_interface()->sets_list());
TEST_CHECK_EQUAL(sets_list->size(), 4U);
TEST_CHECK(sets_list->end() != sets_list->find(SetName("system")));
TEST_CHECK(sets_list->end() != sets_list->find(SetName("security")));
@@ -92,7 +92,7 @@ namespace test_cases
installed->add_version("cat-two", "bar", "1.5");
env.package_database()->add_repository(0, installed);
- std::tr1::shared_ptr<SetSpecTree::ConstItem> set1((*repo)[k::sets_interface()]->package_set(SetName("set1")));
+ std::tr1::shared_ptr<SetSpecTree::ConstItem> set1(repo->sets_interface()->package_set(SetName("set1")));
StringifyFormatter ff;
erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
set1->accept(pretty);
@@ -122,7 +122,7 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::tr1::shared_ptr<SetSpecTree::ConstItem> insecurity((*repo)[k::sets_interface()]->package_set(SetName("insecurity")));
+ std::tr1::shared_ptr<SetSpecTree::ConstItem> insecurity(repo->sets_interface()->package_set(SetName("insecurity")));
StringifyFormatter ff;
erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
insecurity->accept(pretty);
@@ -160,7 +160,7 @@ namespace test_cases
installed->add_version("cat-three", "baz", "1.0");
env.package_database()->add_repository(0, installed);
- std::tr1::shared_ptr<const SetSpecTree::ConstItem> security((*repo)[k::sets_interface()]->package_set(SetName("security")));
+ std::tr1::shared_ptr<const SetSpecTree::ConstItem> security(repo->sets_interface()->package_set(SetName("security")));
StringifyFormatter ff;
erepository::DepSpecPrettyPrinter pretty(0, std::tr1::shared_ptr<const PackageID>(), ff, 0, false);
security->accept(pretty);
diff --git a/paludis/repositories/e/e_stripper.cc b/paludis/repositories/e/e_stripper.cc
index 1f32d5d49..23c24e515 100644
--- a/paludis/repositories/e/e_stripper.cc
+++ b/paludis/repositories/e/e_stripper.cc
@@ -18,9 +18,9 @@
*/
#include <paludis/repositories/e/e_stripper.hh>
-#include <paludis/util/kc.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/make_named_values.hh>
#include <iostream>
using namespace paludis;
@@ -41,11 +41,11 @@ namespace paludis
}
EStripper::EStripper(const EStripperOptions & options) :
- Stripper(StripperOptions::named_create()
- (k::image_dir(), options[k::image_dir()])
- (k::debug_build(), options[k::debug_build()])
- (k::debug_dir(), options[k::debug_dir()])
- ),
+ Stripper(make_named_values<StripperOptions>(
+ value_for<n::debug_build>(options.debug_build()),
+ value_for<n::debug_dir>(options.debug_dir()),
+ value_for<n::image_dir>(options.image_dir())
+ )),
PrivateImplementationPattern<EStripper>(new Implementation<EStripper>(options)),
_imp(PrivateImplementationPattern<EStripper>::_imp)
{
@@ -58,20 +58,20 @@ EStripper::~EStripper()
void
EStripper::on_strip(const FSEntry & f)
{
- std::cout << "str " << f.strip_leading(_imp->options[k::image_dir()]) << std::endl;
+ std::cout << "str " << f.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
EStripper::on_split(const FSEntry & f, const FSEntry & g)
{
- std::cout << "spl " << f.strip_leading(_imp->options[k::image_dir()]) <<
- " -> " << g.strip_leading(_imp->options[k::image_dir()]) << std::endl;
+ std::cout << "spl " << f.strip_leading(_imp->options.image_dir()) <<
+ " -> " << g.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
EStripper::on_unknown(const FSEntry & f)
{
- std::cout << "--- " << f.strip_leading(_imp->options[k::image_dir()]) << std::endl;
+ std::cout << "--- " << f.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
@@ -87,7 +87,7 @@ EStripper::on_leave_dir(const FSEntry &)
void
EStripper::strip()
{
- std::cout << ">>> Stripping inside " << _imp->options[k::image_dir()] << std::endl;
+ std::cout << ">>> Stripping inside " << _imp->options.image_dir() << std::endl;
Stripper::strip();
}
diff --git a/paludis/repositories/e/e_stripper.hh b/paludis/repositories/e/e_stripper.hh
index a8c947037..7bbd33c37 100644
--- a/paludis/repositories/e/e_stripper.hh
+++ b/paludis/repositories/e/e_stripper.hh
@@ -21,17 +21,29 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_E_STRIPPER_HH 1
#include <paludis/stripper.hh>
+#include <paludis/package_id-fwd.hh>
+#include <paludis/util/fs_entry-fwd.hh>
+#include <tr1/memory>
namespace paludis
{
+ namespace n
+ {
+ struct debug_build;
+ struct debug_dir;
+ struct image_dir;
+ struct package_id;
+ }
+
namespace erepository
{
- typedef kc::KeyedClass<
- kc::Field<k::package_id, std::tr1::shared_ptr<const PackageID> >,
- kc::Field<k::image_dir, FSEntry>,
- kc::Field<k::debug_dir, FSEntry>,
- kc::Field<k::debug_build, InstallActionDebugOption>
- > EStripperOptions;
+ struct EStripperOptions
+ {
+ NamedValue<n::debug_build, InstallActionDebugOption> debug_build;
+ NamedValue<n::debug_dir, FSEntry> debug_dir;
+ NamedValue<n::image_dir, FSEntry> image_dir;
+ NamedValue<n::package_id, std::tr1::shared_ptr<const PackageID> > package_id;
+ };
class EStripper :
public Stripper,
diff --git a/paludis/repositories/e/eapi-fwd.hh b/paludis/repositories/e/eapi-fwd.hh
index 2a15c5061..5a4886982 100644
--- a/paludis/repositories/e/eapi-fwd.hh
+++ b/paludis/repositories/e/eapi-fwd.hh
@@ -20,8 +20,6 @@
#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/repositories/e/dep_parser-fwd.hh>
#include <paludis/merger-fwd.hh>
#include <paludis/name-fwd.hh>
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index d5b44611e..9be81c7c3 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -34,7 +34,6 @@
#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 <paludis/util/hashes.hh>
#include <paludis/util/make_named_values.hh>
#include <tr1/unordered_map>
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index a3dee4a7e..3592e3976 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -42,7 +42,6 @@
#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>
@@ -96,122 +95,122 @@ EbuildCommand::operator() ()
Command cmd(getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis") +
"/ebuild.bash '" + ebuild_file() + "' " + commands());
- if (params[k::sandbox()])
+ if (params.sandbox())
cmd.with_sandbox();
- if (params[k::userpriv()])
- cmd.with_uid_gid(params[k::environment()]->reduced_uid(), params[k::environment()]->reduced_gid());
+ if (params.userpriv())
+ cmd.with_uid_gid(params.environment()->reduced_uid(), params.environment()->reduced_gid());
using namespace std::tr1::placeholders;
- cmd.with_pipe_command_handler(std::tr1::bind(&pipe_command_handler, params[k::environment()], params[k::package_id()], _1));
+ cmd.with_pipe_command_handler(std::tr1::bind(&pipe_command_handler, params.environment(), params.package_id(), _1));
- std::tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params[k::environment()]->syncers_dirs());
- std::tr1::shared_ptr<const FSEntrySequence> bashrc_files(params[k::environment()]->bashrc_files());
- std::tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params[k::environment()]->fetchers_dirs());
- std::tr1::shared_ptr<const FSEntrySequence> hook_dirs(params[k::environment()]->hook_dirs());
+ std::tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params.environment()->syncers_dirs());
+ std::tr1::shared_ptr<const FSEntrySequence> bashrc_files(params.environment()->bashrc_files());
+ std::tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params.environment()->fetchers_dirs());
+ std::tr1::shared_ptr<const FSEntrySequence> hook_dirs(params.environment()->hook_dirs());
cmd = extend_command(cmd
- .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()->exported_name()))
+ .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("PKGMANAGER", PALUDIS_PACKAGE "-" + stringify(PALUDIS_VERSION_MAJOR) + "." +
stringify(PALUDIS_VERSION_MINOR) + "." +
stringify(PALUDIS_VERSION_MICRO) + stringify(PALUDIS_VERSION_SUFFIX) +
(std::string(PALUDIS_GIT_HEAD).empty() ?
std::string("") : "-git-" + std::string(PALUDIS_GIT_HEAD)))
- .with_setenv("PALUDIS_TMPDIR", stringify(params[k::builddir()]))
+ .with_setenv("PALUDIS_TMPDIR", stringify(params.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[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_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_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[k::package_id()]->eapi()->supported()->ebuild_options()->utility_path_suffixes())
+ params.package_id()->eapi()->supported()->ebuild_options()->utility_path_suffixes())
.with_setenv("PALUDIS_EBUILD_MODULE_SUFFIXES",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->ebuild_module_suffixes())
+ params.package_id()->eapi()->supported()->ebuild_options()->ebuild_module_suffixes())
.with_setenv("PALUDIS_NON_EMPTY_VARIABLES",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->non_empty_variables())
+ params.package_id()->eapi()->supported()->ebuild_options()->non_empty_variables())
.with_setenv("PALUDIS_DIRECTORY_VARIABLES",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->directory_variables())
+ params.package_id()->eapi()->supported()->ebuild_options()->directory_variables())
.with_setenv("PALUDIS_EBUILD_MUST_NOT_SET_VARIABLES",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->ebuild_must_not_set_variables())
+ params.package_id()->eapi()->supported()->ebuild_options()->ebuild_must_not_set_variables())
.with_setenv("PALUDIS_ECLASS_MUST_NOT_SET_VARIABLES",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->eclass_must_not_set_variables())
+ params.package_id()->eapi()->supported()->ebuild_options()->eclass_must_not_set_variables())
.with_setenv("PALUDIS_SAVE_VARIABLES",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->save_variables())
+ params.package_id()->eapi()->supported()->ebuild_options()->save_variables())
.with_setenv("PALUDIS_SAVE_BASE_VARIABLES",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->save_base_variables())
+ params.package_id()->eapi()->supported()->ebuild_options()->save_base_variables())
.with_setenv("PALUDIS_SAVE_UNMODIFIABLE_VARIABLES",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->save_unmodifiable_variables())
+ params.package_id()->eapi()->supported()->ebuild_options()->save_unmodifiable_variables())
.with_setenv("PALUDIS_DIRECTORY_IF_EXISTS_VARIABLES",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->directory_if_exists_variables())
+ params.package_id()->eapi()->supported()->ebuild_options()->directory_if_exists_variables())
.with_setenv("PALUDIS_SOURCE_MERGED_VARIABLES",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->source_merged_variables())
+ params.package_id()->eapi()->supported()->ebuild_options()->source_merged_variables())
.with_setenv("PALUDIS_BRACKET_MERGED_VARIABLES",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->bracket_merged_variables())
+ params.package_id()->eapi()->supported()->ebuild_options()->bracket_merged_variables())
.with_setenv("PALUDIS_MUST_NOT_CHANGE_VARIABLES",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->must_not_change_variables())
+ params.package_id()->eapi()->supported()->ebuild_options()->must_not_change_variables())
.with_setenv("PALUDIS_RDEPEND_DEFAULTS_TO_DEPEND",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->rdepend_defaults_to_depend() ? "yes" : "")
+ params.package_id()->eapi()->supported()->ebuild_options()->rdepend_defaults_to_depend() ? "yes" : "")
.with_setenv("PALUDIS_F_FUNCTION_PREFIX",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->f_function_prefix())
+ params.package_id()->eapi()->supported()->ebuild_options()->f_function_prefix())
.with_setenv("PALUDIS_IGNORE_PIVOT_ENV_FUNCTIONS",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->ignore_pivot_env_functions())
+ params.package_id()->eapi()->supported()->ebuild_options()->ignore_pivot_env_functions())
.with_setenv("PALUDIS_IGNORE_PIVOT_ENV_VARIABLES",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->ignore_pivot_env_variables())
+ params.package_id()->eapi()->supported()->ebuild_options()->ignore_pivot_env_variables())
.with_setenv("PALUDIS_BINARY_DISTDIR_VARIABLE",
- params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_distdir())
+ params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_distdir())
.with_setenv("PALUDIS_UNPACK_UNRECOGNISED_IS_FATAL",
- params[k::package_id()]->eapi()->supported()->tools_options()->unpack_unrecognised_is_fatal() ? "yes" : "")
+ params.package_id()->eapi()->supported()->tools_options()->unpack_unrecognised_is_fatal() ? "yes" : "")
.with_setenv("PALUDIS_UNPACK_FIX_PERMISSIONS",
- params[k::package_id()]->eapi()->supported()->tools_options()->unpack_fix_permissions() ? "yes" : "")
+ params.package_id()->eapi()->supported()->tools_options()->unpack_fix_permissions() ? "yes" : "")
.with_setenv("PALUDIS_DOSYM_NO_MKDIR",
- params[k::package_id()]->eapi()->supported()->tools_options()->dosym_mkdir() ? "" : "yes")
+ params.package_id()->eapi()->supported()->tools_options()->dosym_mkdir() ? "" : "yes")
.with_setenv("PALUDIS_FAILURE_IS_FATAL",
- params[k::package_id()]->eapi()->supported()->tools_options()->failure_is_fatal() ? "yes" : "")
+ params.package_id()->eapi()->supported()->tools_options()->failure_is_fatal() ? "yes" : "")
.with_setenv("PALUDIS_UNPACK_FROM_VAR",
- params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_distdir())
+ params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_distdir())
.with_setenv("PALUDIS_PIPE_COMMANDS_SUPPORTED", "yes")
)
.with_setenv("SLOT", "")
.with_setenv("PALUDIS_PROFILE_DIR", "")
.with_setenv("PALUDIS_PROFILE_DIRS", "");
- if (! params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_kv().empty())
- cmd.with_setenv(params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_kv(), kernel_version());
- if (! params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_portdir().empty())
- cmd.with_setenv(params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_portdir(),
- stringify(params[k::portdir()]));
- if (! params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_distdir().empty())
- cmd.with_setenv(params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_distdir(),
- stringify(params[k::distdir()]));
+ 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()->supported()->ebuild_options()->support_eclasses())
+ if (params.package_id()->eapi()->supported()->ebuild_options()->support_eclasses())
cmd
- .with_setenv("ECLASSDIR", stringify(*params[k::eclassdirs()]->begin()))
- .with_setenv("ECLASSDIRS", join(params[k::eclassdirs()]->begin(),
- params[k::eclassdirs()]->end(), " "));
+ .with_setenv("ECLASSDIR", stringify(*params.eclassdirs()->begin()))
+ .with_setenv("ECLASSDIRS", join(params.eclassdirs()->begin(),
+ params.eclassdirs()->end(), " "));
- if (params[k::package_id()]->eapi()->supported()->ebuild_options()->support_exlibs())
+ if (params.package_id()->eapi()->supported()->ebuild_options()->support_exlibs())
cmd
- .with_setenv("EXLIBSDIRS", join(params[k::exlibsdirs()]->begin(),
- params[k::exlibsdirs()]->end(), " "));
+ .with_setenv("EXLIBSDIRS", join(params.exlibsdirs()->begin(),
+ params.exlibsdirs()->end(), " "));
- if (params[k::package_id()]->eapi()->supported()->ebuild_options()->want_portage_emulation_vars())
+ if (params.package_id()->eapi()->supported()->ebuild_options()->want_portage_emulation_vars())
cmd = add_portage_vars(cmd);
if (do_run_command(cmd))
@@ -223,26 +222,26 @@ EbuildCommand::operator() ()
std::string
EbuildCommand::ebuild_file() const
{
- return stringify(params[k::ebuild_file()]);
+ return stringify(params.ebuild_file());
}
Command
EbuildCommand::add_portage_vars(const Command & cmd) const
{
return Command(cmd)
- .with_setenv("PORTAGE_ACTUAL_DISTDIR", stringify(params[k::distdir()]))
+ .with_setenv("PORTAGE_ACTUAL_DISTDIR", stringify(params.distdir()))
.with_setenv("PORTAGE_BASHRC", "/dev/null")
- .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_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_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[k::builddir()]))
+ .with_setenv("PORTAGE_TMPDIR", stringify(params.builddir()))
.with_setenv("PORTAGE_TMPFS", "/dev/shm")
.with_setenv("PORTAGE_WORKDIR_MODE", "0700");
}
@@ -265,7 +264,7 @@ EbuildMetadataCommand::~EbuildMetadataCommand()
std::string
EbuildMetadataCommand::commands() const
{
- return params[k::commands()];
+ return params.commands();
}
bool
@@ -278,9 +277,9 @@ Command
EbuildMetadataCommand::extend_command(const Command & cmd)
{
return Command(cmd)
- .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()) + "> ");
+ .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()) + "> ");
}
namespace
@@ -302,7 +301,7 @@ EbuildMetadataCommand::do_run_command(const Command & cmd)
std::string input;
try
{
- Context context("When running ebuild command to generate metadata for '" + stringify(*params[k::package_id()]) + "':");
+ Context context("When running ebuild command to generate metadata for '" + stringify(*params.package_id()) + "':");
std::stringstream prog;
Command real_cmd(cmd);
@@ -326,7 +325,7 @@ EbuildMetadataCommand::do_run_command(const Command & cmd)
{
Log::get_instance()->message("e.ebuild.cache_failure", ll_warning, lc_context) << "Caught exception '"
<< e.message() << "' (" << e.what() << ") when generating cache for '"
- << *params[k::package_id()] << "', input is '" << purdy(input) << "'";
+ << *params.package_id() << "', input is '" << purdy(input) << "'";
}
if (ok)
@@ -334,7 +333,7 @@ EbuildMetadataCommand::do_run_command(const Command & cmd)
else
{
Log::get_instance()->message("e.ebuild.cache_failure", ll_warning, lc_context) << "Could not generate cache for '"
- << *params[k::package_id()] << "'";
+ << *params.package_id() << "'";
keys.reset(new Map<std::string, std::string>);
keys->insert("EAPI", EAPIData::get_instance()->unknown_eapi()->name());
@@ -356,7 +355,7 @@ namespace
void
EbuildMetadataCommand::load(const std::tr1::shared_ptr<const EbuildID> & id)
{
- Context context("When loading generated metadata for '" + stringify(*params[k::package_id()]) + "':");
+ Context context("When loading generated metadata for '" + stringify(*params.package_id()) + "':");
if (! keys)
throw InternalError(PALUDIS_HERE, "keys is 0");
@@ -398,7 +397,7 @@ EbuildMetadataCommand::load(const std::tr1::shared_ptr<const EbuildID> & id)
if (! m.dependencies().name().empty())
{
DependenciesRewriter rewriter;
- parse_depend(get(keys, m.dependencies().name()), params[k::environment()], id, *id->eapi())->accept(rewriter);
+ parse_depend(get(keys, m.dependencies().name()), params.environment(), id, *id->eapi())->accept(rewriter);
id->load_build_depend(m.dependencies().name() + ".DEPEND", m.dependencies().description() + " (build)", rewriter.depend());
id->load_run_depend(m.dependencies().name() + ".RDEPEND", m.dependencies().description() + " (run)", rewriter.rdepend());
id->load_post_depend(m.dependencies().name() + ".PDEPEND", m.dependencies().description() + " (post)", rewriter.pdepend());
@@ -480,7 +479,7 @@ EbuildVariableCommand::EbuildVariableCommand(const EbuildCommandParams & p,
std::string
EbuildVariableCommand::commands() const
{
- return params[k::commands()];
+ return params.commands();
}
bool
@@ -494,7 +493,7 @@ EbuildVariableCommand::extend_command(const Command & cmd)
{
return Command(cmd)
.with_setenv("PALUDIS_VARIABLE", _var)
- .with_uid_gid(params[k::environment()]->reduced_uid(), params[k::environment()]->reduced_gid());
+ .with_uid_gid(params.environment()->reduced_uid(), params.environment()->reduced_gid());
}
bool
@@ -513,38 +512,38 @@ EbuildVariableCommand::do_run_command(const Command & cmd)
std::string
EbuildNoFetchCommand::commands() const
{
- return params[k::commands()];
+ return params.commands();
}
bool
EbuildNoFetchCommand::failure()
{
- throw FetchActionError("Fetch failed for '" + stringify(*params[k::package_id()]) + "'");
+ throw FetchActionError("Fetch failed for '" + stringify(*params.package_id()) + "'");
}
Command
EbuildNoFetchCommand::extend_command(const Command & cmd)
{
Command result(Command(cmd)
- .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()->supported()->ebuild_environment_variables()->env_aa().empty())
- result.with_setenv(params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_aa(),
- fetch_params[k::aa()]);
- if (! params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_use().empty())
- result.with_setenv(params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_use(),
- fetch_params[k::use()]);
- if (! params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_use_expand().empty())
- result.with_setenv(params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_use_expand(),
- fetch_params[k::use_expand()]);
+ .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());
for (Map<std::string, std::string>::ConstIterator
- i(fetch_params[k::expand_vars()]->begin()),
- j(fetch_params[k::expand_vars()]->end()) ; i != j ; ++i)
+ i(fetch_params.expand_vars()->begin()),
+ j(fetch_params.expand_vars()->end()) ; i != j ; ++i)
result.with_setenv(i->first, i->second);
return result;
@@ -560,42 +559,42 @@ EbuildNoFetchCommand::EbuildNoFetchCommand(const EbuildCommandParams & p,
std::string
EbuildInstallCommand::commands() const
{
- return params[k::commands()];
+ return params.commands();
}
bool
EbuildInstallCommand::failure()
{
- throw InstallActionError("Install failed for '" + stringify(*params[k::package_id()]) + "'");
+ throw InstallActionError("Install failed for '" + stringify(*params.package_id()) + "'");
}
Command
EbuildInstallCommand::extend_command(const Command & cmd)
{
Command result(Command(cmd)
- .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_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()->supported()->ebuild_environment_variables()->env_aa().empty())
- result.with_setenv(params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_aa(),
- install_params[k::aa()]);
- if (! params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_use().empty())
- result.with_setenv(params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_use(),
- install_params[k::use()]);
- if (! params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_use_expand().empty())
- result.with_setenv(params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_use_expand(),
- install_params[k::use_expand()]);
+ .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("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());
for (Map<std::string, std::string>::ConstIterator
- i(install_params[k::expand_vars()]->begin()),
- j(install_params[k::expand_vars()]->end()) ; i != j ; ++i)
+ i(install_params.expand_vars()->begin()),
+ j(install_params.expand_vars()->end()) ; i != j ; ++i)
result.with_setenv(i->first, i->second);
return result;
@@ -611,7 +610,7 @@ EbuildInstallCommand::EbuildInstallCommand(const EbuildCommandParams & p,
std::string
EbuildUninstallCommand::commands() const
{
- return params[k::commands()];
+ return params.commands();
}
std::string
@@ -623,20 +622,20 @@ EbuildUninstallCommand::ebuild_file() const
bool
EbuildUninstallCommand::failure()
{
- throw UninstallActionError("Uninstall failed for '" + stringify(*params[k::package_id()]) + "'");
+ throw UninstallActionError("Uninstall failed for '" + stringify(*params.package_id()) + "'");
}
Command
EbuildUninstallCommand::extend_command(const Command & cmd)
{
Command result(Command(cmd)
- .with_setenv("ROOT", uninstall_params[k::root()])
- .with_setenv("PALUDIS_LOADSAVEENV_DIR", stringify(uninstall_params[k::loadsaveenv_dir()]))
+ .with_setenv("ROOT", uninstall_params.root())
+ .with_setenv("PALUDIS_LOADSAVEENV_DIR", stringify(uninstall_params.loadsaveenv_dir()))
);
- if (uninstall_params[k::load_environment()])
+ if (uninstall_params.load_environment())
result
- .with_setenv("PALUDIS_LOAD_ENVIRONMENT", stringify(*uninstall_params[k::load_environment()]))
+ .with_setenv("PALUDIS_LOAD_ENVIRONMENT", stringify(*uninstall_params.load_environment()))
.with_setenv("PALUDIS_SKIP_INHERIT", "yes");
return result;
@@ -658,24 +657,24 @@ EbuildConfigCommand::ebuild_file() const
std::string
EbuildConfigCommand::commands() const
{
- return params[k::commands()];
+ return params.commands();
}
bool
EbuildConfigCommand::failure()
{
- throw ConfigActionError("Configure failed for '" + stringify(*params[k::package_id()]) + "'");
+ throw ConfigActionError("Configure failed for '" + stringify(*params.package_id()) + "'");
}
Command
EbuildConfigCommand::extend_command(const Command & cmd)
{
Command result(Command(cmd)
- .with_setenv("ROOT", config_params[k::root()]));
+ .with_setenv("ROOT", config_params.root()));
- if (config_params[k::load_environment()])
+ if (config_params.load_environment())
result
- .with_setenv("PALUDIS_LOAD_ENVIRONMENT", stringify(*config_params[k::load_environment()]))
+ .with_setenv("PALUDIS_LOAD_ENVIRONMENT", stringify(*config_params.load_environment()))
.with_setenv("PALUDIS_SKIP_INHERIT", "yes");
return result;
@@ -700,13 +699,13 @@ WriteVDBEntryCommand::operator() ()
std::string ebuild_cmd(getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis") +
"/write_vdb_entry.bash '" +
- stringify(params[k::output_directory()]) + "' '" +
- stringify(params[k::environment_file()]) + "'");
+ stringify(params.output_directory()) + "' '" +
+ stringify(params.environment_file()) + "'");
- std::tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params[k::environment()]->syncers_dirs());
- std::tr1::shared_ptr<const FSEntrySequence> bashrc_files(params[k::environment()]->bashrc_files());
- std::tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params[k::environment()]->fetchers_dirs());
- std::tr1::shared_ptr<const FSEntrySequence> hook_dirs(params[k::environment()]->hook_dirs());
+ std::tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params.environment()->syncers_dirs());
+ std::tr1::shared_ptr<const FSEntrySequence> bashrc_files(params.environment()->bashrc_files());
+ std::tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params.environment()->fetchers_dirs());
+ std::tr1::shared_ptr<const FSEntrySequence> hook_dirs(params.environment()->hook_dirs());
Command cmd(Command(ebuild_cmd)
.with_setenv("PKGMANAGER", PALUDIS_PACKAGE "-" + stringify(PALUDIS_VERSION_MAJOR) + "." +
@@ -714,26 +713,26 @@ WriteVDBEntryCommand::operator() ()
stringify(PALUDIS_VERSION_MICRO) +
(std::string(PALUDIS_GIT_HEAD).empty() ?
std::string("") : "-git-" + std::string(PALUDIS_GIT_HEAD)))
- .with_setenv("EAPI", stringify(params[k::package_id()]->eapi()->exported_name()))
+ .with_setenv("EAPI", stringify(params.package_id()->eapi()->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[k::environment()]->paludis_command())
+ .with_setenv("PALUDIS_COMMAND", params.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[k::package_id()]->eapi()->supported()->ebuild_options()->vdb_from_env_variables())
+ params.package_id()->eapi()->supported()->ebuild_options()->vdb_from_env_variables())
.with_setenv("PALUDIS_VDB_FROM_ENV_UNLESS_EMPTY_VARIABLES",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->vdb_from_env_unless_empty_variables())
+ params.package_id()->eapi()->supported()->ebuild_options()->vdb_from_env_unless_empty_variables())
.with_setenv("PALUDIS_F_FUNCTION_PREFIX",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->f_function_prefix())
+ params.package_id()->eapi()->supported()->ebuild_options()->f_function_prefix())
.with_setenv("PALUDIS_IGNORE_PIVOT_ENV_FUNCTIONS",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->ignore_pivot_env_functions())
+ params.package_id()->eapi()->supported()->ebuild_options()->ignore_pivot_env_functions())
.with_setenv("PALUDIS_IGNORE_PIVOT_ENV_VARIABLES",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->ignore_pivot_env_variables())
- .with_pipe_command_handler(std::tr1::bind(&pipe_command_handler, params[k::environment()], params[k::package_id()], _1))
+ params.package_id()->eapi()->supported()->ebuild_options()->ignore_pivot_env_variables())
+ .with_pipe_command_handler(std::tr1::bind(&pipe_command_handler, params.environment(), params.package_id(), _1))
);
if (0 != (run_command(cmd)))
@@ -752,7 +751,7 @@ VDBPostMergeCommand::operator() ()
return;
Command cmd(getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis") +
- "/utils/wrapped_ldconfig '" + stringify(params[k::root()]) + "'");
+ "/utils/wrapped_ldconfig '" + stringify(params.root()) + "'");
if (0 != (run_command(cmd)))
throw InstallActionError("VDB Entry post merge commands failed");
@@ -761,7 +760,7 @@ VDBPostMergeCommand::operator() ()
std::string
EbuildPretendCommand::commands() const
{
- return params[k::commands()];
+ return params.commands();
}
bool
@@ -774,30 +773,30 @@ Command
EbuildPretendCommand::extend_command(const Command & cmd)
{
Command result(Command(cmd)
- .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_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_prefix_discard_blank_output()
.with_prefix_blank_lines()
- .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()->supported()->ebuild_environment_variables()->env_use().empty())
- result.with_setenv(params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_use(),
- pretend_params[k::use()]);
- if (! params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_use_expand().empty())
- result.with_setenv(params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_use_expand(),
- pretend_params[k::use_expand()]);
+ .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());
for (Map<std::string, std::string>::ConstIterator
- i(pretend_params[k::expand_vars()]->begin()),
- j(pretend_params[k::expand_vars()]->end()) ; i != j ; ++i)
+ i(pretend_params.expand_vars()->begin()),
+ j(pretend_params.expand_vars()->end()) ; i != j ; ++i)
result.with_setenv(i->first, i->second);
- result.with_uid_gid(params[k::environment()]->reduced_uid(), params[k::environment()]->reduced_gid());
+ result.with_uid_gid(params.environment()->reduced_uid(), params.environment()->reduced_gid());
return result;
}
@@ -812,8 +811,8 @@ EbuildPretendCommand::EbuildPretendCommand(const EbuildCommandParams & p,
std::string
EbuildInfoCommand::ebuild_file() const
{
- if (info_params[k::use_ebuild_file()])
- return stringify(params[k::ebuild_file()]);
+ if (info_params.use_ebuild_file())
+ return stringify(params.ebuild_file());
else
return "-";
}
@@ -821,7 +820,7 @@ EbuildInfoCommand::ebuild_file() const
std::string
EbuildInfoCommand::commands() const
{
- return params[k::commands()];
+ return params.commands();
}
bool
@@ -833,37 +832,37 @@ EbuildInfoCommand::failure()
Command
EbuildInfoCommand::extend_command(const Command & cmd)
{
- std::string info_vars(join(info_params[k::info_vars()]->begin(), info_params[k::info_vars()]->end(), " "));
+ std::string info_vars(join(info_params.info_vars()->begin(), info_params.info_vars()->end(), " "));
Command result(Command(cmd)
.with_stdout_prefix(" ")
.with_stderr_prefix(" ")
.with_prefix_discard_blank_output()
.with_prefix_blank_lines()
- .with_setenv("ROOT", info_params[k::root()])
+ .with_setenv("ROOT", info_params.root())
.with_setenv("PALUDIS_INFO_VARS", info_vars)
.with_setenv("PALUDIS_PROFILE_DIR",
- 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(), " ")));
+ 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(), " ")));
- if (! params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_use().empty())
- result.with_setenv(params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_use(),
- info_params[k::use()]);
- if (! params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_use_expand().empty())
- result.with_setenv(params[k::package_id()]->eapi()->supported()->ebuild_environment_variables()->env_use_expand(),
- info_params[k::use_expand()]);
+ 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());
for (Map<std::string, std::string>::ConstIterator
- i(info_params[k::expand_vars()]->begin()),
- j(info_params[k::expand_vars()]->end()) ; i != j ; ++i)
+ i(info_params.expand_vars()->begin()),
+ j(info_params.expand_vars()->end()) ; i != j ; ++i)
result.with_setenv(i->first, i->second);
- result.with_uid_gid(params[k::environment()]->reduced_uid(), params[k::environment()]->reduced_gid());
+ result.with_uid_gid(params.environment()->reduced_uid(), params.environment()->reduced_gid());
- if (info_params[k::load_environment()])
+ if (info_params.load_environment())
result
- .with_setenv("PALUDIS_LOAD_ENVIRONMENT", stringify(*info_params[k::load_environment()]))
+ .with_setenv("PALUDIS_LOAD_ENVIRONMENT", stringify(*info_params.load_environment()))
.with_setenv("PALUDIS_SKIP_INHERIT", "yes");
return result;
@@ -886,25 +885,25 @@ WriteBinaryEbuildCommand::operator() ()
{
using namespace std::tr1::placeholders;
- if (! EAPIData::get_instance()->eapi_from_string("pbin-1+" + params[k::package_id()]->eapi()->exported_name())->supported())
+ 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[k::package_id()]->eapi()->exported_name());
+ params.package_id()->eapi()->exported_name());
- 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())
+ 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())
+ "--" + cookie());
std::string ebuild_cmd(getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis") +
"/write_binary_ebuild.bash '" +
- stringify(params[k::binary_ebuild_location()]) + "' '" +
- stringify(params[k::binary_distdir()] / bindistfile) + "' '" +
- stringify(params[k::environment_file()]) + "' '" +
- stringify(params[k::image()]) + "'");
+ stringify(params.binary_ebuild_location()) + "' '" +
+ stringify(params.binary_distdir() / bindistfile) + "' '" +
+ stringify(params.environment_file()) + "' '" +
+ stringify(params.image()) + "'");
- std::tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params[k::environment()]->syncers_dirs());
- std::tr1::shared_ptr<const FSEntrySequence> bashrc_files(params[k::environment()]->bashrc_files());
- std::tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params[k::environment()]->fetchers_dirs());
- std::tr1::shared_ptr<const FSEntrySequence> hook_dirs(params[k::environment()]->hook_dirs());
+ std::tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params.environment()->syncers_dirs());
+ std::tr1::shared_ptr<const FSEntrySequence> bashrc_files(params.environment()->bashrc_files());
+ std::tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params.environment()->fetchers_dirs());
+ std::tr1::shared_ptr<const FSEntrySequence> hook_dirs(params.environment()->hook_dirs());
Command cmd(Command(ebuild_cmd)
.with_setenv("PKGMANAGER", PALUDIS_PACKAGE "-" + stringify(PALUDIS_VERSION_MAJOR) + "." +
@@ -912,31 +911,31 @@ WriteBinaryEbuildCommand::operator() ()
stringify(PALUDIS_VERSION_MICRO) +
(std::string(PALUDIS_GIT_HEAD).empty() ?
std::string("") : "-git-" + std::string(PALUDIS_GIT_HEAD)))
- .with_setenv("EAPI", stringify(params[k::package_id()]->eapi()->exported_name()))
+ .with_setenv("EAPI", stringify(params.package_id()->eapi()->exported_name()))
.with_setenv("PALUDIS_CONFIG_DIR", SYSCONFDIR "/paludis/")
- .with_setenv("PALUDIS_TMPDIR", stringify(params[k::builddir()]))
+ .with_setenv("PALUDIS_TMPDIR", stringify(params.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[k::environment()]->paludis_command())
+ .with_setenv("PALUDIS_COMMAND", params.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[k::package_id()]->eapi()->supported()->ebuild_options()->binary_from_env_variables())
+ params.package_id()->eapi()->supported()->ebuild_options()->binary_from_env_variables())
.with_setenv("PALUDIS_F_FUNCTION_PREFIX",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->f_function_prefix())
+ params.package_id()->eapi()->supported()->ebuild_options()->f_function_prefix())
.with_setenv("PALUDIS_IGNORE_PIVOT_ENV_FUNCTIONS",
- params[k::package_id()]->eapi()->supported()->ebuild_options()->ignore_pivot_env_functions())
+ params.package_id()->eapi()->supported()->ebuild_options()->ignore_pivot_env_functions())
.with_setenv("PALUDIS_IGNORE_PIVOT_ENV_VARIABLES",
- params[k::package_id()]->eapi()->supported()->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)
+ 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[k::package_id()]->eapi()->exported_name())->supported()->ebuild_metadata_variables()->keywords().name())
+ + params.package_id()->eapi()->exported_name())->supported()->ebuild_metadata_variables()->keywords().name())
.with_setenv("PALUDIS_BINARY_DISTDIR_VARIABLE", EAPIData::get_instance()->eapi_from_string("pbin-1+"
- + params[k::package_id()]->eapi()->exported_name())->supported()->ebuild_environment_variables()->env_distdir())
- .with_pipe_command_handler(std::tr1::bind(&pipe_command_handler, params[k::environment()], params[k::package_id()], _1))
+ + params.package_id()->eapi()->exported_name())->supported()->ebuild_environment_variables()->env_distdir())
+ .with_pipe_command_handler(std::tr1::bind(&pipe_command_handler, params.environment(), params.package_id(), _1))
);
if (0 != (run_command(cmd)))
diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh
index ebc7ac650..ad2741103 100644
--- a/paludis/repositories/e/ebuild.hh
+++ b/paludis/repositories/e/ebuild.hh
@@ -24,8 +24,6 @@
#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>
@@ -43,6 +41,45 @@ namespace paludis
class Command;
class ERepository;
+ namespace n
+ {
+ struct a;
+ struct aa;
+ struct binary_distdir;
+ struct binary_ebuild_location;
+ struct builddir;
+ struct commands;
+ struct config_protect;
+ struct config_protect_mask;
+ struct destination_repository;
+ struct distdir;
+ struct ebuild_dir;
+ struct ebuild_file;
+ struct eclassdirs;
+ struct environment;
+ struct environment_file;
+ struct exlibsdirs;
+ struct expand_vars;
+ struct files_dir;
+ struct image;
+ struct info_vars;
+ struct load_environment;
+ struct loadsaveenv_dir;
+ struct merger_options;
+ struct output_directory;
+ struct package_id;
+ struct portdir;
+ struct profiles;
+ struct root;
+ struct sandbox;
+ struct slot;
+ struct unmerge_only;
+ struct use;
+ struct use_ebuild_file;
+ struct use_expand;
+ struct userpriv;
+ }
+
namespace erepository
{
class EbuildID;
@@ -55,21 +92,22 @@ namespace paludis
* \ingroup grpebuildinterface
* \nosubgrouping
*/
- typedef kc::KeyedClass<
- kc::Field<k::environment, const Environment *>,
- kc::Field<k::package_id, std::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, std::tr1::shared_ptr<const FSEntrySequence> >,
- kc::Field<k::exlibsdirs, std::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;
+ struct EbuildCommandParams
+ {
+ NamedValue<n::builddir, FSEntry> builddir;
+ NamedValue<n::commands, std::string> commands;
+ NamedValue<n::distdir, FSEntry> distdir;
+ NamedValue<n::ebuild_dir, FSEntry> ebuild_dir;
+ NamedValue<n::ebuild_file, FSEntry> ebuild_file;
+ NamedValue<n::eclassdirs, std::tr1::shared_ptr<const FSEntrySequence> > eclassdirs;
+ NamedValue<n::environment, const Environment *> environment;
+ NamedValue<n::exlibsdirs, std::tr1::shared_ptr<const FSEntrySequence> > exlibsdirs;
+ NamedValue<n::files_dir, FSEntry> files_dir;
+ NamedValue<n::package_id, std::tr1::shared_ptr<const erepository::ERepositoryID> > package_id;
+ NamedValue<n::portdir, FSEntry> portdir;
+ NamedValue<n::sandbox, bool> sandbox;
+ NamedValue<n::userpriv, bool> userpriv;
+ };
/**
* Parameters for an EbuildNoFetchCommand.
@@ -78,15 +116,16 @@ namespace paludis
* \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, std::tr1::shared_ptr<const FSEntrySequence> >,
- kc::Field<k::expand_vars, std::tr1::shared_ptr<const Map<std::string, std::string> > >
- > EbuildNoFetchCommandParams;
+ struct EbuildNoFetchCommandParams
+ {
+ NamedValue<n::a, std::string> a;
+ NamedValue<n::aa, std::string> aa;
+ NamedValue<n::expand_vars, std::tr1::shared_ptr<const Map<std::string, std::string> > > expand_vars;
+ NamedValue<n::profiles, std::tr1::shared_ptr<const FSEntrySequence> > profiles;
+ NamedValue<n::root, std::string> root;
+ NamedValue<n::use, std::string> use;
+ NamedValue<n::use_expand, std::string> use_expand;
+ };
/**
* Parameters for an EbuildInstallCommand.
@@ -95,19 +134,20 @@ namespace paludis
* \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, std::tr1::shared_ptr<const FSEntrySequence> >,
- kc::Field<k::expand_vars, std::tr1::shared_ptr<const Map<std::string, std::string> > >,
- 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;
+ struct EbuildInstallCommandParams
+ {
+ NamedValue<n::a, std::string> a;
+ NamedValue<n::aa, std::string> aa;
+ NamedValue<n::config_protect, std::string> config_protect;
+ NamedValue<n::config_protect_mask, std::string> config_protect_mask;
+ NamedValue<n::expand_vars, std::tr1::shared_ptr<const Map<std::string, std::string> > > expand_vars;
+ NamedValue<n::loadsaveenv_dir, FSEntry> loadsaveenv_dir;
+ NamedValue<n::profiles, std::tr1::shared_ptr<const FSEntrySequence> > profiles;
+ NamedValue<n::root, std::string> root;
+ NamedValue<n::slot, SlotName> slot;
+ NamedValue<n::use, std::string> use;
+ NamedValue<n::use_expand, std::string> use_expand;
+ };
/**
* Parameters for an EbuildPretendCommand.
@@ -116,13 +156,14 @@ namespace paludis
* \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, std::tr1::shared_ptr<const FSEntrySequence> >,
- kc::Field<k::expand_vars, std::tr1::shared_ptr<const Map<std::string, std::string> > >
- > EbuildPretendCommandParams;
+ struct EbuildPretendCommandParams
+ {
+ NamedValue<n::expand_vars, std::tr1::shared_ptr<const Map<std::string, std::string> > > expand_vars;
+ NamedValue<n::profiles, std::tr1::shared_ptr<const FSEntrySequence> > profiles;
+ NamedValue<n::root, std::string> root;
+ NamedValue<n::use, std::string> use;
+ NamedValue<n::use_expand, std::string> use_expand;
+ };
/**
* Parameters for an EbuildUninstallCommand.
@@ -131,12 +172,13 @@ namespace paludis
* \ingroup grpebuildinterface
* \nosubgrouping
*/
- typedef kc::KeyedClass<
- kc::Field<k::root, std::string>,
- kc::Field<k::unmerge_only, bool>,
- kc::Field<k::load_environment, const FSEntry *>,
- kc::Field<k::loadsaveenv_dir, FSEntry>
- > EbuildUninstallCommandParams;
+ struct EbuildUninstallCommandParams
+ {
+ NamedValue<n::load_environment, const FSEntry *> load_environment;
+ NamedValue<n::loadsaveenv_dir, FSEntry> loadsaveenv_dir;
+ NamedValue<n::root, std::string> root;
+ NamedValue<n::unmerge_only, bool> unmerge_only;
+ };
/**
* Parameters for an EbuildConfigCommand.
@@ -145,10 +187,11 @@ namespace paludis
* \ingroup grpebuildinterface
* \nosubgrouping
*/
- typedef kc::KeyedClass<
- kc::Field<k::root, std::string>,
- kc::Field<k::load_environment, const FSEntry *>
- > EbuildConfigCommandParams;
+ struct EbuildConfigCommandParams
+ {
+ NamedValue<n::load_environment, const FSEntry *> load_environment;
+ NamedValue<n::root, std::string> root;
+ };
/**
* Parameters for an EbuildInfoCommand.
@@ -157,16 +200,17 @@ namespace paludis
* \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, std::tr1::shared_ptr<const FSEntrySequence> >,
- kc::Field<k::expand_vars, std::tr1::shared_ptr<const Map<std::string, std::string> > >,
- kc::Field<k::load_environment, const FSEntry *>,
- kc::Field<k::info_vars, std::tr1::shared_ptr<const Set<std::string> > >,
- kc::Field<k::use_ebuild_file, bool>
- > EbuildInfoCommandParams;
+ struct EbuildInfoCommandParams
+ {
+ NamedValue<n::expand_vars, std::tr1::shared_ptr<const Map<std::string, std::string> > > expand_vars;
+ NamedValue<n::info_vars, std::tr1::shared_ptr<const Set<std::string> > > info_vars;
+ NamedValue<n::load_environment, const FSEntry *> load_environment;
+ NamedValue<n::profiles, std::tr1::shared_ptr<const FSEntrySequence> > profiles;
+ NamedValue<n::root, std::string> root;
+ NamedValue<n::use, std::string> use;
+ NamedValue<n::use_ebuild_file, bool> use_ebuild_file;
+ NamedValue<n::use_expand, std::string> use_expand;
+ };
/**
* Parameters for writing a VDB entry.
@@ -175,12 +219,13 @@ namespace paludis
* \ingroup grpebuildinterface
* \nosubgrouping
*/
- typedef kc::KeyedClass<
- kc::Field<k::environment, const Environment *>,
- kc::Field<k::package_id, std::tr1::shared_ptr<const erepository::ERepositoryID> >,
- kc::Field<k::output_directory, FSEntry>,
- kc::Field<k::environment_file, FSEntry>
- > WriteVDBEntryParams;
+ struct WriteVDBEntryParams
+ {
+ NamedValue<n::environment, const Environment *> environment;
+ NamedValue<n::environment_file, FSEntry> environment_file;
+ NamedValue<n::output_directory, FSEntry> output_directory;
+ NamedValue<n::package_id, std::tr1::shared_ptr<const erepository::ERepositoryID> > package_id;
+ };
/**
* Parameters for writing a binary ebuild.
@@ -189,17 +234,18 @@ namespace paludis
* \ingroup grpebuildinterface
* \nosubgrouping
*/
- typedef kc::KeyedClass<
- kc::Field<k::environment, const Environment *>,
- kc::Field<k::destination_repository, const ERepository *>,
- kc::Field<k::package_id, std::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;
+ struct WriteBinaryEbuildCommandParams
+ {
+ NamedValue<n::binary_distdir, FSEntry> binary_distdir;
+ NamedValue<n::binary_ebuild_location, FSEntry> binary_ebuild_location;
+ NamedValue<n::builddir, FSEntry> builddir;
+ NamedValue<n::destination_repository, const ERepository *> destination_repository;
+ NamedValue<n::environment, const Environment *> environment;
+ NamedValue<n::environment_file, FSEntry> environment_file;
+ NamedValue<n::image, FSEntry> image;
+ NamedValue<n::merger_options, MergerOptions> merger_options;
+ NamedValue<n::package_id, std::tr1::shared_ptr<const erepository::ERepositoryID> > package_id;
+ };
/**
* Parameters for a VDBPostMergeCommand.
@@ -208,9 +254,10 @@ namespace paludis
* \ingroup grpebuildinterface
* \nosubgrouping
*/
- typedef kc::KeyedClass<
- kc::Field<k::root, FSEntry>
- > VDBPostMergeCommandParams;
+ struct VDBPostMergeCommandParams
+ {
+ NamedValue<n::root, FSEntry> root;
+ };
/**
* An EbuildCommand is the base class from which specific ebuild
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index 6f60fe965..4295107d4 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -49,10 +49,10 @@
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/kc.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/instantiation_policy-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_named_values.hh>
#include <tr1/functional>
#include <fstream>
#include <list>
@@ -431,10 +431,10 @@ EbuildEntries::fetch(const std::tr1::shared_ptr<const ERepositoryID> & id,
stringify(_imp->e_repository->params().master_repository->name()) :
stringify(_imp->e_repository->name()));
FetchVisitor f(_imp->params.environment, id, *id->eapi(),
- _imp->e_repository->params().distdir, o[k::fetch_unneeded()], fetch_userpriv_ok, mirrors_name,
- id->fetches_key()->initial_label(), o[k::safe_resume()]);
+ _imp->e_repository->params().distdir, o.fetch_unneeded(), fetch_userpriv_ok, mirrors_name,
+ id->fetches_key()->initial_label(), o.safe_resume());
id->fetches_key()->value()->accept(f);
- CheckFetchedFilesVisitor c(_imp->environment, id, _imp->e_repository->params().distdir, o[k::fetch_unneeded()], fetch_restrict,
+ CheckFetchedFilesVisitor c(_imp->environment, id, _imp->e_repository->params().distdir, o.fetch_unneeded(), fetch_restrict,
((_imp->e_repository->layout()->package_directory(id->name())) / "Manifest"),
_imp->e_repository->params().use_manifest);
id->fetches_key()->value()->accept(c);
@@ -454,31 +454,32 @@ EbuildEntries::fetch(const std::tr1::shared_ptr<const ERepositoryID> & id,
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
phase != phase_end ; ++phase)
{
- 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(), id->fs_location_key()->value())
- (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") && userpriv_ok)
- (k::sandbox(), phase->option("sandbox"))
- (k::commands(), join(phase->begin_commands(), phase->end_commands(), " "))
- (k::builddir(), _imp->params.builddir));
+ EbuildCommandParams command_params(make_named_values<EbuildCommandParams>(
+ value_for<n::builddir>(_imp->params.builddir),
+ value_for<n::commands>(join(phase->begin_commands(), phase->end_commands(), " ")),
+ value_for<n::distdir>(_imp->params.distdir),
+ value_for<n::ebuild_dir>(_imp->e_repository->layout()->package_directory(id->name())),
+ value_for<n::ebuild_file>(id->fs_location_key()->value()),
+ value_for<n::eclassdirs>(_imp->params.eclassdirs),
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::exlibsdirs>(exlibsdirs),
+ value_for<n::files_dir>(_imp->e_repository->layout()->package_directory(id->name()) / "files"),
+ value_for<n::package_id>(id),
+ value_for<n::portdir>(_imp->params.master_repository ? _imp->params.master_repository->params().location : _imp->params.location),
+ value_for<n::sandbox>(phase->option("sandbox")),
+ value_for<n::userpriv>(phase->option("userpriv") && userpriv_ok)
+ ));
EbuildNoFetchCommand nofetch_cmd(command_params,
- 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));
+ make_named_values<EbuildNoFetchCommandParams>(
+ value_for<n::a>(archives),
+ value_for<n::aa>(all_archives),
+ value_for<n::expand_vars>(expand_vars),
+ value_for<n::profiles>(_imp->params.profiles),
+ value_for<n::root>("/"),
+ value_for<n::use>(use),
+ value_for<n::use_expand>(join(p->begin_use_expand(), p->end_use_expand(), " "))
+ ));
if (! nofetch_cmd())
throw FetchActionError("Fetch of '" + stringify(*id) + "' failed", c.failures());
@@ -501,7 +502,7 @@ EbuildEntries::pretend_fetch(const std::tr1::shared_ptr<const ERepositoryID> & i
if (id->fetches_key())
{
PretendFetchVisitor f(_imp->params.environment, id, *id->eapi(),
- _imp->e_repository->params().distdir, a.options[k::fetch_unneeded()],
+ _imp->e_repository->params().distdir, a.options.fetch_unneeded(),
id->fetches_key()->initial_label(), a);
id->fetches_key()->value()->accept(f);
}
@@ -609,28 +610,28 @@ EbuildEntries::install(const std::tr1::shared_ptr<const ERepositoryID> & id,
{
if (phase->option("merge"))
{
- if (! (*o[k::destination()])[k::destination_interface()])
+ if (! (*o.destination()).destination_interface())
throw InstallActionError("Can't install '" + stringify(*id)
- + "' to destination '" + stringify(o[k::destination()]->name())
+ + "' to destination '" + stringify(o.destination()->name())
+ "' because destination does not provide destination_interface");
- (*o[k::destination()])[k::destination_interface()]->merge(
- MergeParams::named_create()
- (k::package_id(), id)
- (k::image_dir(), _imp->params.builddir / (stringify(id->name().category) + "-" + stringify(id->name().package) + "-"
- + 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())
- );
+ (*o.destination()).destination_interface()->merge(
+ make_named_values<MergeParams>(
+ value_for<n::environment_file>(_imp->params.builddir / (stringify(id->name().category) + "-" +
+ stringify(id->name().package) + "-" + stringify(id->version())) / "temp" / "loadsaveenv"),
+ value_for<n::image_dir>(_imp->params.builddir / (stringify(id->name().category) + "-" +
+ stringify(id->name().package) + "-" + stringify(id->version())) / "image"),
+ value_for<n::options>(id->eapi()->supported()->merger_options()),
+ value_for<n::package_id>(id)
+ ));
}
else if (phase->option("strip"))
{
if (! strip_restrict)
{
std::string libdir("lib");
- FSEntry root(o[k::destination()]->installed_root_key() ?
- stringify(o[k::destination()]->installed_root_key()->value()) : "/");
+ FSEntry root(o.destination()->installed_root_key() ?
+ stringify(o.destination()->installed_root_key()->value()) : "/");
if ((root / "usr" / "lib").is_symbolic_link())
{
libdir = (root / "usr" / "lib").readlink();
@@ -640,27 +641,27 @@ EbuildEntries::install(const std::tr1::shared_ptr<const ERepositoryID> & id,
Log::get_instance()->message("e.ebuild.libdir", ll_debug, lc_context) << "Using '" << libdir << "' for libdir";
- EStripper stripper(EStripperOptions::named_create()
- (k::package_id(), id)
- (k::image_dir(), _imp->params.builddir / (stringify(id->name().category) + "-" + stringify(id->name().package) + "-"
- + stringify(id->version())) / "image")
- (k::debug_dir(), _imp->params.builddir / (stringify(id->name().category) + "-" + stringify(id->name().package) + "-"
- + stringify(id->version())) / "image" / "usr" / libdir / "debug")
- (k::debug_build(), o[k::debug_build()])
- );
+ EStripper stripper(make_named_values<EStripperOptions>(
+ value_for<n::debug_build>(o.debug_build()),
+ value_for<n::debug_dir>(_imp->params.builddir / (stringify(id->name().category) + "-" +
+ stringify(id->name().package) + "-" + stringify(id->version())) / "image" / "usr" / libdir / "debug"),
+ value_for<n::image_dir>(_imp->params.builddir / (stringify(id->name().category) + "-" +
+ stringify(id->name().package) + "-" + stringify(id->version())) / "image"),
+ value_for<n::package_id>(id)
+ ));
stripper.strip();
}
}
else if ((! phase->option("prepost")) ||
- ((*o[k::destination()])[k::destination_interface()] &&
- (*o[k::destination()])[k::destination_interface()]->want_pre_post_phases()))
+ ((*o.destination()).destination_interface() &&
+ (*o.destination()).destination_interface()->want_pre_post_phases()))
{
if (phase->option("checkphase"))
{
if (test_restrict)
continue;
- switch (o[k::checks()])
+ switch (o.checks())
{
case iaco_none:
if (! phase->option("checks=none"))
@@ -682,37 +683,36 @@ EbuildEntries::install(const std::tr1::shared_ptr<const ERepositoryID> & id,
}
}
- 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(), id->fs_location_key()->value())
- (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));
+ EbuildCommandParams command_params(make_named_values<EbuildCommandParams>(
+ value_for<n::builddir>(_imp->params.builddir),
+ value_for<n::commands>(join(phase->begin_commands(), phase->end_commands(), " ")),
+ value_for<n::distdir>(_imp->params.distdir),
+ value_for<n::ebuild_dir>(_imp->e_repository->layout()->package_directory(id->name())),
+ value_for<n::ebuild_file>(id->fs_location_key()->value()),
+ value_for<n::eclassdirs>(_imp->params.eclassdirs),
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::exlibsdirs>(exlibsdirs),
+ value_for<n::files_dir>(_imp->e_repository->layout()->package_directory(id->name()) / "files"),
+ value_for<n::package_id>(id),
+ value_for<n::portdir>(_imp->params.master_repository ? _imp->params.master_repository->params().location : _imp->params.location),
+ value_for<n::sandbox>(phase->option("sandbox")),
+ value_for<n::userpriv>(phase->option("userpriv") && userpriv_ok)
+ ));
EbuildInstallCommandParams install_params(
- 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::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())));
+ make_named_values<EbuildInstallCommandParams>(
+ value_for<n::a>(archives),
+ value_for<n::aa>(all_archives),
+ value_for<n::config_protect>(_imp->e_repository->profile_variable("CONFIG_PROTECT")),
+ value_for<n::config_protect_mask>(_imp->e_repository->profile_variable("CONFIG_PROTECT_MASK")),
+ value_for<n::expand_vars>(expand_vars),
+ value_for<n::loadsaveenv_dir>(_imp->params.builddir / (stringify(id->name().category) + "-" + stringify(id->name().package) + "-" + stringify(id->version())) / "temp"),
+ value_for<n::profiles>(_imp->params.profiles),
+ value_for<n::root>(o.destination()->installed_root_key() ? stringify(o.destination()->installed_root_key()->value()) : "/"),
+ value_for<n::slot>(SlotName(id->slot())),
+ value_for<n::use>(use),
+ value_for<n::use_expand>(join(p->begin_use_expand(), p->end_use_expand(), " "))
+ ));
EbuildInstallCommand cmd(command_params, install_params);
cmd();
@@ -761,35 +761,34 @@ EbuildEntries::info(const std::tr1::shared_ptr<const ERepositoryID> & id,
if (phase->option("installed=true"))
continue;
- 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(), id->fs_location_key()->value())
- (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));
+ EbuildCommandParams command_params(make_named_values<EbuildCommandParams>(
+ value_for<n::builddir>(_imp->params.builddir),
+ value_for<n::commands>(join(phase->begin_commands(), phase->end_commands(), " ")),
+ value_for<n::distdir>(_imp->params.distdir),
+ value_for<n::ebuild_dir>(_imp->e_repository->layout()->package_directory(id->name())),
+ value_for<n::ebuild_file>(id->fs_location_key()->value()),
+ value_for<n::eclassdirs>(_imp->params.eclassdirs),
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::exlibsdirs>(exlibsdirs),
+ value_for<n::files_dir>(_imp->e_repository->layout()->package_directory(id->name()) / "files"),
+ value_for<n::package_id>(id),
+ value_for<n::portdir>(_imp->params.master_repository ? _imp->params.master_repository->params().location : _imp->params.location),
+ value_for<n::sandbox>(phase->option("sandbox")),
+ value_for<n::userpriv>(phase->option("userpriv") && userpriv_ok)
+ ));
EbuildInfoCommandParams info_params(
- 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(), _imp->e_repository->info_vars_key() ?
- _imp->e_repository->info_vars_key()->value() :
- make_shared_ptr(new const Set<std::string>))
- (k::use_ebuild_file(), true)
- );
+ make_named_values<EbuildInfoCommandParams>(
+ value_for<n::expand_vars>(expand_vars),
+ value_for<n::info_vars>(_imp->e_repository->info_vars_key() ?
+ _imp->e_repository->info_vars_key()->value() : make_shared_ptr(new const Set<std::string>)),
+ value_for<n::load_environment>(static_cast<const FSEntry *>(0)),
+ value_for<n::profiles>(_imp->params.profiles),
+ value_for<n::root>(stringify(_imp->params.environment->root())),
+ value_for<n::use>(use),
+ value_for<n::use_ebuild_file>(true),
+ value_for<n::use_expand>(join(p->begin_use_expand(), p->end_use_expand(), " "))
+ ));
EbuildInfoCommand cmd(command_params, info_params);
cmd();
@@ -826,21 +825,21 @@ EbuildEntries::get_environment_variable(const std::tr1::shared_ptr<const EReposi
std::tr1::shared_ptr<const FSEntrySequence> exlibsdirs(_imp->e_repository->layout()->exlibsdirs(id->name()));
- 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(), id->fs_location_key()->value())
- (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") && userpriv_ok)
- (k::commands(), join(phases.begin_phases()->begin_commands(), phases.begin_phases()->end_commands(), " "))
- (k::builddir(), _imp->params.builddir),
+ EbuildVariableCommand cmd(make_named_values<EbuildCommandParams>(
+ value_for<n::builddir>(_imp->params.builddir),
+ value_for<n::commands>(join(phases.begin_phases()->begin_commands(), phases.begin_phases()->end_commands(), " ")),
+ value_for<n::distdir>(_imp->params.distdir),
+ value_for<n::ebuild_dir>(_imp->e_repository->layout()->package_directory(id->name())),
+ value_for<n::ebuild_file>(id->fs_location_key()->value()),
+ value_for<n::eclassdirs>(_imp->params.eclassdirs),
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::exlibsdirs>(exlibsdirs),
+ value_for<n::files_dir>(_imp->e_repository->layout()->package_directory(id->name()) / "files"),
+ value_for<n::package_id>(id),
+ value_for<n::portdir>(_imp->params.master_repository ? _imp->params.master_repository->params().location : _imp->params.location),
+ value_for<n::sandbox>(phases.begin_phases()->option("sandbox")),
+ value_for<n::userpriv>(phases.begin_phases()->option("userpriv") && userpriv_ok)
+ ),
var);
@@ -860,31 +859,31 @@ EbuildEntries::make_ebuild_entries(
void
EbuildEntries::merge(const MergeParams & m)
{
- Context context("When merging '" + stringify(*m[k::package_id()]) + "' at '" + stringify(m[k::image_dir()])
+ Context context("When merging '" + stringify(*m.package_id()) + "' at '" + stringify(m.image_dir())
+ "' to E repository '" + stringify(_imp->e_repository->name()) + "':");
- if (! _imp->e_repository->is_suitable_destination_for(*m[k::package_id()]))
- throw InstallActionError("Not a suitable destination for '" + stringify(*m[k::package_id()]) + "'");
+ if (! _imp->e_repository->is_suitable_destination_for(*m.package_id()))
+ throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
FSEntry binary_ebuild_location(_imp->e_repository->layout()->binary_ebuild_location(
- m[k::package_id()]->name(), m[k::package_id()]->version(),
- "pbin-1+" + std::tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()])->eapi()->name()));
+ m.package_id()->name(), m.package_id()->version(),
+ "pbin-1+" + std::tr1::static_pointer_cast<const ERepositoryID>(m.package_id())->eapi()->name()));
binary_ebuild_location.dirname().dirname().mkdir();
binary_ebuild_location.dirname().mkdir();
WriteBinaryEbuildCommand write_binary_ebuild_command(
- WriteBinaryEbuildCommandParams::named_create()
- (k::environment(), _imp->params.environment)
- (k::package_id(), std::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(), std::tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()])->eapi()->supported()->merger_options())
- );
+ make_named_values<WriteBinaryEbuildCommandParams>(
+ value_for<n::binary_distdir>(_imp->params.binary_distdir),
+ value_for<n::binary_ebuild_location>(binary_ebuild_location),
+ value_for<n::builddir>(_imp->params.builddir),
+ value_for<n::destination_repository>(_imp->e_repository),
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::environment_file>(m.environment_file()),
+ value_for<n::image>(m.image_dir()),
+ value_for<n::merger_options>(std::tr1::static_pointer_cast<const ERepositoryID>(m.package_id())->eapi()->supported()->merger_options()),
+ value_for<n::package_id>(std::tr1::static_pointer_cast<const ERepositoryID>(m.package_id()))
+ ));
write_binary_ebuild_command();
}
@@ -954,29 +953,30 @@ EbuildEntries::pretend(const std::tr1::shared_ptr<const ERepositoryID> & id,
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
phase != phase_end ; ++phase)
{
- 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(), id->fs_location_key()->value())
- (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") && userpriv_ok)
- (k::sandbox(), phase->option("sandbox"))
- (k::commands(), join(phase->begin_commands(), phase->end_commands(), " "))
- (k::builddir(), _imp->params.builddir));
+ EbuildCommandParams command_params(make_named_values<EbuildCommandParams>(
+ value_for<n::builddir>(_imp->params.builddir),
+ value_for<n::commands>(join(phase->begin_commands(), phase->end_commands(), " ")),
+ value_for<n::distdir>(_imp->params.distdir),
+ value_for<n::ebuild_dir>(_imp->e_repository->layout()->package_directory(id->name())),
+ value_for<n::ebuild_file>(id->fs_location_key()->value()),
+ value_for<n::eclassdirs>(_imp->params.eclassdirs),
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::exlibsdirs>(exlibsdirs),
+ value_for<n::files_dir>(_imp->e_repository->layout()->package_directory(id->name()) / "files"),
+ value_for<n::package_id>(id),
+ value_for<n::portdir>(_imp->params.master_repository ? _imp->params.master_repository->params().location : _imp->params.location),
+ value_for<n::sandbox>(phase->option("sandbox")),
+ value_for<n::userpriv>(phase->option("userpriv") && userpriv_ok)
+ ));
EbuildPretendCommand pretend_cmd(command_params,
- 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));
+ make_named_values<EbuildPretendCommandParams>(
+ value_for<n::expand_vars>(expand_vars),
+ value_for<n::profiles>(_imp->params.profiles),
+ value_for<n::root>(stringify(_imp->params.environment->root())),
+ value_for<n::use>(use),
+ value_for<n::use_expand>(join(p->begin_use_expand(), p->end_use_expand(), " "))
+ ));
if (! pretend_cmd())
return false;
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index c0b6d26cd..a633b206c 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -44,6 +44,7 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/save.hh>
+#include <paludis/util/make_named_values.hh>
#include <iterator>
#include <fstream>
@@ -214,21 +215,22 @@ EbuildID::need_keys_added() const
throw EAPIConfigurationError("EAPI '" + _imp->eapi->name() + "' defines "
+ (count == 0 ? "no" : stringify(count)) + " ebuild variable phases but expected exactly one");
- 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")));
+ EbuildMetadataCommand cmd(make_named_values<EbuildCommandParams>(
+ value_for<n::builddir>(_imp->repository->params().builddir),
+ value_for<n::commands>(join(phases.begin_phases()->begin_commands(), phases.begin_phases()->end_commands(), " ")),
+ value_for<n::distdir>(_imp->repository->params().distdir),
+ value_for<n::ebuild_dir>(_imp->repository->layout()->package_directory(name())),
+ value_for<n::ebuild_file>(_imp->ebuild),
+ value_for<n::eclassdirs>(_imp->repository->params().eclassdirs),
+ value_for<n::environment>(_imp->environment),
+ value_for<n::exlibsdirs>(_imp->repository->layout()->exlibsdirs(name())),
+ value_for<n::files_dir>(_imp->repository->layout()->package_directory(name()) / "files"),
+ value_for<n::package_id>(shared_from_this()),
+ value_for<n::portdir>(_imp->repository->params().master_repository ?
+ _imp->repository->params().master_repository->params().location : _imp->repository->params().location),
+ value_for<n::sandbox>(phases.begin_phases()->option("sandbox")),
+ value_for<n::userpriv>(phases.begin_phases()->option("userpriv"))
+ ));
if (! cmd())
Log::get_instance()->message("e.ebuild.metadata.unusable", ll_warning, lc_no_context) << "No usable metadata for '" +
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 4324c6e2a..cb65e70e8 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -31,9 +31,9 @@
#include <paludis/util/cookie.hh>
#include <paludis/util/set.hh>
#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/kc.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/system.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/distribution.hh>
#include <paludis/environment.hh>
#include <paludis/ndbam.hh>
@@ -95,20 +95,22 @@ ExndbamRepository::ExndbamRepository(const RepositoryName & n, const ExndbamRepo
.environment(p.environment)
.builddir(p.builddir)
.root(p.root),
- n, RepositoryCapabilities::named_create()
- (k::sets_interface(), this)
- (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
- (k::use_interface(), this)
- (k::environment_variable_interface(), this)
- (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
- (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
- (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
- (k::destination_interface(), this)
- (k::e_interface(), static_cast<RepositoryEInterface *>(0))
- (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
- (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
- (k::hook_interface(), this)
- (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
+ n,
+ make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(this),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(this),
+ value_for<n::hook_interface>(this),
+ value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
+ value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(this),
+ value_for<n::syncable_interface>(static_cast<RepositorySyncableInterface *>(0)),
+ value_for<n::use_interface>(this),
+ value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ )),
PrivateImplementationPattern<ExndbamRepository>(new Implementation<ExndbamRepository>(p)),
_imp(PrivateImplementationPattern<ExndbamRepository>::_imp)
{
@@ -150,7 +152,7 @@ ExndbamRepository::make_exndbam_repository(
builddir = f("buildroot");
if (builddir.empty())
builddir = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution()))[k::default_ebuild_builddir()];
+ env->distribution())).default_ebuild_builddir();
else
Log::get_instance()->message("e.exndbam.configuration.deprecated", ll_warning, lc_context)
<< "Key 'buildroot' is deprecated, use 'builddir' instead";
@@ -200,11 +202,11 @@ ExndbamRepository::package_ids(const QualifiedPackageName & q) const
for (IndirectIterator<NDBAMEntrySequence::ConstIterator> e(entries->begin()), e_end(entries->end()) ;
e != e_end ; ++e)
{
- Lock l(*(*e)[k::mutex()]);
- if (! (*e)[k::package_id()])
- (*e)[k::package_id()].reset(new ExndbamID((*e)[k::name()], (*e)[k::version()], _imp->params.environment,
- shared_from_this(), (*e)[k::fs_location()], &_imp->ndbam));
- result->push_back((*e)[k::package_id()]);
+ Lock l(*(*e).mutex());
+ if (! (*e).package_id())
+ (*e).package_id().reset(new ExndbamID((*e).name(), (*e).version(), _imp->params.environment,
+ shared_from_this(), (*e).fs_location(), &_imp->ndbam));
+ result->push_back((*e).package_id());
}
return result;
@@ -279,20 +281,20 @@ namespace
void
ExndbamRepository::merge(const MergeParams & m)
{
- Context context("When merging '" + stringify(*m[k::package_id()]) + "' at '" + stringify(m[k::image_dir()])
+ Context context("When merging '" + stringify(*m.package_id()) + "' at '" + stringify(m.image_dir())
+ "' to Exndbam repository '" + stringify(name()) + "':");
- if (! is_suitable_destination_for(*m[k::package_id()]))
- throw InstallActionError("Not a suitable destination for '" + stringify(*m[k::package_id()]) + "'");
+ if (! is_suitable_destination_for(*m.package_id()))
+ throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
std::tr1::shared_ptr<const PackageID> if_overwritten_id, if_same_name_id;
{
- std::tr1::shared_ptr<const PackageIDSequence> ids(package_ids(m[k::package_id()]->name()));
+ std::tr1::shared_ptr<const PackageIDSequence> ids(package_ids(m.package_id()->name()));
for (PackageIDSequence::ConstIterator v(ids->begin()), v_end(ids->end()) ;
v != v_end ; ++v)
{
if_same_name_id = *v;
- if ((*v)->version() == m[k::package_id()]->version() && (*v)->slot() == m[k::package_id()]->slot())
+ if ((*v)->version() == m.package_id()->version() && (*v)->slot() == m.package_id()->slot())
{
if_overwritten_id = *v;
break;
@@ -305,7 +307,7 @@ ExndbamRepository::merge(const MergeParams & m)
uid_dir = if_same_name_id->fs_location_key()->value().dirname();
else
{
- std::string uid(stringify(m[k::package_id()]->name().category) + "---" + stringify(m[k::package_id()]->name().package));
+ std::string uid(stringify(m.package_id()->name().category) + "---" + stringify(m.package_id()->name().package));
uid_dir /= "data";
uid_dir.mkdir();
uid_dir /= uid;
@@ -313,7 +315,7 @@ ExndbamRepository::merge(const MergeParams & m)
}
FSEntry target_ver_dir(uid_dir);
- target_ver_dir /= (stringify(m[k::package_id()]->version()) + ":" + stringify(m[k::package_id()]->slot()) + ":" + cookie());
+ target_ver_dir /= (stringify(m.package_id()->version()) + ":" + stringify(m.package_id()->slot()) + ":" + cookie());
if (target_ver_dir.exists())
throw InstallActionError("Temporary merge directory '" + stringify(target_ver_dir) + "' already exists, probably "
@@ -321,11 +323,12 @@ ExndbamRepository::merge(const MergeParams & m)
target_ver_dir.mkdir();
WriteVDBEntryCommand write_vdb_entry_command(
- WriteVDBEntryParams::named_create()
- (k::environment(), _imp->params.environment)
- (k::package_id(), std::tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()]))
- (k::output_directory(), target_ver_dir)
- (k::environment_file(), m[k::environment_file()]));
+ make_named_values<WriteVDBEntryParams>(
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::environment_file>(m.environment_file()),
+ value_for<n::output_directory>(target_ver_dir),
+ value_for<n::package_id>(std::tr1::static_pointer_cast<const ERepositoryID>(m.package_id()))
+ ));
write_vdb_entry_command();
@@ -340,18 +343,18 @@ ExndbamRepository::merge(const MergeParams & m)
}
NDBAMMerger merger(
- NDBAMMergerParams::named_create()
- (k::environment(), _imp->params.environment)
- (k::image(), m[k::image_dir()])
- (k::root(), installed_root_key()->value())
- (k::install_under(), FSEntry("/"))
- (k::contents_file(), target_ver_dir / "contents")
- (k::config_protect(), config_protect)
- (k::config_protect_mask(), config_protect_mask)
- (k::package_id(), m[k::package_id()])
- (k::get_new_ids_or_minus_one(), std::tr1::bind(&get_new_ids_or_minus_one, _imp->params.environment,
- std::tr1::placeholders::_1))
- (k::options(), m[k::options()]));
+ make_named_values<NDBAMMergerParams>(
+ value_for<n::config_protect>(config_protect),
+ value_for<n::config_protect_mask>(config_protect_mask),
+ value_for<n::contents_file>(target_ver_dir / "contents"),
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::get_new_ids_or_minus_one>(std::tr1::bind(&get_new_ids_or_minus_one, _imp->params.environment, std::tr1::placeholders::_1)),
+ value_for<n::image>(m.image_dir()),
+ value_for<n::install_under>(FSEntry("/")),
+ value_for<n::options>(m.options()),
+ value_for<n::package_id>(m.package_id()),
+ value_for<n::root>(installed_root_key()->value())
+ ));
if (! merger.check())
{
@@ -364,7 +367,7 @@ ExndbamRepository::merge(const MergeParams & m)
merger.merge();
- _imp->ndbam.index(m[k::package_id()]->name(), uid_dir.basename());
+ _imp->ndbam.index(m.package_id()->name(), uid_dir.basename());
if (if_overwritten_id)
{
@@ -372,8 +375,9 @@ ExndbamRepository::merge(const MergeParams & m)
}
VDBPostMergeCommand post_merge_command(
- VDBPostMergeCommandParams::named_create()
- (k::root(), installed_root_key()->value()));
+ make_named_values<VDBPostMergeCommandParams>(
+ value_for<n::root>(installed_root_key()->value())
+ ));
post_merge_command();
}
@@ -426,39 +430,44 @@ ExndbamRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositor
/* unmerge */
NDBAMUnmerger unmerger(
- NDBAMUnmergerOptions::named_create()
- (k::environment(), _imp->params.environment)
- (k::root(), installed_root_key()->value())
- (k::contents_file(), ver_dir / "contents")
- (k::config_protect(), config_protect)
- (k::config_protect_mask(), config_protect_mask)
- (k::ndbam(), &_imp->ndbam)
- (k::package_id(), id));
+ make_named_values<NDBAMUnmergerOptions>(
+ value_for<n::config_protect>(config_protect),
+ value_for<n::config_protect_mask>(config_protect_mask),
+ value_for<n::contents_file>(ver_dir / "contents"),
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::ndbam>(&_imp->ndbam),
+ value_for<n::package_id>(id),
+ value_for<n::root>(installed_root_key()->value())
+ ));
unmerger.unmerge();
}
else
{
- 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::unmerge_only(), false)
- (k::loadsaveenv_dir(), ver_dir)
- (k::load_environment(), load_env.get()));
+ EbuildCommandParams params(
+ make_named_values<EbuildCommandParams>(
+ value_for<n::builddir>(_imp->params.builddir),
+ value_for<n::commands>(join(phase->begin_commands(), phase->end_commands(), " ")),
+ value_for<n::distdir>(ver_dir),
+ value_for<n::ebuild_dir>(ver_dir),
+ value_for<n::ebuild_file>(ver_dir / (stringify(id->name().package) + "-" + stringify(id->version()) + ".ebuild")),
+ value_for<n::eclassdirs>(eclassdirs),
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::exlibsdirs>(make_shared_ptr(new FSEntrySequence)),
+ value_for<n::files_dir>(ver_dir),
+ value_for<n::package_id>(id),
+ value_for<n::portdir>(_imp->params.location),
+ value_for<n::sandbox>(phase->option("sandbox")),
+ value_for<n::userpriv>(phase->option("userpriv"))
+ ));
+
+ EbuildUninstallCommandParams uninstall_params(
+ make_named_values<EbuildUninstallCommandParams>(
+ value_for<n::load_environment>(load_env.get()),
+ value_for<n::loadsaveenv_dir>(ver_dir),
+ value_for<n::root>(stringify(_imp->params.root)),
+ value_for<n::unmerge_only>(false)
+ ));
EbuildUninstallCommand uninstall_cmd_pre(params, uninstall_params);
uninstall_cmd_pre();
diff --git a/paludis/repositories/e/info_metadata_key.cc b/paludis/repositories/e/info_metadata_key.cc
index 87fad675a..f61ae7bd5 100644
--- a/paludis/repositories/e/info_metadata_key.cc
+++ b/paludis/repositories/e/info_metadata_key.cc
@@ -27,7 +27,6 @@
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
-#include <paludis/util/kc.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/join.hh>
diff --git a/paludis/repositories/e/make_ebuild_repository.cc b/paludis/repositories/e/make_ebuild_repository.cc
index 022643daa..c796b25f9 100644
--- a/paludis/repositories/e/make_ebuild_repository.cc
+++ b/paludis/repositories/e/make_ebuild_repository.cc
@@ -28,7 +28,6 @@
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/options.hh>
#include <paludis/util/config_file.hh>
-#include <paludis/util/kc.hh>
#include <paludis/repositories/e/e_repository_exceptions.hh>
#include <paludis/environment.hh>
#include <paludis/distribution.hh>
@@ -111,7 +110,7 @@ paludis::make_ebuild_repository(
else
{
distdir = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution()))[k::default_ebuild_distdir()];
+ env->distribution())).default_ebuild_distdir();
if (distdir.empty())
distdir = location + "/distfiles";
else if ('/' != distdir.at(0))
@@ -142,7 +141,7 @@ paludis::make_ebuild_repository(
std::string write_cache(f("write_cache"));
if (write_cache.empty())
write_cache = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution()))[k::default_ebuild_write_cache()];
+ env->distribution())).default_ebuild_write_cache();
bool append_repository_name_to_write_cache(true);
if (! f("append_repository_name_to_write_cache").empty())
@@ -164,7 +163,7 @@ paludis::make_ebuild_repository(
if (! layout_conf
|| (eapi_when_unknown = layout_conf->get("eapi_when_unknown")).empty())
eapi_when_unknown = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution()))[k::default_ebuild_eapi_when_unknown()];
+ env->distribution())).default_ebuild_eapi_when_unknown();
}
std::string eapi_when_unspecified(f("eapi_when_unspecified"));
@@ -173,7 +172,7 @@ paludis::make_ebuild_repository(
if (! layout_conf
|| (eapi_when_unspecified = layout_conf->get("eapi_when_unspecified")).empty())
eapi_when_unspecified = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution()))[k::default_ebuild_eapi_when_unspecified()];
+ env->distribution())).default_ebuild_eapi_when_unspecified();
}
std::string profile_eapi(f("profile_eapi"));
@@ -182,14 +181,14 @@ paludis::make_ebuild_repository(
if (! layout_conf
|| (profile_eapi = layout_conf->get("eapi_when_unspecified")).empty())
profile_eapi = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution()))[k::default_ebuild_profile_eapi()];
+ env->distribution())).default_ebuild_profile_eapi();
}
std::string names_cache(f("names_cache"));
if (names_cache.empty())
{
names_cache = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution()))[k::default_ebuild_names_cache()];
+ env->distribution())).default_ebuild_names_cache();
if (names_cache.empty())
{
Log::get_instance()->message("e.ebuild.configuration.no_names_cache", ll_warning, lc_no_context)
@@ -221,7 +220,7 @@ paludis::make_ebuild_repository(
builddir = stringify(master_repository->params().builddir);
else
builddir = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution()))[k::default_ebuild_builddir()];
+ env->distribution())).default_ebuild_builddir();
}
else
Log::get_instance()->message("e.ebuild.configuration.deprecated", ll_warning, lc_context)
@@ -234,7 +233,7 @@ paludis::make_ebuild_repository(
if (! layout_conf
|| (layout = layout_conf->get("layout")).empty())
layout = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution()))[k::default_ebuild_layout()];
+ env->distribution())).default_ebuild_layout();
}
erepository::UseManifest use_manifest(erepository::manifest_use);
diff --git a/paludis/repositories/e/qa/eapi_supported.cc b/paludis/repositories/e/qa/eapi_supported.cc
index d449753e4..10d1e7304 100644
--- a/paludis/repositories/e/qa/eapi_supported.cc
+++ b/paludis/repositories/e/qa/eapi_supported.cc
@@ -23,7 +23,6 @@
#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(
diff --git a/paludis/repositories/e/qa/fetches_key.cc b/paludis/repositories/e/qa/fetches_key.cc
index a3779dd8c..91f96aeab 100644
--- a/paludis/repositories/e/qa/fetches_key.cc
+++ b/paludis/repositories/e/qa/fetches_key.cc
@@ -145,7 +145,7 @@ namespace
else
{
mirror_host.erase(pos);
- RepositoryMirrorsInterface * m((*id->repository())[k::mirrors_interface()]);
+ RepositoryMirrorsInterface * m((*id->repository()).mirrors_interface());
if (! m->is_mirror(mirror_host))
reporter.message(QAMessage(entry, qaml_normal, name,
"Unknown mirror '" + mirror_host + "' for '" +
diff --git a/paludis/repositories/e/qa/iuse_key.cc b/paludis/repositories/e/qa/iuse_key.cc
index 4074bb8d8..eaf78fe97 100644
--- a/paludis/repositories/e/qa/iuse_key.cc
+++ b/paludis/repositories/e/qa/iuse_key.cc
@@ -94,7 +94,7 @@ paludis::erepository::iuse_key_check(
.with_associated_id(id)
.with_associated_key(id, id->iuse_key()));
- if ("" == (*repo)[k::use_interface()]->describe_use_flag(it->flag, *id))
+ if ("" == (*repo).use_interface()->describe_use_flag(it->flag, *id))
reporter.message(QAMessage(entry, qaml_minor, name,
"Flag '" + stringify(it->flag) + "' in '" + id->iuse_key()->raw_name() + "' has no description")
.with_associated_id(id)
diff --git a/paludis/repositories/e/qa/spec_keys.cc b/paludis/repositories/e/qa/spec_keys.cc
index 9a421e6bf..9c3f73777 100644
--- a/paludis/repositories/e/qa/spec_keys.cc
+++ b/paludis/repositories/e/qa/spec_keys.cc
@@ -190,7 +190,7 @@ namespace
.with_associated_id(id)
.with_associated_key(id, key));
- if ((*id->repository())[k::use_interface()]->arch_flags()->count(elike_conditional_dep_spec_flag(u)))
+ if ((*id->repository()).use_interface()->arch_flags()->count(elike_conditional_dep_spec_flag(u)))
{
if (forbid_arch_flags)
reporter.message(QAMessage(entry, qaml_normal, name,
@@ -209,14 +209,14 @@ namespace
if (iuse_flags.end() == iuse_flags.find(elike_conditional_dep_spec_flag(u)))
{
std::tr1::shared_ptr<const UseFlagNameSet> c(
- (*id->repository())[k::use_interface()]->use_expand_hidden_prefixes());
+ (*id->repository()).use_interface()->use_expand_hidden_prefixes());
std::string flag(stringify(elike_conditional_dep_spec_flag(u)));
bool is_hidden(false);
for (UseFlagNameSet::ConstIterator i(c->begin()), i_end(c->end()) ;
i != i_end ; ++i)
{
- std::string prefix(stringify(*i) + (*id->repository())[k::use_interface()]->use_expand_separator(*id));
+ std::string prefix(stringify(*i) + (*id->repository()).use_interface()->use_expand_separator(*id));
if (0 == flag.compare(0, prefix.length(), prefix))
{
is_hidden = true;
diff --git a/paludis/repositories/e/qa/visibility.cc b/paludis/repositories/e/qa/visibility.cc
index 96b8d98b1..33fd73926 100644
--- a/paludis/repositories/e/qa/visibility.cc
+++ b/paludis/repositories/e/qa/visibility.cc
@@ -117,8 +117,8 @@ namespace
/* rewrite virtuals to avoid problems later on */
if (p->package_ptr())
{
- ERepositoryProfile::VirtualsConstIterator v((*profile)[k::profile()]->find_virtual(*p->package_ptr()));
- if ((*profile)[k::profile()]->end_virtuals() != v)
+ ERepositoryProfile::VirtualsConstIterator v((*profile).profile()->find_virtual(*p->package_ptr()));
+ if ((*profile).profile()->end_virtuals() != v)
{
PartiallyMadePackageDepSpec pp;
@@ -148,8 +148,8 @@ namespace
if (reporter)
reporter->message(QAMessage(entry, qaml_normal, name, "No packages matching '"
+ stringify(orig_p) + "' in dependencies key '" + stringify(key->raw_name()) + "' for profile '"
- + stringify((*profile)[k::path()]) + "' (" + stringify((*profile)[k::arch()]) + "."
- + stringify((*profile)[k::status()])
+ + stringify((*profile).path()) + "' (" + stringify((*profile).arch()) + "."
+ + stringify((*profile).status())
+ (unstable ? ".unstable" : ".stable") + ")")
.with_associated_id(id)
.with_associated_key(id, key));
@@ -162,13 +162,13 @@ namespace
/* can't use the usual masked rules here, so this gets a bit complicated... */
if ((*i)->repository() == repo)
{
- if (repo->repository_masked(**i) || (*profile)[k::profile()]->profile_masked(**i) || ! (*i)->keywords_key())
+ if (repo->repository_masked(**i) || (*profile).profile()->profile_masked(**i) || ! (*i)->keywords_key())
continue;
}
else if ((*i)->repository() == repo->params().master_repository)
{
if (repo->params().master_repository->repository_masked(**i) ||
- (*profile)[k::profile()]->profile_masked(**i) || ! (*i)->keywords_key())
+ (*profile).profile()->profile_masked(**i) || ! (*i)->keywords_key())
continue;
}
else
@@ -196,7 +196,7 @@ namespace
if (reporter)
reporter->message(QAMessage(entry, qaml_normal, name, "No visible packages matching '"
+ stringify(orig_p) + "' in dependencies key '" + stringify(key->raw_name()) + "' for profile '"
- + stringify((*profile)[k::path()]) + "' (" + stringify((*profile)[k::arch()]) + "." + stringify((*profile)[k::status()])
+ + stringify((*profile).path()) + "' (" + stringify((*profile).arch()) + "." + stringify((*profile).status())
+ (unstable ? ".unstable" : ".stable") + ")")
.with_associated_id(id)
.with_associated_key(id, key));
@@ -208,8 +208,8 @@ namespace
DependencySpecTree::ConstSequenceIterator end)
{
viable =
- ((! elike_conditional_dep_spec_is_inverse(u)) && (! (*profile)[k::profile()]->use_masked(elike_conditional_dep_spec_flag(u), *id))) ||
- ((elike_conditional_dep_spec_is_inverse(u)) && (! (*profile)[k::profile()]->use_forced(elike_conditional_dep_spec_flag(u), *id)));
+ ((! elike_conditional_dep_spec_is_inverse(u)) && (! (*profile).profile()->use_masked(elike_conditional_dep_spec_flag(u), *id))) ||
+ ((elike_conditional_dep_spec_is_inverse(u)) && (! (*profile).profile()->use_forced(elike_conditional_dep_spec_flag(u), *id)));
if (viable)
std::for_each(cur, end, accept_visitor(*this));
@@ -243,7 +243,7 @@ namespace
std::for_each(begin, end, accept_visitor(printer));
reporter->message(QAMessage(entry, qaml_normal, name, "No item in block '|| ( "
+ stringify(printer) + " )' visible for profile '"
- + stringify((*profile)[k::path()]) + "' (" + stringify((*profile)[k::arch()]) + "." + stringify((*profile)[k::status()])
+ + stringify((*profile).path()) + "' (" + stringify((*profile).arch()) + "." + stringify((*profile).status())
+ (unstable ? ".unstable" : ".stable") + ")")
.with_associated_id(id)
.with_associated_key(id, key));
@@ -281,11 +281,11 @@ paludis::erepository::visibility_check(
for (ERepository::ProfilesConstIterator p(repo->begin_profiles()), p_end(repo->end_profiles()) ;
p != p_end ; ++p)
{
- if ((*p)[k::profile()]->profile_masked(*id))
+ if ((*p).profile()->profile_masked(*id))
continue;
std::set<KeywordName> accepted_keywords, overlap;
- tokenise_whitespace((*p)[k::profile()]->environment_variable(
+ tokenise_whitespace((*p).profile()->environment_variable(
repo->accept_keywords_variable()), create_inserter<KeywordName>(std::inserter(accepted_keywords, accepted_keywords.begin())));
std::set_intersection(accepted_keywords.begin(), accepted_keywords.end(),
diff --git a/paludis/repositories/e/source_uri_finder.cc b/paludis/repositories/e/source_uri_finder.cc
index dcdc60a9c..47b8f5066 100644
--- a/paludis/repositories/e/source_uri_finder.cc
+++ b/paludis/repositories/e/source_uri_finder.cc
@@ -158,9 +158,9 @@ SourceURIFinder::add_mirrors()
{
Context local_context("When adding repository mirrors '" + _imp->mirrors_name + "':");
- if ((*_imp->repo)[k::mirrors_interface()])
- for (RepositoryMirrorsInterface::MirrorsConstIterator m((*_imp->repo)[k::mirrors_interface()]->begin_mirrors(_imp->mirrors_name)),
- m_end((*_imp->repo)[k::mirrors_interface()]->end_mirrors(_imp->mirrors_name)) ;
+ if ((*_imp->repo).mirrors_interface())
+ for (RepositoryMirrorsInterface::MirrorsConstIterator m((*_imp->repo).mirrors_interface()->begin_mirrors(_imp->mirrors_name)),
+ m_end((*_imp->repo).mirrors_interface()->end_mirrors(_imp->mirrors_name)) ;
m != m_end ; ++m)
{
Log::get_instance()->message("e.source_uri_finder.adding_mirror", ll_debug, lc_context)
@@ -199,9 +199,9 @@ SourceURIFinder::add_listed()
{
Context local_context("When adding from repository for listed mirror '" + mirror + "':");
- if ((*_imp->repo)[k::mirrors_interface()])
- for (RepositoryMirrorsInterface::MirrorsConstIterator m((*_imp->repo)[k::mirrors_interface()]->begin_mirrors(mirror)),
- m_end((*_imp->repo)[k::mirrors_interface()]->end_mirrors(mirror)) ;
+ if ((*_imp->repo).mirrors_interface())
+ for (RepositoryMirrorsInterface::MirrorsConstIterator m((*_imp->repo).mirrors_interface()->begin_mirrors(mirror)),
+ m_end((*_imp->repo).mirrors_interface()->end_mirrors(mirror)) ;
m != m_end ; ++m)
{
Log::get_instance()->message("e.source_uri_finder.adding_mirror", ll_debug, lc_context)
diff --git a/paludis/repositories/e/vdb_merger.cc b/paludis/repositories/e/vdb_merger.cc
index 2d30cf435..6848cf63c 100644
--- a/paludis/repositories/e/vdb_merger.cc
+++ b/paludis/repositories/e/vdb_merger.cc
@@ -28,6 +28,7 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/hook.hh>
#include <paludis/package_id.hh>
#include <paludis/util/md5.hh>
@@ -54,10 +55,10 @@ namespace paludis
Implementation(const VDBMergerParams & p) :
params(p),
- realroot(params[k::root()].realpath())
+ realroot(params.root().realpath())
{
- tokenise_whitespace(params[k::config_protect()], std::back_inserter(config_protect));
- tokenise_whitespace(params[k::config_protect_mask()], std::back_inserter(config_protect_mask));
+ tokenise_whitespace(params.config_protect(), std::back_inserter(config_protect));
+ tokenise_whitespace(params.config_protect_mask(), std::back_inserter(config_protect_mask));
}
};
}
@@ -75,14 +76,15 @@ namespace
}
VDBMerger::VDBMerger(const VDBMergerParams & p) :
- Merger(MergerParams::named_create()
- (k::environment(), p[k::environment()])
- (k::image(), p[k::image()])
- (k::install_under(), FSEntry("/"))
- (k::root(), p[k::root()])
- (k::no_chown(), ! getenv_with_default("PALUDIS_NO_CHOWN", "").empty())
- (k::get_new_ids_or_minus_one(), std::tr1::bind(&get_new_ids_or_minus_one, p[k::environment()], std::tr1::placeholders::_1))
- (k::options(), p[k::options()])),
+ Merger(make_named_values<MergerParams>(
+ value_for<n::environment>(p.environment()),
+ value_for<n::get_new_ids_or_minus_one>(std::tr1::bind(&get_new_ids_or_minus_one, p.environment(), std::tr1::placeholders::_1)),
+ value_for<n::image>(p.image()),
+ value_for<n::install_under>(FSEntry("/")),
+ value_for<n::no_chown>(! getenv_with_default("PALUDIS_NO_CHOWN", "").empty()),
+ value_for<n::options>(p.options()),
+ value_for<n::root>(p.root())
+ )),
PrivateImplementationPattern<VDBMerger>(new Implementation<VDBMerger>(p)),
_imp(PrivateImplementationPattern<VDBMerger>::_imp)
{
@@ -95,33 +97,33 @@ VDBMerger::~VDBMerger()
Hook
VDBMerger::extend_hook(const Hook & h)
{
- std::tr1::shared_ptr<const FSEntrySequence> bashrc_files(_imp->params[k::environment()]->bashrc_files());
+ std::tr1::shared_ptr<const FSEntrySequence> bashrc_files(_imp->params.environment()->bashrc_files());
- if (_imp->params[k::package_id()])
+ if (_imp->params.package_id())
{
- std::string cat(stringify(_imp->params[k::package_id()]->name().category));
- std::string pn(stringify(_imp->params[k::package_id()]->name().package));
- std::string pvr(stringify(_imp->params[k::package_id()]->version()));
- std::string pv(stringify(_imp->params[k::package_id()]->version().remove_revision()));
- std::string slot(stringify(_imp->params[k::package_id()]->slot()));
+ std::string cat(stringify(_imp->params.package_id()->name().category));
+ std::string pn(stringify(_imp->params.package_id()->name().package));
+ std::string pvr(stringify(_imp->params.package_id()->version()));
+ std::string pv(stringify(_imp->params.package_id()->version().remove_revision()));
+ std::string slot(stringify(_imp->params.package_id()->slot()));
return Merger::extend_hook(h)
("P", pn + "-" + pv)
("PN", pn)
("CATEGORY", cat)
- ("PR", _imp->params[k::package_id()]->version().revision_only())
+ ("PR", _imp->params.package_id()->version().revision_only())
("PV", pv)
("PVR", pvr)
("PF", pn + "-" + pvr)
("SLOT", slot)
- ("CONFIG_PROTECT", _imp->params[k::config_protect()])
- ("CONFIG_PROTECT_MASK", _imp->params[k::config_protect_mask()])
+ ("CONFIG_PROTECT", _imp->params.config_protect())
+ ("CONFIG_PROTECT_MASK", _imp->params.config_protect_mask())
("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "));
}
else
return Merger::extend_hook(h)
- ("CONFIG_PROTECT", _imp->params[k::config_protect()])
- ("CONFIG_PROTECT_MASK", _imp->params[k::config_protect_mask()])
+ ("CONFIG_PROTECT", _imp->params.config_protect())
+ ("CONFIG_PROTECT_MASK", _imp->params.config_protect_mask())
("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "));
}
@@ -257,15 +259,15 @@ VDBMerger::make_config_protect_name(const FSEntry & src, const FSEntry & dst)
void
VDBMerger::merge()
{
- display_override(">>> Merging to " + stringify(_imp->params[k::root()]));
- _imp->contents_file.reset(new std::ofstream(stringify(_imp->params[k::contents_file()]).c_str()));
+ display_override(">>> Merging to " + stringify(_imp->params.root()));
+ _imp->contents_file.reset(new std::ofstream(stringify(_imp->params.contents_file()).c_str()));
Merger::merge();
}
bool
VDBMerger::check()
{
- std::cout << ">>> Checking whether we can merge to " << _imp->params[k::root()] << " ";
+ std::cout << ">>> Checking whether we can merge to " << _imp->params.root() << " ";
bool result(Merger::check());
std::cout << std::endl;
return result;
diff --git a/paludis/repositories/e/vdb_merger.hh b/paludis/repositories/e/vdb_merger.hh
index 9d27d8b97..ab694b98c 100644
--- a/paludis/repositories/e/vdb_merger.hh
+++ b/paludis/repositories/e/vdb_merger.hh
@@ -23,13 +23,23 @@
#include <paludis/merger.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/kc.hh>
-#include <paludis/util/keys.hh>
namespace paludis
{
class Hook;
+ namespace n
+ {
+ struct config_protect;
+ struct config_protect_mask;
+ struct contents_file;
+ struct environment;
+ struct image;
+ struct options;
+ struct package_id;
+ struct root;
+ }
+
/**
* Parameters for a VDBMerger.
*
@@ -39,16 +49,17 @@ namespace paludis
* \nosubgrouping
* \since 0.26
*/
- typedef kc::KeyedClass<
- kc::Field<k::environment, Environment *>,
- kc::Field<k::image, FSEntry>,
- kc::Field<k::root, FSEntry>,
- kc::Field<k::contents_file, FSEntry>,
- kc::Field<k::config_protect, std::string>,
- kc::Field<k::config_protect_mask, std::string>,
- kc::Field<k::package_id, std::tr1::shared_ptr<const PackageID> >,
- kc::Field<k::options, MergerOptions>
- > VDBMergerParams;
+ struct VDBMergerParams
+ {
+ NamedValue<n::config_protect, std::string> config_protect;
+ NamedValue<n::config_protect_mask, std::string> config_protect_mask;
+ NamedValue<n::contents_file, FSEntry> contents_file;
+ NamedValue<n::environment, Environment *> environment;
+ NamedValue<n::image, FSEntry> image;
+ NamedValue<n::options, MergerOptions> options;
+ NamedValue<n::package_id, std::tr1::shared_ptr<const PackageID> > package_id;
+ NamedValue<n::root, FSEntry> root;
+ };
/**
* Merger for VDBRepository.
diff --git a/paludis/repositories/e/vdb_merger_TEST.cc b/paludis/repositories/e/vdb_merger_TEST.cc
index 71347b344..01d2a8269 100644
--- a/paludis/repositories/e/vdb_merger_TEST.cc
+++ b/paludis/repositories/e/vdb_merger_TEST.cc
@@ -21,6 +21,7 @@
#include "vdb_merger.hh"
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
+#include <paludis/util/make_named_values.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <fstream>
@@ -75,15 +76,16 @@ namespace
TestCase("merge '" + what + "' test"),
root_dir(FSEntry::cwd() / "vdb_merger_TEST_dir" / what / "root"),
target(what),
- merger(VDBMergerParams::named_create()
- (k::environment(), &env)
- (k::image(), FSEntry::cwd() / "vdb_merger_TEST_dir" / what / "image")
- (k::root(), root_dir)
- (k::contents_file(), FSEntry::cwd() / "vdb_merger_TEST_dir/CONTENTS" / what)
- (k::config_protect(), "/protected_file /protected_dir")
- (k::config_protect_mask(), "/protected_dir/unprotected_file /protected_dir/unprotected_dir")
- (k::package_id(), std::tr1::shared_ptr<PackageID>())
- (k::options(), MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs))
+ merger(make_named_values<VDBMergerParams>(
+ value_for<n::config_protect>("/protected_file /protected_dir"),
+ value_for<n::config_protect_mask>("/protected_dir/unprotected_file /protected_dir/unprotected_dir"),
+ value_for<n::contents_file>(FSEntry::cwd() / "vdb_merger_TEST_dir/CONTENTS" / what),
+ value_for<n::environment>(&env),
+ value_for<n::image>(FSEntry::cwd() / "vdb_merger_TEST_dir" / what / "image"),
+ value_for<n::options>(MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs),
+ value_for<n::package_id>(std::tr1::shared_ptr<PackageID>()),
+ value_for<n::root>(root_dir)
+ ))
{
}
};
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 6b717fc43..0019e0ca9 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -65,9 +65,10 @@
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/kc.hh>
#include <paludis/util/create_iterator-impl.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/make_named_values.hh>
+
#include <tr1/unordered_map>
#include <tr1/functional>
#include <fstream>
@@ -153,20 +154,21 @@ VDBRepository::VDBRepository(const VDBRepositoryParams & p) :
.builddir(p.builddir)
.deprecated_world(p.deprecated_world),
p.name,
- RepositoryCapabilities::named_create()
- (k::sets_interface(), this)
- (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
- (k::use_interface(), this)
- (k::environment_variable_interface(), this)
- (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
- (k::provides_interface(), this)
- (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
- (k::destination_interface(), this)
- (k::e_interface(), static_cast<RepositoryEInterface *>(0))
- (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
- (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
- (k::hook_interface(), this)
- (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
+ make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(this),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(this),
+ value_for<n::hook_interface>(this),
+ value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
+ value_for<n::provides_interface>(this),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(this),
+ value_for<n::syncable_interface>(static_cast<RepositorySyncableInterface *>(0)),
+ value_for<n::use_interface>(this),
+ value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ )),
PrivateImplementationPattern<VDBRepository>(new Implementation<VDBRepository>(this, p)),
_imp(PrivateImplementationPattern<VDBRepository>::_imp)
{
@@ -304,7 +306,7 @@ VDBRepository::make_vdb_repository(
if (provides_cache.empty())
{
provides_cache = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution()))[k::default_vdb_provides_cache()];
+ env->distribution())).default_vdb_provides_cache();
if (provides_cache.empty())
{
Log::get_instance()->message("e.vdb.configuration.no_provides_cache", ll_warning, lc_no_context)
@@ -318,7 +320,7 @@ VDBRepository::make_vdb_repository(
if (names_cache.empty())
{
names_cache = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution()))[k::default_vdb_names_cache()];
+ env->distribution())).default_vdb_names_cache();
if (names_cache.empty())
{
Log::get_instance()->message("e.vdb.configuration.no_names_cache", ll_warning, lc_no_context)
@@ -334,7 +336,7 @@ VDBRepository::make_vdb_repository(
builddir = f("buildroot");
if (builddir.empty())
builddir = (*DistributionData::get_instance()->distribution_from_string(
- env->distribution()))[k::default_ebuild_builddir()];
+ env->distribution())).default_ebuild_builddir();
else
Log::get_instance()->message("e.vdb.configuration.deprecated", ll_warning, lc_context)
<< "Key 'buildroot' is deprecated, use 'builddir' instead";
@@ -407,38 +409,41 @@ VDBRepository::perform_uninstall(const std::tr1::shared_ptr<const ERepositoryID>
/* unmerge */
VDBUnmerger unmerger(
- VDBUnmergerOptions::named_create()
- (k::environment(), _imp->params.environment)
- (k::root(), installed_root_key()->value())
- (k::contents_file(), pkg_dir / "CONTENTS")
- (k::config_protect(), config_protect)
- (k::config_protect_mask(), config_protect_mask)
- (k::package_id(), id));
+ make_named_values<VDBUnmergerOptions>(
+ value_for<n::config_protect>(config_protect),
+ value_for<n::config_protect_mask>(config_protect_mask),
+ value_for<n::contents_file>(pkg_dir / "CONTENTS"),
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::package_id>(id),
+ value_for<n::root>(installed_root_key()->value())
+ ));
unmerger.unmerge();
}
else
{
- 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::unmerge_only(), false)
- (k::loadsaveenv_dir(), pkg_dir)
- (k::load_environment(), load_env.get()));
+ EbuildCommandParams params(make_named_values<EbuildCommandParams>(
+ value_for<n::builddir>(_imp->params.builddir),
+ value_for<n::commands>(join(phase->begin_commands(), phase->end_commands(), " ")),
+ value_for<n::distdir>(pkg_dir),
+ value_for<n::ebuild_dir>(pkg_dir),
+ value_for<n::ebuild_file>(pkg_dir / (stringify(id->name().package) + "-" + stringify(id->version()) + ".ebuild")),
+ value_for<n::eclassdirs>(eclassdirs),
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::exlibsdirs>(make_shared_ptr(new FSEntrySequence)),
+ value_for<n::files_dir>(pkg_dir),
+ value_for<n::package_id>(id),
+ value_for<n::portdir>(_imp->params.location),
+ value_for<n::sandbox>(phase->option("sandbox")),
+ value_for<n::userpriv>(phase->option("userpriv"))
+ ));
+
+ EbuildUninstallCommandParams uninstall_params(make_named_values<EbuildUninstallCommandParams>(
+ value_for<n::load_environment>(load_env.get()),
+ value_for<n::loadsaveenv_dir>(pkg_dir),
+ value_for<n::root>(stringify(_imp->params.root)),
+ value_for<n::unmerge_only>(false)
+ ));
EbuildUninstallCommand uninstall_cmd_pre(params, uninstall_params);
uninstall_cmd_pre();
@@ -516,9 +521,10 @@ VDBRepository::provided_packages() const
for (Sequence<QualifiedPackageName>::ConstIterator it2(it->second->begin()),
it2_end(it->second->end()); it2_end != it2; ++it2)
- _imp->provides->push_back(RepositoryProvidesEntry::named_create()
- (k::virtual_name(), *it2)
- (k::provided_by(), id));
+ _imp->provides->push_back(make_named_values<RepositoryProvidesEntry>(
+ value_for<n::provided_by>(id),
+ value_for<n::virtual_name>(*it2)
+ ));
}
return _imp->provides;
@@ -763,29 +769,30 @@ VDBRepository::category_names_containing_package(const PackageNamePart & p) cons
void
VDBRepository::merge(const MergeParams & m)
{
- Context context("When merging '" + stringify(*m[k::package_id()]) + "' at '" + stringify(m[k::image_dir()])
+ Context context("When merging '" + stringify(*m.package_id()) + "' at '" + stringify(m.image_dir())
+ "' to VDB repository '" + stringify(name()) + "':");
- if (! is_suitable_destination_for(*m[k::package_id()]))
- throw InstallActionError("Not a suitable destination for '" + stringify(*m[k::package_id()]) + "'");
+ if (! is_suitable_destination_for(*m.package_id()))
+ throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
- std::tr1::shared_ptr<const ERepositoryID> is_replace(package_id_if_exists(m[k::package_id()]->name(), m[k::package_id()]->version()));
+ std::tr1::shared_ptr<const ERepositoryID> is_replace(package_id_if_exists(m.package_id()->name(), m.package_id()->version()));
FSEntry tmp_vdb_dir(_imp->params.location);
if (! tmp_vdb_dir.exists())
tmp_vdb_dir.mkdir();
- tmp_vdb_dir /= stringify(m[k::package_id()]->name().category);
+ tmp_vdb_dir /= stringify(m.package_id()->name().category);
if (! tmp_vdb_dir.exists())
tmp_vdb_dir.mkdir();
- tmp_vdb_dir /= ("-checking-" + stringify(m[k::package_id()]->name().package) + "-" + stringify(m[k::package_id()]->version()));
+ tmp_vdb_dir /= ("-checking-" + stringify(m.package_id()->name().package) + "-" + stringify(m.package_id()->version()));
tmp_vdb_dir.mkdir();
WriteVDBEntryCommand write_vdb_entry_command(
- WriteVDBEntryParams::named_create()
- (k::environment(), _imp->params.environment)
- (k::package_id(), std::tr1::static_pointer_cast<const ERepositoryID>(m[k::package_id()]))
- (k::output_directory(), tmp_vdb_dir)
- (k::environment_file(), m[k::environment_file()]));
+ make_named_values<WriteVDBEntryParams>(
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::environment_file>(m.environment_file()),
+ value_for<n::output_directory>(tmp_vdb_dir),
+ value_for<n::package_id>(std::tr1::static_pointer_cast<const ERepositoryID>(m.package_id()))
+ ));
write_vdb_entry_command();
@@ -800,19 +807,20 @@ VDBRepository::merge(const MergeParams & m)
}
FSEntry vdb_dir(_imp->params.location);
- vdb_dir /= stringify(m[k::package_id()]->name().category);
- vdb_dir /= (stringify(m[k::package_id()]->name().package) + "-" + stringify(m[k::package_id()]->version()));
+ vdb_dir /= stringify(m.package_id()->name().category);
+ vdb_dir /= (stringify(m.package_id()->name().package) + "-" + stringify(m.package_id()->version()));
VDBMerger merger(
- VDBMergerParams::named_create()
- (k::environment(), _imp->params.environment)
- (k::image(), m[k::image_dir()])
- (k::root(), installed_root_key()->value())
- (k::contents_file(), vdb_dir / "CONTENTS")
- (k::config_protect(), config_protect)
- (k::config_protect_mask(), config_protect_mask)
- (k::package_id(), m[k::package_id()])
- (k::options(), m[k::options()]));
+ make_named_values<VDBMergerParams>(
+ value_for<n::config_protect>(config_protect),
+ value_for<n::config_protect_mask>(config_protect_mask),
+ value_for<n::contents_file>(vdb_dir / "CONTENTS"),
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::image>(m.image_dir()),
+ value_for<n::options>(m.options()),
+ value_for<n::package_id>(m.package_id()),
+ value_for<n::root>(installed_root_key()->value())
+ ));
if (! merger.check())
{
@@ -844,15 +852,16 @@ VDBRepository::merge(const MergeParams & m)
perform_uninstall(is_replace, true);
VDBPostMergeCommand post_merge_command(
- VDBPostMergeCommandParams::named_create()
- (k::root(), installed_root_key()->value()));
+ make_named_values<VDBPostMergeCommandParams>(
+ value_for<n::root>(installed_root_key()->value())
+ ));
post_merge_command();
- _imp->names_cache->add(m[k::package_id()]->name());
+ _imp->names_cache->add(m.package_id()->name());
if (_imp->used_provides_cache || (! _imp->tried_provides_cache && load_provided_using_cache()))
{
- provides_from_package_id(*m[k::package_id()]);
+ provides_from_package_id(*m.package_id());
write_provides_cache();
_imp->provides.reset();
}
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index 817239a2a..159cc5b96 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -28,6 +28,7 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/options.hh>
#include <paludis/util/dir_iterator.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
@@ -130,9 +131,9 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
&env, UserPackageDepSpecOptions()))))]->begin());
- TEST_CHECK((*repo)[k::use_interface()]->query_use(UseFlagName("flag1"), *e1) == use_enabled);
- TEST_CHECK((*repo)[k::use_interface()]->query_use(UseFlagName("flag2"), *e1) == use_enabled);
- TEST_CHECK((*repo)[k::use_interface()]->query_use(UseFlagName("flag3"), *e1) == use_disabled);
+ TEST_CHECK(repo->use_interface()->query_use(UseFlagName("flag1"), *e1) == use_enabled);
+ TEST_CHECK(repo->use_interface()->query_use(UseFlagName("flag2"), *e1) == use_enabled);
+ TEST_CHECK(repo->use_interface()->query_use(UseFlagName("flag3"), *e1) == use_disabled);
}
} test_vdb_repository_query_use;
@@ -334,11 +335,11 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(0, vdb_repo);
- InstallAction install_action(InstallActionOptions::named_create()
- (k::debug_build(), iado_none)
- (k::checks(), iaco_default)
- (k::destination(), vdb_repo)
- );
+ InstallAction install_action(make_named_values<InstallActionOptions>(
+ value_for<n::checks>(iaco_default),
+ value_for<n::debug_build>(iado_none),
+ value_for<n::destination>(vdb_repo)
+ ));
UninstallAction uninstall_action;
@@ -448,11 +449,11 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(0, vdb_repo);
- InstallAction install_action(InstallActionOptions::named_create()
- (k::debug_build(), iado_none)
- (k::checks(), iaco_default)
- (k::destination(), vdb_repo)
- );
+ InstallAction install_action(make_named_values<InstallActionOptions>(
+ value_for<n::checks>(iaco_default),
+ value_for<n::debug_build>(iado_none),
+ value_for<n::destination>(vdb_repo)
+ ));
UninstallAction uninstall_action;
@@ -562,11 +563,11 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(0, vdb_repo);
- InstallAction install_action(InstallActionOptions::named_create()
- (k::debug_build(), iado_none)
- (k::checks(), iaco_default)
- (k::destination(), vdb_repo)
- );
+ InstallAction install_action(make_named_values<InstallActionOptions>(
+ value_for<n::checks>(iaco_default),
+ value_for<n::debug_build>(iado_none),
+ value_for<n::destination>(vdb_repo)
+ ));
UninstallAction uninstall_action;
@@ -806,20 +807,20 @@ namespace test_cases
TEST_CHECK(! provides_cache.exists());
{
- std::tr1::shared_ptr<const RepositoryProvidesInterface::ProvidesSequence> seq((*vdb_repo)[k::provides_interface()]->provided_packages());
+ std::tr1::shared_ptr<const RepositoryProvidesInterface::ProvidesSequence> seq(vdb_repo->provides_interface()->provided_packages());
TEST_CHECK_EQUAL(std::distance(seq->begin(), seq->end()), 5U);
RepositoryProvidesInterface::ProvidesSequence::ConstIterator it(seq->begin());
- TEST_CHECK_STRINGIFY_EQUAL((*it)[k::virtual_name()], "virtual/foo");
- TEST_CHECK_STRINGIFY_EQUAL(*(*it++)[k::provided_by()], "cat1/pkg1-1::installed");
- TEST_CHECK_STRINGIFY_EQUAL((*it)[k::virtual_name()], "virtual/foo");
- TEST_CHECK_STRINGIFY_EQUAL(*(*it++)[k::provided_by()], "cat1/pkg1-2::installed");
- TEST_CHECK_STRINGIFY_EQUAL((*it)[k::virtual_name()], "virtual/foo");
- TEST_CHECK_STRINGIFY_EQUAL(*(*it++)[k::provided_by()], "cat1/pkg2-1::installed");
- TEST_CHECK_STRINGIFY_EQUAL((*it)[k::virtual_name()], "virtual/bar");
- TEST_CHECK_STRINGIFY_EQUAL(*(*it++)[k::provided_by()], "cat1/pkg2-1::installed");
- TEST_CHECK_STRINGIFY_EQUAL((*it)[k::virtual_name()], "virtual/bar");
- TEST_CHECK_STRINGIFY_EQUAL(*(*it++)[k::provided_by()], "cat1/pkg2-2::installed");
+ TEST_CHECK_STRINGIFY_EQUAL(it->virtual_name(), "virtual/foo");
+ TEST_CHECK_STRINGIFY_EQUAL(*(*it++).provided_by(), "cat1/pkg1-1::installed");
+ TEST_CHECK_STRINGIFY_EQUAL(it->virtual_name(), "virtual/foo");
+ TEST_CHECK_STRINGIFY_EQUAL(*(*it++).provided_by(), "cat1/pkg1-2::installed");
+ TEST_CHECK_STRINGIFY_EQUAL(it->virtual_name(), "virtual/foo");
+ TEST_CHECK_STRINGIFY_EQUAL(*(*it++).provided_by(), "cat1/pkg2-1::installed");
+ TEST_CHECK_STRINGIFY_EQUAL(it->virtual_name(), "virtual/bar");
+ TEST_CHECK_STRINGIFY_EQUAL(*(*it++).provided_by(), "cat1/pkg2-1::installed");
+ TEST_CHECK_STRINGIFY_EQUAL(it->virtual_name(), "virtual/bar");
+ TEST_CHECK_STRINGIFY_EQUAL(*(*it++).provided_by(), "cat1/pkg2-2::installed");
}
vdb_repo->regenerate_cache();
@@ -827,20 +828,20 @@ namespace test_cases
vdb_repo->invalidate();
{
- std::tr1::shared_ptr<const RepositoryProvidesInterface::ProvidesSequence> seq((*vdb_repo)[k::provides_interface()]->provided_packages());
+ std::tr1::shared_ptr<const RepositoryProvidesInterface::ProvidesSequence> seq(vdb_repo->provides_interface()->provided_packages());
TEST_CHECK_EQUAL(std::distance(seq->begin(), seq->end()), 5U);
RepositoryProvidesInterface::ProvidesSequence::ConstIterator it(seq->begin());
- TEST_CHECK_STRINGIFY_EQUAL((*it)[k::virtual_name()], "virtual/foo");
- TEST_CHECK_STRINGIFY_EQUAL(*(*it++)[k::provided_by()], "cat1/pkg1-1::installed");
- TEST_CHECK_STRINGIFY_EQUAL((*it)[k::virtual_name()], "virtual/foo");
- TEST_CHECK_STRINGIFY_EQUAL(*(*it++)[k::provided_by()], "cat1/pkg1-2::installed");
- TEST_CHECK_STRINGIFY_EQUAL((*it)[k::virtual_name()], "virtual/foo");
- TEST_CHECK_STRINGIFY_EQUAL(*(*it++)[k::provided_by()], "cat1/pkg2-1::installed");
- TEST_CHECK_STRINGIFY_EQUAL((*it)[k::virtual_name()], "virtual/bar");
- TEST_CHECK_STRINGIFY_EQUAL(*(*it++)[k::provided_by()], "cat1/pkg2-1::installed");
- TEST_CHECK_STRINGIFY_EQUAL((*it)[k::virtual_name()], "virtual/bar");
- TEST_CHECK_STRINGIFY_EQUAL(*(*it++)[k::provided_by()], "cat1/pkg2-2::installed");
+ TEST_CHECK_STRINGIFY_EQUAL(it->virtual_name(), "virtual/foo");
+ TEST_CHECK_STRINGIFY_EQUAL(*(*it++).provided_by(), "cat1/pkg1-1::installed");
+ TEST_CHECK_STRINGIFY_EQUAL(it->virtual_name(), "virtual/foo");
+ TEST_CHECK_STRINGIFY_EQUAL(*(*it++).provided_by(), "cat1/pkg1-2::installed");
+ TEST_CHECK_STRINGIFY_EQUAL(it->virtual_name(), "virtual/foo");
+ TEST_CHECK_STRINGIFY_EQUAL(*(*it++).provided_by(), "cat1/pkg2-1::installed");
+ TEST_CHECK_STRINGIFY_EQUAL(it->virtual_name(), "virtual/bar");
+ TEST_CHECK_STRINGIFY_EQUAL(*(*it++).provided_by(), "cat1/pkg2-1::installed");
+ TEST_CHECK_STRINGIFY_EQUAL(it->virtual_name(), "virtual/bar");
+ TEST_CHECK_STRINGIFY_EQUAL(*(*it++).provided_by(), "cat1/pkg2-2::installed");
}
}
@@ -921,11 +922,11 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(0, vdb_repo);
- InstallAction install_action(InstallActionOptions::named_create()
- (k::debug_build(), iado_none)
- (k::checks(), iaco_default)
- (k::destination(), vdb_repo)
- );
+ InstallAction install_action(make_named_values<InstallActionOptions>(
+ value_for<n::checks>(iaco_default),
+ value_for<n::debug_build>(iado_none),
+ value_for<n::destination>(vdb_repo)
+ ));
UninstallAction uninstall_action;
@@ -1134,11 +1135,11 @@ namespace test_cases
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(0, vdb_repo);
- InstallAction install_action(InstallActionOptions::named_create()
- (k::debug_build(), iado_none)
- (k::checks(), iaco_default)
- (k::destination(), vdb_repo)
- );
+ InstallAction install_action(make_named_values<InstallActionOptions>(
+ value_for<n::checks>(iaco_default),
+ value_for<n::debug_build>(iado_none),
+ value_for<n::destination>(vdb_repo)
+ ));
TEST_CHECK(vdb_repo->package_ids(QualifiedPackageName("cat/pkg"))->empty());
diff --git a/paludis/repositories/e/vdb_unmerger.cc b/paludis/repositories/e/vdb_unmerger.cc
index a3130753c..bd40b2073 100644
--- a/paludis/repositories/e/vdb_unmerger.cc
+++ b/paludis/repositories/e/vdb_unmerger.cc
@@ -37,6 +37,7 @@ using namespace paludis;
#include <paludis/util/sequence.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/strip.hh>
+#include <paludis/util/make_named_values.hh>
#include <list>
#include <map>
@@ -57,8 +58,8 @@ namespace paludis
Implementation(const VDBUnmergerOptions & o) :
options(o)
{
- tokenise_whitespace(o[k::config_protect()], std::back_inserter(config_protect));
- tokenise_whitespace(o[k::config_protect_mask()], std::back_inserter(config_protect_mask));
+ tokenise_whitespace(o.config_protect(), std::back_inserter(config_protect));
+ tokenise_whitespace(o.config_protect_mask(), std::back_inserter(config_protect_mask));
}
};
}
@@ -116,9 +117,10 @@ class VDBUnmerger::MiscExtraInfo :
};
VDBUnmerger::VDBUnmerger(const VDBUnmergerOptions & o) :
- Unmerger(UnmergerOptions::named_create()
- (k::environment(), o[k::environment()])
- (k::root(), o[k::root()])),
+ Unmerger(make_named_values<UnmergerOptions>(
+ value_for<n::environment>(o.environment()),
+ value_for<n::root>(o.root())
+ )),
PrivateImplementationPattern<VDBUnmerger>(new Implementation<VDBUnmerger>(o)),
_imp(PrivateImplementationPattern<VDBUnmerger>::_imp.get())
{
@@ -131,29 +133,29 @@ VDBUnmerger::~VDBUnmerger()
Hook
VDBUnmerger::extend_hook(const Hook & h) const
{
- std::tr1::shared_ptr<const FSEntrySequence> bashrc_files(_imp->options[k::environment()]->bashrc_files());
+ std::tr1::shared_ptr<const FSEntrySequence> bashrc_files(_imp->options.environment()->bashrc_files());
Hook result(Unmerger::extend_hook(h)
- ("CONFIG_PROTECT", _imp->options[k::config_protect()])
- ("CONFIG_PROTECT_MASK", _imp->options[k::config_protect_mask()])
+ ("CONFIG_PROTECT", _imp->options.config_protect())
+ ("CONFIG_PROTECT_MASK", _imp->options.config_protect_mask())
("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " ")));
- if (_imp->options[k::package_id()])
+ if (_imp->options.package_id())
{
- std::string cat(stringify(_imp->options[k::package_id()]->name().category));
- std::string pn(stringify(_imp->options[k::package_id()]->name().package));
- std::string pvr(stringify(_imp->options[k::package_id()]->version()));
- std::string pv(stringify(_imp->options[k::package_id()]->version().remove_revision()));
+ std::string cat(stringify(_imp->options.package_id()->name().category));
+ std::string pn(stringify(_imp->options.package_id()->name().package));
+ std::string pvr(stringify(_imp->options.package_id()->version()));
+ std::string pv(stringify(_imp->options.package_id()->version().remove_revision()));
return result
("P", pn + "-" + pv)
("PN", pn)
("CATEGORY", cat)
- ("PR", _imp->options[k::package_id()]->version().revision_only())
+ ("PR", _imp->options.package_id()->version().revision_only())
("PV", pv)
("PVR", pvr)
("PF", pn + "-" + pvr)
- ("SLOT", stringify(_imp->options[k::package_id()]->slot()));
+ ("SLOT", stringify(_imp->options.package_id()->slot()));
}
return result;
@@ -187,7 +189,7 @@ VDBUnmerger::config_protected(const FSEntry & f) const
std::string
VDBUnmerger::make_tidy(const FSEntry & f) const
{
- std::string root_str(stringify(_imp->options[k::root()])), f_str(stringify(f));
+ std::string root_str(stringify(_imp->options.root())), f_str(stringify(f));
if (root_str == "/")
root_str.clear();
if (0 != f_str.compare(0, root_str.length(), root_str))
@@ -198,9 +200,9 @@ VDBUnmerger::make_tidy(const FSEntry & f) const
void
VDBUnmerger::populate_unmerge_set()
{
- std::ifstream c(stringify(_imp->options[k::contents_file()]).c_str());
+ std::ifstream c(stringify(_imp->options.contents_file()).c_str());
if (! c)
- throw VDBUnmergerError("Cannot read '" + stringify(_imp->options[k::contents_file()]) + "'");
+ throw VDBUnmergerError("Cannot read '" + stringify(_imp->options.contents_file()) + "'");
std::string line;
while (std::getline(c, line))
@@ -251,22 +253,22 @@ VDBUnmerger::check_file(const FSEntry & f, std::tr1::shared_ptr<ExtraInfo> ei) c
{
std::tr1::shared_ptr<FileExtraInfo> fie(std::tr1::static_pointer_cast<FileExtraInfo>(ei));
- if (! (_imp->options[k::root()] / f).is_regular_file())
+ if (! (_imp->options.root() / f).is_regular_file())
display("--- [!type] " + stringify(f));
- else if ((_imp->options[k::root()] / f).mtime() != fie->_mtime)
+ else if ((_imp->options.root() / f).mtime() != fie->_mtime)
display("--- [!time] " + stringify(f));
else
{
- std::ifstream md5_file(stringify(_imp->options[k::root()] / f).c_str());
+ std::ifstream md5_file(stringify(_imp->options.root() / f).c_str());
if (! md5_file)
{
Log::get_instance()->message("e.vdb.contents.md5_failed", ll_warning, lc_no_context)
- << "Cannot get md5 for '" << (_imp->options[k::root()] / f) << "'";
+ << "Cannot get md5 for '" << (_imp->options.root() / f) << "'";
display("--- [!md5?] " + stringify(f));
}
else if (MD5(md5_file).hexsum() != fie->_md5sum)
display("--- [!md5 ] " + stringify(f));
- else if (config_protected(_imp->options[k::root()] / f))
+ else if (config_protected(_imp->options.root() / f))
display("--- [cfgpr] " + stringify(f));
else
return true;
@@ -280,11 +282,11 @@ VDBUnmerger::check_sym(const FSEntry & f, std::tr1::shared_ptr<ExtraInfo> ei) co
{
std::tr1::shared_ptr<SymlinkExtraInfo> sie(std::tr1::static_pointer_cast<SymlinkExtraInfo>(ei));
- if (! (_imp->options[k::root()] / f).is_symbolic_link())
+ if (! (_imp->options.root() / f).is_symbolic_link())
display("--- [!type] " + stringify(f));
- else if ((_imp->options[k::root()] / f).mtime() != sie->_mtime)
+ else if ((_imp->options.root() / f).mtime() != sie->_mtime)
display("--- [!time] " + stringify(f));
- else if ((_imp->options[k::root()] / f).readlink() != sie->_dest)
+ else if ((_imp->options.root() / f).readlink() != sie->_dest)
display("--- [!dest] " + stringify(f));
else
return true;
@@ -297,9 +299,9 @@ VDBUnmerger::check_misc(const FSEntry & f, std::tr1::shared_ptr<ExtraInfo> ei) c
{
std::tr1::shared_ptr<MiscExtraInfo> mie(std::tr1::static_pointer_cast<MiscExtraInfo>(ei));
- if ("fif" == mie->_type && ! (_imp->options[k::root()] / f).is_fifo())
+ if ("fif" == mie->_type && ! (_imp->options.root() / f).is_fifo())
display("--- [!type] " + stringify(f));
- else if ("dev" == mie->_type && ! (_imp->options[k::root()] / f).is_device())
+ else if ("dev" == mie->_type && ! (_imp->options.root() / f).is_device())
display("--- [!type] " + stringify(f));
else
return true;
@@ -310,9 +312,9 @@ VDBUnmerger::check_misc(const FSEntry & f, std::tr1::shared_ptr<ExtraInfo> ei) c
bool
VDBUnmerger::check_dir(const FSEntry & f, std::tr1::shared_ptr<ExtraInfo>) const
{
- if (! (_imp->options[k::root()] / f).is_directory())
+ if (! (_imp->options.root() / f).is_directory())
display("--- [!type] " + stringify(f));
- else if (DirIterator(_imp->options[k::root()] / f, DirIteratorOptions() + dio_include_dotfiles + dio_first_only) != DirIterator())
+ else if (DirIterator(_imp->options.root() / f, DirIteratorOptions() + dio_include_dotfiles + dio_first_only) != DirIterator())
display("--- [!empt] " + stringify(f));
else
return true;
diff --git a/paludis/repositories/e/vdb_unmerger.hh b/paludis/repositories/e/vdb_unmerger.hh
index d06971faa..5d2b26262 100644
--- a/paludis/repositories/e/vdb_unmerger.hh
+++ b/paludis/repositories/e/vdb_unmerger.hh
@@ -22,8 +22,6 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_VDB_UNMERGER_HH 1
#include <paludis/repository.hh>
-#include <paludis/util/kc.hh>
-#include <paludis/util/keys.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/unmerger.hh>
@@ -32,6 +30,16 @@ namespace paludis
{
class Environment;
+ namespace n
+ {
+ struct config_protect;
+ struct config_protect_mask;
+ struct contents_file;
+ struct environment;
+ struct package_id;
+ struct root;
+ }
+
/**
* Options for a VDBUnmerger.
*
@@ -39,14 +47,15 @@ namespace paludis
* \ingroup grpvdbrepository
* \nosubgrouping
*/
- typedef kc::KeyedClass<
- kc::Field<k::environment, Environment *>,
- kc::Field<k::root, FSEntry>,
- kc::Field<k::contents_file, FSEntry>,
- kc::Field<k::config_protect, std::string>,
- kc::Field<k::config_protect_mask, std::string>,
- kc::Field<k::package_id, std::tr1::shared_ptr<const PackageID> >
- > VDBUnmergerOptions;
+ struct VDBUnmergerOptions
+ {
+ NamedValue<n::config_protect, std::string> config_protect;
+ NamedValue<n::config_protect_mask, std::string> config_protect_mask;
+ NamedValue<n::contents_file, FSEntry> contents_file;
+ NamedValue<n::environment, Environment *> environment;
+ NamedValue<n::package_id, std::tr1::shared_ptr<const PackageID> > package_id;
+ NamedValue<n::root, FSEntry> root;
+ };
/**
* Thrown if an unmerge from a VDBRepository using VDBUnmerger fails.
diff --git a/paludis/repositories/e/vdb_unmerger_TEST.cc b/paludis/repositories/e/vdb_unmerger_TEST.cc
index a887df18a..7ca2b45d8 100644
--- a/paludis/repositories/e/vdb_unmerger_TEST.cc
+++ b/paludis/repositories/e/vdb_unmerger_TEST.cc
@@ -20,6 +20,7 @@
#include "vdb_unmerger.hh"
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
+#include <paludis/util/make_named_values.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -66,13 +67,14 @@ namespace
TestCase("unmerge '" + what + "' test"),
root_dir("vdb_unmerger_TEST_dir/root"),
target(what),
- unmerger(VDBUnmergerOptions::named_create()
- (k::environment(), &env)
- (k::root(), root_dir)
- (k::contents_file(), "vdb_unmerger_TEST_dir/CONTENTS/" + what)
- (k::config_protect(), "/protected_file /protected_dir")
- (k::config_protect_mask(), "/protected_dir/unprotected_file /protected_dir/unprotected_dir")
- (k::package_id(), std::tr1::shared_ptr<PackageID>()))
+ unmerger(make_named_values<VDBUnmergerOptions>(
+ value_for<n::config_protect>("/protected_file /protected_dir"),
+ value_for<n::config_protect_mask>("/protected_dir/unprotected_file /protected_dir/unprotected_dir"),
+ value_for<n::contents_file>("vdb_unmerger_TEST_dir/CONTENTS/" + what),
+ value_for<n::environment>(&env),
+ value_for<n::package_id>(std::tr1::shared_ptr<PackageID>()),
+ value_for<n::root>(root_dir)
+ ))
{
}
};
diff --git a/paludis/repositories/fake/dep_parser.cc b/paludis/repositories/fake/dep_parser.cc
index 3aeb5b077..16897a31a 100644
--- a/paludis/repositories/fake/dep_parser.cc
+++ b/paludis/repositories/fake/dep_parser.cc
@@ -18,12 +18,11 @@
*/
#include <paludis/repositories/fake/dep_parser.hh>
-#include <paludis/util/kc.hh>
-#include <paludis/util/keys.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/options.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/elike_dep_parser.hh>
#include <paludis/elike_conditional_dep_spec.hh>
#include <paludis/elike_package_dep_spec.hh>
@@ -41,6 +40,15 @@ FakeDepParseError::FakeDepParseError(const std::string & s, const std::string &
{
}
+namespace paludis
+{
+ namespace n
+ {
+ struct add_handler;
+ struct item;
+ }
+}
+
namespace
{
template <typename T_>
@@ -48,10 +56,11 @@ namespace
{
typedef std::tr1::function<void (const std::tr1::shared_ptr<const typename T_::ConstItem> &)> AddHandler;
- typedef kc::KeyedClass<
- kc::Field<k::add_handler, AddHandler>,
- kc::Field<k::item, const std::tr1::shared_ptr<const typename T_::ConstItem> >
- > Item;
+ struct Item
+ {
+ NamedValue<n::add_handler, AddHandler> add_handler;
+ NamedValue<n::item, const std::tr1::shared_ptr<const typename T_::ConstItem> > item;
+ };
typedef std::list<Item> Stack;
};
@@ -64,7 +73,7 @@ namespace
+ epdso_allow_slot_star_deps + epdso_allow_slot_equal_deps + epdso_allow_repository_deps
+ epdso_allow_use_deps + epdso_allow_ranged_deps + epdso_allow_tilde_greater_deps
+ epdso_strict_parsing, id));
- (*h.begin())[k::add_handler()](make_shared_ptr(new TreeLeaf<T_, PackageDepSpec>(make_shared_ptr(new PackageDepSpec(p)))));
+ (*h.begin()).add_handler()(make_shared_ptr(new TreeLeaf<T_, PackageDepSpec>(make_shared_ptr(new PackageDepSpec(p)))));
}
template <typename T_>
@@ -79,7 +88,7 @@ namespace
+ epdso_allow_slot_star_deps + epdso_allow_slot_equal_deps + epdso_allow_repository_deps
+ epdso_allow_use_deps + epdso_allow_ranged_deps + epdso_allow_tilde_greater_deps
+ epdso_strict_parsing, id)))));
- (*h.begin())[k::add_handler()](make_shared_ptr(new TreeLeaf<T_, BlockDepSpec>(b)));
+ (*h.begin()).add_handler()(make_shared_ptr(new TreeLeaf<T_, BlockDepSpec>(b)));
}
else
package_dep_spec_string_handler<T_>(h, s, id);
@@ -88,19 +97,19 @@ namespace
template <typename T_>
void license_handler(const typename ParseStackTypes<T_>::Stack & h, const std::string & s)
{
- (*h.begin())[k::add_handler()](make_shared_ptr(new TreeLeaf<T_, LicenseDepSpec>(make_shared_ptr(new LicenseDepSpec(s)))));
+ (*h.begin()).add_handler()(make_shared_ptr(new TreeLeaf<T_, LicenseDepSpec>(make_shared_ptr(new LicenseDepSpec(s)))));
}
template <typename T_>
void simple_uri_handler(const typename ParseStackTypes<T_>::Stack & h, const std::string & s)
{
- (*h.begin())[k::add_handler()](make_shared_ptr(new TreeLeaf<T_, SimpleURIDepSpec>(make_shared_ptr(new SimpleURIDepSpec(s)))));
+ (*h.begin()).add_handler()(make_shared_ptr(new TreeLeaf<T_, SimpleURIDepSpec>(make_shared_ptr(new SimpleURIDepSpec(s)))));
}
template <typename T_>
void arrow_handler(const typename ParseStackTypes<T_>::Stack & h, const std::string & s, const std::string & t)
{
- (*h.begin())[k::add_handler()](make_shared_ptr(new TreeLeaf<T_, FetchableURIDepSpec>(make_shared_ptr(
+ (*h.begin()).add_handler()(make_shared_ptr(new TreeLeaf<T_, FetchableURIDepSpec>(make_shared_ptr(
new FetchableURIDepSpec(t.empty() ? s : s + " -> " + t)))));
}
@@ -138,11 +147,11 @@ namespace
using namespace std::tr1::placeholders;
std::tr1::shared_ptr<ConstTreeSequence<T_, A_> > item(
new ConstTreeSequence<T_, A_>(make_shared_ptr(new A_)));
- (*stack.begin())[k::add_handler()](item);
- stack.push_front(ParseStackTypes<T_>::Item::named_create()
- (k::add_handler(), std::tr1::bind(&ConstTreeSequence<T_, A_>::add, item.get(), _1))
- (k::item(), item)
- );
+ (*stack.begin()).add_handler()(item);
+ stack.push_front(make_named_values<typename ParseStackTypes<T_>::Item>(
+ value_for<n::add_handler>(std::tr1::bind(&ConstTreeSequence<T_, A_>::add, item.get(), _1)),
+ value_for<n::item>(item)
+ ));
}
template <typename T_>
@@ -153,11 +162,11 @@ namespace
std::tr1::shared_ptr<ConstTreeSequence<T_, ConditionalDepSpec> > item(
new ConstTreeSequence<T_, ConditionalDepSpec>(make_shared_ptr(new ConditionalDepSpec(
parse_elike_conditional_dep_spec(u, env, id)))));
- (*stack.begin())[k::add_handler()](item);
- stack.push_front(ParseStackTypes<T_>::Item::named_create()
- (k::add_handler(), std::tr1::bind(&ConstTreeSequence<T_, ConditionalDepSpec>::add, item.get(), _1))
- (k::item(), item)
- );
+ (*stack.begin()).add_handler()(item);
+ stack.push_front(make_named_values<typename ParseStackTypes<T_>::Item>(
+ value_for<n::add_handler>(std::tr1::bind(&ConstTreeSequence<T_, ConditionalDepSpec>::add, item.get(), _1)),
+ value_for<n::item>(item)
+ ));
}
template <typename T_>
@@ -193,29 +202,29 @@ paludis::fakerepository::parse_depend(const std::string & s,
ParseStackTypes<DependencySpecTree>::Stack stack;
std::tr1::shared_ptr<ConstTreeSequence<DependencySpecTree, AllDepSpec> > top(
new ConstTreeSequence<DependencySpecTree, AllDepSpec>(make_shared_ptr(new AllDepSpec)));
- stack.push_front(ParseStackTypes<DependencySpecTree>::Item::named_create()
- (k::add_handler(), std::tr1::bind(&ConstTreeSequence<DependencySpecTree, AllDepSpec>::add, top.get(), _1))
- (k::item(), top)
- );
+ stack.push_front(make_named_values<ParseStackTypes<DependencySpecTree>::Item>(
+ value_for<n::add_handler>(std::tr1::bind(&ConstTreeSequence<DependencySpecTree, AllDepSpec>::add, top.get(), _1)),
+ value_for<n::item>(top)
+ ));
ELikeDepParserCallbacks callbacks(
- ELikeDepParserCallbacks::named_create()
- (k::on_string(), std::tr1::bind(&package_or_block_dep_spec_string_handler<DependencySpecTree>, std::tr1::ref(stack), _1, id))
- (k::on_arrow(), std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2))
- (k::on_any(), std::tr1::bind(&any_all_handler<DependencySpecTree, AnyDepSpec>, std::tr1::ref(stack)))
- (k::on_all(), std::tr1::bind(&any_all_handler<DependencySpecTree, AllDepSpec>, std::tr1::ref(stack)))
- (k::on_use(), std::tr1::bind(&use_handler<DependencySpecTree>, std::tr1::ref(stack), _1, env, id))
- (k::on_label(), std::tr1::bind(&labels_not_allowed_handler, s, _1))
- (k::on_pop(), std::tr1::bind(&pop_handler<DependencySpecTree>, std::tr1::ref(stack), s))
- (k::on_error(), std::tr1::bind(&error_handler, s, _1))
- (k::on_should_be_empty(), std::tr1::bind(&should_be_empty_handler<DependencySpecTree>, std::tr1::ref(stack), s))
- (k::on_use_under_any(), &do_nothing)
- (k::on_annotations(), &discard_annotations)
- );
+ make_named_values<ELikeDepParserCallbacks>(
+ value_for<n::on_all>(std::tr1::bind(&any_all_handler<DependencySpecTree, AllDepSpec>, std::tr1::ref(stack))),
+ value_for<n::on_annotations>(&discard_annotations),
+ value_for<n::on_any>(std::tr1::bind(&any_all_handler<DependencySpecTree, AnyDepSpec>, std::tr1::ref(stack))),
+ value_for<n::on_arrow>(std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2)),
+ value_for<n::on_error>(std::tr1::bind(&error_handler, s, _1)),
+ value_for<n::on_label>(std::tr1::bind(&labels_not_allowed_handler, s, _1)),
+ value_for<n::on_pop>(std::tr1::bind(&pop_handler<DependencySpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_should_be_empty>(std::tr1::bind(&should_be_empty_handler<DependencySpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_string>(std::tr1::bind(&package_or_block_dep_spec_string_handler<DependencySpecTree>, std::tr1::ref(stack), _1, id)),
+ value_for<n::on_use>(std::tr1::bind(&use_handler<DependencySpecTree>, std::tr1::ref(stack), _1, env, id)),
+ value_for<n::on_use_under_any>(&do_nothing)
+ ));
parse_elike_dependencies(s, callbacks);
- return (*stack.begin())[k::item()];
+ return (*stack.begin()).item();
}
std::tr1::shared_ptr<ProvideSpecTree::ConstItem>
@@ -227,29 +236,29 @@ paludis::fakerepository::parse_provide(const std::string & s,
ParseStackTypes<ProvideSpecTree>::Stack stack;
std::tr1::shared_ptr<ConstTreeSequence<ProvideSpecTree, AllDepSpec> > top(
new ConstTreeSequence<ProvideSpecTree, AllDepSpec>(make_shared_ptr(new AllDepSpec)));
- stack.push_front(ParseStackTypes<ProvideSpecTree>::Item::named_create()
- (k::add_handler(), std::tr1::bind(&ConstTreeSequence<ProvideSpecTree, AllDepSpec>::add, top.get(), _1))
- (k::item(), top)
- );
+ stack.push_front(make_named_values<ParseStackTypes<ProvideSpecTree>::Item>(
+ value_for<n::add_handler>(std::tr1::bind(&ConstTreeSequence<ProvideSpecTree, AllDepSpec>::add, top.get(), _1)),
+ value_for<n::item>(top)
+ ));
ELikeDepParserCallbacks callbacks(
- ELikeDepParserCallbacks::named_create()
- (k::on_string(), std::tr1::bind(&package_dep_spec_string_handler<ProvideSpecTree>, std::tr1::ref(stack), _1, id))
- (k::on_arrow(), std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2))
- (k::on_any(), std::tr1::bind(&any_not_allowed_handler, s))
- (k::on_all(), std::tr1::bind(&any_all_handler<ProvideSpecTree, AllDepSpec>, std::tr1::ref(stack)))
- (k::on_use(), std::tr1::bind(&use_handler<ProvideSpecTree>, std::tr1::ref(stack), _1, env, id))
- (k::on_label(), std::tr1::bind(&labels_not_allowed_handler, s, _1))
- (k::on_pop(), std::tr1::bind(&pop_handler<ProvideSpecTree>, std::tr1::ref(stack), s))
- (k::on_error(), std::tr1::bind(&error_handler, s, _1))
- (k::on_should_be_empty(), std::tr1::bind(&should_be_empty_handler<ProvideSpecTree>, std::tr1::ref(stack), s))
- (k::on_use_under_any(), &do_nothing)
- (k::on_annotations(), &discard_annotations)
- );
+ make_named_values<ELikeDepParserCallbacks>(
+ value_for<n::on_all>(std::tr1::bind(&any_all_handler<ProvideSpecTree, AllDepSpec>, std::tr1::ref(stack))),
+ value_for<n::on_annotations>(&discard_annotations),
+ value_for<n::on_any>(std::tr1::bind(&any_not_allowed_handler, s)),
+ value_for<n::on_arrow>(std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2)),
+ value_for<n::on_error>(std::tr1::bind(&error_handler, s, _1)),
+ value_for<n::on_label>(std::tr1::bind(&labels_not_allowed_handler, s, _1)),
+ value_for<n::on_pop>(std::tr1::bind(&pop_handler<ProvideSpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_should_be_empty>(std::tr1::bind(&should_be_empty_handler<ProvideSpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_string>(std::tr1::bind(&package_dep_spec_string_handler<ProvideSpecTree>, std::tr1::ref(stack), _1, id)),
+ value_for<n::on_use>(std::tr1::bind(&use_handler<ProvideSpecTree>, std::tr1::ref(stack), _1, env, id)),
+ value_for<n::on_use_under_any>(&do_nothing)
+ ));
parse_elike_dependencies(s, callbacks);
- return (*stack.begin())[k::item()];
+ return (*stack.begin()).item();
}
std::tr1::shared_ptr<FetchableURISpecTree::ConstItem>
@@ -261,29 +270,29 @@ paludis::fakerepository::parse_fetchable_uri(const std::string & s,
ParseStackTypes<FetchableURISpecTree>::Stack stack;
std::tr1::shared_ptr<ConstTreeSequence<FetchableURISpecTree, AllDepSpec> > top(
new ConstTreeSequence<FetchableURISpecTree, AllDepSpec>(make_shared_ptr(new AllDepSpec)));
- stack.push_front(ParseStackTypes<FetchableURISpecTree>::Item::named_create()
- (k::add_handler(), std::tr1::bind(&ConstTreeSequence<FetchableURISpecTree, AllDepSpec>::add, top.get(), _1))
- (k::item(), top)
- );
+ stack.push_front(make_named_values<ParseStackTypes<FetchableURISpecTree>::Item>(
+ value_for<n::add_handler>(std::tr1::bind(&ConstTreeSequence<FetchableURISpecTree, AllDepSpec>::add, top.get(), _1)),
+ value_for<n::item>(top)
+ ));
ELikeDepParserCallbacks callbacks(
- ELikeDepParserCallbacks::named_create()
- (k::on_string(), std::tr1::bind(&arrow_handler<FetchableURISpecTree>, std::tr1::ref(stack), _1, ""))
- (k::on_arrow(), std::tr1::bind(&arrow_handler<FetchableURISpecTree>, std::tr1::ref(stack), _1, _2))
- (k::on_any(), std::tr1::bind(&any_not_allowed_handler, s))
- (k::on_all(), std::tr1::bind(&any_all_handler<FetchableURISpecTree, AllDepSpec>, std::tr1::ref(stack)))
- (k::on_use(), std::tr1::bind(&use_handler<FetchableURISpecTree>, std::tr1::ref(stack), _1, env, id))
- (k::on_label(), std::tr1::bind(&labels_not_allowed_handler, s, _1))
- (k::on_pop(), std::tr1::bind(&pop_handler<FetchableURISpecTree>, std::tr1::ref(stack), s))
- (k::on_error(), std::tr1::bind(&error_handler, s, _1))
- (k::on_should_be_empty(), std::tr1::bind(&should_be_empty_handler<FetchableURISpecTree>, std::tr1::ref(stack), s))
- (k::on_use_under_any(), &do_nothing)
- (k::on_annotations(), &discard_annotations)
- );
+ make_named_values<ELikeDepParserCallbacks>(
+ value_for<n::on_all>(std::tr1::bind(&any_all_handler<FetchableURISpecTree, AllDepSpec>, std::tr1::ref(stack))),
+ value_for<n::on_annotations>(&discard_annotations),
+ value_for<n::on_any>(std::tr1::bind(&any_not_allowed_handler, s)),
+ value_for<n::on_arrow>(std::tr1::bind(&arrow_handler<FetchableURISpecTree>, std::tr1::ref(stack), _1, _2)),
+ value_for<n::on_error>(std::tr1::bind(&error_handler, s, _1)),
+ value_for<n::on_label>(std::tr1::bind(&labels_not_allowed_handler, s, _1)),
+ value_for<n::on_pop>(std::tr1::bind(&pop_handler<FetchableURISpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_should_be_empty>(std::tr1::bind(&should_be_empty_handler<FetchableURISpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_string>(std::tr1::bind(&arrow_handler<FetchableURISpecTree>, std::tr1::ref(stack), _1, "")),
+ value_for<n::on_use>(std::tr1::bind(&use_handler<FetchableURISpecTree>, std::tr1::ref(stack), _1, env, id)),
+ value_for<n::on_use_under_any>(&do_nothing)
+ ));
parse_elike_dependencies(s, callbacks);
- return (*stack.begin())[k::item()];
+ return (*stack.begin()).item();
}
std::tr1::shared_ptr<SimpleURISpecTree::ConstItem>
@@ -295,29 +304,29 @@ paludis::fakerepository::parse_simple_uri(const std::string & s,
ParseStackTypes<SimpleURISpecTree>::Stack stack;
std::tr1::shared_ptr<ConstTreeSequence<SimpleURISpecTree, AllDepSpec> > top(
new ConstTreeSequence<SimpleURISpecTree, AllDepSpec>(make_shared_ptr(new AllDepSpec)));
- stack.push_front(ParseStackTypes<SimpleURISpecTree>::Item::named_create()
- (k::add_handler(), std::tr1::bind(&ConstTreeSequence<SimpleURISpecTree, AllDepSpec>::add, top.get(), _1))
- (k::item(), top)
- );
+ stack.push_front(make_named_values<ParseStackTypes<SimpleURISpecTree>::Item>(
+ value_for<n::add_handler>(std::tr1::bind(&ConstTreeSequence<SimpleURISpecTree, AllDepSpec>::add, top.get(), _1)),
+ value_for<n::item>(top)
+ ));
ELikeDepParserCallbacks callbacks(
- ELikeDepParserCallbacks::named_create()
- (k::on_string(), std::tr1::bind(&simple_uri_handler<SimpleURISpecTree>, std::tr1::ref(stack), _1))
- (k::on_arrow(), std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2))
- (k::on_any(), std::tr1::bind(&any_not_allowed_handler, s))
- (k::on_all(), std::tr1::bind(&any_all_handler<SimpleURISpecTree, AllDepSpec>, std::tr1::ref(stack)))
- (k::on_use(), std::tr1::bind(&use_handler<SimpleURISpecTree>, std::tr1::ref(stack), _1, env, id))
- (k::on_label(), std::tr1::bind(&labels_not_allowed_handler, s, _1))
- (k::on_pop(), std::tr1::bind(&pop_handler<SimpleURISpecTree>, std::tr1::ref(stack), s))
- (k::on_error(), std::tr1::bind(&error_handler, s, _1))
- (k::on_should_be_empty(), std::tr1::bind(&should_be_empty_handler<SimpleURISpecTree>, std::tr1::ref(stack), s))
- (k::on_use_under_any(), &do_nothing)
- (k::on_annotations(), &discard_annotations)
- );
+ make_named_values<ELikeDepParserCallbacks>(
+ value_for<n::on_all>(std::tr1::bind(&any_all_handler<SimpleURISpecTree, AllDepSpec>, std::tr1::ref(stack))),
+ value_for<n::on_annotations>(&discard_annotations),
+ value_for<n::on_any>(std::tr1::bind(&any_not_allowed_handler, s)),
+ value_for<n::on_arrow>(std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2)),
+ value_for<n::on_error>(std::tr1::bind(&error_handler, s, _1)),
+ value_for<n::on_label>(std::tr1::bind(&labels_not_allowed_handler, s, _1)),
+ value_for<n::on_pop>(std::tr1::bind(&pop_handler<SimpleURISpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_should_be_empty>(std::tr1::bind(&should_be_empty_handler<SimpleURISpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_string>(std::tr1::bind(&simple_uri_handler<SimpleURISpecTree>, std::tr1::ref(stack), _1)),
+ value_for<n::on_use>(std::tr1::bind(&use_handler<SimpleURISpecTree>, std::tr1::ref(stack), _1, env, id)),
+ value_for<n::on_use_under_any>(&do_nothing)
+ ));
parse_elike_dependencies(s, callbacks);
- return (*stack.begin())[k::item()];
+ return (*stack.begin()).item();
}
std::tr1::shared_ptr<LicenseSpecTree::ConstItem>
@@ -329,28 +338,28 @@ paludis::fakerepository::parse_license(const std::string & s,
ParseStackTypes<LicenseSpecTree>::Stack stack;
std::tr1::shared_ptr<ConstTreeSequence<LicenseSpecTree, AllDepSpec> > top(
new ConstTreeSequence<LicenseSpecTree, AllDepSpec>(make_shared_ptr(new AllDepSpec)));
- stack.push_front(ParseStackTypes<LicenseSpecTree>::Item::named_create()
- (k::add_handler(), std::tr1::bind(&ConstTreeSequence<LicenseSpecTree, AllDepSpec>::add, top.get(), _1))
- (k::item(), top)
- );
+ stack.push_front(make_named_values<ParseStackTypes<LicenseSpecTree>::Item>(
+ value_for<n::add_handler>(std::tr1::bind(&ConstTreeSequence<LicenseSpecTree, AllDepSpec>::add, top.get(), _1)),
+ value_for<n::item>(top)
+ ));
ELikeDepParserCallbacks callbacks(
- ELikeDepParserCallbacks::named_create()
- (k::on_string(), std::tr1::bind(&license_handler<LicenseSpecTree>, std::tr1::ref(stack), _1))
- (k::on_arrow(), std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2))
- (k::on_any(), std::tr1::bind(&any_all_handler<LicenseSpecTree, AnyDepSpec>, std::tr1::ref(stack)))
- (k::on_all(), std::tr1::bind(&any_all_handler<LicenseSpecTree, AllDepSpec>, std::tr1::ref(stack)))
- (k::on_use(), std::tr1::bind(&use_handler<LicenseSpecTree>, std::tr1::ref(stack), _1, env, id))
- (k::on_label(), std::tr1::bind(&labels_not_allowed_handler, s, _1))
- (k::on_pop(), std::tr1::bind(&pop_handler<LicenseSpecTree>, std::tr1::ref(stack), s))
- (k::on_error(), std::tr1::bind(&error_handler, s, _1))
- (k::on_should_be_empty(), std::tr1::bind(&should_be_empty_handler<LicenseSpecTree>, std::tr1::ref(stack), s))
- (k::on_use_under_any(), &do_nothing)
- (k::on_annotations(), &discard_annotations)
- );
+ make_named_values<ELikeDepParserCallbacks>(
+ value_for<n::on_all>(std::tr1::bind(&any_all_handler<LicenseSpecTree, AllDepSpec>, std::tr1::ref(stack))),
+ value_for<n::on_annotations>(&discard_annotations),
+ value_for<n::on_any>(std::tr1::bind(&any_all_handler<LicenseSpecTree, AnyDepSpec>, std::tr1::ref(stack))),
+ value_for<n::on_arrow>(std::tr1::bind(&arrows_not_allowed_handler, s, _1, _2)),
+ value_for<n::on_error>(std::tr1::bind(&error_handler, s, _1)),
+ value_for<n::on_label>(std::tr1::bind(&labels_not_allowed_handler, s, _1)),
+ value_for<n::on_pop>(std::tr1::bind(&pop_handler<LicenseSpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_should_be_empty>(std::tr1::bind(&should_be_empty_handler<LicenseSpecTree>, std::tr1::ref(stack), s)),
+ value_for<n::on_string>(std::tr1::bind(&license_handler<LicenseSpecTree>, std::tr1::ref(stack), _1)),
+ value_for<n::on_use>(std::tr1::bind(&use_handler<LicenseSpecTree>, std::tr1::ref(stack), _1, env, id)),
+ value_for<n::on_use_under_any>(&do_nothing)
+ ));
parse_elike_dependencies(s, callbacks);
- return (*stack.begin())[k::item()];
+ return (*stack.begin()).item();
}
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index b8409ce8f..553ab36d2 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -24,6 +24,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/environment.hh>
@@ -53,20 +54,21 @@ namespace paludis
}
FakeInstalledRepository::FakeInstalledRepository(const Environment * const e, const RepositoryName & our_name) :
- FakeRepositoryBase(e, our_name, RepositoryCapabilities::named_create()
- (k::sets_interface(), this)
- (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
- (k::use_interface(), this)
- (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
- (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
- (k::provides_interface(), this)
- (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
- (k::destination_interface(), this)
- (k::e_interface(), static_cast<RepositoryEInterface *>(0))
- (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
- (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
- (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
- (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
+ FakeRepositoryBase(e, our_name, make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(this),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
+ value_for<n::hook_interface>(static_cast<RepositoryHookInterface *>(0)),
+ value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
+ value_for<n::provides_interface>(this),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(this),
+ value_for<n::syncable_interface>(static_cast<RepositorySyncableInterface *>(0)),
+ value_for<n::use_interface>(this),
+ value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ )),
PrivateImplementationPattern<FakeInstalledRepository>(new Implementation<FakeInstalledRepository>),
_imp(PrivateImplementationPattern<FakeInstalledRepository>::_imp)
{
@@ -108,9 +110,10 @@ FakeInstalledRepository::provided_packages() const
(*v)->provide_key()->value()->accept(f);
for (DepSpecFlattener<ProvideSpecTree, PackageDepSpec>::ConstIterator q(f.begin()), q_end(f.end()) ; q != q_end ; ++q)
- result->push_back(RepositoryProvidesEntry::named_create()
- (k::virtual_name(), QualifiedPackageName((*q)->text()))
- (k::provided_by(), *v));
+ result->push_back(make_named_values<RepositoryProvidesEntry>(
+ value_for<n::provided_by>(*v),
+ value_for<n::virtual_name>(QualifiedPackageName((*q)->text()))
+ ));
}
}
}
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 019dda313..d086986b7 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -1004,9 +1004,9 @@ FakeMetadataIUseSetKey::pretty_print_flat(const Formatter<IUseFlag> & f) const
if (! result.empty())
result.append(" ");
- if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_mask(i->flag, *_imp->id))
+ if ((*_imp->id->repository()).use_interface() && (*_imp->id->repository()).use_interface()->query_use_mask(i->flag, *_imp->id))
result.append(f.format(*i, format::Masked()));
- else if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_force(i->flag, *_imp->id))
+ else if ((*_imp->id->repository()).use_interface() && (*_imp->id->repository()).use_interface()->query_use_force(i->flag, *_imp->id))
result.append(f.format(*i, format::Forced()));
else if (_imp->env->query_use(i->flag, *_imp->id))
result.append(f.format(*i, format::Enabled()));
@@ -1033,12 +1033,12 @@ FakeMetadataIUseSetKey::pretty_print_flat_with_comparison(
std::string l;
bool n;
- if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_mask(i->flag, *_imp->id))
+ if ((*_imp->id->repository()).use_interface() && (*_imp->id->repository()).use_interface()->query_use_mask(i->flag, *_imp->id))
{
l = f.format(*i, format::Masked());
n = false;
}
- else if ((*_imp->id->repository())[k::use_interface()] && (*_imp->id->repository())[k::use_interface()]->query_use_force(i->flag, *_imp->id))
+ else if ((*_imp->id->repository()).use_interface() && (*_imp->id->repository()).use_interface()->query_use_force(i->flag, *_imp->id))
{
l = f.format(*i, format::Forced());
n = true;
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 3e73df409..ba5a8211d 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -24,7 +24,7 @@
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/visitor-impl.hh>
-#include <paludis/util/kc.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/distribution.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
@@ -60,21 +60,22 @@ namespace paludis
FakeRepository::FakeRepository(const Environment * const env, const RepositoryName & r) :
PrivateImplementationPattern<FakeRepository>(new Implementation<FakeRepository>),
- FakeRepositoryBase(env, r, RepositoryCapabilities::named_create()
- (k::sets_interface(), this)
- (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
- (k::use_interface(), this)
- (k::mirrors_interface(), this)
- (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
- (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
- (k::virtuals_interface(), (*DistributionData::get_instance()->distribution_from_string(
- env->distribution()))[k::support_old_style_virtuals()] ? this : 0)
- (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
- (k::e_interface(), static_cast<RepositoryEInterface *>(0))
- (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
- (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
- (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
- (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
+ FakeRepositoryBase(env, r, make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
+ value_for<n::hook_interface>(static_cast<RepositoryHookInterface *>(0)),
+ value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(this),
+ value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(this),
+ value_for<n::syncable_interface>(static_cast<RepositorySyncableInterface *>(0)),
+ value_for<n::use_interface>(this),
+ value_for<n::virtuals_interface>((*DistributionData::get_instance()->distribution_from_string(
+ env->distribution())).support_old_style_virtuals() ? this : 0)
+ )),
_imp(PrivateImplementationPattern<FakeRepository>::_imp)
{
add_metadata_key(_imp->format_key);
@@ -82,21 +83,22 @@ FakeRepository::FakeRepository(const Environment * const env, const RepositoryNa
FakeRepository::FakeRepository(const FakeRepositoryParams & params) :
PrivateImplementationPattern<FakeRepository>(new Implementation<FakeRepository>),
- FakeRepositoryBase(params.environment, params.name, RepositoryCapabilities::named_create()
- (k::sets_interface(), this)
- (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
- (k::use_interface(), this)
- (k::mirrors_interface(), this)
- (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
- (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
- (k::virtuals_interface(), (*DistributionData::get_instance()->distribution_from_string(
- params.environment->distribution()))[k::support_old_style_virtuals()] ? this : 0)
- (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
- (k::e_interface(), static_cast<RepositoryEInterface *>(0))
- (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
- (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
- (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
- (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
+ FakeRepositoryBase(params.environment, params.name, make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
+ value_for<n::hook_interface>(static_cast<RepositoryHookInterface *>(0)),
+ value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(this),
+ value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(this),
+ value_for<n::syncable_interface>(static_cast<RepositorySyncableInterface *>(0)),
+ value_for<n::use_interface>(this),
+ value_for<n::virtuals_interface>((*DistributionData::get_instance()->distribution_from_string(
+ params.environment->distribution())).support_old_style_virtuals() ? this : 0)
+ )),
_imp(PrivateImplementationPattern<FakeRepository>::_imp)
{
add_metadata_key(_imp->format_key);
@@ -115,7 +117,10 @@ FakeRepository::virtual_packages() const
void
FakeRepository::add_virtual_package(const QualifiedPackageName & q, std::tr1::shared_ptr<const PackageDepSpec> p)
{
- _imp->virtual_packages->push_back(RepositoryVirtualsEntry(q, p));
+ _imp->virtual_packages->push_back(make_named_values<RepositoryVirtualsEntry>(
+ value_for<n::provided_by_spec>(p),
+ value_for<n::virtual_name>(q)
+ ));
}
namespace paludis
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index ed088e8ba..4b77049c5 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -31,6 +31,7 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/action.hh>
#include <paludis/metadata_key.hh>
#include <paludis/literal_metadata_key.hh>
@@ -86,20 +87,21 @@ namespace paludis
GemsRepository::GemsRepository(const gems::RepositoryParams & params) :
Repository(RepositoryName("gems"),
- RepositoryCapabilities::named_create()
- (k::sets_interface(), static_cast<RepositorySetsInterface *>(0))
- (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
- (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
- (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
- (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
- (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
- (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
- (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
- (k::e_interface(), static_cast<RepositoryEInterface *>(0))
- (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
- (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
- (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
- (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
+ make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
+ value_for<n::hook_interface>(static_cast<RepositoryHookInterface *>(0)),
+ value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
+ value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(static_cast<RepositorySetsInterface *>(0)),
+ value_for<n::syncable_interface>(static_cast<RepositorySyncableInterface *>(0)),
+ value_for<n::use_interface>(static_cast<RepositoryUseInterface *>(0)),
+ value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ )),
PrivateImplementationPattern<GemsRepository>(new Implementation<GemsRepository>(params)),
_imp(PrivateImplementationPattern<GemsRepository>::_imp)
{
diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc
index 199ba4cf6..1f5a968dc 100644
--- a/paludis/repositories/gems/installed_gems_repository.cc
+++ b/paludis/repositories/gems/installed_gems_repository.cc
@@ -36,6 +36,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/action.hh>
#include <tr1/unordered_map>
@@ -86,20 +87,21 @@ namespace paludis
InstalledGemsRepository::InstalledGemsRepository(const gems::InstalledRepositoryParams & params) :
Repository(RepositoryName("installed-gems"),
- RepositoryCapabilities::named_create()
- (k::sets_interface(), static_cast<RepositorySetsInterface *>(0))
- (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
- (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
- (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
- (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
- (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
- (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
- (k::destination_interface(), this)
- (k::e_interface(), static_cast<RepositoryEInterface *>(0))
- (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
- (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
- (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
- (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
+ make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(this),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
+ value_for<n::hook_interface>(static_cast<RepositoryHookInterface *>(0)),
+ value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
+ value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(static_cast<RepositorySetsInterface *>(0)),
+ value_for<n::syncable_interface>(static_cast<RepositorySyncableInterface *>(0)),
+ value_for<n::use_interface>(static_cast<RepositoryUseInterface *>(0)),
+ value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ )),
PrivateImplementationPattern<InstalledGemsRepository>(new Implementation<InstalledGemsRepository>(params)),
_imp(PrivateImplementationPattern<InstalledGemsRepository>::_imp)
{
diff --git a/paludis/repositories/gems/registration.cc b/paludis/repositories/gems/registration.cc
index f161ccbbb..1d2d54c0f 100644
--- a/paludis/repositories/gems/registration.cc
+++ b/paludis/repositories/gems/registration.cc
@@ -25,7 +25,6 @@
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/map.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/kc.hh>
#include <paludis/distribution.hh>
#include <paludis/environment.hh>
@@ -52,7 +51,7 @@ namespace
std::string builddir(f("builddir"));
if (builddir.empty())
- builddir = (*DistributionData::get_instance()->distribution_from_string(env->distribution()))[k::default_ebuild_builddir()];
+ builddir = (*DistributionData::get_instance()->distribution_from_string(env->distribution())).default_ebuild_builddir();
return make_shared_ptr(new GemsRepository(gems::RepositoryParams::create()
.location(location)
@@ -74,7 +73,7 @@ namespace
std::string builddir(f("builddir"));
if (builddir.empty())
- builddir = (*DistributionData::get_instance()->distribution_from_string(env->distribution()))[k::default_ebuild_builddir()];
+ builddir = (*DistributionData::get_instance()->distribution_from_string(env->distribution())).default_ebuild_builddir();
std::string root(f("root"));
if (root.empty())
diff --git a/paludis/repositories/unavailable/registration.cc b/paludis/repositories/unavailable/registration.cc
index bc88d95da..a408f1032 100644
--- a/paludis/repositories/unavailable/registration.cc
+++ b/paludis/repositories/unavailable/registration.cc
@@ -21,6 +21,7 @@
#include <paludis/repositories/unavailable/unavailable_repository.hh>
#include <paludis/util/map.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/make_named_values.hh>
using namespace paludis;
using namespace paludis::unavailable_repository;
@@ -52,13 +53,13 @@ namespace
std::string sync_options(f("sync_options"));
return std::tr1::shared_ptr<UnavailableRepository>(new UnavailableRepository(
- UnavailableRepositoryParams::named_create()
- (k::name(), RepositoryName(name_str))
- (k::location(), location)
- (k::sync(), sync)
- (k::sync_options(), sync_options)
- (k::environment(), env)
- ));
+ make_named_values<UnavailableRepositoryParams>(
+ value_for<n::environment>(env),
+ value_for<n::location>(location),
+ value_for<n::name>(RepositoryName(name_str)),
+ value_for<n::sync>(sync),
+ value_for<n::sync_options>(sync_options)
+ )));
}
}
diff --git a/paludis/repositories/unavailable/unavailable_id.cc b/paludis/repositories/unavailable/unavailable_id.cc
index ddade4437..cf430574c 100644
--- a/paludis/repositories/unavailable/unavailable_id.cc
+++ b/paludis/repositories/unavailable/unavailable_id.cc
@@ -20,7 +20,6 @@
#include <paludis/repositories/unavailable/unavailable_id.hh>
#include <paludis/repositories/unavailable/unavailable_repository.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/kc.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/visitor_cast.hh>
@@ -52,15 +51,15 @@ namespace paludis
Implementation(
const UnavailableIDParams & e) :
- name(e[k::name()]),
- version(e[k::version()]),
- slot(e[k::slot()]),
- repo(e[k::repository()]),
- description_key(e[k::description()]),
- repository_homepage_key(e[k::repository_homepage()]),
- repository_description_key(e[k::repository_description()]),
- from_repositories_key(e[k::from_repositories()]),
- mask(e[k::mask()])
+ name(e.name()),
+ version(e.version()),
+ slot(e.slot()),
+ repo(e.repository()),
+ description_key(e.description()),
+ repository_homepage_key(e.repository_homepage()),
+ repository_description_key(e.repository_description()),
+ from_repositories_key(e.from_repositories()),
+ mask(e.mask())
{
}
};
diff --git a/paludis/repositories/unavailable/unavailable_id.hh b/paludis/repositories/unavailable/unavailable_id.hh
index aafa2b833..970e6b15e 100644
--- a/paludis/repositories/unavailable/unavailable_id.hh
+++ b/paludis/repositories/unavailable/unavailable_id.hh
@@ -20,25 +20,40 @@
#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNAVAILABLE_UNAVAILABLE_ID_HH
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNAVAILABLE_UNAVAILABLE_ID_HH 1
+#include <paludis/util/named_value.hh>
#include <paludis/package_id.hh>
#include <paludis/repositories/unavailable/unavailable_repository_file-fwd.hh>
#include <paludis/repositories/unavailable/unavailable_repository-fwd.hh>
namespace paludis
{
+ namespace n
+ {
+ struct description;
+ struct from_repositories;
+ struct mask;
+ struct name;
+ struct repository;
+ struct repository_description;
+ struct repository_homepage;
+ struct slot;
+ struct version;
+ }
+
namespace unavailable_repository
{
- typedef kc::KeyedClass<
- kc::Field<k::name, QualifiedPackageName>,
- kc::Field<k::version, VersionSpec>,
- kc::Field<k::slot, SlotName>,
- kc::Field<k::repository, const UnavailableRepository *>,
- kc::Field<k::from_repositories, std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > >,
- kc::Field<k::repository_homepage, std::tr1::shared_ptr<const MetadataValueKey<std::string> > >,
- kc::Field<k::repository_description, std::tr1::shared_ptr<const MetadataValueKey<std::string> > >,
- kc::Field<k::description, std::tr1::shared_ptr<const MetadataValueKey<std::string> > >,
- kc::Field<k::mask, std::tr1::shared_ptr<const Mask> >
- > UnavailableIDParams;
+ struct UnavailableIDParams
+ {
+ NamedValue<n::description, std::tr1::shared_ptr<const MetadataValueKey<std::string> > > description;
+ NamedValue<n::from_repositories, std::tr1::shared_ptr<const MetadataCollectionKey<Set<std::string> > > > from_repositories;
+ NamedValue<n::mask, std::tr1::shared_ptr<const Mask> > mask;
+ NamedValue<n::name, QualifiedPackageName> name;
+ NamedValue<n::repository, const UnavailableRepository *> repository;
+ NamedValue<n::repository_description, std::tr1::shared_ptr<const MetadataValueKey<std::string> > > repository_description;
+ NamedValue<n::repository_homepage, std::tr1::shared_ptr<const MetadataValueKey<std::string> > > repository_homepage;
+ NamedValue<n::slot, SlotName> slot;
+ NamedValue<n::version, VersionSpec> version;
+ };
class PALUDIS_VISIBLE UnavailableID :
public PackageID,
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index d94f69ca9..42da64627 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_repository.cc
@@ -25,6 +25,7 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/action.hh>
#include <paludis/syncer.hh>
@@ -38,7 +39,7 @@ namespace
std::tr1::shared_ptr<UnavailableRepositoryStore>
make_store(const UnavailableRepository * const repo, const UnavailableRepositoryParams & p)
{
- return make_shared_ptr(new UnavailableRepositoryStore(p[k::environment()], repo, p[k::location()]));
+ return make_shared_ptr(new UnavailableRepositoryStore(p.environment(), repo, p.location()));
}
}
@@ -62,11 +63,11 @@ namespace paludis
format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
mkt_significant, "unavailable")),
location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
- mkt_significant, params[k::location()])),
+ mkt_significant, params.location())),
sync_key(new LiteralMetadataValueKey<std::string> (
- "sync", "sync", mkt_normal, params[k::sync()])),
+ "sync", "sync", mkt_normal, params.sync())),
sync_options_key(new LiteralMetadataValueKey<std::string> (
- "sync_options", "sync_options", mkt_normal, params[k::sync_options()])),
+ "sync_options", "sync_options", mkt_normal, params.sync_options())),
store(DeferredConstructionPtr<std::tr1::shared_ptr<UnavailableRepositoryStore> > (
std::tr1::bind(&make_store, repo, std::tr1::cref(params))))
{
@@ -82,22 +83,22 @@ UnavailableRepositoryConfigurationError::UnavailableRepositoryConfigurationError
UnavailableRepository::UnavailableRepository(const UnavailableRepositoryParams & p) :
PrivateImplementationPattern<UnavailableRepository>(new Implementation<UnavailableRepository>(this, p)),
Repository(
- p[k::name()],
- RepositoryCapabilities::named_create()
- (k::sets_interface(), static_cast<RepositorySetsInterface *>(0))
- (k::syncable_interface(), this)
- (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
- (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
- (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
- (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
- (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
- (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
- (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
- (k::e_interface(), static_cast<RepositoryEInterface *>(0))
- (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
- (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
- (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))
- ),
+ p.name(),
+ make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
+ value_for<n::hook_interface>(static_cast<RepositoryHookInterface *>(0)),
+ value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
+ value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(static_cast<RepositorySetsInterface *>(0)),
+ value_for<n::syncable_interface>(this),
+ value_for<n::use_interface>(static_cast<RepositoryUseInterface *>(0)),
+ value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ )),
_imp(PrivateImplementationPattern<UnavailableRepository>::_imp)
{
_add_metadata_keys();
@@ -254,26 +255,26 @@ UnavailableRepository::sync() const
{
Context context("When syncing repository '" + stringify(name()) + "':");
- if (_imp->params[k::sync()].empty())
+ if (_imp->params.sync().empty())
return false;
std::list<std::string> sync_list;
- tokenise_whitespace(_imp->params[k::sync()], std::back_inserter(sync_list));
+ tokenise_whitespace(_imp->params.sync(), std::back_inserter(sync_list));
bool ok(false);
for (std::list<std::string>::const_iterator s(sync_list.begin()),
s_end(sync_list.end()) ; s != s_end ; ++s)
{
- DefaultSyncer syncer(SyncerParams::named_create()
- (k::environment(), _imp->params[k::environment()])
- (k::local(), stringify(_imp->params[k::location()]))
- (k::remote(), *s)
- );
- SyncOptions opts(
- _imp->params[k::sync_options()],
- FSEntry("/dev/null"),
- "sync " + stringify(name()) + "> "
- );
+ DefaultSyncer syncer(make_named_values<SyncerParams>(
+ value_for<n::environment>(_imp->params.environment()),
+ value_for<n::local>(stringify(_imp->params.location())),
+ value_for<n::remote>(*s)
+ ));
+ SyncOptions opts(make_named_values<SyncOptions>(
+ value_for<n::filter_file>(FSEntry("/dev/null")),
+ value_for<n::options>(_imp->params.sync_options()),
+ value_for<n::output_prefix>("sync " + stringify(name()) + "> ")
+ ));
try
{
syncer.sync(opts);
@@ -288,7 +289,7 @@ UnavailableRepository::sync() const
}
if (! ok)
- throw SyncFailedError(stringify(_imp->params[k::location()]), _imp->params[k::sync()]);
+ throw SyncFailedError(stringify(_imp->params.location()), _imp->params.sync());
return true;
}
diff --git a/paludis/repositories/unavailable/unavailable_repository.hh b/paludis/repositories/unavailable/unavailable_repository.hh
index cdcecabcd..95be50128 100644
--- a/paludis/repositories/unavailable/unavailable_repository.hh
+++ b/paludis/repositories/unavailable/unavailable_repository.hh
@@ -27,6 +27,15 @@
namespace paludis
{
+ namespace n
+ {
+ struct environment;
+ struct location;
+ struct name;
+ struct sync;
+ struct sync_options;
+ }
+
namespace unavailable_repository
{
class PALUDIS_VISIBLE UnavailableRepositoryConfigurationError :
@@ -36,13 +45,14 @@ namespace paludis
UnavailableRepositoryConfigurationError(const std::string &) throw ();
};
- typedef kc::KeyedClass<
- kc::Field<k::environment, Environment *>,
- kc::Field<k::name, RepositoryName>,
- kc::Field<k::location, FSEntry>,
- kc::Field<k::sync, std::string>,
- kc::Field<k::sync_options, std::string>
- > UnavailableRepositoryParams;
+ struct UnavailableRepositoryParams
+ {
+ NamedValue<n::environment, Environment *> environment;
+ NamedValue<n::location, FSEntry> location;
+ NamedValue<n::name, RepositoryName> name;
+ NamedValue<n::sync, std::string> sync;
+ NamedValue<n::sync_options, std::string> sync_options;
+ };
class PALUDIS_VISIBLE UnavailableRepository :
private PrivateImplementationPattern<UnavailableRepository>,
diff --git a/paludis/repositories/unavailable/unavailable_repository_TEST.cc b/paludis/repositories/unavailable/unavailable_repository_TEST.cc
index eca2373ae..41a96bc61 100644
--- a/paludis/repositories/unavailable/unavailable_repository_TEST.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_TEST.cc
@@ -24,6 +24,7 @@
#include <paludis/util/join.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/generator.hh>
#include <paludis/selection.hh>
#include <paludis/filtered_generator.hh>
@@ -48,13 +49,13 @@ namespace test_cases
{
TestEnvironment env;
std::tr1::shared_ptr<UnavailableRepository> repo(new UnavailableRepository(
- UnavailableRepositoryParams::named_create()
- (k::name(), RepositoryName("unavailable"))
- (k::sync(), "")
- (k::sync_options(), "")
- (k::location(), FSEntry::cwd() / "unavailable_repository_TEST_dir" / "repo1")
- (k::environment(), &env)
- ));
+ make_named_values<UnavailableRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry::cwd() / "unavailable_repository_TEST_dir" / "repo1"),
+ value_for<n::name>(RepositoryName("unavailable")),
+ value_for<n::sync>(""),
+ value_for<n::sync_options>("")
+ )));
env.package_database()->add_repository(1, repo);
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "unavailable");
}
@@ -68,13 +69,13 @@ namespace test_cases
{
TestEnvironment env;
std::tr1::shared_ptr<UnavailableRepository> repo(new UnavailableRepository(
- UnavailableRepositoryParams::named_create()
- (k::name(), RepositoryName("unavailable"))
- (k::sync(), "")
- (k::sync_options(), "")
- (k::location(), FSEntry::cwd() / "unavailable_repository_TEST_dir" / "repo2")
- (k::environment(), &env)
- ));
+ make_named_values<UnavailableRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::location>(FSEntry::cwd() / "unavailable_repository_TEST_dir" / "repo2"),
+ value_for<n::name>(RepositoryName("unavailable")),
+ value_for<n::sync>(""),
+ value_for<n::sync_options>("")
+ )));
env.package_database()->add_repository(1, repo);
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "unavailable");
diff --git a/paludis/repositories/unavailable/unavailable_repository_file-fwd.hh b/paludis/repositories/unavailable/unavailable_repository_file-fwd.hh
index b779c3245..8855064f1 100644
--- a/paludis/repositories/unavailable/unavailable_repository_file-fwd.hh
+++ b/paludis/repositories/unavailable/unavailable_repository_file-fwd.hh
@@ -21,25 +21,33 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNAVAILABLE_UNAVAILABLE_REPOSITORY_FILE_FWD_HH 1
#include <paludis/util/attributes.hh>
-#include <paludis/util/keys.hh>
-#include <paludis/util/kc-fwd.hh>
-#include <paludis/name-fwd.hh>
-#include <paludis/version_spec-fwd.hh>
+#include <paludis/util/named_value.hh>
+#include <paludis/name.hh>
+#include <paludis/version_spec.hh>
#include <paludis/metadata_key-fwd.hh>
#include <tr1/memory>
namespace paludis
{
+ namespace n
+ {
+ struct description;
+ struct name;
+ struct slot;
+ struct version;
+ }
+
namespace unavailable_repository
{
class UnavailableRepositoryFile;
- typedef kc::KeyedClass<
- kc::Field<k::name, QualifiedPackageName>,
- kc::Field<k::version, VersionSpec>,
- kc::Field<k::slot, SlotName>,
- kc::Field<k::description, std::tr1::shared_ptr<const MetadataValueKey<std::string> > >
- > UnavailableRepositoryFileEntry;
+ struct UnavailableRepositoryFileEntry
+ {
+ NamedValue<n::description, std::tr1::shared_ptr<const MetadataValueKey<std::string> > > description;
+ NamedValue<n::name, QualifiedPackageName> name;
+ NamedValue<n::slot, SlotName> slot;
+ NamedValue<n::version, VersionSpec> version;
+ };
}
}
diff --git a/paludis/repositories/unavailable/unavailable_repository_file.cc b/paludis/repositories/unavailable/unavailable_repository_file.cc
index d4f754820..dc406e05e 100644
--- a/paludis/repositories/unavailable/unavailable_repository_file.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_file.cc
@@ -21,10 +21,10 @@
#include <paludis/repositories/unavailable/unavailable_repository.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/kc.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
#include <paludis/util/simple_parser.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/literal_metadata_key.hh>
@@ -188,12 +188,12 @@ UnavailableRepositoryFile::_load(const FSEntry & f)
token));
for (std::list<VersionSpec>::const_iterator v(versions.begin()), v_end(versions.end()) ;
v != v_end ; ++v)
- _imp->entries.push_back(UnavailableRepositoryFileEntry::named_create()
- (k::name(), category + package)
- (k::version(), *v)
- (k::slot(), slot)
- (k::description(), desc)
- );
+ _imp->entries.push_back(make_named_values<UnavailableRepositoryFileEntry>(
+ value_for<n::description>(desc),
+ value_for<n::name>(category + package),
+ value_for<n::slot>(slot),
+ value_for<n::version>(*v)
+ ));
}
else
throw UnavailableRepositoryConfigurationError(
diff --git a/paludis/repositories/unavailable/unavailable_repository_store.cc b/paludis/repositories/unavailable/unavailable_repository_store.cc
index f47cc578b..c5ee262ba 100644
--- a/paludis/repositories/unavailable/unavailable_repository_store.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_store.cc
@@ -28,10 +28,10 @@
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/hashes.hh>
-#include <paludis/util/kc.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/literal_metadata_key.hh>
@@ -141,40 +141,40 @@ UnavailableRepositoryStore::_populate_one(const Environment * const env, const F
for (UnavailableRepositoryFile::ConstIterator i(file.begin()), i_end(file.end()) ;
i != i_end ; ++i)
{
- if (old_name.category != (*i)[k::name()].category)
+ if (old_name.category != (*i).name().category)
{
- _imp->categories->insert((*i)[k::name()].category);
- PackageNames::iterator p(_imp->package_names.find((*i)[k::name()].category));
+ _imp->categories->insert((*i).name().category);
+ PackageNames::iterator p(_imp->package_names.find((*i).name().category));
if (_imp->package_names.end() == p)
- p = _imp->package_names.insert(std::make_pair((*i)[k::name()].category,
+ p = _imp->package_names.insert(std::make_pair((*i).name().category,
make_shared_ptr(new QualifiedPackageNameSet))).first;
pkgs = p->second;
}
- if (old_name != (*i)[k::name()])
+ if (old_name != (*i).name())
{
- pkgs->insert((*i)[k::name()]);
- IDs::iterator p(_imp->ids.find((*i)[k::name()]));
+ pkgs->insert((*i).name());
+ IDs::iterator p(_imp->ids.find((*i).name()));
if (_imp->ids.end() == p)
- p = _imp->ids.insert(std::make_pair((*i)[k::name()],
+ p = _imp->ids.insert(std::make_pair((*i).name(),
make_shared_ptr(new PackageIDSequence))).first;
ids = p->second;
}
- ids->push_back(make_shared_ptr(new UnavailableID(UnavailableIDParams::named_create()
- (k::repository(), _imp->repo)
- (k::name(), (*i)[k::name()])
- (k::version(), (*i)[k::version()])
- (k::slot(), (*i)[k::slot()])
- (k::description(), (*i)[k::description()])
- (k::from_repositories(), from_repositories)
- (k::repository_homepage(), repository_homepage)
- (k::repository_description(), repository_description)
- (k::mask(), mask)
- )));
-
- old_name = (*i)[k::name()];
+ ids->push_back(make_shared_ptr(new UnavailableID(make_named_values<UnavailableIDParams>(
+ value_for<n::description>((*i).description()),
+ value_for<n::from_repositories>(from_repositories),
+ value_for<n::mask>(mask),
+ value_for<n::name>((*i).name()),
+ value_for<n::repository>(_imp->repo),
+ value_for<n::repository_description>(repository_description),
+ value_for<n::repository_homepage>(repository_homepage),
+ value_for<n::slot>((*i).slot()),
+ value_for<n::version>((*i).version())
+ ))));
+
+ old_name = (*i).name();
}
}
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index b4f7bd7eb..536fe7c1c 100644
--- a/paludis/repositories/unpackaged/installed_id.cc
+++ b/paludis/repositories/unpackaged/installed_id.cc
@@ -33,6 +33,7 @@
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/package_database.hh>
@@ -748,14 +749,15 @@ InstalledUnpackagedID::uninstall(const bool replace) const
FSEntry ver_dir(fs_location_key()->value());
NDBAMUnmerger unmerger(
- NDBAMUnmergerOptions::named_create()
- (k::environment(), _imp->env)
- (k::root(), _imp->root)
- (k::contents_file(), ver_dir / "contents")
- (k::config_protect(), getenv_with_default("CONFIG_PROTECT", ""))
- (k::config_protect_mask(), getenv_with_default("CONFIG_PROTECT_MASK", ""))
- (k::ndbam(), _imp->ndbam)
- (k::package_id(), shared_from_this()));
+ make_named_values<NDBAMUnmergerOptions>(
+ value_for<n::config_protect>(getenv_with_default("CONFIG_PROTECT", "")),
+ value_for<n::config_protect_mask>(getenv_with_default("CONFIG_PROTECT_MASK", "")),
+ value_for<n::contents_file>(ver_dir / "contents"),
+ value_for<n::environment>(_imp->env),
+ value_for<n::ndbam>(_imp->ndbam),
+ value_for<n::package_id>(shared_from_this()),
+ value_for<n::root>(_imp->root)
+ ));
unmerger.unmerge();
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index acd6f335c..9e9175a47 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -30,8 +30,8 @@
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/system.hh>
#include <paludis/util/cookie.hh>
-#include <paludis/util/kc.hh>
#include <paludis/util/visitor_cast.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/stringify_formatter.hh>
#include <paludis/action.hh>
#include <paludis/environment.hh>
@@ -84,20 +84,21 @@ namespace paludis
InstalledUnpackagedRepository::InstalledUnpackagedRepository(
const RepositoryName & n, const InstalledUnpackagedRepositoryParams & p) :
PrivateImplementationPattern<InstalledUnpackagedRepository>(new Implementation<InstalledUnpackagedRepository>(p)),
- Repository(n, RepositoryCapabilities::named_create()
- (k::sets_interface(), this)
- (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
- (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
- (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
- (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
- (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
- (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
- (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
- (k::destination_interface(), this)
- (k::e_interface(), static_cast<RepositoryEInterface *>(0))
- (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
- (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
- (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
+ Repository(n, make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(this),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
+ value_for<n::hook_interface>(static_cast<RepositoryHookInterface *>(0)),
+ value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
+ value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(this),
+ value_for<n::syncable_interface>(static_cast<RepositorySyncableInterface *>(0)),
+ value_for<n::use_interface>(static_cast<RepositoryUseInterface *>(0)),
+ value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ )),
_imp(PrivateImplementationPattern<InstalledUnpackagedRepository>::_imp)
{
_add_metadata_keys();
@@ -125,11 +126,11 @@ InstalledUnpackagedRepository::package_ids(const QualifiedPackageName & q) const
for (IndirectIterator<NDBAMEntrySequence::ConstIterator> e(entries->begin()), e_end(entries->end()) ;
e != e_end ; ++e)
{
- Lock l(*(*e)[k::mutex()]);
- if (! (*e)[k::package_id()])
- (*e)[k::package_id()].reset(new InstalledUnpackagedID(_imp->params.environment, (*e)[k::name()], (*e)[k::version()],
- (*e)[k::slot()], name(), (*e)[k::fs_location()], (*e)[k::magic()], installed_root_key()->value(), &_imp->ndbam));
- result->push_back((*e)[k::package_id()]);
+ Lock l(*(*e).mutex());
+ if (! (*e).package_id())
+ (*e).package_id().reset(new InstalledUnpackagedID(_imp->params.environment, (*e).name(), (*e).version(),
+ (*e).slot(), name(), (*e).fs_location(), (*e).magic(), installed_root_key()->value(), &_imp->ndbam));
+ result->push_back((*e).package_id());
}
return result;
@@ -243,16 +244,16 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
{
using namespace std::tr1::placeholders;
- Context context("When merging '" + stringify(*m[k::package_id()]) + "' at '" + stringify(m[k::image_dir()])
+ Context context("When merging '" + stringify(*m.package_id()) + "' at '" + stringify(m.image_dir())
+ "' to InstalledUnpackagedRepository repository '" + stringify(name()) + "':");
- if (! is_suitable_destination_for(*m[k::package_id()]))
- throw InstallActionError("Not a suitable destination for '" + stringify(*m[k::package_id()]) + "'");
+ if (! is_suitable_destination_for(*m.package_id()))
+ throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
FSEntry install_under("/");
{
- Repository::MetadataConstIterator k(m[k::package_id()]->repository()->find_metadata("install_under"));
- if (k == m[k::package_id()]->repository()->end_metadata())
+ Repository::MetadataConstIterator k(m.package_id()->repository()->find_metadata("install_under"));
+ if (k == m.package_id()->repository()->end_metadata())
throw InstallActionError("Could not fetch install_under key from owning repository");
const MetadataValueKey<FSEntry> * kk(visitor_cast<const MetadataValueKey<FSEntry> >(**k));
if (! kk)
@@ -262,8 +263,8 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
int rewrite_ids_over_to_root(-1);
{
- Repository::MetadataConstIterator k(m[k::package_id()]->repository()->find_metadata("rewrite_ids_over_to_root"));
- if (k == m[k::package_id()]->repository()->end_metadata())
+ Repository::MetadataConstIterator k(m.package_id()->repository()->find_metadata("rewrite_ids_over_to_root"));
+ if (k == m.package_id()->repository()->end_metadata())
throw InstallActionError("Could not fetch rewrite_ids_over_to_root key from owning repository");
const MetadataValueKey<long> * kk(visitor_cast<const MetadataValueKey<long> >(**k));
if (! kk)
@@ -273,12 +274,12 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
std::tr1::shared_ptr<const PackageID> if_overwritten_id, if_same_name_id;
{
- std::tr1::shared_ptr<const PackageIDSequence> ids(package_ids(m[k::package_id()]->name()));
+ std::tr1::shared_ptr<const PackageIDSequence> ids(package_ids(m.package_id()->name()));
for (PackageIDSequence::ConstIterator v(ids->begin()), v_end(ids->end()) ;
v != v_end ; ++v)
{
if_same_name_id = *v;
- if ((*v)->version() == m[k::package_id()]->version() && (*v)->slot() == m[k::package_id()]->slot())
+ if ((*v)->version() == m.package_id()->version() && (*v)->slot() == m.package_id()->slot())
{
if_overwritten_id = *v;
break;
@@ -291,7 +292,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
uid_dir = if_same_name_id->fs_location_key()->value().dirname();
else
{
- std::string uid(stringify(m[k::package_id()]->name().category) + "---" + stringify(m[k::package_id()]->name().package));
+ std::string uid(stringify(m.package_id()->name().category) + "---" + stringify(m.package_id()->name().package));
uid_dir /= "data";
uid_dir.mkdir();
uid_dir /= uid;
@@ -299,7 +300,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
}
FSEntry target_ver_dir(uid_dir);
- target_ver_dir /= (stringify(m[k::package_id()]->version()) + ":" + stringify(m[k::package_id()]->slot()) + ":" + cookie());
+ target_ver_dir /= (stringify(m.package_id()->version()) + ":" + stringify(m.package_id()->slot()) + ":" + cookie());
if (target_ver_dir.exists())
throw InstallActionError("Temporary merge directory '" + stringify(target_ver_dir) + "' already exists, probably "
@@ -308,50 +309,51 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
{
std::ofstream source_repository_file(stringify(target_ver_dir / "source_repository").c_str());
- source_repository_file << m[k::package_id()]->repository()->name() << std::endl;
+ source_repository_file << m.package_id()->repository()->name() << std::endl;
if (! source_repository_file)
throw InstallActionError("Could not write to '" + stringify(target_ver_dir / "source_repository") + "'");
}
- if (m[k::package_id()]->short_description_key())
+ if (m.package_id()->short_description_key())
{
std::ofstream description_file(stringify(target_ver_dir / "description").c_str());
- description_file << m[k::package_id()]->short_description_key()->value() << std::endl;
+ description_file << m.package_id()->short_description_key()->value() << std::endl;
if (! description_file)
throw InstallActionError("Could not write to '" + stringify(target_ver_dir / "description") + "'");
}
- if (m[k::package_id()]->build_dependencies_key())
+ if (m.package_id()->build_dependencies_key())
{
std::ofstream build_dependencies_file(stringify(target_ver_dir / "build_dependencies").c_str());
StringifyFormatter f;
- build_dependencies_file << m[k::package_id()]->build_dependencies_key()->pretty_print_flat(f) << std::endl;
+ build_dependencies_file << m.package_id()->build_dependencies_key()->pretty_print_flat(f) << std::endl;
if (! build_dependencies_file)
throw InstallActionError("Could not write to '" + stringify(target_ver_dir / "build_dependencies") + "'");
}
- if (m[k::package_id()]->run_dependencies_key())
+ if (m.package_id()->run_dependencies_key())
{
std::ofstream run_dependencies_file(stringify(target_ver_dir / "run_dependencies").c_str());
StringifyFormatter f;
- run_dependencies_file << m[k::package_id()]->run_dependencies_key()->pretty_print_flat(f) << std::endl;
+ run_dependencies_file << m.package_id()->run_dependencies_key()->pretty_print_flat(f) << std::endl;
if (! run_dependencies_file)
throw InstallActionError("Could not write to '" + stringify(target_ver_dir / "run_dependencies") + "'");
}
NDBAMMerger merger(
- NDBAMMergerParams::named_create()
- (k::environment(), _imp->params.environment)
- (k::image(), m[k::image_dir()])
- (k::install_under(), install_under)
- (k::root(), installed_root_key()->value())
- (k::contents_file(), target_ver_dir / "contents")
- (k::config_protect(), getenv_with_default("CONFIG_PROTECT", ""))
- (k::config_protect_mask(), getenv_with_default("CONFIG_PROTECT_MASK", ""))
- (k::package_id(), m[k::package_id()])
- (k::get_new_ids_or_minus_one(), std::tr1::bind(&get_new_ids_or_minus_one, _imp->params.environment,
- rewrite_ids_over_to_root, _1))
- (k::options(), MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs));
+ make_named_values<NDBAMMergerParams>(
+ value_for<n::config_protect>(getenv_with_default("CONFIG_PROTECT", "")),
+ value_for<n::config_protect_mask>(getenv_with_default("CONFIG_PROTECT_MASK", "")),
+ value_for<n::contents_file>(target_ver_dir / "contents"),
+ value_for<n::environment>(_imp->params.environment),
+ value_for<n::get_new_ids_or_minus_one>(std::tr1::bind(&get_new_ids_or_minus_one,
+ _imp->params.environment, rewrite_ids_over_to_root, _1)),
+ value_for<n::image>(m.image_dir()),
+ value_for<n::install_under>(install_under),
+ value_for<n::options>(MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs),
+ value_for<n::package_id>(m.package_id()),
+ value_for<n::root>(installed_root_key()->value())
+ ));
if (! merger.check())
{
@@ -363,7 +365,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
merger.merge();
- _imp->ndbam.index(m[k::package_id()]->name(), uid_dir.basename());
+ _imp->ndbam.index(m.package_id()->name(), uid_dir.basename());
if (if_overwritten_id)
{
diff --git a/paludis/repositories/unpackaged/installed_repository_TEST.cc b/paludis/repositories/unpackaged/installed_repository_TEST.cc
index bd017326e..d29355c03 100644
--- a/paludis/repositories/unpackaged/installed_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/installed_repository_TEST.cc
@@ -33,7 +33,7 @@
#include <paludis/util/join.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/options.hh>
-#include <paludis/util/kc.hh>
+#include <paludis/util/make_named_values.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <algorithm>
@@ -363,18 +363,18 @@ namespace test_cases
std::tr1::shared_ptr<Repository> source_repo(new UnpackagedRepository(
RepositoryName("unpackaged"),
- unpackaged_repositories::UnpackagedRepositoryParams::named_create()
- (k::environment(), &env)
- (k::name(), QualifiedPackageName("cat/pkg4a"))
- (k::version(), VersionSpec("1.0"))
- (k::slot(), SlotName("foo"))
- (k::location(), FSEntry("installed_repository_TEST_dir/src4a"))
- (k::install_under(), FSEntry("/"))
- (k::build_dependencies(), "")
- (k::run_dependencies(), "")
- (k::rewrite_ids_over_to_root(), -1)
- (k::description(), "")
- ));
+ make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
+ value_for<n::build_dependencies>(""),
+ value_for<n::description>(""),
+ value_for<n::environment>(&env),
+ value_for<n::install_under>(FSEntry("/")),
+ value_for<n::location>(FSEntry("installed_repository_TEST_dir/src4a")),
+ value_for<n::name>(QualifiedPackageName("cat/pkg4a")),
+ value_for<n::rewrite_ids_over_to_root>(-1),
+ value_for<n::run_dependencies>(""),
+ value_for<n::slot>(SlotName("foo")),
+ value_for<n::version>(VersionSpec("1.0"))
+ )));
env.package_database()->add_repository(1, source_repo);
{
@@ -385,10 +385,11 @@ namespace test_cases
TEST_CHECK(! FSEntry("installed_repository_TEST_dir/root4/dir").exists());
- InstallAction action(InstallActionOptions::named_create()
- (k::destination(), repo)
- (k::checks(), iaco_default)
- (k::debug_build(), iado_none));
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::checks>(iaco_default),
+ value_for<n::debug_build>(iado_none),
+ value_for<n::destination>(repo)
+ ));
(*env[selection::RequireExactlyOne(generator::InRepository(RepositoryName("unpackaged")))]->begin())->perform_action(action);
TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir").is_directory());
@@ -418,18 +419,18 @@ namespace test_cases
std::tr1::shared_ptr<Repository> source_repo(new UnpackagedRepository(
RepositoryName("unpackaged"),
- unpackaged_repositories::UnpackagedRepositoryParams::named_create()
- (k::environment(), &env)
- (k::name(), QualifiedPackageName("cat/pkg4b"))
- (k::version(), VersionSpec("1.0"))
- (k::slot(), SlotName("foo"))
- (k::location(), FSEntry("installed_repository_TEST_dir/src4b1"))
- (k::install_under(), FSEntry("/"))
- (k::build_dependencies(), "")
- (k::run_dependencies(), "")
- (k::rewrite_ids_over_to_root(), -1)
- (k::description(), "")
- ));
+ make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
+ value_for<n::build_dependencies>(""),
+ value_for<n::description>(""),
+ value_for<n::environment>(&env),
+ value_for<n::install_under>(FSEntry("/")),
+ value_for<n::location>(FSEntry("installed_repository_TEST_dir/src4b1")),
+ value_for<n::name>(QualifiedPackageName("cat/pkg4b")),
+ value_for<n::rewrite_ids_over_to_root>(-1),
+ value_for<n::run_dependencies>(""),
+ value_for<n::slot>(SlotName("foo")),
+ value_for<n::version>(VersionSpec("1.0"))
+ )));
env.package_database()->add_repository(1, source_repo);
{
@@ -439,10 +440,11 @@ namespace test_cases
"cat/pkg4a-1.0:foo::installed-unpackaged");
}
- InstallAction action(InstallActionOptions::named_create()
- (k::destination(), repo)
- (k::checks(), iaco_default)
- (k::debug_build(), iado_none));
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::checks>(iaco_default),
+ value_for<n::debug_build>(iado_none),
+ value_for<n::destination>(repo)
+ ));
(*env[selection::RequireExactlyOne(generator::InRepository(RepositoryName("unpackaged")))]->begin())->perform_action(action);
TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir").is_directory());
@@ -475,18 +477,18 @@ namespace test_cases
std::tr1::shared_ptr<Repository> source_repo(new UnpackagedRepository(
RepositoryName("unpackaged"),
- unpackaged_repositories::UnpackagedRepositoryParams::named_create()
- (k::environment(), &env)
- (k::name(), QualifiedPackageName("cat/pkg4b"))
- (k::version(), VersionSpec("1.0"))
- (k::slot(), SlotName("foo"))
- (k::location(), FSEntry("installed_repository_TEST_dir/src4b2"))
- (k::install_under(), FSEntry("/"))
- (k::build_dependencies(), "")
- (k::rewrite_ids_over_to_root(), -1)
- (k::run_dependencies(), "")
- (k::description(), "")
- ));
+ make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
+ value_for<n::build_dependencies>(""),
+ value_for<n::description>(""),
+ value_for<n::environment>(&env),
+ value_for<n::install_under>(FSEntry("/")),
+ value_for<n::location>(FSEntry("installed_repository_TEST_dir/src4b2")),
+ value_for<n::name>(QualifiedPackageName("cat/pkg4b")),
+ value_for<n::rewrite_ids_over_to_root>(-1),
+ value_for<n::run_dependencies>(""),
+ value_for<n::slot>(SlotName("foo")),
+ value_for<n::version>(VersionSpec("1.0"))
+ )));
env.package_database()->add_repository(1, source_repo);
{
@@ -496,10 +498,11 @@ namespace test_cases
"cat/pkg4a-1.0:foo::installed-unpackaged cat/pkg4b-1.0:foo::installed-unpackaged");
}
- InstallAction action(InstallActionOptions::named_create()
- (k::destination(), repo)
- (k::checks(), iaco_default)
- (k::debug_build(), iado_none));
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::checks>(iaco_default),
+ value_for<n::debug_build>(iado_none),
+ value_for<n::destination>(repo)
+ ));
(*env[selection::RequireExactlyOne(generator::InRepository(RepositoryName("unpackaged")))]->begin())->perform_action(action);
TEST_CHECK(FSEntry("installed_repository_TEST_dir/root4/dir").is_directory());
diff --git a/paludis/repositories/unpackaged/registration.cc b/paludis/repositories/unpackaged/registration.cc
index 115d39146..74fb46b82 100644
--- a/paludis/repositories/unpackaged/registration.cc
+++ b/paludis/repositories/unpackaged/registration.cc
@@ -22,6 +22,7 @@
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/destringify.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/repositories/unpackaged/installed_repository.hh>
#include <paludis/repositories/unpackaged/unpackaged_repository.hh>
#include <paludis/repositories/unpackaged/exceptions.hh>
@@ -69,17 +70,18 @@ namespace
}
return make_shared_ptr(new UnpackagedRepository(RepositoryName("unpackaged"),
- unpackaged_repositories::UnpackagedRepositoryParams::named_create()
- (k::environment(), env)
- (k::location(), location)
- (k::install_under(), install_under)
- (k::name(), QualifiedPackageName(name))
- (k::version(), VersionSpec(version))
- (k::slot(), SlotName(slot))
- (k::build_dependencies(), build_dependencies)
- (k::run_dependencies(), run_dependencies)
- (k::rewrite_ids_over_to_root(), rewrite_ids_over_to_root)
- (k::description(), description)));
+ make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
+ value_for<n::build_dependencies>(build_dependencies),
+ value_for<n::description>(description),
+ value_for<n::environment>(env),
+ value_for<n::install_under>(install_under),
+ value_for<n::location>(location),
+ value_for<n::name>(QualifiedPackageName(name)),
+ value_for<n::rewrite_ids_over_to_root>(rewrite_ids_over_to_root),
+ value_for<n::run_dependencies>(run_dependencies),
+ value_for<n::slot>(SlotName(slot)),
+ value_for<n::version>(VersionSpec(version))
+ )));
}
std::tr1::shared_ptr<Repository>
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index fc132c860..d51bde3e9 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -28,9 +28,9 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/visitor_cast.hh>
#include <paludis/util/make_shared_ptr.hh>
-#include <paludis/util/kc.hh>
#include <paludis/util/log.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/package_database.hh>
@@ -290,14 +290,14 @@ UnpackagedID::perform_action(Action & action) const
if (! install_action)
throw UnsupportedActionError(*this, action);
- if (! (*install_action->options[k::destination()])[k::destination_interface()])
+ if (! (*install_action->options.destination()).destination_interface())
throw InstallActionError("Can't install '" + stringify(*this)
- + "' to destination '" + stringify(install_action->options[k::destination()]->name())
+ + "' to destination '" + stringify(install_action->options.destination()->name())
+ "' because destination does not provide destination_interface");
std::string libdir("lib");
- FSEntry root(install_action->options[k::destination()]->installed_root_key() ?
- stringify(install_action->options[k::destination()]->installed_root_key()->value()) : "/");
+ FSEntry root(install_action->options.destination()->installed_root_key() ?
+ stringify(install_action->options.destination()->installed_root_key()->value()) : "/");
if ((root / "usr" / "lib").is_symbolic_link())
{
libdir = (root / "usr" / "lib").readlink();
@@ -307,22 +307,22 @@ UnpackagedID::perform_action(Action & action) const
Log::get_instance()->message("unpackaged.libdir", ll_debug, lc_context) << "Using '" << libdir << "' for libdir";
- UnpackagedStripper stripper(UnpackagedStripperOptions::named_create()
- (k::image_dir(), fs_location_key()->value())
- (k::debug_dir(), fs_location_key()->value() / "usr" / libdir / "debug")
- (k::debug_build(), install_action->options[k::debug_build()])
- (k::package_id(), shared_from_this())
- );
+ UnpackagedStripper stripper(make_named_values<UnpackagedStripperOptions>(
+ value_for<n::debug_build>(install_action->options.debug_build()),
+ value_for<n::debug_dir>(fs_location_key()->value() / "usr" / libdir / "debug"),
+ value_for<n::image_dir>(fs_location_key()->value()),
+ value_for<n::package_id>(shared_from_this())
+ ));
stripper.strip();
- (*install_action->options[k::destination()])[k::destination_interface()]->merge(
- MergeParams::named_create()
- (k::package_id(), shared_from_this())
- (k::image_dir(), fs_location_key()->value())
- (k::environment_file(), FSEntry("/dev/null"))
- (k::options(), MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs)
- );
+ (*install_action->options.destination()).destination_interface()->merge(
+ make_named_values<MergeParams>(
+ value_for<n::environment_file>(FSEntry("/dev/null")),
+ value_for<n::image_dir>(fs_location_key()->value()),
+ value_for<n::options>(MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs),
+ value_for<n::package_id>(shared_from_this())
+ ));
}
void
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc
index 410aeb935..73fa542ac 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository.cc
@@ -24,6 +24,7 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/make_named_values.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
@@ -56,29 +57,29 @@ namespace paludis
Implementation(const RepositoryName & n,
const UnpackagedRepositoryParams & p) :
params(p),
- id(new UnpackagedID(params[k::environment()], params[k::name()], params[k::version()], params[k::slot()], n, params[k::location()],
- params[k::build_dependencies()], params[k::run_dependencies()], params[k::description()])),
+ id(new UnpackagedID(params.environment(), params.name(), params.version(), params.slot(), n, params.location(),
+ params.build_dependencies(), params.run_dependencies(), params.description())),
ids(new PackageIDSequence),
package_names(new QualifiedPackageNameSet),
category_names(new CategoryNamePartSet),
location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
- mkt_significant, params[k::location()])),
+ mkt_significant, params.location())),
install_under_key(new LiteralMetadataValueKey<FSEntry> ("install_under", "install_under",
- mkt_significant, params[k::install_under()])),
+ mkt_significant, params.install_under())),
rewrite_ids_over_to_root_key(new LiteralMetadataValueKey<long> ("rewrite_ids_over_to_root", "rewrite_ids_over_to_root",
- mkt_normal, params[k::rewrite_ids_over_to_root()])),
+ mkt_normal, params.rewrite_ids_over_to_root())),
name_key(new LiteralMetadataValueKey<std::string> ("name", "name",
- mkt_normal, stringify(params[k::name()]))),
+ mkt_normal, stringify(params.name()))),
slot_key(new LiteralMetadataValueKey<std::string> ("slot", "slot",
- mkt_normal, stringify(params[k::slot()]))),
+ mkt_normal, stringify(params.slot()))),
format_key(new LiteralMetadataValueKey<std::string> (
"format", "format", mkt_significant, "unpackaged")),
build_dependencies_key(new LiteralMetadataValueKey<std::string> (
- "build_dependencies", "build_dependencies", mkt_normal, params[k::build_dependencies()])),
+ "build_dependencies", "build_dependencies", mkt_normal, params.build_dependencies())),
run_dependencies_key(new LiteralMetadataValueKey<std::string> (
- "run_dependencies", "run_dependencies", mkt_normal, params[k::run_dependencies()])),
+ "run_dependencies", "run_dependencies", mkt_normal, params.run_dependencies())),
description_key(new LiteralMetadataValueKey<std::string> (
- "description", "description", mkt_normal, params[k::description()]))
+ "description", "description", mkt_normal, params.description()))
{
ids->push_back(id);
package_names->insert(id->name());
@@ -90,20 +91,21 @@ namespace paludis
UnpackagedRepository::UnpackagedRepository(const RepositoryName & n,
const UnpackagedRepositoryParams & params) :
PrivateImplementationPattern<UnpackagedRepository>(new Implementation<UnpackagedRepository>(n, params)),
- Repository(n, RepositoryCapabilities::named_create()
- (k::sets_interface(), static_cast<RepositorySetsInterface *>(0))
- (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
- (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
- (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
- (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
- (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
- (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
- (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
- (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
- (k::e_interface(), static_cast<RepositoryEInterface *>(0))
- (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
- (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
- (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
+ Repository(n, make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
+ value_for<n::hook_interface>(static_cast<RepositoryHookInterface *>(0)),
+ value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
+ value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(static_cast<RepositorySetsInterface *>(0)),
+ value_for<n::syncable_interface>(static_cast<RepositorySyncableInterface *>(0)),
+ value_for<n::use_interface>(static_cast<RepositoryUseInterface *>(0)),
+ value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ )),
_imp(PrivateImplementationPattern<UnpackagedRepository>::_imp)
{
_add_metadata_keys();
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.hh b/paludis/repositories/unpackaged/unpackaged_repository.hh
index 2f72592b6..7020f311c 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.hh
+++ b/paludis/repositories/unpackaged/unpackaged_repository.hh
@@ -23,25 +23,38 @@
#include <paludis/repository.hh>
#include <paludis/util/map.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/util/kc-fwd.hh>
-#include <paludis/util/keys.hh>
namespace paludis
{
+ namespace n
+ {
+ struct build_dependencies;
+ struct description;
+ struct environment;
+ struct install_under;
+ struct location;
+ struct name;
+ struct rewrite_ids_over_to_root;
+ struct run_dependencies;
+ struct slot;
+ struct version;
+ }
+
namespace unpackaged_repositories
{
- typedef kc::KeyedClass<
- kc::Field<k::environment, Environment *>,
- kc::Field<k::location, FSEntry>,
- kc::Field<k::install_under, FSEntry>,
- kc::Field<k::name, QualifiedPackageName>,
- kc::Field<k::version, VersionSpec>,
- kc::Field<k::slot, SlotName>,
- kc::Field<k::build_dependencies, std::string>,
- kc::Field<k::run_dependencies, std::string>,
- kc::Field<k::description, std::string>,
- kc::Field<k::rewrite_ids_over_to_root, int>
- > UnpackagedRepositoryParams;
+ struct UnpackagedRepositoryParams
+ {
+ NamedValue<n::build_dependencies, std::string> build_dependencies;
+ NamedValue<n::description, std::string> description;
+ NamedValue<n::environment, Environment *> environment;
+ NamedValue<n::install_under, FSEntry> install_under;
+ NamedValue<n::location, FSEntry> location;
+ NamedValue<n::name, QualifiedPackageName> name;
+ NamedValue<n::rewrite_ids_over_to_root, int> rewrite_ids_over_to_root;
+ NamedValue<n::run_dependencies, std::string> run_dependencies;
+ NamedValue<n::slot, SlotName> slot;
+ NamedValue<n::version, VersionSpec> version;
+ };
}
class PALUDIS_VISIBLE UnpackagedRepository :
diff --git a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
index 90bf59e20..5cbddbdd8 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
@@ -33,7 +33,7 @@
#include <paludis/util/join.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/kc.hh>
+#include <paludis/util/make_named_values.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -51,18 +51,18 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<Repository> repo(new UnpackagedRepository(
RepositoryName("unpackaged"),
- unpackaged_repositories::UnpackagedRepositoryParams::named_create()
- (k::environment(), &env)
- (k::name(), QualifiedPackageName("cat/pkg"))
- (k::version(), VersionSpec("1.0"))
- (k::slot(), SlotName("foo"))
- (k::location(), FSEntry("unpackaged_repository_TEST_dir/pkg"))
- (k::install_under(), FSEntry("/"))
- (k::build_dependencies(), "")
- (k::run_dependencies(), "")
- (k::description(), "")
- (k::rewrite_ids_over_to_root(), -1)
- ));
+ make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
+ value_for<n::build_dependencies>(""),
+ value_for<n::description>(""),
+ value_for<n::environment>(&env),
+ value_for<n::install_under>(FSEntry("/")),
+ value_for<n::location>(FSEntry("unpackaged_repository_TEST_dir/pkg")),
+ value_for<n::name>(QualifiedPackageName("cat/pkg")),
+ value_for<n::rewrite_ids_over_to_root>(-1),
+ value_for<n::run_dependencies>(""),
+ value_for<n::slot>(SlotName("foo")),
+ value_for<n::version>(VersionSpec("1.0"))
+ )));
env.package_database()->add_repository(1, repo);
const std::tr1::shared_ptr<const PackageIDSequence> ids(
@@ -81,18 +81,18 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<Repository> repo(new UnpackagedRepository(
RepositoryName("unpackaged"),
- unpackaged_repositories::UnpackagedRepositoryParams::named_create()
- (k::environment(), &env)
- (k::name(), QualifiedPackageName("cat/pkg"))
- (k::version(), VersionSpec("1.0"))
- (k::slot(), SlotName("foo"))
- (k::location(), FSEntry("unpackaged_repository_TEST_dir/pkg"))
- (k::install_under(), FSEntry("/"))
- (k::build_dependencies(), "")
- (k::run_dependencies(), "")
- (k::rewrite_ids_over_to_root(), -1)
- (k::description(), "")
- ));
+ make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
+ value_for<n::build_dependencies>(""),
+ value_for<n::description>(""),
+ value_for<n::environment>(&env),
+ value_for<n::install_under>(FSEntry("/")),
+ value_for<n::location>(FSEntry("unpackaged_repository_TEST_dir/pkg")),
+ value_for<n::name>(QualifiedPackageName("cat/pkg")),
+ value_for<n::rewrite_ids_over_to_root>(-1),
+ value_for<n::run_dependencies>(""),
+ value_for<n::slot>(SlotName("foo")),
+ value_for<n::version>(VersionSpec("1.0"))
+ )));
env.package_database()->add_repository(1, repo);
const std::tr1::shared_ptr<const PackageID> id(
@@ -116,18 +116,18 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<Repository> repo(new UnpackagedRepository(
RepositoryName("unpackaged"),
- unpackaged_repositories::UnpackagedRepositoryParams::named_create()
- (k::environment(), &env)
- (k::name(), QualifiedPackageName("cat/pkg"))
- (k::version(), VersionSpec("1.0"))
- (k::slot(), SlotName("foo"))
- (k::location(), FSEntry("unpackaged_repository_TEST_dir/pkg"))
- (k::install_under(), FSEntry("/"))
- (k::build_dependencies(), "")
- (k::run_dependencies(), "")
- (k::rewrite_ids_over_to_root(), -1)
- (k::description(), "")
- ));
+ make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
+ value_for<n::build_dependencies>(""),
+ value_for<n::description>(""),
+ value_for<n::environment>(&env),
+ value_for<n::install_under>(FSEntry("/")),
+ value_for<n::location>(FSEntry("unpackaged_repository_TEST_dir/pkg")),
+ value_for<n::name>(QualifiedPackageName("cat/pkg")),
+ value_for<n::rewrite_ids_over_to_root>(-1),
+ value_for<n::run_dependencies>(""),
+ value_for<n::slot>(SlotName("foo")),
+ value_for<n::version>(VersionSpec("1.0"))
+ )));
env.package_database()->add_repository(1, repo);
const std::tr1::shared_ptr<const PackageID> id(
@@ -146,18 +146,18 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<Repository> repo(new UnpackagedRepository(
RepositoryName("unpackaged"),
- unpackaged_repositories::UnpackagedRepositoryParams::named_create()
- (k::environment(), &env)
- (k::name(), QualifiedPackageName("cat/pkg"))
- (k::version(), VersionSpec("1.0"))
- (k::slot(), SlotName("foo"))
- (k::location(), FSEntry("unpackaged_repository_TEST_dir/pkg"))
- (k::install_under(), FSEntry("/"))
- (k::build_dependencies(), "")
- (k::run_dependencies(), "")
- (k::rewrite_ids_over_to_root(), -1)
- (k::description(), "")
- ));
+ make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
+ value_for<n::build_dependencies>(""),
+ value_for<n::description>(""),
+ value_for<n::environment>(&env),
+ value_for<n::install_under>(FSEntry("/")),
+ value_for<n::location>(FSEntry("unpackaged_repository_TEST_dir/pkg")),
+ value_for<n::name>(QualifiedPackageName("cat/pkg")),
+ value_for<n::rewrite_ids_over_to_root>(-1),
+ value_for<n::run_dependencies>(""),
+ value_for<n::slot>(SlotName("foo")),
+ value_for<n::version>(VersionSpec("1.0"))
+ )));
env.package_database()->add_repository(1, repo);
TEST_CHECK(repo->some_ids_might_support_action(SupportsActionTest<InstallAction>()));
@@ -189,18 +189,18 @@ namespace test_cases
std::tr1::shared_ptr<Repository> repo(new UnpackagedRepository(
RepositoryName("unpackaged"),
- unpackaged_repositories::UnpackagedRepositoryParams::named_create()
- (k::environment(), &env)
- (k::name(), QualifiedPackageName("cat/pkg"))
- (k::version(), VersionSpec("1.0"))
- (k::slot(), SlotName("foo"))
- (k::location(), FSEntry("unpackaged_repository_TEST_dir/pkg"))
- (k::install_under(), FSEntry("/"))
- (k::build_dependencies(), "")
- (k::run_dependencies(), "")
- (k::rewrite_ids_over_to_root(), -1)
- (k::description(), "")
- ));
+ make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
+ value_for<n::build_dependencies>(""),
+ value_for<n::description>(""),
+ value_for<n::environment>(&env),
+ value_for<n::install_under>(FSEntry("/")),
+ value_for<n::location>(FSEntry("unpackaged_repository_TEST_dir/pkg")),
+ value_for<n::name>(QualifiedPackageName("cat/pkg")),
+ value_for<n::rewrite_ids_over_to_root>(-1),
+ value_for<n::run_dependencies>(""),
+ value_for<n::slot>(SlotName("foo")),
+ value_for<n::version>(VersionSpec("1.0"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<Repository> installed_repo(new InstalledUnpackagedRepository(
@@ -217,11 +217,11 @@ namespace test_cases
const std::tr1::shared_ptr<const PackageID> id(
*env[selection::RequireExactlyOne(generator::All())]->begin());
- InstallAction action(InstallActionOptions::named_create()
- (k::debug_build(), iado_none)
- (k::checks(), iaco_default)
- (k::destination(), installed_repo)
- );
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::checks>(iaco_default),
+ value_for<n::debug_build>(iado_none),
+ value_for<n::destination>(installed_repo)
+ ));
id->perform_action(action);
TEST_CHECK(FSEntry("unpackaged_repository_TEST_dir/root/first").is_regular_file());
@@ -243,18 +243,18 @@ namespace test_cases
std::tr1::shared_ptr<Repository> repo(new UnpackagedRepository(
RepositoryName("unpackaged"),
- unpackaged_repositories::UnpackagedRepositoryParams::named_create()
- (k::environment(), &env)
- (k::name(), QualifiedPackageName("cat/pkg"))
- (k::version(), VersionSpec("1.0"))
- (k::slot(), SlotName("foo"))
- (k::location(), FSEntry("unpackaged_repository_TEST_dir/under_pkg"))
- (k::install_under(), FSEntry("/magic/pixie"))
- (k::build_dependencies(), "")
- (k::run_dependencies(), "")
- (k::rewrite_ids_over_to_root(), -1)
- (k::description(), "")
- ));
+ make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
+ value_for<n::build_dependencies>(""),
+ value_for<n::description>(""),
+ value_for<n::environment>(&env),
+ value_for<n::install_under>(FSEntry("/magic/pixie")),
+ value_for<n::location>(FSEntry("unpackaged_repository_TEST_dir/under_pkg")),
+ value_for<n::name>(QualifiedPackageName("cat/pkg")),
+ value_for<n::rewrite_ids_over_to_root>(-1),
+ value_for<n::run_dependencies>(""),
+ value_for<n::slot>(SlotName("foo")),
+ value_for<n::version>(VersionSpec("1.0"))
+ )));
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<Repository> installed_repo(new InstalledUnpackagedRepository(
@@ -271,11 +271,11 @@ namespace test_cases
const std::tr1::shared_ptr<const PackageID> id(
*env[selection::RequireExactlyOne(generator::All())]->begin());
- InstallAction action(InstallActionOptions::named_create()
- (k::debug_build(), iado_none)
- (k::checks(), iaco_default)
- (k::destination(), installed_repo)
- );
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::checks>(iaco_default),
+ value_for<n::debug_build>(iado_none),
+ value_for<n::destination>(installed_repo)
+ ));
id->perform_action(action);
TEST_CHECK(FSEntry("unpackaged_repository_TEST_dir/under_root/magic/pixie/first").is_regular_file());
diff --git a/paludis/repositories/unpackaged/unpackaged_stripper.cc b/paludis/repositories/unpackaged/unpackaged_stripper.cc
index 670c2377f..ec1313d76 100644
--- a/paludis/repositories/unpackaged/unpackaged_stripper.cc
+++ b/paludis/repositories/unpackaged/unpackaged_stripper.cc
@@ -18,9 +18,9 @@
*/
#include <paludis/repositories/unpackaged/unpackaged_stripper.hh>
-#include <paludis/util/kc.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/make_named_values.hh>
#include <iostream>
using namespace paludis;
@@ -41,11 +41,11 @@ namespace paludis
}
UnpackagedStripper::UnpackagedStripper(const UnpackagedStripperOptions & options) :
- Stripper(StripperOptions::named_create()
- (k::image_dir(), options[k::image_dir()])
- (k::debug_build(), options[k::debug_build()])
- (k::debug_dir(), options[k::debug_dir()])
- ),
+ Stripper(make_named_values<StripperOptions>(
+ value_for<n::debug_build>(options.debug_build()),
+ value_for<n::debug_dir>(options.debug_dir()),
+ value_for<n::image_dir>(options.image_dir())
+ )),
PrivateImplementationPattern<UnpackagedStripper>(new Implementation<UnpackagedStripper>(options)),
_imp(PrivateImplementationPattern<UnpackagedStripper>::_imp)
{
@@ -58,20 +58,20 @@ UnpackagedStripper::~UnpackagedStripper()
void
UnpackagedStripper::on_strip(const FSEntry & f)
{
- std::cout << "str " << f.strip_leading(_imp->options[k::image_dir()]) << std::endl;
+ std::cout << "str " << f.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
UnpackagedStripper::on_split(const FSEntry & f, const FSEntry & g)
{
- std::cout << "spl " << f.strip_leading(_imp->options[k::image_dir()]) <<
- " -> " << g.strip_leading(_imp->options[k::image_dir()]) << std::endl;
+ std::cout << "spl " << f.strip_leading(_imp->options.image_dir()) <<
+ " -> " << g.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
UnpackagedStripper::on_unknown(const FSEntry & f)
{
- std::cout << "--- " << f.strip_leading(_imp->options[k::image_dir()]) << std::endl;
+ std::cout << "--- " << f.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
@@ -87,7 +87,7 @@ UnpackagedStripper::on_leave_dir(const FSEntry &)
void
UnpackagedStripper::strip()
{
- std::cout << ">>> Stripping inside " << _imp->options[k::image_dir()] << std::endl;
+ std::cout << ">>> Stripping inside " << _imp->options.image_dir() << std::endl;
Stripper::strip();
}
diff --git a/paludis/repositories/unpackaged/unpackaged_stripper.hh b/paludis/repositories/unpackaged/unpackaged_stripper.hh
index 13ad87d58..d0c42de6e 100644
--- a/paludis/repositories/unpackaged/unpackaged_stripper.hh
+++ b/paludis/repositories/unpackaged/unpackaged_stripper.hh
@@ -21,17 +21,28 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_UNPACKAGED_STRIPPER_HH 1
#include <paludis/stripper.hh>
+#include <paludis/package_id-fwd.hh>
+#include <tr1/memory>
namespace paludis
{
+ namespace n
+ {
+ struct debug_build;
+ struct debug_dir;
+ struct image_dir;
+ struct package_id;
+ }
+
namespace unpackaged_repositories
{
- typedef kc::KeyedClass<
- kc::Field<k::package_id, std::tr1::shared_ptr<const PackageID> >,
- kc::Field<k::image_dir, FSEntry>,
- kc::Field<k::debug_dir, FSEntry>,
- kc::Field<k::debug_build, InstallActionDebugOption>
- > UnpackagedStripperOptions;
+ struct UnpackagedStripperOptions
+ {
+ NamedValue<n::debug_build, InstallActionDebugOption> debug_build;
+ NamedValue<n::debug_dir, FSEntry> debug_dir;
+ NamedValue<n::image_dir, FSEntry> image_dir;
+ NamedValue<n::package_id, std::tr1::shared_ptr<const PackageID> > package_id;
+ };
class UnpackagedStripper :
public Stripper,
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index cc09b138f..5b5147c67 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -34,6 +34,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/make_named_values.hh>
#include <tr1/functional>
#include <tr1/unordered_map>
@@ -107,20 +108,21 @@ namespace
InstalledVirtualsRepository::InstalledVirtualsRepository(const Environment * const env,
const FSEntry & r) :
- Repository(RepositoryName(make_name(r)), RepositoryCapabilities::named_create()
- (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
- (k::sets_interface(), static_cast<RepositorySetsInterface *>(0))
- (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
- (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
- (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
- (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
- (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
- (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
- (k::e_interface(), static_cast<RepositoryEInterface *>(0))
- (k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
- (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
- (k::hook_interface(), this)
- (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
+ Repository(RepositoryName(make_name(r)), make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
+ value_for<n::hook_interface>(this),
+ value_for<n::make_virtuals_interface>(static_cast<RepositoryMakeVirtualsInterface *>(0)),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
+ value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(static_cast<RepositorySetsInterface *>(0)),
+ value_for<n::syncable_interface>(static_cast<RepositorySyncableInterface *>(0)),
+ value_for<n::use_interface>(static_cast<RepositoryUseInterface *>(0)),
+ value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ )),
PrivateImplementationPattern<InstalledVirtualsRepository>(
new Implementation<InstalledVirtualsRepository>(env, r)),
_imp(PrivateImplementationPattern<InstalledVirtualsRepository>::_imp)
@@ -147,21 +149,21 @@ InstalledVirtualsRepository::need_ids() const
for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
{
- if (! (**r)[k::provides_interface()])
+ if (! (**r).provides_interface())
continue;
std::tr1::shared_ptr<const RepositoryProvidesInterface::ProvidesSequence> pp(
- (**r)[k::provides_interface()]->provided_packages());
+ (**r).provides_interface()->provided_packages());
for (RepositoryProvidesInterface::ProvidesSequence::ConstIterator p(
pp->begin()), p_end(pp->end()) ; p != p_end ; ++p)
{
- IDMap::iterator i(_imp->ids.find((*p)[k::virtual_name()]));
+ IDMap::iterator i(_imp->ids.find((*p).virtual_name()));
if (i == _imp->ids.end())
- i = _imp->ids.insert(std::make_pair((*p)[k::virtual_name()], make_shared_ptr(new PackageIDSequence))).first;
+ i = _imp->ids.insert(std::make_pair((*p).virtual_name(), make_shared_ptr(new PackageIDSequence))).first;
std::tr1::shared_ptr<const PackageID> id(new virtuals::VirtualsPackageID(
- _imp->env, shared_from_this(), (*p)[k::virtual_name()], (*p)[k::provided_by()], false));
+ _imp->env, shared_from_this(), (*p).virtual_name(), (*p).provided_by(), false));
i->second->push_back(id);
}
}
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index b0b0fb21a..d5ece7a67 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -40,6 +40,7 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/make_named_values.hh>
#include <tr1/functional>
#include <tr1/unordered_map>
@@ -117,20 +118,21 @@ namespace
}
VirtualsRepository::VirtualsRepository(const Environment * const env) :
- Repository(RepositoryName("virtuals"), RepositoryCapabilities::named_create()
- (k::use_interface(), static_cast<RepositoryUseInterface *>(0))
- (k::sets_interface(), static_cast<RepositorySetsInterface *>(0))
- (k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
- (k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
- (k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
- (k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
- (k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
- (k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
- (k::e_interface(), static_cast<RepositoryEInterface *>(0))
- (k::make_virtuals_interface(), this)
- (k::qa_interface(), static_cast<RepositoryQAInterface *>(0))
- (k::hook_interface(), static_cast<RepositoryHookInterface *>(0))
- (k::manifest_interface(), static_cast<RepositoryManifestInterface *>(0))),
+ Repository(RepositoryName("virtuals"), make_named_values<RepositoryCapabilities>(
+ value_for<n::destination_interface>(static_cast<RepositoryDestinationInterface *>(0)),
+ value_for<n::e_interface>(static_cast<RepositoryEInterface *>(0)),
+ value_for<n::environment_variable_interface>(static_cast<RepositoryEnvironmentVariableInterface *>(0)),
+ value_for<n::hook_interface>(static_cast<RepositoryHookInterface *>(0)),
+ value_for<n::make_virtuals_interface>(this),
+ value_for<n::manifest_interface>(static_cast<RepositoryManifestInterface *>(0)),
+ value_for<n::mirrors_interface>(static_cast<RepositoryMirrorsInterface *>(0)),
+ value_for<n::provides_interface>(static_cast<RepositoryProvidesInterface *>(0)),
+ value_for<n::qa_interface>(static_cast<RepositoryQAInterface *>(0)),
+ value_for<n::sets_interface>(static_cast<RepositorySetsInterface *>(0)),
+ value_for<n::syncable_interface>(static_cast<RepositorySyncableInterface *>(0)),
+ value_for<n::use_interface>(static_cast<RepositoryUseInterface *>(0)),
+ value_for<n::virtuals_interface>(static_cast<RepositoryVirtualsInterface *>(0))
+ )),
PrivateImplementationPattern<VirtualsRepository>(
new Implementation<VirtualsRepository>(env)),
_imp(PrivateImplementationPattern<VirtualsRepository>::_imp)
@@ -158,15 +160,15 @@ VirtualsRepository::need_names() const
for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
{
- if (! (**r)[k::provides_interface()])
+ if (! (**r).provides_interface())
continue;
std::tr1::shared_ptr<const RepositoryProvidesInterface::ProvidesSequence> provides(
- (**r)[k::provides_interface()]->provided_packages());
+ (**r).provides_interface()->provided_packages());
for (RepositoryProvidesInterface::ProvidesSequence::ConstIterator p(provides->begin()),
p_end(provides->end()) ; p != p_end ; ++p)
- _imp->names.push_back(std::make_pair((*p)[k::virtual_name()], std::tr1::shared_ptr<const PackageDepSpec>(
- new PackageDepSpec(make_package_dep_spec().package((*p)[k::provided_by()]->name())))));
+ _imp->names.push_back(std::make_pair((*p).virtual_name(), std::tr1::shared_ptr<const PackageDepSpec>(
+ new PackageDepSpec(make_package_dep_spec().package((*p).provided_by()->name())))));
}
std::sort(_imp->names.begin(), _imp->names.end(), NamesSortComparator());
@@ -177,11 +179,11 @@ VirtualsRepository::need_names() const
for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
{
- if (! (**r)[k::virtuals_interface()])
+ if (! (**r).virtuals_interface())
continue;
std::tr1::shared_ptr<const RepositoryVirtualsInterface::VirtualsSequence> virtuals(
- (**r)[k::virtuals_interface()]->virtual_packages());
+ (**r).virtuals_interface()->virtual_packages());
for (RepositoryVirtualsInterface::VirtualsSequence::ConstIterator v(virtuals->begin()),
v_end(virtuals->end()) ; v != v_end ; ++v)
{
@@ -189,11 +191,11 @@ VirtualsRepository::need_names() const
std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator,
std::vector<std::pair<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator> p(
std::equal_range(_imp->names.begin(), _imp->names.end(),
- std::make_pair((*v)[k::virtual_name()], std::tr1::shared_ptr<const PackageDepSpec>()),
+ std::make_pair((*v).virtual_name(), std::tr1::shared_ptr<const PackageDepSpec>()),
NamesNameComparator()));
if (p.first == p.second)
- new_names.push_back(std::make_pair((*v)[k::virtual_name()], (*v)[k::provided_by_spec()]));
+ new_names.push_back(std::make_pair((*v).virtual_name(), (*v).provided_by_spec()));
}
}
diff --git a/paludis/repositories/virtuals/virtuals_repository_TEST.cc b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
index 3750bd4a8..cc6da4ecc 100644
--- a/paludis/repositories/virtuals/virtuals_repository_TEST.cc
+++ b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
@@ -53,7 +53,7 @@ namespace test_cases
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
std::tr1::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(&env, RepositoryName("installed")));
- TEST_CHECK((*repo)[k::virtuals_interface()]);
+ TEST_CHECK(repo->virtuals_interface());
env.package_database()->add_repository(2, virtuals);
env.package_database()->add_repository(3, repo);