aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-02 18:26:13 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-02 18:26:13 +0100
commit7db5cb4a1a07d0d9d857ea39f47ed01ae2fd638c (patch)
tree47c51373f218c7d8cc8ae7be6e0c2548052e1d0b
parentae1d2c5f8cc11ed6579fd45ff034ec2944a86f8c (diff)
downloadpaludis-7db5cb4a1a07d0d9d857ea39f47ed01ae2fd638c.tar.gz
paludis-7db5cb4a1a07d0d9d857ea39f47ed01ae2fd638c.tar.xz
Split up cave resolve options
-rw-r--r--src/clients/cave/cmd_resolve_cmdline.cc44
-rw-r--r--src/clients/cave/cmd_resolve_cmdline.hh64
-rw-r--r--src/clients/cave/cmd_resolve_display_explanations.cc6
-rw-r--r--src/clients/cave/cmd_resolve_dump.cc4
4 files changed, 88 insertions, 30 deletions
diff --git a/src/clients/cave/cmd_resolve_cmdline.cc b/src/clients/cave/cmd_resolve_cmdline.cc
index e5905d6..d67b5d9 100644
--- a/src/clients/cave/cmd_resolve_cmdline.cc
+++ b/src/clients/cave/cmd_resolve_cmdline.cc
@@ -78,12 +78,6 @@ ResolveCommandLineResolutionOptions::ResolveCommandLineResolutionOptions(args::A
// "new"
// ),
- g_explanations(this, "Explanations", "Options requesting the resolver explain a particular decision "
- "that it made"),
- a_explain(&g_explanations, "explain", '\0', "Explain why the resolver made a particular decision. The "
- "argument is a package dependency specification, so --explain dev-libs/boost or --explain qt:3"
- " or even --explain '*/*' (although --dump is a better way of getting highly noisy debug output)."),
-
// g_phase_options(this, "Phase Options", "Options controlling which phases to execute. No sanity checking "
// "is done, allowing you to shoot as many feet off as you desire. Phase names do not have the "
// "src_, pkg_ or builtin_ prefix, so 'init', 'preinst', 'unpack', 'merge', 'strip' etc."),
@@ -170,7 +164,7 @@ ResolveCommandLineResolutionOptions::ResolveCommandLineResolutionOptions(args::A
"Follow build dependencies for installed packages (default if --complete or --everything)", true),
a_ignore_installed_dependencies(&g_dependency_options, "ignore-installed-dependencies", 'd',
"Ignore dependencies (except compiled-against dependencies, which are already taken) "
- "for installed packages. (default if --lazy)", true),
+ "for installed packages. (default if --lazy)", true)
//
// g_suggestion_options(this, "Suggestion Options", "Control whether suggestions are taken. Suggestions that are "
// "already installed are instead treated as hard dependencies."),
@@ -217,6 +211,16 @@ ResolveCommandLineResolutionOptions::ResolveCommandLineResolutionOptions(args::A
// a_create_binaries(&g_destination_options, "create-binaries", '\0', "Create binary packages", true),
// a_install_to_chroot(&g_destination_options, "install-to-chroot", '\0', "Install packages to the environment-configured chroot", true),
// a_install_to_root(&g_destination_options, "install-to-root", '\0', "Install packages to /", true),
+{
+}
+
+ResolveCommandLineDisplayOptions::ResolveCommandLineDisplayOptions(args::ArgsHandler * const h) :
+ ArgsSection(h, "Display Options"),
+ g_explanations(this, "Explanations", "Options requesting the resolver explain a particular decision "
+ "that it made"),
+ a_explain(&g_explanations, "explain", '\0', "Explain why the resolver made a particular decision. The "
+ "argument is a package dependency specification, so --explain dev-libs/boost or --explain qt:3"
+ " or even --explain '*/*' (although --dump is a better way of getting highly noisy debug output)."),
g_dump_options(this, "Dump Options", "Dump the resolver's state to stdout after completion, or when an "
"error occurs. For debugging purposes; produces rather a lot of noise."),
@@ -226,8 +230,32 @@ ResolveCommandLineResolutionOptions::ResolveCommandLineResolutionOptions(args::A
{
}
+ResolveCommandLineExecutionOptions::ResolveCommandLineExecutionOptions(args::ArgsHandler * const h) :
+ ArgsSection(h, "Execution Options")
+{
+}
+
+ResolveCommandLineProgramOptions::ResolveCommandLineProgramOptions(args::ArgsHandler * const h) :
+ ArgsSection(h, "Program Options"),
+ g_program_options(this, "Program Options", "Options controlling which programs are used to carry out "
+ "various tasks. Any replacement to the standard program must provide exactly the same interface. "
+ "In all cases, $CAVE can be used to get the path of the main 'cave' executable."),
+ a_display_resolution_program(&g_program_options, "display-resolution-program", '\0', "The program used to display "
+ "the resolution. Defaults to '$CAVE display-resolution'."),
+ a_execute_resolution_program(&g_program_options, "execute-resolution-program", '\0', "The program used to execute "
+ "the resolution. Defaults to '$CAVE execute-resolution'."),
+ a_perform_program(&g_program_options, "perform-program", '\0', "The program used to perform "
+ "actions. Defaults to '$CAVE perform'."),
+ a_update_world_program(&g_program_options, "update-world-program", '\0', "The program used to perform "
+ "world updates. Defaults to '$CAVE update-world'.")
+{
+}
+
ResolveCommandLine::ResolveCommandLine() :
- resolution_options(this)
+ resolution_options(this),
+ execution_options(this),
+ display_options(this),
+ program_options(this)
{
add_usage_line("[ -x|--execute ] [ -z|--lazy or -c|--complete or -e|--everything ] spec ...");
add_usage_line("[ -x|--execute ] [ -z|--lazy or -c|--complete or -e|--everything ] set");
diff --git a/src/clients/cave/cmd_resolve_cmdline.hh b/src/clients/cave/cmd_resolve_cmdline.hh
index 0752efb..ad5240c 100644
--- a/src/clients/cave/cmd_resolve_cmdline.hh
+++ b/src/clients/cave/cmd_resolve_cmdline.hh
@@ -33,7 +33,6 @@ namespace paludis
// args::ArgsGroup g_execution_options;
// args::SwitchArg a_execute;
- // args::SwitchArg a_preserve_world;
args::ArgsGroup g_convenience_options;
args::SwitchArg a_lazy;
@@ -50,22 +49,6 @@ namespace paludis
// args::SwitchArg a_purge_unused_slots;
// args::SwitchArg a_purge_unused_packages;
- // args::ArgsGroup g_failure_options;
- // args::EnumArg a_continue_on_failure;
-
- // args::ArgsGroup g_display_options;
- // args::EnumArg a_show_option_descriptions;
- // args::EnumArg a_show_descriptions;
-
- args::ArgsGroup g_explanations;
- args::StringSetArg a_explain;
-
- // args::ArgsGroup g_phase_options;
- // args::StringSetArg a_skip_phase;
- // args::StringSetArg a_abort_at_phase;
- // args::StringSetArg a_skip_until_phase;
- // args::EnumArg a_change_phases_for;
-
args::ArgsGroup g_keep_options;
args::EnumArg a_keep_targets;
args::EnumArg a_keep;
@@ -111,11 +94,55 @@ namespace paludis
// args::SwitchArg a_interactive_slots;
// args::SwitchArg a_interactive_decisions;
// args::SwitchArg a_interactive_ordering;
+ };
+
+ struct ResolveCommandLineExecutionOptions :
+ args::ArgsSection
+ {
+ ResolveCommandLineExecutionOptions(args::ArgsHandler * const);
+
+ // args::ArgsGroup g_world_options;
+ // args::SwitchArg a_preserve_world;
+
+ // args::ArgsGroup g_failure_options;
+ // args::EnumArg a_continue_on_failure;
+
+ // args::ArgsGroup g_phase_options;
+ // args::StringSetArg a_skip_phase;
+ // args::StringSetArg a_abort_at_phase;
+ // args::StringSetArg a_skip_until_phase;
+ // args::EnumArg a_change_phases_for;
+
+
+ };
+
+ struct ResolveCommandLineDisplayOptions :
+ args::ArgsSection
+ {
+ ResolveCommandLineDisplayOptions(args::ArgsHandler * const);
+
+ // args::ArgsGroup g_display_options;
+ // args::EnumArg a_show_option_descriptions;
+ // args::EnumArg a_show_descriptions;
+
+ args::ArgsGroup g_explanations;
+ args::StringSetArg a_explain;
args::ArgsGroup g_dump_options;
args::SwitchArg a_dump;
args::SwitchArg a_dump_dependencies;
+ };
+
+ struct ResolveCommandLineProgramOptions :
+ args::ArgsSection
+ {
+ ResolveCommandLineProgramOptions(args::ArgsHandler * const);
+ args::ArgsGroup g_program_options;
+ args::StringArg a_display_resolution_program;
+ args::StringArg a_execute_resolution_program;
+ args::StringArg a_perform_program;
+ args::StringArg a_update_world_program;
};
struct ResolveCommandLine :
@@ -128,6 +155,9 @@ namespace paludis
ResolveCommandLine();
ResolveCommandLineResolutionOptions resolution_options;
+ ResolveCommandLineExecutionOptions execution_options;
+ ResolveCommandLineDisplayOptions display_options;
+ ResolveCommandLineProgramOptions program_options;
};
}
}
diff --git a/src/clients/cave/cmd_resolve_display_explanations.cc b/src/clients/cave/cmd_resolve_display_explanations.cc
index 1fe68cb..7a75a53 100644
--- a/src/clients/cave/cmd_resolve_display_explanations.cc
+++ b/src/clients/cave/cmd_resolve_display_explanations.cc
@@ -70,13 +70,13 @@ cave::display_explanations(
{
Context context("When displaying explanations:");
- if (cmdline.resolution_options.a_explain.begin_args() == cmdline.resolution_options.a_explain.end_args())
+ if (cmdline.display_options.a_explain.begin_args() == cmdline.display_options.a_explain.end_args())
return;
std::cout << "Explaining requested decisions:" << std::endl << std::endl;
- for (args::StringSetArg::ConstIterator i(cmdline.resolution_options.a_explain.begin_args()),
- i_end(cmdline.resolution_options.a_explain.end_args()) ;
+ for (args::StringSetArg::ConstIterator i(cmdline.display_options.a_explain.begin_args()),
+ i_end(cmdline.display_options.a_explain.end_args()) ;
i != i_end ; ++i)
{
bool any(false);
diff --git a/src/clients/cave/cmd_resolve_dump.cc b/src/clients/cave/cmd_resolve_dump.cc
index 951bde2..37d0f91 100644
--- a/src/clients/cave/cmd_resolve_dump.cc
+++ b/src/clients/cave/cmd_resolve_dump.cc
@@ -36,7 +36,7 @@ paludis::cave::dump_if_requested(
{
Context context("When dumping the resolver:");
- if (! cmdline.resolution_options.a_dump.specified())
+ if (! cmdline.display_options.a_dump.specified())
return;
std::cout << "Dumping resolutions by QPN:S:" << std::endl << std::endl;
@@ -47,7 +47,7 @@ paludis::cave::dump_if_requested(
{
std::cout << c->first << std::endl;
std::cout << " = " << *c->second << std::endl;
- if (cmdline.resolution_options.a_dump_dependencies.specified() && c->second->sanitised_dependencies())
+ if (cmdline.display_options.a_dump_dependencies.specified() && c->second->sanitised_dependencies())
for (SanitisedDependencies::ConstIterator d(c->second->sanitised_dependencies()->begin()),
d_end(c->second->sanitised_dependencies()->end()) ;
d != d_end ; ++d)