aboutsummaryrefslogtreecommitdiff
path: root/src/clients
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-05-19 14:20:48 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-05-19 20:52:24 +0100
commite52571861104efe6139b78b22557211f08025f11 (patch)
tree634bec98491886d12f8f5a25b24f4cacf8d69de5 /src/clients
parent80bf4ad14bfd8ab74a9c0d5f203ad5a370351def (diff)
downloadpaludis-e52571861104efe6139b78b22557211f08025f11.tar.gz
paludis-e52571861104efe6139b78b22557211f08025f11.tar.xz
Revert the package dep spec changes
Diffstat (limited to 'src/clients')
-rw-r--r--src/clients/cave/cmd_digest.cc4
-rwxr-xr-xsrc/clients/cave/cmd_display_resolution.cc31
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc13
-rw-r--r--src/clients/cave/cmd_fix_linkage.cc15
-rw-r--r--src/clients/cave/cmd_graph_jobs.cc17
-rw-r--r--src/clients/cave/cmd_mirror.cc1
-rw-r--r--src/clients/cave/cmd_print_spec.cc123
-rw-r--r--src/clients/cave/cmd_report.cc12
-rw-r--r--src/clients/cave/cmd_show.cc36
-rw-r--r--src/clients/cave/resolve_common.cc19
10 files changed, 111 insertions, 160 deletions
diff --git a/src/clients/cave/cmd_digest.cc b/src/clients/cave/cmd_digest.cc
index c78379fe5..3c8ea88f4 100644
--- a/src/clients/cave/cmd_digest.cc
+++ b/src/clients/cave/cmd_digest.cc
@@ -47,7 +47,7 @@
#include <paludis/metadata_key.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/action.hh>
-#include <paludis/dep_spec_data.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <cstdlib>
#include <iostream>
@@ -116,7 +116,7 @@ DigestCommand::run(
throw args::DoHelp("digest takes exactly two parameters");
RepositoryName repo(*next(cmdline.begin_parameters()));
- Filter repo_filter(filter::Matches(MutablePackageDepSpecData({ }).require_in_repository(repo), make_null_shared_ptr(), { }));
+ Filter repo_filter(filter::Matches(make_package_dep_spec({ }).in_repository(repo), make_null_shared_ptr(), { }));
QualifiedPackageName pkg(std::string::npos == cmdline.begin_parameters()->find('/') ?
env->fetch_unique_qualified_package_name(PackageNamePart(*cmdline.begin_parameters()), repo_filter) :
QualifiedPackageName(*cmdline.begin_parameters()));
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 0a5e8f176..16182dd7b 100755
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -79,7 +79,6 @@
#include <paludis/changed_choices.hh>
#include <paludis/mask_utils.hh>
#include <paludis/dep_spec_annotations.hh>
-#include <paludis/package_dep_spec_requirement.hh>
#include <set>
#include <iterator>
@@ -1427,35 +1426,15 @@ namespace
s.append(" (and " + stringify(c->second.second.size() - 1) + " more)");
cout << fuc(fs_unable_unsuitable_did_not_meet(), fv<'s'>(s));
- if (constraint->spec().if_package() &&
- package_dep_spec_has_properties(*constraint->spec().if_package(), make_named_values<PackageDepSpecProperties>(
- n::has_any_slot_requirement() = indeterminate,
- n::has_category_name_part() = indeterminate,
- n::has_choice_requirements() = true,
- n::has_exact_slot_requirement() = indeterminate,
- n::has_from_repository() = indeterminate,
- n::has_in_repository() = indeterminate,
- n::has_installable_to_path() = indeterminate,
- n::has_installable_to_repository() = indeterminate,
- n::has_installed_at_path() = indeterminate,
- n::has_key_requirements() = indeterminate,
- n::has_package() = indeterminate,
- n::has_package_name_part() = indeterminate,
- n::has_tag() = indeterminate,
- n::has_version_requirements() = indeterminate
- )) &&
+ if (constraint->spec().if_package() && constraint->spec().if_package()->additional_requirements_ptr() &&
(! match_package(*env, *constraint->spec().if_package(), u->package_id(), constraint->from_id(), { })) &&
- match_package(*env, *constraint->spec().if_package(), u->package_id(), constraint->from_id(), { mpo_ignore_choice_requirements }))
+ match_package(*env, *constraint->spec().if_package(), u->package_id(), constraint->from_id(), { mpo_ignore_additional_requirements }))
{
- for (auto a(constraint->spec().if_package()->requirements()->begin()),
- a_end(constraint->spec().if_package()->requirements()->end()) ;
+ for (AdditionalPackageDepSpecRequirements::ConstIterator a(constraint->spec().if_package()->additional_requirements_ptr()->begin()),
+ a_end(constraint->spec().if_package()->additional_requirements_ptr()->end()) ;
a != a_end ; ++a)
{
- auto a_choice(visitor_cast<const ChoiceRequirement>(**a));
- if (! a_choice)
- continue;
-
- const std::pair<bool, std::string> p(a_choice->requirement_met(env.get(), 0, u->package_id(), constraint->from_id(), 0));
+ const std::pair<bool, std::string> p((*a)->requirement_met(env.get(), 0, u->package_id(), constraint->from_id(), 0));
if (p.first)
continue;
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index ac530c10d..b9b71c12c 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -25,10 +25,8 @@
#include "colours.hh"
#include "resume_data.hh"
#include "format_user_config.hh"
-
#include <paludis/args/do_help.hh>
#include <paludis/args/escape.hh>
-
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/safe_ofstream.hh>
#include <paludis/util/system.hh>
@@ -50,7 +48,6 @@
#include <paludis/util/timestamp.hh>
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/process.hh>
-
#include <paludis/resolver/resolutions_by_resolvent.hh>
#include <paludis/resolver/reason.hh>
#include <paludis/resolver/sanitised_dependencies.hh>
@@ -65,7 +62,6 @@
#include <paludis/resolver/job.hh>
#include <paludis/resolver/job_state.hh>
#include <paludis/resolver/job_requirements.hh>
-
#include <paludis/package_id.hh>
#include <paludis/version_spec.hh>
#include <paludis/metadata_key.hh>
@@ -84,7 +80,6 @@
#include <paludis/filter.hh>
#include <paludis/elike_blocker.hh>
#include <paludis/repository.hh>
-#include <paludis/package_dep_spec_requirement.hh>
#include <set>
#include <iterator>
@@ -328,7 +323,7 @@ namespace
const auto replacing_ids((*env)[selection::BestVersionOnly(generator::Matches(*i, make_null_shared_ptr(), { }))]);
if (replacing_ids->empty())
r.append(stringify(*i));
- else if (id_specs->empty() || id_specs->begin()->package_name_requirement()->name() != (*replacing_ids->begin())->name())
+ else if (id_specs->empty() || *id_specs->begin()->package_ptr() != (*replacing_ids->begin())->name())
r.append(stringify(**replacing_ids->begin()));
else
r.append((*replacing_ids->begin())->canonical_form(idcf_no_name));
@@ -685,18 +680,16 @@ namespace
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_any_slot_requirement() = false,
+ n::has_additional_requirements() = false,
n::has_category_name_part() = false,
- n::has_choice_requirements() = false,
- n::has_exact_slot_requirement() = false,
n::has_from_repository() = false,
n::has_in_repository() = false,
n::has_installable_to_path() = false,
n::has_installable_to_repository() = false,
n::has_installed_at_path() = false,
- n::has_key_requirements() = false,
n::has_package() = true,
n::has_package_name_part() = false,
+ n::has_slot_requirement() = false,
n::has_tag() = indeterminate,
n::has_version_requirements() = false
)))
diff --git a/src/clients/cave/cmd_fix_linkage.cc b/src/clients/cave/cmd_fix_linkage.cc
index 01c030596..af28ee324 100644
--- a/src/clients/cave/cmd_fix_linkage.cc
+++ b/src/clients/cave/cmd_fix_linkage.cc
@@ -28,7 +28,6 @@
#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>
@@ -37,8 +36,8 @@
#include <paludis/metadata_key.hh>
#include <paludis/notifier_callback.hh>
#include <paludis/version_operator.hh>
-#include <paludis/version_spec.hh>
-#include <paludis/dep_spec_data.hh>
+#include <paludis/version_requirements.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <iostream>
#include <set>
@@ -208,13 +207,15 @@ FixLinkageCommand::run(
cout << endl;
}
- MutablePackageDepSpecData part_spec({ });
- part_spec.require_package((*pkg_it)->name());
+ PartiallyMadePackageDepSpec part_spec({ });
+ part_spec.package((*pkg_it)->name());
if ((*pkg_it)->slot_key())
- part_spec.require_exact_slot((*pkg_it)->slot_key()->parse_value(), false);
+ part_spec.slot_requirement(std::make_shared<UserSlotExactRequirement>((*pkg_it)->slot_key()->parse_value()));
if (cmdline.a_exact.specified())
- part_spec.require_version(vrc_and, vo_equal, (*pkg_it)->version());
+ part_spec.version_requirement(make_named_values<VersionRequirement>(
+ n::version_operator() = vo_equal,
+ n::version_spec() = (*pkg_it)->version()));
targets->push_back(std::make_pair(stringify(PackageDepSpec(part_spec)), join(broken_files.begin(), broken_files.end(), ", ")));
}
diff --git a/src/clients/cave/cmd_graph_jobs.cc b/src/clients/cave/cmd_graph_jobs.cc
index 34ba7d7d8..5583422b7 100644
--- a/src/clients/cave/cmd_graph_jobs.cc
+++ b/src/clients/cave/cmd_graph_jobs.cc
@@ -21,9 +21,7 @@
#include "resolve_cmdline.hh"
#include "exceptions.hh"
#include "command_command_line.hh"
-
#include <paludis/args/do_help.hh>
-
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_shared_copy.hh>
@@ -33,16 +31,13 @@
#include <paludis/util/fs_path.hh>
#include <paludis/util/join.hh>
#include <paludis/util/process.hh>
-
#include <paludis/resolver/job_list.hh>
#include <paludis/resolver/job_lists.hh>
#include <paludis/resolver/job.hh>
#include <paludis/resolver/job_requirements.hh>
-
#include <paludis/serialise-impl.hh>
#include <paludis/dep_spec.hh>
#include <paludis/name.hh>
-#include <paludis/package_dep_spec_requirement.hh>
#include <iostream>
#include <cstdlib>
@@ -91,15 +86,15 @@ namespace
std::string short_spec(const PackageDepSpec & p, bool full)
{
- if (full || ! p.package_name_requirement())
+ if (full || ! p.package_ptr())
return stringify(p);
else
{
- std::string result(stringify(p.package_name_requirement()->name().package()));
- if (p.exact_slot_requirement())
- result = result + ":" + stringify(p.exact_slot_requirement()->name());
- if (p.in_repository_requirement())
- result = result + "::" + stringify(p.in_repository_requirement()->name());
+ std::string result(stringify(p.package_ptr()->package()));
+ if (p.slot_requirement_ptr())
+ result = result + stringify(*p.slot_requirement_ptr());
+ if (p.in_repository_ptr())
+ result = result + "::" + stringify(*p.in_repository_ptr());
return result;
}
}
diff --git a/src/clients/cave/cmd_mirror.cc b/src/clients/cave/cmd_mirror.cc
index 2d9267739..f51560916 100644
--- a/src/clients/cave/cmd_mirror.cc
+++ b/src/clients/cave/cmd_mirror.cc
@@ -48,6 +48,7 @@
#include <paludis/metadata_key.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/action.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <cstdlib>
#include <iostream>
diff --git a/src/clients/cave/cmd_print_spec.cc b/src/clients/cave/cmd_print_spec.cc
index b984ad062..00124bda7 100644
--- a/src/clients/cave/cmd_print_spec.cc
+++ b/src/clients/cave/cmd_print_spec.cc
@@ -20,10 +20,8 @@
#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>
@@ -34,16 +32,14 @@
#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>
+#include <paludis/additional_package_dep_spec_requirement.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/version_operator.hh>
-#include <paludis/version_spec.hh>
-#include <paludis/elike_use_requirement.hh>
-#include <paludis/dep_spec_data.hh>
-
+#include <paludis/version_requirements.hh>
#include <iostream>
#include <algorithm>
@@ -122,43 +118,45 @@ namespace
const PrintSpecCommandLine & cmdline
)
{
- MutablePackageDepSpecData s(*spec.data());
+ PartiallyMadePackageDepSpec s(spec);
if (cmdline.a_package.specified())
{
- s.unrequire_package();
- s.unrequire_package_name_part();
- s.unrequire_category_name_part();
- if (! cmdline.a_package.argument().empty())
- s.require_package(QualifiedPackageName(cmdline.a_package.argument()));
+ if (cmdline.a_package.argument().empty())
+ s.clear_package();
+ else
+ s.package(QualifiedPackageName(cmdline.a_package.argument()));
}
if (cmdline.a_slot_requirement.specified())
{
- s.unrequire_exact_slot();
- s.unrequire_any_slot();
- if (! cmdline.a_slot_requirement.argument().empty())
- s.require_exact_slot(SlotName(cmdline.a_slot_requirement.argument()), false);
+ if (cmdline.a_slot_requirement.argument().empty())
+ s.clear_slot_requirement();
+ else
+ s.slot_requirement(std::make_shared<UserSlotExactRequirement>(SlotName(cmdline.a_slot_requirement.argument())));
}
if (cmdline.a_in_repository.specified())
{
- s.unrequire_in_repository();
- if (! cmdline.a_in_repository.argument().empty())
- s.require_in_repository(RepositoryName(cmdline.a_in_repository.argument()));
+ if (cmdline.a_in_repository.argument().empty())
+ s.clear_in_repository();
+ else
+ s.in_repository(RepositoryName(cmdline.a_in_repository.argument()));
}
if (cmdline.a_from_repository.specified())
{
- s.unrequire_from_repository();
- if (! cmdline.a_from_repository.argument().empty())
- s.require_from_repository(RepositoryName(cmdline.a_from_repository.argument()));
+ if (cmdline.a_from_repository.argument().empty())
+ s.clear_from_repository();
+ else
+ s.from_repository(RepositoryName(cmdline.a_from_repository.argument()));
}
if (cmdline.a_installable_to_repository.specified())
{
- s.unrequire_installable_to_repository();
- if (! cmdline.a_installable_to_repository.argument().empty())
+ if (cmdline.a_installable_to_repository.argument().empty())
+ s.clear_installable_to_repository();
+ else
{
std::string repo(cmdline.a_installable_to_repository.argument());
bool include_masked(false);
@@ -168,21 +166,26 @@ namespace
include_masked = true;
}
- s.require_installable_to_repository(RepositoryName(repo), include_masked);
+ s.installable_to_repository(make_named_values<InstallableToRepository>(
+ n::include_masked() = include_masked,
+ n::repository() = RepositoryName(repo)
+ ));
}
}
if (cmdline.a_installed_at_path.specified())
{
- s.unrequire_installed_at_path();
- if (! cmdline.a_installed_at_path.argument().empty())
- s.require_installed_at_path(FSPath(cmdline.a_installed_at_path.argument()));
+ if (cmdline.a_installed_at_path.argument().empty())
+ s.clear_installed_at_path();
+ else
+ s.installed_at_path(FSPath(cmdline.a_installed_at_path.argument()));
}
if (cmdline.a_installable_to_path.specified())
{
- s.unrequire_installable_to_path();
- if (! cmdline.a_installable_to_path.argument().empty())
+ if (cmdline.a_installable_to_path.argument().empty())
+ s.clear_installable_to_path();
+ else
{
std::string path(cmdline.a_installable_to_path.argument());
bool include_masked(false);
@@ -192,43 +195,32 @@ namespace
include_masked = true;
}
- s.require_installable_to_path(FSPath(path), include_masked);
+ s.installable_to_path(make_named_values<InstallableToPath>(
+ n::include_masked() = include_masked,
+ n::path() = FSPath(path)
+ ));
}
}
- if (cmdline.a_package_part.specified() || cmdline.a_category_part.specified())
- {
- s.unrequire_package();
- s.unrequire_package_name_part();
- s.unrequire_category_name_part();
- }
-
if (cmdline.a_package_part.specified())
{
- if (! cmdline.a_package_part.argument().empty())
- s.require_package_name_part(PackageNamePart(cmdline.a_package_part.argument()));
+ if (cmdline.a_package_part.argument().empty())
+ s.clear_package_name_part();
+ else
+ s.package_name_part(PackageNamePart(cmdline.a_package_part.argument()));
}
if (cmdline.a_category_part.specified())
{
- if (! cmdline.a_category_part.argument().empty())
- s.require_category_name_part(CategoryNamePart(cmdline.a_category_part.argument()));
- }
-
- VersionRequirementCombiner vrc(vrc_and);
- if (cmdline.a_version_requirements_mode.specified())
- {
- if (cmdline.a_version_requirements_mode.argument() == "and")
- vrc = vrc_and;
- else if (cmdline.a_version_requirements_mode.argument() == "or")
- vrc = vrc_or;
+ if (cmdline.a_category_part.argument().empty())
+ s.clear_category_name_part();
else
- throw args::DoHelp("Argument for --" + cmdline.a_version_requirements_mode.long_name() + " unrecognised");
+ s.category_name_part(CategoryNamePart(cmdline.a_category_part.argument()));
}
if (cmdline.a_version_requirement.specified())
{
- s.unrequire_versions();
+ s.clear_version_requirements();
for (args::StringSetArg::ConstIterator a(cmdline.a_version_requirement.begin_args()),
a_end(cmdline.a_version_requirement.end_args()) ;
@@ -240,22 +232,33 @@ 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.require_version(vrc, VersionOperator(op), VersionSpec(ver, {}));
+
+ s.version_requirement(make_named_values<VersionRequirement>(
+ n::version_operator() = VersionOperator(op),
+ n::version_spec() = VersionSpec(ver, {})
+ ));
}
}
+ 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.unrequire_choices();
+ s.clear_additional_requirements();
for (args::StringSetArg::ConstIterator a(cmdline.a_additional_requirement.begin_args()),
a_end(cmdline.a_additional_requirement.end_args()) ;
a != a_end ; ++a)
if (! a->empty())
- {
- auto k(parse_elike_use_requirement(*a, { }));
- s.require_choice(k);
- }
+ s.additional_requirement(std::make_shared<UserKeyRequirement>(*a));
}
cout << PackageDepSpec(s) << endl;
diff --git a/src/clients/cave/cmd_report.cc b/src/clients/cave/cmd_report.cc
index 1959a6d4c..6d6704ad2 100644
--- a/src/clients/cave/cmd_report.cc
+++ b/src/clients/cave/cmd_report.cc
@@ -37,9 +37,9 @@
#include <paludis/metadata_key.hh>
#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/dep_spec_data.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -107,9 +107,11 @@ namespace
{
auto ids((*env)[selection::BestVersionOnly((
generator::InRepository(RepositoryName(*r)) &
- generator::Matches(MutablePackageDepSpecData({ })
- .require_package(id->name())
- .require_version(vrc_and, vo_equal, id->version()),
+ 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())),
make_null_shared_ptr(), { })) |
filter::SupportsAction<InstallAction>())]);
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index 2f4ce6b25..0adbc2644 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -25,20 +25,8 @@
#include "format_user_config.hh"
#include "parse_spec_with_nice_error.hh"
-#include <paludis/util/set.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/visitor_cast.hh>
-#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/pretty_print.hh>
-#include <paludis/util/timestamp.hh>
-#include <paludis/util/make_null_shared_ptr.hh>
-#include <paludis/util/accept_visitor.hh>
-#include <paludis/util/stringify.hh>
-#include <paludis/util/join.hh>
-
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
-
#include <paludis/name.hh>
#include <paludis/environment.hh>
#include <paludis/repository.hh>
@@ -49,16 +37,26 @@
#include <paludis/selection.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/visitor_cast.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/pretty_print.hh>
+#include <paludis/util/timestamp.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/accept_visitor.hh>
+#include <paludis/util/stringify.hh>
+#include <paludis/util/join.hh>
#include <paludis/action.hh>
#include <paludis/mask.hh>
#include <paludis/choice.hh>
+#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/mask_utils.hh>
#include <paludis/permitted_choice_value_parameter_values.hh>
#include <paludis/contents.hh>
#include <paludis/dep_spec_data.hh>
#include <paludis/dep_spec_annotations.hh>
#include <paludis/match_package.hh>
-
#include <cstdlib>
#include <iostream>
#include <algorithm>
@@ -254,7 +252,7 @@ namespace
for (PackageIDSequence::ConstIterator i(names->begin()), i_end(names->end()) ;
i != i_end ; ++i)
{
- PackageDepSpec name_spec(MutablePackageDepSpecData({ }).require_package((*i)->name()));
+ PackageDepSpec name_spec(make_package_dep_spec({ }).package((*i)->name()));
cout << fuc(select_format_for_spec(env, name_spec, make_null_shared_ptr(),
fs_wildcard_spec_installed(),
fs_wildcard_spec_installable(),
@@ -1352,9 +1350,7 @@ namespace
for (auto r(repos.begin()), r_end(repos.end()) ; r != r_end ; ++r)
{
auto r_ids((*env)[selection::AllVersionsGroupedBySlot(generator::Matches(
- MutablePackageDepSpecData(*s.data())
- .unrequire_in_repository()
- .require_in_repository(*r), make_null_shared_ptr(), { }))]);
+ PartiallyMadePackageDepSpec(s).in_repository(*r), make_null_shared_ptr(), { }))]);
if (! r_ids->empty())
do_one_package_with_ids(cmdline, env, basic_ppos, s, r_ids, cout, rest_out);
}
@@ -1381,9 +1377,7 @@ namespace
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
- do_one_package(cmdline, env, basic_ppos, MutablePackageDepSpecData(*s.data())
- .unrequire_package()
- .require_package((*i)->name()));
+ do_one_package(cmdline, env, basic_ppos, PartiallyMadePackageDepSpec(s).package((*i)->name()));
}
}
@@ -1425,7 +1419,7 @@ ShowCommand::run(
try
{
PackageDepSpec spec(parse_spec_with_nice_error(*p, env.get(), { updso_throw_if_set, updso_allow_wildcards }, filter::All()));
- if ((! spec.package_name_requirement()))
+ if ((! spec.package_ptr()))
do_one_wildcard(env, spec);
else
do_one_package(cmdline, env, basic_ppos, spec);
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index e9356af87..b095dfce5 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -106,7 +106,6 @@
#include <paludis/generator.hh>
#include <paludis/selection.hh>
#include <paludis/elike_blocker.hh>
-#include <paludis/package_dep_spec_properties.hh>
#include <algorithm>
#include <iostream>
@@ -1125,23 +1124,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 (package_dep_spec_has_properties(ts, make_named_values<PackageDepSpecProperties>(
- n::has_any_slot_requirement() = indeterminate,
- n::has_category_name_part() = indeterminate,
- n::has_choice_requirements() = indeterminate,
- n::has_exact_slot_requirement() = indeterminate,
- n::has_from_repository() = indeterminate,
- n::has_in_repository() = indeterminate,
- n::has_installable_to_path() = indeterminate,
- n::has_installable_to_repository() = indeterminate,
- n::has_installed_at_path() = indeterminate,
- n::has_key_requirements() = indeterminate,
- n::has_package() = indeterminate,
- n::has_package_name_part() = indeterminate,
- n::has_tag() = indeterminate,
- n::has_version_requirements() = true
- )))
+ if (ts.version_requirements_ptr() && ! ts.version_requirements_ptr()->empty())
{
confirm_helper.add_permit_downgrade_spec(ts);
confirm_helper.add_permit_old_version_spec(ts);