aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-02-05 16:20:21 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-02-05 16:20:21 +0000
commit828d9e3fd5a0874b87227243466cbf2b14d4dfa9 (patch)
tree809bd853f2d0fedaf911ec21129fcab354ba6e73
parent09cebe09216574e86921087212ee8c355d79f8a9 (diff)
downloadpaludis-828d9e3fd5a0874b87227243466cbf2b14d4dfa9.tar.gz
paludis-828d9e3fd5a0874b87227243466cbf2b14d4dfa9.tar.xz
execute-resolution --block
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index 8b3e160..8398707 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -89,6 +89,7 @@ namespace
args::ArgsGroup g_general_options;
args::SwitchArg a_pretend;
args::SwitchArg a_set;
+ args::SwitchArg a_block;
ResolveCommandLineExecutionOptions execution_options;
ResolveCommandLineProgramOptions program_options;
@@ -98,6 +99,7 @@ namespace
g_general_options(main_options_section(), "General Options", "General options."),
a_pretend(&g_general_options, "pretend", '\0', "Only carry out the pretend action", false),
a_set(&g_general_options, "set", '\0', "Our target is a set rather than package specs", false),
+ a_block(&g_general_options, "block", '\0', "Our target contains block rather than package specs", false),
execution_options(this),
program_options(this),
import_options(this)
@@ -639,11 +641,21 @@ namespace
}
else
{
+ if (cmdline.a_block.specified())
+ command.append(" --remove");
+
for (args::ArgsHandler::ParametersConstIterator a(cmdline.begin_parameters()),
a_end(cmdline.end_parameters()) ;
a != a_end ; ++a)
{
- PackageDepSpec spec(parse_user_package_dep_spec(*a, env.get(), UserPackageDepSpecOptions()));
+ std::string aa(*a);
+ if (aa.empty())
+ continue;
+
+ if (cmdline.a_block.specified())
+ aa.erase(0, 1);
+
+ PackageDepSpec spec(parse_user_package_dep_spec(aa, env.get(), UserPackageDepSpecOptions()));
if (package_dep_spec_has_properties(spec, make_named_values<PackageDepSpecProperties>(
value_for<n::has_additional_requirements>(false),
value_for<n::has_category_name_part>(false),
@@ -660,12 +672,18 @@ namespace
)))
{
any = true;
- cout << "* Adding '" << spec << "'" << endl;
+ if (cmdline.a_block.specified())
+ cout << "* Removing '" << spec << "'" << endl;
+ else
+ cout << "* Adding '" << spec << "'" << endl;
command.append(" " + stringify(spec));
}
else
{
- cout << "* Not adding '" << spec << "'" << endl;
+ if (cmdline.a_block.specified())
+ cout << "* Not removing '" << spec << "'" << endl;
+ else
+ cout << "* Not adding '" << spec << "'" << endl;
}
}
}