aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/clients/cave/cmd_fix_linkage.cc7
-rw-r--r--src/clients/cave/cmd_print_spec.cc33
-rw-r--r--src/clients/cave/cmd_report.cc6
-rw-r--r--src/clients/cave/resolve_common.cc2
4 files changed, 23 insertions, 25 deletions
diff --git a/src/clients/cave/cmd_fix_linkage.cc b/src/clients/cave/cmd_fix_linkage.cc
index a99f227c5..c12fcf05a 100644
--- a/src/clients/cave/cmd_fix_linkage.cc
+++ b/src/clients/cave/cmd_fix_linkage.cc
@@ -28,6 +28,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/create_iterator-impl.hh>
+
#include <paludis/broken_linkage_finder.hh>
#include <paludis/package_id.hh>
#include <paludis/name.hh>
@@ -36,8 +37,8 @@
#include <paludis/metadata_key.hh>
#include <paludis/notifier_callback.hh>
#include <paludis/version_operator.hh>
-#include <paludis/version_requirements.hh>
#include <paludis/partially_made_package_dep_spec.hh>
+#include <paludis/version_spec.hh>
#include <iostream>
#include <set>
@@ -213,9 +214,7 @@ FixLinkageCommand::run(
part_spec.exact_slot_constraint((*pkg_it)->slot_key()->value(), false);
if (cmdline.a_exact.specified())
- part_spec.version_requirement(make_named_values<VersionRequirement>(
- n::version_operator() = vo_equal,
- n::version_spec() = (*pkg_it)->version()));
+ part_spec.version_constraint((*pkg_it)->version(), vo_equal, vcc_and);
targets->push_back(std::make_pair(stringify(PackageDepSpec(part_spec)), join(broken_files.begin(), broken_files.end(), ", ")));
}
diff --git a/src/clients/cave/cmd_print_spec.cc b/src/clients/cave/cmd_print_spec.cc
index a967aec0a..6380a9ded 100644
--- a/src/clients/cave/cmd_print_spec.cc
+++ b/src/clients/cave/cmd_print_spec.cc
@@ -20,8 +20,10 @@
#include "cmd_print_spec.hh"
#include "exceptions.hh"
#include "format_string.hh"
+
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
+
#include <paludis/util/visitor_cast.hh>
#include <paludis/util/set.hh>
#include <paludis/util/iterator_funcs.hh>
@@ -32,6 +34,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/join.hh>
#include <paludis/util/make_named_values.hh>
+
#include <paludis/environment.hh>
#include <paludis/metadata_key.hh>
#include <paludis/user_dep_spec.hh>
@@ -39,7 +42,8 @@
#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/version_operator.hh>
-#include <paludis/version_requirements.hh>
+#include <paludis/version_spec.hh>
+
#include <iostream>
#include <algorithm>
@@ -218,6 +222,17 @@ namespace
s.category_name_part(CategoryNamePart(cmdline.a_category_part.argument()));
}
+ VersionConstraintCombiner vcc(vcc_and);
+ if (cmdline.a_version_requirements_mode.specified())
+ {
+ if (cmdline.a_version_requirements_mode.argument() == "and")
+ vcc = vcc_and;
+ else if (cmdline.a_version_requirements_mode.argument() == "or")
+ vcc = vcc_or;
+ else
+ throw args::DoHelp("Argument for --" + cmdline.a_version_requirements_mode.long_name() + " unrecognised");
+ }
+
if (cmdline.a_version_requirement.specified())
{
s.clear_version_requirements();
@@ -232,24 +247,10 @@ namespace
throw args::DoHelp("--" + cmdline.a_version_requirement.long_name() + " arguments should be in the form =1.23");
std::string op(a->substr(0, p)), ver(a->substr(p));
-
- s.version_requirement(make_named_values<VersionRequirement>(
- n::version_operator() = VersionOperator(op),
- n::version_spec() = VersionSpec(ver, {})
- ));
+ s.version_constraint(VersionSpec(ver, {}), VersionOperator(op), vcc);
}
}
- if (cmdline.a_version_requirements_mode.specified())
- {
- if (cmdline.a_version_requirements_mode.argument() == "and")
- s.version_requirements_mode(vr_and);
- else if (cmdline.a_version_requirements_mode.argument() == "or")
- s.version_requirements_mode(vr_or);
- else
- throw args::DoHelp("Argument for --" + cmdline.a_version_requirements_mode.long_name() + " unrecognised");
- }
-
if (cmdline.a_additional_requirement.specified())
{
s.clear_additional_requirements();
diff --git a/src/clients/cave/cmd_report.cc b/src/clients/cave/cmd_report.cc
index 4aefa3a7d..ff6e639ed 100644
--- a/src/clients/cave/cmd_report.cc
+++ b/src/clients/cave/cmd_report.cc
@@ -38,8 +38,8 @@
#include <paludis/mask.hh>
#include <paludis/match_package.hh>
#include <paludis/partially_made_package_dep_spec.hh>
-#include <paludis/version_requirements.hh>
#include <paludis/action.hh>
+#include <paludis/version_operator.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -108,9 +108,7 @@ namespace
generator::InRepository(RepositoryName(*r)) &
generator::Matches(make_package_dep_spec({ })
.package(id->name())
- .version_requirement(make_named_values<VersionRequirement>(
- n::version_operator() = vo_equal,
- n::version_spec() = id->version())),
+ .version_constraint(id->version(), vo_equal, vcc_and),
make_null_shared_ptr(), { })) |
filter::SupportsAction<InstallAction>())]);
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index cfb68dc1e..cad509ba4 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -1118,7 +1118,7 @@ paludis::cave::resolve_common(
if ('!' != t->at(0) && std::string::npos != t->find('/'))
{
PackageDepSpec ts(parse_spec_with_nice_error(*t, env.get(), { }, filter::All()));
- if (ts.version_requirements_ptr() && ! ts.version_requirements_ptr()->empty())
+ if (ts.all_version_constraints() && ! ts.all_version_constraints()->empty())
{
confirm_helper.add_permit_downgrade_spec(ts);
confirm_helper.add_permit_old_version_spec(ts);