aboutsummaryrefslogtreecommitdiff
path: root/src/clients/cave
diff options
context:
space:
mode:
Diffstat (limited to 'src/clients/cave')
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc32
-rw-r--r--src/clients/cave/resolve_common.cc10
2 files changed, 24 insertions, 18 deletions
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index 4e14b80bc..e1bdc14b4 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -79,6 +79,7 @@
#include <paludis/filtered_generator.hh>
#include <paludis/filter.hh>
#include <paludis/package_database.hh>
+#include <paludis/elike_blocker.hh>
#include <set>
#include <iterator>
@@ -658,23 +659,26 @@ namespace
a_end(cmdline.a_world_specs.end_args()) ;
a != a_end ; ++a)
{
- std::string aa(*a);
- if (aa.empty())
- continue;
-
- if ('!' == aa.at(0))
- {
- if (! removes)
- continue;
- aa.erase(0, 1);
- }
- else
+ auto p(split_elike_blocker(*a));
+ switch (std::get<0>(p))
{
- if (removes)
- continue;
+ case ebk_no_block:
+ if (removes)
+ continue;
+ break;
+
+ case ebk_single_bang:
+ case ebk_bang_question:
+ case ebk_double_bang:
+ if (! removes)
+ continue;
+ break;
+
+ case last_ebk:
+ throw InternalError(PALUDIS_HERE, "unhandled ebk");
}
- PackageDepSpec spec(parse_user_package_dep_spec(aa, env.get(), { updso_no_disambiguation }));
+ PackageDepSpec spec(parse_user_package_dep_spec(std::get<2>(p), env.get(), { updso_no_disambiguation }));
if (package_dep_spec_has_properties(spec, make_named_values<PackageDepSpecProperties>(
n::has_additional_requirements() = false,
n::has_category_name_part() = false,
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index df6193dd4..98d193ce5 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -106,6 +106,7 @@
#include <paludis/filter.hh>
#include <paludis/generator.hh>
#include <paludis/selection.hh>
+#include <paludis/elike_blocker.hh>
#include <algorithm>
#include <iostream>
@@ -147,19 +148,20 @@ namespace
std::string p_suggesion(p->first);
try
{
+ auto b(split_elike_blocker(p->first));
- if ('!' == p->first.at(0))
+ if (ebk_no_block != std::get<0>(b))
{
- p_suggesion.erase(0, 1);
+ p_suggesion = std::get<2>(b);
seen_packages = true;
- PackageDepSpec s(parse_spec_with_nice_error(p->first.substr(1), env.get(), { }, filter::All()));
+ PackageDepSpec s(parse_spec_with_nice_error(std::get<2>(b), env.get(), { }, filter::All()));
BlockDepSpec bs(make_uninstall_blocker(s));
result->push_back(stringify(bs));
resolver->add_target(bs, p->second);
}
else
{
- PackageDepSpec s(parse_spec_with_nice_error(p->first, env.get(), { updso_throw_if_set }, filter::All()));
+ PackageDepSpec s(parse_spec_with_nice_error(std::get<2>(b), env.get(), { updso_throw_if_set }, filter::All()));
result->push_back(stringify(s));
resolver->add_target(s, p->second);
seen_packages = true;