aboutsummaryrefslogtreecommitdiff
path: root/paludis
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-02-02 16:27:55 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-02-02 16:27:55 +0000
commita5d40f88ff2e5452adb6e1b6f1d73b0bac7efde0 (patch)
tree91450c8d11ba03ebfb0c8bcda82e23fa513778c2 /paludis
parentdb6f0b1425ee62088bd290b3ae684ea2d51ff1ad (diff)
downloadpaludis-a5d40f88ff2e5452adb6e1b6f1d73b0bac7efde0.tar.gz
paludis-a5d40f88ff2e5452adb6e1b6f1d73b0bac7efde0.tar.xz
Start switching over from sr to kc.
Diffstat (limited to 'paludis')
-rw-r--r--paludis/action-fwd.hh61
-rw-r--r--paludis/action.cc8
-rw-r--r--paludis/action.hh5
-rw-r--r--paludis/action.sr88
-rw-r--r--paludis/files.m42
-rw-r--r--paludis/install_task.cc29
-rw-r--r--paludis/repositories/e/check_fetched_files_visitor.cc104
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc45
-rw-r--r--paludis/repositories/e/ebuild_entries.cc23
-rw-r--r--paludis/repositories/e/qa/function_keyword_TEST.cc4
-rw-r--r--paludis/repositories/e/vdb_repository.cc3
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc5
-rw-r--r--paludis/repositories/unpackaged/installed_repository_TEST.cc49
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc9
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository_TEST.cc13
-rw-r--r--paludis/uninstall_task.cc5
-rw-r--r--paludis/util/files.m42
-rw-r--r--paludis/util/kc-fwd.hh65
-rw-r--r--paludis/util/kc.hh260
-rw-r--r--paludis/util/keys.hh43
20 files changed, 580 insertions, 243 deletions
diff --git a/paludis/action-fwd.hh b/paludis/action-fwd.hh
index 8a4bd75fa..dbad67dfe 100644
--- a/paludis/action-fwd.hh
+++ b/paludis/action-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -22,6 +22,10 @@
#include <iosfwd>
#include <paludis/util/attributes.hh>
+#include <paludis/util/kc-fwd.hh>
+#include <paludis/util/keys.hh>
+#include <paludis/util/tr1_memory.hh>
+#include <paludis/repository-fwd.hh>
/** \file
* Forward declarations for paludis/action.hh .
@@ -54,13 +58,58 @@ namespace paludis
class ConfigActionError;
class InfoActionError;
- class FetchActionFailure;
+#include <paludis/action-se.hh>
- class InstallActionOptions;
- class UninstallActionOptions;
- class FetchActionOptions;
+ /**
+ * Options for a FetchAction.
+ *
+ * \see FetchAction
+ * \ingroup g_actions
+ * \since 0.26
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::fetch_unneeded, bool>,
+ kc::Field<k::safe_resume, bool>
+ > FetchActionOptions;
-#include <paludis/action-se.hh>
+ /**
+ * Options for an InstallAction.
+ *
+ * \see InstallAction
+ * \ingroup g_actions
+ * \since 0.26
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::no_config_protect, bool>,
+ kc::Field<k::debug_build, InstallActionDebugOption>,
+ kc::Field<k::checks, InstallActionChecksOption>,
+ kc::Field<k::destination, tr1::shared_ptr<Repository> >
+ > InstallActionOptions;
+
+ /**
+ * Options for an UninstallAction.
+ *
+ * \see UninstallAction
+ * \ingroup g_actions
+ * \since 0.26
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::no_config_protect, bool>
+ > UninstallActionOptions;
+
+ /**
+ * A failed fetch action part.
+ *
+ * \see FetchActionError
+ * \ingroup g_actions
+ * \since 0.26
+ */
+ typedef kc::KeyedClass<
+ kc::Field<k::target_file, std::string>,
+ kc::Field<k::requires_manual_fetching, bool>,
+ kc::Field<k::failed_automatic_fetching, bool>,
+ kc::Field<k::failed_integrity_checks, std::string>
+ > FetchActionFailure;
}
diff --git a/paludis/action.cc b/paludis/action.cc
index a6b955aa1..849eb39bc 100644
--- a/paludis/action.cc
+++ b/paludis/action.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -23,11 +23,11 @@
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/kc.hh>
using namespace paludis;
#include <paludis/action-se.cc>
-#include <paludis/action-sr.cc>
template class AcceptInterfaceVisitsThis<ActionVisitorTypes, InstallAction>;
template class AcceptInterfaceVisitsThis<ActionVisitorTypes, ConfigAction>;
@@ -182,8 +182,8 @@ namespace
void visit(const InstallAction & a)
{
s << "install to ";
- if (a.options.destination)
- s << a.options.destination->name();
+ if (a.options[k::destination()])
+ s << a.options[k::destination()]->name();
else
s << "nowhere";
}
diff --git a/paludis/action.hh b/paludis/action.hh
index 1ce900a6c..f090795db 100644
--- a/paludis/action.hh
+++ b/paludis/action.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -42,9 +42,6 @@
namespace paludis
{
-
-#include <paludis/action-sr.hh>
-
/**
* Types for visiting an action.
*
diff --git a/paludis/action.sr b/paludis/action.sr
deleted file mode 100644
index 435237353..000000000
--- a/paludis/action.sr
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-make_class_FetchActionOptions()
-{
- visible
- allow_named_args
-
- key fetch_unneeded bool
- key safe_resume bool
-
- doxygen_comment << "END"
- /**
- * Options for FetchAction.
- *
- * \see FetchAction
- * \ingroup g_actions
- * \since 0.26
- * \nosubgrouping
- */
-END
-}
-
-
-make_class_InstallActionOptions()
-{
- visible
- allow_named_args
-
- key no_config_protect bool
- key debug_build InstallActionDebugOption
- key checks InstallActionChecksOption
- key destination "tr1::shared_ptr<Repository>"
-
- doxygen_comment << "END"
- /**
- * Options for InstallAction.
- *
- * \see InstallAction
- * \ingroup g_actions
- * \since 0.26
- * \nosubgrouping
- */
-END
-}
-
-make_class_UninstallActionOptions()
-{
- visible
- allow_named_args
-
- key no_config_protect bool
-
- doxygen_comment << "END"
- /**
- * Options for UninstallAction.
- *
- * \see UninstallAction
- * \ingroup g_actions
- * \since 0.26
- * \nosubgrouping
- */
-END
-}
-
-make_class_FetchActionFailure()
-{
- visible
- allow_named_args
-
- key target_file std::string
- key requires_manual_fetching bool
- key failed_automatic_fetching bool
- key failed_integrity_checks std::string
-
- doxygen_comment << "END"
- /**
- * A failed fetch action part.
- *
- * \see FetchActionError
- * \ingroup g_actions
- * \ingroup g_exceptions
- * \ingroup g_actions
- * \nosubgrouping
- */
-END
-}
-
diff --git a/paludis/files.m4 b/paludis/files.m4
index 573c84b64..2f30b5df2 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -9,7 +9,7 @@ dnl `test', `impl', `testscript'. Note that there isn't much error checking done
dnl on this file at present...
add(`about', `hh', `test')
-add(`action', `hh', `cc', `fwd', `se', `sr')
+add(`action', `hh', `cc', `fwd', `se')
add(`condition_tracker', `hh', `cc')
add(`contents', `hh', `cc', `fwd')
add(`dep_label', `hh', `cc', `fwd')
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index 2e7227b30..c6fcf8c1e 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -38,6 +38,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/kc.hh>
#include <paludis/handled_information.hh>
#include <functional>
#include <algorithm>
@@ -84,16 +85,16 @@ namespace paludis
env(e),
dep_list(e, o),
fetch_options(
- FetchActionOptions::create()
- .safe_resume(false)
- .fetch_unneeded(false)
+ FetchActionOptions::named_create()
+ (k::safe_resume(), false)
+ (k::fetch_unneeded(), false)
),
install_options(
- InstallActionOptions::create()
- .no_config_protect(false)
- .debug_build(iado_none)
- .checks(iaco_default)
- .destination(tr1::shared_ptr<Repository>())
+ InstallActionOptions::named_create()
+ (k::no_config_protect(), false)
+ (k::debug_build(), iado_none)
+ (k::checks(), iaco_default)
+ (k::destination(), tr1::shared_ptr<Repository>())
),
uninstall_options(false),
targets(new ConstTreeSequence<SetSpecTree, AllDepSpec>(tr1::shared_ptr<AllDepSpec>(new AllDepSpec))),
@@ -465,7 +466,7 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
if (! _imp->fetch_only)
{
- _imp->install_options.destination = dep->destination;
+ _imp->install_options[k::destination()] = dep->destination;
InstallAction install_action(_imp->install_options);
dep->package_id->perform_action(install_action);
}
@@ -844,8 +845,8 @@ InstallTask::dep_list() const
void
InstallTask::set_no_config_protect(const bool value)
{
- _imp->install_options.no_config_protect = value;
- _imp->uninstall_options.no_config_protect = value;
+ _imp->install_options[k::no_config_protect()] = value;
+ _imp->uninstall_options[k::no_config_protect()] = value;
}
void
@@ -869,13 +870,13 @@ InstallTask::set_preserve_world(const bool value)
void
InstallTask::set_debug_mode(const InstallActionDebugOption value)
{
- _imp->install_options.debug_build = value;
+ _imp->install_options[k::debug_build()] = value;
}
void
InstallTask::set_checks_mode(const InstallActionChecksOption value)
{
- _imp->install_options.checks = value;
+ _imp->install_options[k::checks()] = value;
}
void
@@ -928,7 +929,7 @@ InstallTask::had_package_targets() const
void
InstallTask::set_safe_resume(const bool value)
{
- _imp->fetch_options.safe_resume = value;
+ _imp->fetch_options[k::safe_resume()] = value;
}
HookResult
diff --git a/paludis/repositories/e/check_fetched_files_visitor.cc b/paludis/repositories/e/check_fetched_files_visitor.cc
index e3fa8d575..2e6447460 100644
--- a/paludis/repositories/e/check_fetched_files_visitor.cc
+++ b/paludis/repositories/e/check_fetched_files_visitor.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -35,7 +35,7 @@
#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/sha256.hh>
#include <paludis/util/md5.hh>
@@ -187,11 +187,11 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
case manifest_require:
case last_manifest:
- _imp->failures->push_back(FetchActionFailure::create()
- .target_file(stringify(distfile.basename()))
- .failed_integrity_checks("No Manifest available")
- .requires_manual_fetching(false)
- .failed_automatic_fetching(false)
+ _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)
);
return false;
@@ -218,11 +218,11 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
Log::get_instance()->message(ll_debug, lc_context)
<< "Malformed Manifest: no file size found";
std::cout << "incorrect size";
- _imp->failures->push_back(FetchActionFailure::create()
- .target_file(stringify(distfile.basename()))
- .requires_manual_fetching(false)
- .failed_integrity_checks("Incorrect file size")
- .failed_automatic_fetching(false)
+ _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)
);
return false;
}
@@ -231,11 +231,11 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
if (! file_stream)
{
std::cout << "unreadable file";
- _imp->failures->push_back(FetchActionFailure::create()
- .target_file(stringify(distfile.basename()))
- .requires_manual_fetching(false)
- .failed_integrity_checks("Unreadable file")
- .failed_automatic_fetching(false)
+ _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)
);
return false;
}
@@ -248,11 +248,11 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
Log::get_instance()->message(ll_debug, lc_context)
<< "Malformed Manifest: failed RMD160 checksum";
std::cout << "failed RMD160";
- _imp->failures->push_back(FetchActionFailure::create()
- .target_file(stringify(distfile.basename()))
- .requires_manual_fetching(false)
- .failed_integrity_checks("Failed RMD160 checksum")
- .failed_automatic_fetching(false)
+ _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)
);
return false;
}
@@ -270,11 +270,11 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
Log::get_instance()->message(ll_debug, lc_context)
<< "Malformed Manifest: failed SHA256 checksum";
std::cout << "failed SHA256";
- _imp->failures->push_back(FetchActionFailure::create()
- .target_file(stringify(distfile.basename()))
- .requires_manual_fetching(false)
- .failed_integrity_checks("Failed SHA256 checksum")
- .failed_automatic_fetching(false)
+ _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)
);
return false;
}
@@ -292,11 +292,11 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
Log::get_instance()->message(ll_debug, lc_context)
<< "Malformed Manifest: failed MD5 checksum";
std::cout << "failed MD5";
- _imp->failures->push_back(FetchActionFailure::create()
- .target_file(stringify(distfile.basename()))
- .requires_manual_fetching(false)
- .failed_integrity_checks("Failed MD5 checksum")
- .failed_automatic_fetching(false)
+ _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)
);
return false;
}
@@ -308,11 +308,11 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
if (! found)
{
std::cout << "not in Manifest";
- _imp->failures->push_back(FetchActionFailure::create()
- .target_file(stringify(distfile.basename()))
- .requires_manual_fetching(false)
- .failed_integrity_checks("Not in Manifest")
- .failed_automatic_fetching(false)
+ _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)
);
return false;
}
@@ -341,22 +341,22 @@ CheckFetchedFilesVisitor::visit_leaf(const FetchableURIDepSpec & u)
Log::get_instance()->message(ll_debug, lc_context) << "Manual fetch required for '" << u.filename() << "'";
std::cout << "requires manual fetch";
_imp->need_nofetch = true;
- _imp->failures->push_back(FetchActionFailure::create()
- .target_file(u.filename())
- .requires_manual_fetching(true)
- .failed_automatic_fetching(false)
- .failed_integrity_checks("")
+ _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(), "")
);
}
else
{
Log::get_instance()->message(ll_debug, lc_context) << "Automatic fetch failed for '" << u.filename() << "'";
std::cout << "does not exist";
- _imp->failures->push_back(FetchActionFailure::create()
- .target_file(u.filename())
- .requires_manual_fetching(false)
- .failed_automatic_fetching(true)
- .failed_integrity_checks("")
+ _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(), "")
);
}
}
@@ -364,11 +364,11 @@ CheckFetchedFilesVisitor::visit_leaf(const FetchableURIDepSpec & u)
{
Log::get_instance()->message(ll_debug, lc_context) << "Empty file for '" << u.filename() << "'";
std::cout << "empty file";
- _imp->failures->push_back(FetchActionFailure::create()
- .target_file(u.filename())
- .requires_manual_fetching(false)
- .failed_integrity_checks("SIZE (empty file)")
- .failed_automatic_fetching(false)
+ _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)
);
}
else if (! check_distfile_manifest(_imp->distdir / u.filename()))
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 548337621..b2fa98388 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -33,6 +33,7 @@
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/map.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/kc.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/query.hh>
@@ -913,9 +914,9 @@ namespace test_cases
tr1::shared_ptr<ERepository> repo(make_ebuild_repository(&env, keys));
env.package_database()->add_repository(1, repo);
- FetchAction action(FetchActionOptions::create()
- .fetch_unneeded(false)
- .safe_resume(true)
+ FetchAction action(FetchActionOptions::named_create()
+ (k::fetch_unneeded(), false)
+ (k::safe_resume(), true)
);
{
@@ -1019,9 +1020,9 @@ namespace test_cases
&env, keys));
env.package_database()->add_repository(1, repo);
- FetchAction action(FetchActionOptions::create()
- .fetch_unneeded(false)
- .safe_resume(true)
+ FetchAction action(FetchActionOptions::named_create()
+ (k::fetch_unneeded(), false)
+ (k::safe_resume(), true)
);
const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
@@ -1071,11 +1072,11 @@ namespace test_cases
env.package_database()->add_repository(-2, RepositoryMaker::get_instance()->find_maker("virtuals")(&env,
tr1::shared_ptr<Map<std::string, std::string> >()));
- InstallAction action(InstallActionOptions::create()
- .debug_build(iado_none)
- .checks(iaco_default)
- .no_config_protect(false)
- .destination(installed_repo)
+ InstallAction action(InstallActionOptions::named_create()
+ (k::debug_build(), iado_none)
+ (k::checks(), iaco_default)
+ (k::no_config_protect(), false)
+ (k::destination(), installed_repo)
);
{
@@ -1198,11 +1199,11 @@ namespace test_cases
tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
env.package_database()->add_repository(2, installed_repo);
- InstallAction action(InstallActionOptions::create()
- .debug_build(iado_none)
- .checks(iaco_default)
- .no_config_protect(false)
- .destination(installed_repo)
+ InstallAction action(InstallActionOptions::named_create()
+ (k::debug_build(), iado_none)
+ (k::checks(), iaco_default)
+ (k::no_config_protect(), false)
+ (k::destination(), installed_repo)
);
{
@@ -1254,11 +1255,11 @@ namespace test_cases
env.package_database()->add_repository(-2, RepositoryMaker::get_instance()->find_maker("virtuals")(&env,
tr1::shared_ptr<Map<std::string, std::string> >()));
- InstallAction action(InstallActionOptions::create()
- .debug_build(iado_none)
- .checks(iaco_default)
- .no_config_protect(false)
- .destination(installed_repo)
+ InstallAction action(InstallActionOptions::named_create()
+ (k::debug_build(), iado_none)
+ (k::checks(), iaco_default)
+ (k::no_config_protect(), false)
+ (k::destination(), installed_repo)
);
{
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index 4b902ba55..8364fb52a 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -48,6 +48,7 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/kc.hh>
#include <fstream>
#include <list>
@@ -363,10 +364,10 @@ EbuildEntries::fetch(const 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.fetch_unneeded, fetch_userpriv_ok, mirrors_name,
- id->fetches_key()->initial_label(), o.safe_resume);
+ _imp->e_repository->params().distdir, o[k::fetch_unneeded()], fetch_userpriv_ok, mirrors_name,
+ id->fetches_key()->initial_label(), o[k::safe_resume()]);
id->fetches_key()->value()->accept(f);
- CheckFetchedFilesVisitor c(_imp->environment, id, _imp->e_repository->params().distdir, o.fetch_unneeded, fetch_restrict,
+ CheckFetchedFilesVisitor c(_imp->environment, id, _imp->e_repository->params().distdir, o[k::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);
@@ -534,12 +535,12 @@ EbuildEntries::install(const tr1::shared_ptr<const ERepositoryID> & id,
{
if (phase->option("merge"))
{
- if (! o.destination->destination_interface)
+ if (! o[k::destination()]->destination_interface)
throw InstallActionError("Can't install '" + stringify(*id)
- + "' to destination '" + stringify(o.destination->name())
+ + "' to destination '" + stringify(o[k::destination()]->name())
+ "' because destination does not provide destination_interface");
- o.destination->destination_interface->merge(
+ o[k::destination()]->destination_interface->merge(
MergeOptions::create()
.package_id(id)
.image_dir(_imp->params.builddir / stringify(id->name().category) / (stringify(id->name().package) + "-"
@@ -550,11 +551,11 @@ EbuildEntries::install(const tr1::shared_ptr<const ERepositoryID> & id,
);
}
else if ((! phase->option("prepost")) ||
- (o.destination->destination_interface && o.destination->destination_interface->want_pre_post_phases()))
+ (o[k::destination()]->destination_interface && o[k::destination()]->destination_interface->want_pre_post_phases()))
{
if (phase->option("checkphase"))
{
- switch (o.checks)
+ switch (o[k::checks()])
{
case iaco_none:
if (! phase->option("checks=none"))
@@ -599,10 +600,10 @@ EbuildEntries::install(const tr1::shared_ptr<const ERepositoryID> & id,
.aa(all_archives)
.use_expand(join(p->begin_use_expand(), p->end_use_expand(), " "))
.expand_vars(expand_vars)
- .root(o.destination->installed_root_key() ? stringify(o.destination->installed_root_key()->value()) : "/")
+ .root(o[k::destination()]->installed_root_key() ? stringify(o[k::destination()]->installed_root_key()->value()) : "/")
.profiles(_imp->params.profiles)
- .disable_cfgpro(o.no_config_protect)
- .debug_build(o.debug_build)
+ .disable_cfgpro(o[k::no_config_protect()])
+ .debug_build(o[k::debug_build()])
.config_protect(_imp->e_repository->profile_variable("CONFIG_PROTECT"))
.config_protect_mask(_imp->e_repository->profile_variable("CONFIG_PROTECT_MASK"))
.loadsaveenv_dir(_imp->params.builddir / stringify(id->name().category) / (
diff --git a/paludis/repositories/e/qa/function_keyword_TEST.cc b/paludis/repositories/e/qa/function_keyword_TEST.cc
index d1ddae84c..9f7f397ac 100644
--- a/paludis/repositories/e/qa/function_keyword_TEST.cc
+++ b/paludis/repositories/e/qa/function_keyword_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
* Copyright (c) 2007 Fernando J. Pereda
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -43,7 +43,7 @@ namespace
{
}
- void message(const QAMessage & m)
+ void message(const QAMessage &)
{
++count;
}
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 34e9de591..0fbe87beb 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -66,6 +66,7 @@
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/kc.hh>
#include <fstream>
#include <functional>
@@ -451,7 +452,7 @@ VDBRepository::perform_uninstall(const tr1::shared_ptr<const ERepositoryID> & id
EbuildUninstallCommandParams uninstall_params(EbuildUninstallCommandParams::create()
.root(stringify(_imp->params.root) + "/")
- .disable_cfgpro(o.no_config_protect)
+ .disable_cfgpro(o[k::no_config_protect()])
.unmerge_only(false)
.loadsaveenv_dir(pkg_dir)
.load_environment(load_env.get()));
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index d4181df1f..851e8087a 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -30,6 +30,7 @@
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/system.hh>
#include <paludis/util/cookie.hh>
+#include <paludis/util/kc.hh>
#include <paludis/stringify_formatter.hh>
#include <paludis/action.hh>
#include <paludis/environment.hh>
@@ -318,8 +319,8 @@ InstalledUnpackagedRepository::merge(const MergeOptions & m)
if (if_overwritten_id)
{
- tr1::static_pointer_cast<const InstalledUnpackagedID>(if_overwritten_id)->uninstall(UninstallActionOptions::create()
- .no_config_protect(false),
+ tr1::static_pointer_cast<const InstalledUnpackagedID>(if_overwritten_id)->uninstall(UninstallActionOptions::named_create()
+ (k::no_config_protect(), false),
true);
}
}
diff --git a/paludis/repositories/unpackaged/installed_repository_TEST.cc b/paludis/repositories/unpackaged/installed_repository_TEST.cc
index 5dbed30b5..a7b1e3241 100644
--- a/paludis/repositories/unpackaged/installed_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/installed_repository_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -29,6 +29,7 @@
#include <paludis/util/join.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/kc.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <algorithm>
@@ -252,8 +253,8 @@ namespace test_cases
const tr1::shared_ptr<const PackageID> id(
*env.package_database()->query(query::All(), qo_require_exactly_one)->begin());
- UninstallAction action(UninstallActionOptions::create()
- .no_config_protect(false)
+ UninstallAction action(UninstallActionOptions::named_create()
+ (k::no_config_protect(), false)
);
id->perform_action(action);
@@ -305,8 +306,8 @@ namespace test_cases
*env.package_database()->query(query::Matches(parse_user_package_dep_spec("cat-one/foo:fred", UserPackageDepSpecOptions())),
qo_require_exactly_one)->begin());
- UninstallAction action(UninstallActionOptions::create()
- .no_config_protect(false)
+ UninstallAction action(UninstallActionOptions::named_create()
+ (k::no_config_protect(), false)
);
id->perform_action(action);
@@ -388,11 +389,11 @@ namespace test_cases
TEST_CHECK(! FSEntry("installed_repository_TEST_dir/root4/dir").exists());
- InstallAction action(InstallActionOptions::create()
- .destination(repo)
- .no_config_protect(false)
- .checks(iaco_default)
- .debug_build(iado_none));
+ InstallAction action(InstallActionOptions::named_create()
+ (k::destination(), repo)
+ (k::no_config_protect(), false)
+ (k::checks(), iaco_default)
+ (k::debug_build(), iado_none));
(*env.package_database()->query(query::Repository(RepositoryName("unpackaged")),
qo_require_exactly_one)->begin())->perform_action(action);
@@ -442,11 +443,11 @@ namespace test_cases
"cat/pkg4a-1.0:foo::installed-unpackaged");
}
- InstallAction action(InstallActionOptions::create()
- .destination(repo)
- .no_config_protect(false)
- .checks(iaco_default)
- .debug_build(iado_none));
+ InstallAction action(InstallActionOptions::named_create()
+ (k::destination(), repo)
+ (k::no_config_protect(), false)
+ (k::checks(), iaco_default)
+ (k::debug_build(), iado_none));
(*env.package_database()->query(query::Repository(RepositoryName("unpackaged")),
qo_require_exactly_one)->begin())->perform_action(action);
@@ -499,11 +500,11 @@ namespace test_cases
"cat/pkg4a-1.0:foo::installed-unpackaged cat/pkg4b-1.0:foo::installed-unpackaged");
}
- InstallAction action(InstallActionOptions::create()
- .destination(repo)
- .no_config_protect(false)
- .checks(iaco_default)
- .debug_build(iado_none));
+ InstallAction action(InstallActionOptions::named_create()
+ (k::destination(), repo)
+ (k::no_config_protect(), false)
+ (k::checks(), iaco_default)
+ (k::debug_build(), iado_none));
(*env.package_database()->query(query::Repository(RepositoryName("unpackaged")),
qo_require_exactly_one)->begin())->perform_action(action);
@@ -542,8 +543,8 @@ namespace test_cases
"cat/pkg4a-1.0:foo::installed-unpackaged cat/pkg4b-1.0:foo::installed-unpackaged");
}
- UninstallAction action(UninstallActionOptions::create()
- .no_config_protect(false));
+ UninstallAction action(UninstallActionOptions::named_create()
+ (k::no_config_protect(), false));
(*env.package_database()->query(query::Matches(parse_user_package_dep_spec("cat/pkg4a", UserPackageDepSpecOptions())),
qo_require_exactly_one)->begin())->perform_action(action);
@@ -582,8 +583,8 @@ namespace test_cases
"cat/pkg4b-1.0:foo::installed-unpackaged");
}
- UninstallAction action(UninstallActionOptions::create()
- .no_config_protect(false));
+ UninstallAction action(UninstallActionOptions::named_create()
+ (k::no_config_protect(), false));
(*env.package_database()->query(query::Matches(parse_user_package_dep_spec("cat/pkg4b", UserPackageDepSpecOptions())),
qo_require_exactly_one)->begin())->perform_action(action);
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index 6dd7cbf3a..767c88112 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -27,6 +27,7 @@
#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/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/package_database.hh>
@@ -299,12 +300,12 @@ UnpackagedID::perform_action(Action & action) const
if (! install_action)
throw UnsupportedActionError(*this, action);
- if (! install_action->options.destination->destination_interface)
+ if (! install_action->options[k::destination()]->destination_interface)
throw InstallActionError("Can't install '" + stringify(*this)
- + "' to destination '" + stringify(install_action->options.destination->name())
+ + "' to destination '" + stringify(install_action->options[k::destination()]->name())
+ "' because destination does not provide destination_interface");
- install_action->options.destination->destination_interface->merge(
+ install_action->options[k::destination()]->destination_interface->merge(
MergeOptions::create()
.package_id(shared_from_this())
.image_dir(fs_location_key()->value())
diff --git a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
index 1c49c7534..a6b4dfc69 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -30,6 +30,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 <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -203,11 +204,11 @@ namespace test_cases
const tr1::shared_ptr<const PackageID> id(
*env.package_database()->query(query::All(), qo_require_exactly_one)->begin());
- InstallAction action(InstallActionOptions::create()
- .no_config_protect(false)
- .debug_build(iado_none)
- .checks(iaco_default)
- .destination(installed_repo)
+ InstallAction action(InstallActionOptions::named_create()
+ (k::no_config_protect(), false)
+ (k::debug_build(), iado_none)
+ (k::checks(), iaco_default)
+ (k::destination(), installed_repo)
);
id->perform_action(action);
diff --git a/paludis/uninstall_task.cc b/paludis/uninstall_task.cc
index 8dec4b576..490da8f68 100644
--- a/paludis/uninstall_task.cc
+++ b/paludis/uninstall_task.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -31,6 +31,7 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/kc.hh>
#include <paludis/query.hh>
#include <paludis/package_database.hh>
#include <paludis/hook.hh>
@@ -133,7 +134,7 @@ UninstallTask::set_pretend(const bool v)
void
UninstallTask::set_no_config_protect(const bool v)
{
- _imp->uninstall_options.no_config_protect = v;
+ _imp->uninstall_options[k::no_config_protect()] = v;
}
void
diff --git a/paludis/util/files.m4 b/paludis/util/files.m4
index 1ab35fb16..76f0eda06 100644
--- a/paludis/util/files.m4
+++ b/paludis/util/files.m4
@@ -29,6 +29,8 @@ add(`indirect_iterator', `hh', `fwd', `impl', `test')
add(`instantiation_policy', `hh', `impl', `test')
add(`is_file_with_extension', `hh', `cc', `se', `test', `testscript')
add(`join', `hh', `test')
+add(`kc', `hh', `fwd')
+add(`keys', `hh')
add(`log', `hh', `cc', `se', `test')
add(`make_shared_ptr', `hh', `fwd')
add(`map', `hh', `fwd', `impl', `cc')
diff --git a/paludis/util/kc-fwd.hh b/paludis/util/kc-fwd.hh
new file mode 100644
index 000000000..1fa9cff07
--- /dev/null
+++ b/paludis/util/kc-fwd.hh
@@ -0,0 +1,65 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2008 Ciaran McCreesh
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_UTIL_KC_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_KC_FWD_HH 1
+
+namespace paludis
+{
+ namespace kc
+ {
+ template <typename Key_, typename Type_>
+ struct Field;
+
+ template <unsigned id_>
+ struct NoField;
+
+ template <unsigned id_>
+ struct Key;
+
+ template <bool b_, typename T_>
+ struct NamedField;
+
+ template <typename T_>
+ struct NamedField<false, T_>;
+
+ template <unsigned id_, typename T_>
+ struct NamedField<true, Field<Key<id_>, T_> >;
+
+ template <typename T_>
+ struct Part;
+
+ template <unsigned id_>
+ struct Part<NoField<id_> >;
+
+ template <unsigned id_, typename Type_>
+ struct Part<Field<Key<id_>, Type_> >;
+
+ template <
+ typename T1_ = NoField<1>,
+ typename T2_ = NoField<2>,
+ typename T3_ = NoField<3>,
+ typename T4_ = NoField<4>,
+ typename T5_ = NoField<5>
+ > class KeyedClass;
+
+ }
+}
+
+#endif
diff --git a/paludis/util/kc.hh b/paludis/util/kc.hh
new file mode 100644
index 000000000..ad4f1b074
--- /dev/null
+++ b/paludis/util/kc.hh
@@ -0,0 +1,260 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2008 Ciaran McCreesh
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_UTIL_KC_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_KC_HH 1
+
+#include <paludis/util/kc-fwd.hh>
+
+namespace paludis
+{
+ namespace kc
+ {
+ template <typename Key_, typename Type_>
+ struct Field
+ {
+ typedef Type_ ConstructorType;
+ typedef void DefaultConstructorValueType;
+
+ typedef Key_ NamedKeyFirstParamType;
+ typedef Type_ NamedKeySecondParamType;
+ };
+
+ template <unsigned id_>
+ struct NoField
+ {
+ typedef NoField<id_> ConstructorType;
+ typedef NoField<id_> DefaultConstructorValueType;
+
+ typedef NoField<id_> NamedKeyFirstParamType;
+ typedef NoField<id_> NamedKeySecondParamType;
+ };
+
+ template <unsigned id_>
+ struct Key
+ {
+ };
+
+ template <bool b_, typename T_>
+ struct NamedField;
+
+ template <typename T_>
+ struct NamedField<false, T_>
+ {
+ };
+
+ template <unsigned id_, typename T_>
+ struct NamedField<true, Field<Key<id_>, T_> >
+ {
+ const T_ & value;
+
+ NamedField(const T_ & v) :
+ value(v)
+ {
+ }
+ };
+
+ template <typename T_>
+ struct Part;
+
+ template <unsigned id_>
+ struct Part<NoField<id_> >
+ {
+ public:
+ void operator[] (const NoField<id_> &);
+
+ Part(const NoField<id_> &)
+ {
+ }
+
+ Part(const NamedField<false, NoField<id_> > &)
+ {
+ }
+ };
+
+ template <unsigned id_, typename Type_>
+ class Part<Field<Key<id_>, Type_> >
+ {
+ private:
+ Type_ _value;
+
+ public:
+ Type_ & operator[] (const Key<id_> &)
+ {
+ return _value;
+ }
+
+ const Type_ & operator[] (const Key<id_> &) const
+ {
+ return _value;
+ }
+
+ Part(const Type_ & v) :
+ _value(v)
+ {
+ }
+
+ Part(const NamedField<true, Field<Key<id_>, Type_> > & v) :
+ _value(v.value)
+ {
+ }
+ };
+
+ template <
+ typename T1_,
+ typename T2_,
+ typename T3_,
+ typename T4_,
+ typename T5_
+ > class KeyedClass :
+ public Part<T1_>,
+ public Part<T2_>,
+ public Part<T3_>,
+ public Part<T4_>,
+ public Part<T5_>
+ {
+ public:
+ typedef KeyedClass BaseType;
+
+ KeyedClass
+ (
+ const typename T1_::ConstructorType & v1 = typename T1_::DefaultConstructorValueType(),
+ const typename T2_::ConstructorType & v2 = typename T2_::DefaultConstructorValueType(),
+ const typename T3_::ConstructorType & v3 = typename T3_::DefaultConstructorValueType(),
+ const typename T4_::ConstructorType & v4 = typename T4_::DefaultConstructorValueType(),
+ const typename T5_::ConstructorType & v5 = typename T5_::DefaultConstructorValueType()
+ ) :
+ Part<T1_>(v1),
+ Part<T2_>(v2),
+ Part<T3_>(v3),
+ Part<T4_>(v4),
+ Part<T5_>(v5)
+ {
+ }
+
+ KeyedClass(const KeyedClass & other) :
+ Part<T1_>(other),
+ Part<T2_>(other),
+ Part<T3_>(other),
+ Part<T4_>(other),
+ Part<T5_>(other)
+ {
+ }
+
+ using Part<T1_>::operator[];
+ using Part<T2_>::operator[];
+ using Part<T3_>::operator[];
+ using Part<T4_>::operator[];
+ using Part<T5_>::operator[];
+
+ template <
+ bool b1_,
+ bool b2_,
+ bool b3_,
+ bool b4_,
+ bool b5_
+ >
+ struct Named
+ {
+ NamedField<b1_, T1_> v1;
+ NamedField<b2_, T2_> v2;
+ NamedField<b3_, T3_> v3;
+ NamedField<b4_, T4_> v4;
+ NamedField<b5_, T5_> v5;
+
+ Named()
+ {
+ }
+
+ Named(
+ NamedField<b1_, T1_> p1,
+ NamedField<b2_, T2_> p2,
+ NamedField<b3_, T3_> p3,
+ NamedField<b4_, T4_> p4,
+ NamedField<b5_, T5_> p5
+ ) :
+ v1(p1),
+ v2(p2),
+ v3(p3),
+ v4(p4),
+ v5(p5)
+ {
+ }
+
+ Named<true, b2_, b3_, b4_, b5_> operator() (
+ const typename T1_::NamedKeyFirstParamType &,
+ const typename T1_::NamedKeySecondParamType & v)
+ {
+ return Named<! b1_, b2_, b3_, b4_, b5_>(v, v2, v3, v4, v5);
+ }
+
+ Named<b1_, true, b3_, b4_, b5_> operator() (
+ const typename T2_::NamedKeyFirstParamType &,
+ const typename T2_::NamedKeySecondParamType & v)
+ {
+ return Named<b1_, ! b2_, b3_, b4_, b5_>(v1, v, v3, v4, v5);
+ }
+
+ Named<b1_, b2_, true, b4_, b5_> operator() (
+ const typename T3_::NamedKeyFirstParamType &,
+ const typename T3_::NamedKeySecondParamType & v)
+ {
+ return Named<b1_, b2_, ! b3_, b4_, b5_>(v1, v2, v, v4, v5);
+ }
+
+ Named<b1_, b2_, b3_, true, b5_> operator() (
+ const typename T4_::NamedKeyFirstParamType &,
+ const typename T4_::NamedKeySecondParamType & v)
+ {
+ return Named<b1_, b2_, b3_, ! b4_, b5_>(v1, v2, v3, v, v5);
+ }
+
+ Named<b1_, b2_, b3_, b4_, true> operator() (
+ const typename T5_::NamedKeyFirstParamType &,
+ const typename T5_::NamedKeySecondParamType & v)
+ {
+ return Named<b1_, b2_, b3_, b4_, ! b5_>(v1, v2, v3, v4, v);
+ }
+ };
+
+ static Named<false, false, false, false, false> named_create()
+ {
+ return Named<false, false, false, false, false>();
+ }
+
+ template <
+ bool b1_,
+ bool b2_,
+ bool b3_,
+ bool b4_,
+ bool b5_>
+ KeyedClass(const Named<b1_, b2_, b3_, b4_, b5_> & named) :
+ Part<T1_>(named.v1),
+ Part<T2_>(named.v2),
+ Part<T3_>(named.v3),
+ Part<T4_>(named.v4),
+ Part<T5_>(named.v5)
+ {
+ }
+ };
+
+ }
+}
+
+#endif
diff --git a/paludis/util/keys.hh b/paludis/util/keys.hh
new file mode 100644
index 000000000..4879bb385
--- /dev/null
+++ b/paludis/util/keys.hh
@@ -0,0 +1,43 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2008 Ciaran McCreesh
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_UTIL_KEYS_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_KEYS_HH 1
+
+#include <paludis/util/kc-fwd.hh>
+
+namespace paludis
+{
+ namespace k
+ {
+ typedef kc::Key<1> fetch_unneeded;
+ typedef kc::Key<2> safe_resume;
+ typedef kc::Key<3> no_config_protect;
+ typedef kc::Key<4> debug_build;
+ typedef kc::Key<5> checks;
+ typedef kc::Key<6> destination;
+ typedef kc::Key<7> visible;
+ typedef kc::Key<8> target_file;
+ typedef kc::Key<9> requires_manual_fetching;
+ typedef kc::Key<10> failed_automatic_fetching;
+ typedef kc::Key<11> failed_integrity_checks;
+ }
+}
+
+#endif