aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-01 16:46:15 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-01 16:46:15 +0000
commit6a432ad8d444deda7fc65746e8028e21dfde2d1e (patch)
tree7fb0f1556a0a3346b0ea4fe0706f8dce2ea55dc5
parent462b3e40072d94d9af6c30b3862aec7e0f4db398 (diff)
downloadpaludis-6a432ad8d444deda7fc65746e8028e21dfde2d1e.tar.gz
paludis-6a432ad8d444deda7fc65746e8028e21dfde2d1e.tar.xz
Show nice errors for specs in more places
-rw-r--r--src/clients/cave/Makefile.am1
-rw-r--r--src/clients/cave/cmd_config.cc3
-rw-r--r--src/clients/cave/cmd_contents.cc3
-rwxr-xr-xsrc/clients/cave/cmd_display_resolution.cc3
-rw-r--r--src/clients/cave/cmd_info.cc3
-rw-r--r--src/clients/cave/cmd_match.cc3
-rw-r--r--src/clients/cave/cmd_perform.cc5
-rw-r--r--src/clients/cave/cmd_show.cc10
-rw-r--r--src/clients/cave/cmd_uninstall.cc3
-rw-r--r--src/clients/cave/cmd_verify.cc3
-rw-r--r--src/clients/cave/executables_common.cc3
-rw-r--r--src/clients/cave/parse_spec_with_nice_error.cc43
-rw-r--r--src/clients/cave/parse_spec_with_nice_error.hh38
-rw-r--r--src/clients/cave/resolve_common.cc58
-rw-r--r--src/clients/cave/size_common.cc3
15 files changed, 135 insertions, 47 deletions
diff --git a/src/clients/cave/Makefile.am b/src/clients/cave/Makefile.am
index fb03c54..a9dcfc5 100644
--- a/src/clients/cave/Makefile.am
+++ b/src/clients/cave/Makefile.am
@@ -190,6 +190,7 @@ libcave_a_SOURCES = \
search_extras_handle.cc search_extras_handle.hh \
select_format_for_spec.cc select_format_for_spec.hh \
owner_common.cc owner_common.hh \
+ parse_spec_with_nice_error.cc parse_spec_with_nice_error.hh \
resolve_cmdline.cc resolve_cmdline.hh \
resolve_common.cc resolve_common.hh \
resume_data.cc resume_data.hh \
diff --git a/src/clients/cave/cmd_config.cc b/src/clients/cave/cmd_config.cc
index 7f19c59..336e778 100644
--- a/src/clients/cave/cmd_config.cc
+++ b/src/clients/cave/cmd_config.cc
@@ -19,6 +19,7 @@
#include "cmd_config.hh"
#include "exceptions.hh"
+#include "parse_spec_with_nice_error.hh"
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -94,7 +95,7 @@ ConfigCommand::run(
if (1 != std::distance(cmdline.begin_parameters(), cmdline.end_parameters()))
throw args::DoHelp("config takes exactly one parameter");
- PackageDepSpec spec(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(), { }));
+ PackageDepSpec spec(parse_spec_with_nice_error(*cmdline.begin_parameters(), env.get(), { }, filter::SupportsAction<ConfigAction>()));
const std::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsUnsorted(
generator::Matches(spec, make_null_shared_ptr(), { }) | filter::SupportsAction<ConfigAction>())]);
if (ids->empty())
diff --git a/src/clients/cave/cmd_contents.cc b/src/clients/cave/cmd_contents.cc
index 7eb9ec8..8f1d937 100644
--- a/src/clients/cave/cmd_contents.cc
+++ b/src/clients/cave/cmd_contents.cc
@@ -43,6 +43,7 @@
#include <set>
#include "command_command_line.hh"
+#include "parse_spec_with_nice_error.hh"
using namespace paludis;
using namespace cave;
@@ -126,7 +127,7 @@ ContentsCommand::run(
if (1 != std::distance(cmdline.begin_parameters(), cmdline.end_parameters()))
throw args::DoHelp("contents takes exactly one parameter");
- PackageDepSpec spec(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(),
+ PackageDepSpec spec(parse_spec_with_nice_error(*cmdline.begin_parameters(), env.get(),
{ }, filter::InstalledAtRoot(env->preferred_root_key()->value())));
std::shared_ptr<const PackageIDSequence> entries(
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 1a39837..b5a60f5 100755
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -24,6 +24,7 @@
#include "colours.hh"
#include "colour_pretty_printer.hh"
#include "format_user_config.hh"
+#include "parse_spec_with_nice_error.hh"
#include <paludis/args/do_help.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/system.hh>
@@ -488,7 +489,7 @@ namespace
i != i_end ; ++i)
{
bool any(false);
- PackageDepSpec spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ PackageDepSpec spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
for (ResolutionsByResolvent::ConstIterator r(resolved->resolutions_by_resolvent()->begin()),
r_end(resolved->resolutions_by_resolvent()->end()) ;
r != r_end ; ++r)
diff --git a/src/clients/cave/cmd_info.cc b/src/clients/cave/cmd_info.cc
index 24056a1..09261bd 100644
--- a/src/clients/cave/cmd_info.cc
+++ b/src/clients/cave/cmd_info.cc
@@ -23,6 +23,7 @@
#include "colours.hh"
#include "exceptions.hh"
#include "format_user_config.hh"
+#include "parse_spec_with_nice_error.hh"
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
@@ -373,7 +374,7 @@ namespace
const std::shared_ptr<Environment> & env,
const std::string & param)
{
- PackageDepSpec spec(parse_user_package_dep_spec(param, env.get(), { }));
+ PackageDepSpec spec(parse_spec_with_nice_error(param, env.get(), { }, filter::All()));
const std::shared_ptr<const PackageIDSequence> installed_ids((*env)[selection::AllVersionsSorted(generator::Matches(
spec, make_null_shared_ptr(), { }) | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
diff --git a/src/clients/cave/cmd_match.cc b/src/clients/cave/cmd_match.cc
index dfe5b01..18b18fc 100644
--- a/src/clients/cave/cmd_match.cc
+++ b/src/clients/cave/cmd_match.cc
@@ -18,6 +18,7 @@
*/
#include "cmd_match.hh"
+#include "parse_spec_with_nice_error.hh"
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
#include <paludis/name.hh>
@@ -394,7 +395,7 @@ MatchCommand::run(
if (capped_distance(cmdline.begin_parameters(), cmdline.end_parameters(), 2) < 2)
throw args::DoHelp("match requires at least two parameters");
- PackageDepSpec spec(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(), { }));
+ PackageDepSpec spec(parse_spec_with_nice_error(*cmdline.begin_parameters(), env.get(), { }, filter::All()));
const std::shared_ptr<Set<std::string> > patterns(std::make_shared<Set<std::string>>());
std::copy(next(cmdline.begin_parameters()), cmdline.end_parameters(), patterns->inserter());
diff --git a/src/clients/cave/cmd_perform.cc b/src/clients/cave/cmd_perform.cc
index a4edf18..fce13cb 100644
--- a/src/clients/cave/cmd_perform.cc
+++ b/src/clients/cave/cmd_perform.cc
@@ -21,6 +21,7 @@
#include "resolve_cmdline.hh"
#include "exceptions.hh"
#include "format_user_config.hh"
+#include "parse_spec_with_nice_error.hh"
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
#include <paludis/name.hh>
@@ -412,7 +413,7 @@ PerformCommand::run(
std::string action(*cmdline.begin_parameters());
const auto spec_str(*next(cmdline.begin_parameters()));
- const auto spec(parse_user_package_dep_spec(spec_str, env.get(), { }));
+ const auto spec(parse_spec_with_nice_error(spec_str, env.get(), { }, filter::All()));
const auto ids((*env)[selection::AllVersionsUnsorted(generator::Matches(spec, make_null_shared_ptr(), { }))]);
if (ids->empty())
nothing_matching_error(env.get(), spec_str, filter::All());
@@ -432,7 +433,7 @@ PerformCommand::run(
p_end(cmdline.a_replacing.end_args()) ;
p != p_end ; ++p)
{
- PackageDepSpec rspec(parse_user_package_dep_spec(*p, env.get(), { }));
+ PackageDepSpec rspec(parse_spec_with_nice_error(*p, env.get(), { }, filter::All()));
const std::shared_ptr<const PackageIDSequence> rids((*env)[selection::AllVersionsUnsorted(generator::Matches(rspec, make_null_shared_ptr(), { }))]);
if (rids->empty())
nothing_matching_error(env.get(), *p, filter::All());
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index 8b6b07f..99b7137 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -23,6 +23,8 @@
#include "exceptions.hh"
#include "select_format_for_spec.hh"
#include "format_user_config.hh"
+#include "parse_spec_with_nice_error.hh"
+
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
#include <paludis/name.hh>
@@ -1386,16 +1388,14 @@ ShowCommand::run(
else if (cmdline.a_type.argument() == "repository")
do_one_repository(cmdline, env, RepositoryName(*p));
else if (cmdline.a_type.argument() == "wildcard")
- do_one_wildcard(env, parse_user_package_dep_spec(
- *p, env.get(), { updso_allow_wildcards }));
+ do_one_wildcard(env, parse_spec_with_nice_error(*p, env.get(), { updso_allow_wildcards }, filter::All()));
else if (cmdline.a_type.argument() == "package")
- do_all_packages(cmdline, env, parse_user_package_dep_spec(
- *p, env.get(), { updso_allow_wildcards }));
+ do_all_packages(cmdline, env, parse_spec_with_nice_error(*p, env.get(), { updso_allow_wildcards }, filter::All()));
else if (cmdline.a_type.argument() == "auto")
{
try
{
- PackageDepSpec spec(parse_user_package_dep_spec(*p, env.get(), { updso_throw_if_set, updso_allow_wildcards }));
+ PackageDepSpec spec(parse_spec_with_nice_error(*p, env.get(), { updso_throw_if_set, updso_allow_wildcards }, filter::All()));
if ((! spec.package_ptr()))
do_one_wildcard(env, spec);
else
diff --git a/src/clients/cave/cmd_uninstall.cc b/src/clients/cave/cmd_uninstall.cc
index 5f5798e..b6a52db 100644
--- a/src/clients/cave/cmd_uninstall.cc
+++ b/src/clients/cave/cmd_uninstall.cc
@@ -21,6 +21,7 @@
#include "resolve_cmdline.hh"
#include "resolve_common.hh"
#include "exceptions.hh"
+#include "parse_spec_with_nice_error.hh"
#include <paludis/util/stringify.hh>
#include <paludis/util/indirect_iterator-impl.hh>
@@ -140,7 +141,7 @@ UninstallCommand::run(
for (UninstallCommandLine::ParametersConstIterator p(cmdline.begin_parameters()), p_end(cmdline.end_parameters()) ;
p != p_end ; ++p)
{
- PackageDepSpec spec(parse_user_package_dep_spec(*p, env.get(), { updso_allow_wildcards }));
+ PackageDepSpec spec(parse_spec_with_nice_error(*p, env.get(), { updso_allow_wildcards }, filter::All()));
const std::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsSorted(
generator::Matches(spec, make_null_shared_ptr(), { }) | filter::SupportsAction<UninstallAction>())]);
if (ids->empty())
diff --git a/src/clients/cave/cmd_verify.cc b/src/clients/cave/cmd_verify.cc
index 624ee8e..87d013f 100644
--- a/src/clients/cave/cmd_verify.cc
+++ b/src/clients/cave/cmd_verify.cc
@@ -21,6 +21,7 @@
#include "format_user_config.hh"
#include "colours.hh"
#include "exceptions.hh"
+#include "parse_spec_with_nice_error.hh"
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
@@ -210,7 +211,7 @@ VerifyCommand::run(
if (1 != std::distance(cmdline.begin_parameters(), cmdline.end_parameters()))
throw args::DoHelp("verify takes exactly one parameter");
- PackageDepSpec spec(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(),
+ PackageDepSpec spec(parse_spec_with_nice_error(*cmdline.begin_parameters(), env.get(),
{ updso_allow_wildcards }, filter::InstalledAtRoot(env->preferred_root_key()->value())));
std::shared_ptr<const PackageIDSequence> entries(
diff --git a/src/clients/cave/executables_common.cc b/src/clients/cave/executables_common.cc
index 73dd041..4dc507a 100644
--- a/src/clients/cave/executables_common.cc
+++ b/src/clients/cave/executables_common.cc
@@ -20,6 +20,7 @@
#include "executables_common.hh"
#include "exceptions.hh"
+#include "parse_spec_with_nice_error.hh"
#include <paludis/contents.hh>
#include <paludis/environment.hh>
#include <paludis/filter.hh>
@@ -112,7 +113,7 @@ paludis::cave::executables_common(
const bool all,
const bool best)
{
- PackageDepSpec spec(parse_user_package_dep_spec(param, env.get(), { updso_allow_wildcards },
+ PackageDepSpec spec(parse_spec_with_nice_error(param, env.get(), { updso_allow_wildcards },
filter::InstalledAtRoot(env->preferred_root_key()->value())));
std::shared_ptr<const PackageIDSequence> entries(
diff --git a/src/clients/cave/parse_spec_with_nice_error.cc b/src/clients/cave/parse_spec_with_nice_error.cc
new file mode 100644
index 0000000..22f1b90
--- /dev/null
+++ b/src/clients/cave/parse_spec_with_nice_error.cc
@@ -0,0 +1,43 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2011 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
+ */
+
+#include "parse_spec_with_nice_error.hh"
+#include "exceptions.hh"
+#include <paludis/package_database.hh>
+
+using namespace paludis;
+using namespace cave;
+
+PackageDepSpec
+paludis::cave::parse_spec_with_nice_error(
+ const std::string & s,
+ const Environment * const env,
+ const UserPackageDepSpecOptions & o,
+ const Filter & f)
+{
+ try
+ {
+ return parse_user_package_dep_spec(s, env, o, f);
+ }
+ catch (const NoSuchPackageError &)
+ {
+ nothing_matching_error(env, s, f);
+ }
+}
+
diff --git a/src/clients/cave/parse_spec_with_nice_error.hh b/src/clients/cave/parse_spec_with_nice_error.hh
new file mode 100644
index 0000000..607c69c
--- /dev/null
+++ b/src/clients/cave/parse_spec_with_nice_error.hh
@@ -0,0 +1,38 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2011 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_SRC_CLIENTS_CAVE_PARSE_SPEC_WITH_NICE_ERROR_HH
+#define PALUDIS_GUARD_SRC_CLIENTS_CAVE_PARSE_SPEC_WITH_NICE_ERROR_HH 1
+
+#include <paludis/user_dep_spec.hh>
+
+namespace paludis
+{
+ namespace cave
+ {
+ PackageDepSpec parse_spec_with_nice_error(
+ const std::string &,
+ const Environment * const,
+ const UserPackageDepSpecOptions &,
+ const Filter &) PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ }
+}
+
+#endif
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index 210ab43..37257b3 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -25,6 +25,7 @@
#include "cmd_graph_jobs.hh"
#include "exceptions.hh"
#include "command_command_line.hh"
+#include "parse_spec_with_nice_error.hh"
#include <paludis/util/mutex.hh>
#include <paludis/util/stringify.hh>
@@ -145,15 +146,14 @@ namespace
{
p_suggesion.erase(0, 1);
seen_packages = true;
- PackageDepSpec s(parse_user_package_dep_spec(p->first.substr(1), env.get(), { }));
+ PackageDepSpec s(parse_spec_with_nice_error(p->first.substr(1), env.get(), { }, filter::All()));
BlockDepSpec bs("!" + stringify(s), s, bk_weak);
result->push_back(stringify(bs));
resolver->add_target(bs, p->second);
}
else
{
- PackageDepSpec s(parse_user_package_dep_spec(p->first, env.get(),
- { updso_throw_if_set }));
+ PackageDepSpec s(parse_spec_with_nice_error(p->first, env.get(), { updso_throw_if_set }, filter::All()));
result->push_back(stringify(s));
resolver->add_target(s, p->second);
seen_packages = true;
@@ -168,10 +168,6 @@ namespace
result->push_back(p->first);
seen_sets = true;
}
- catch (const NoSuchPackageError &)
- {
- nothing_matching_error(env.get(), p_suggesion, filter::All());
- }
}
if (seen_sets + seen_packages > 1)
@@ -725,36 +721,36 @@ paludis::cave::resolve_common(
for (args::StringSetArg::ConstIterator i(resolution_options.a_permit_uninstall.begin_args()),
i_end(resolution_options.a_permit_uninstall.end_args()) ;
i != i_end ; ++i)
- allowed_to_remove_helper.add_allowed_to_remove_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ allowed_to_remove_helper.add_allowed_to_remove_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
AlwaysViaBinaryHelper always_via_binary_helper(env.get());
for (args::StringSetArg::ConstIterator i(resolution_options.a_via_binary.begin_args()),
i_end(resolution_options.a_via_binary.end_args()) ;
i != i_end ; ++i)
- always_via_binary_helper.add_always_via_binary_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ always_via_binary_helper.add_always_via_binary_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
CanUseHelper can_use_helper(env.get());
for (args::StringSetArg::ConstIterator i(resolution_options.a_not_usable.begin_args()),
i_end(resolution_options.a_not_usable.end_args()) ;
i != i_end ; ++i)
- can_use_helper.add_cannot_use_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ can_use_helper.add_cannot_use_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
ConfirmHelper confirm_helper(env.get());
for (args::StringSetArg::ConstIterator i(resolution_options.a_permit_downgrade.begin_args()),
i_end(resolution_options.a_permit_downgrade.end_args()) ;
i != i_end ; ++i)
- confirm_helper.add_permit_downgrade_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ confirm_helper.add_permit_downgrade_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
for (args::StringSetArg::ConstIterator i(resolution_options.a_permit_old_version.begin_args()),
i_end(resolution_options.a_permit_old_version.end_args()) ;
i != i_end ; ++i)
- confirm_helper.add_permit_old_version_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ confirm_helper.add_permit_old_version_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
for (args::StringSetArg::ConstIterator i(resolution_options.a_uninstalls_may_break.begin_args()),
i_end(resolution_options.a_uninstalls_may_break.end_args()) ;
i != i_end ; ++i)
if (*i == "system")
confirm_helper.set_allowed_to_break_system(true);
else
- confirm_helper.add_allowed_to_break_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ confirm_helper.add_allowed_to_break_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
FindReplacingHelper find_replacing_helper(env.get());
find_replacing_helper.set_one_binary_per_slot(resolution_options.a_one_binary_per_slot.specified());
@@ -766,13 +762,13 @@ paludis::cave::resolve_common(
i_end(resolution_options.a_less_restrictive_remove_blockers.end_args()) ;
i != i_end ; ++i)
get_constraints_for_dependent_helper.add_less_restrictive_remove_blockers_spec(
- parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
GetConstraintsForPurgeHelper get_constraints_for_purge_helper(env.get());
for (args::StringSetArg::ConstIterator i(resolution_options.a_purge.begin_args()),
i_end(resolution_options.a_purge.end_args()) ;
i != i_end ; ++i)
- get_constraints_for_purge_helper.add_purge_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ get_constraints_for_purge_helper.add_purge_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
GetConstraintsForViaBinaryHelper get_constraints_for_via_binary_helper(env.get());
@@ -786,12 +782,12 @@ paludis::cave::resolve_common(
for (args::StringSetArg::ConstIterator i(resolution_options.a_without.begin_args()),
i_end(resolution_options.a_without.end_args()) ;
i != i_end ; ++i)
- get_initial_constraints_for_helper.add_without_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ get_initial_constraints_for_helper.add_without_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
for (args::StringSetArg::ConstIterator i(resolution_options.a_preset.begin_args()),
i_end(resolution_options.a_preset.end_args()) ;
i != i_end ; ++i)
- get_initial_constraints_for_helper.add_preset_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }), make_null_shared_ptr());
+ get_initial_constraints_for_helper.add_preset_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()), make_null_shared_ptr());
get_initial_constraints_for_helper.set_reinstall_scm_days(reinstall_scm_days(resolution_options));
@@ -882,12 +878,12 @@ paludis::cave::resolve_common(
for (args::StringSetArg::ConstIterator i(resolution_options.a_without.begin_args()),
i_end(resolution_options.a_without.end_args()) ;
i != i_end ; ++i)
- get_use_existing_nothing_helper.add_without_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ get_use_existing_nothing_helper.add_without_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
for (args::StringSetArg::ConstIterator i(resolution_options.a_with.begin_args()),
i_end(resolution_options.a_with.end_args()) ;
i != i_end ; ++i)
- get_use_existing_nothing_helper.add_with_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ get_use_existing_nothing_helper.add_with_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
get_use_existing_nothing_helper.set_use_existing_for_dependencies(use_existing_from_arg(resolution_options.a_keep, false));
get_use_existing_nothing_helper.set_use_existing_for_targets(use_existing_from_arg(resolution_options.a_keep_targets, false));
@@ -906,12 +902,12 @@ paludis::cave::resolve_common(
for (args::StringSetArg::ConstIterator i(resolution_options.a_early.begin_args()),
i_end(resolution_options.a_early.end_args()) ;
i != i_end ; ++i)
- order_early_helper.add_early_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ order_early_helper.add_early_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
for (args::StringSetArg::ConstIterator i(resolution_options.a_late.begin_args()),
i_end(resolution_options.a_late.end_args()) ;
i != i_end ; ++i)
- order_early_helper.add_late_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ order_early_helper.add_late_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
PreferOrAvoidHelper prefer_or_avoid_helper(env.get());
for (args::StringSetArg::ConstIterator i(resolution_options.a_favour.begin_args()),
@@ -927,7 +923,7 @@ paludis::cave::resolve_common(
for (args::StringSetArg::ConstIterator i(resolution_options.a_remove_if_dependent.begin_args()),
i_end(resolution_options.a_remove_if_dependent.end_args()) ;
i != i_end ; ++i)
- remove_if_dependent_helper.add_remove_if_dependent_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ remove_if_dependent_helper.add_remove_if_dependent_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
InterestInSpecHelper interest_in_spec_helper(env.get());
for (args::StringSetArg::ConstIterator i(resolution_options.a_take.begin_args()),
@@ -944,20 +940,20 @@ paludis::cave::resolve_common(
interest_in_spec_helper.add_take_group(*i);
try
{
- interest_in_spec_helper.add_take_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ interest_in_spec_helper.add_take_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
}
catch (const Exception &)
{
}
}
else
- interest_in_spec_helper.add_take_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ interest_in_spec_helper.add_take_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
}
for (args::StringSetArg::ConstIterator i(resolution_options.a_take_from.begin_args()),
i_end(resolution_options.a_take_from.end_args()) ;
i != i_end ; ++i)
- interest_in_spec_helper.add_take_from_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ interest_in_spec_helper.add_take_from_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
for (args::StringSetArg::ConstIterator i(resolution_options.a_ignore.begin_args()),
i_end(resolution_options.a_ignore.end_args()) ;
@@ -973,30 +969,30 @@ paludis::cave::resolve_common(
interest_in_spec_helper.add_ignore_group(*i);
try
{
- interest_in_spec_helper.add_ignore_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ interest_in_spec_helper.add_ignore_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
}
catch (const Exception &)
{
}
}
else
- interest_in_spec_helper.add_ignore_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ interest_in_spec_helper.add_ignore_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
}
for (args::StringSetArg::ConstIterator i(resolution_options.a_ignore_from.begin_args()),
i_end(resolution_options.a_ignore_from.end_args()) ;
i != i_end ; ++i)
- interest_in_spec_helper.add_ignore_from_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ interest_in_spec_helper.add_ignore_from_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
for (args::StringSetArg::ConstIterator i(resolution_options.a_no_dependencies_from.begin_args()),
i_end(resolution_options.a_no_dependencies_from.end_args()) ;
i != i_end ; ++i)
- interest_in_spec_helper.add_no_dependencies_from_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ interest_in_spec_helper.add_no_dependencies_from_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
for (args::StringSetArg::ConstIterator i(resolution_options.a_no_blockers_from.begin_args()),
i_end(resolution_options.a_no_blockers_from.end_args()) ;
i != i_end ; ++i)
- interest_in_spec_helper.add_no_blockers_from_spec(parse_user_package_dep_spec(*i, env.get(), { updso_allow_wildcards }));
+ interest_in_spec_helper.add_no_blockers_from_spec(parse_spec_with_nice_error(*i, env.get(), { updso_allow_wildcards }, filter::All()));
interest_in_spec_helper.set_follow_installed_dependencies(! resolution_options.a_no_follow_installed_dependencies.specified());
interest_in_spec_helper.set_follow_installed_build_dependencies(resolution_options.a_follow_installed_build_dependencies.specified());
@@ -1078,7 +1074,7 @@ paludis::cave::resolve_common(
t != t_end ; ++t)
if ('!' != t->at(0) && std::string::npos != t->find('/'))
{
- PackageDepSpec ts(parse_user_package_dep_spec(*t, env.get(), { }));
+ PackageDepSpec ts(parse_spec_with_nice_error(*t, env.get(), { }, filter::All()));
if (ts.version_requirements_ptr() && ! ts.version_requirements_ptr()->empty())
{
confirm_helper.add_permit_downgrade_spec(ts);
diff --git a/src/clients/cave/size_common.cc b/src/clients/cave/size_common.cc
index 8bcace5..22a095d 100644
--- a/src/clients/cave/size_common.cc
+++ b/src/clients/cave/size_common.cc
@@ -19,6 +19,7 @@
#include "size_common.hh"
#include "exceptions.hh"
+#include "parse_spec_with_nice_error.hh"
#include <paludis/action.hh>
#include <paludis/contents.hh>
#include <paludis/environment.hh>
@@ -93,7 +94,7 @@ paludis::cave::size_common(
const bool all,
const bool best)
{
- PackageDepSpec spec(parse_user_package_dep_spec(q, env.get(), { }));
+ PackageDepSpec spec(parse_spec_with_nice_error(q, env.get(), { }, filter::All()));
std::shared_ptr<const PackageIDSequence> entries((*env)[selection::AllVersionsSorted(generator::Matches(spec, make_null_shared_ptr(), { }) |
filter::InstalledAtRoot(env->preferred_root_key()->value()))]);