aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-12 14:28:03 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-12 14:45:22 +0100
commit120c58323950219e16d8fe22693af221d2887f9b (patch)
tree2df48534abea1af807750dbbd0ce3ac9922bd44b /src
parent271074eb112e276d5ba25f91785431911ee3443f (diff)
downloadpaludis-120c58323950219e16d8fe22693af221d2887f9b.tar.gz
paludis-120c58323950219e16d8fe22693af221d2887f9b.tar.xz
MetadataKey value -> parse_value
Diffstat (limited to 'src')
-rw-r--r--src/clients/cave/cmd_contents.cc21
-rwxr-xr-xsrc/clients/cave/cmd_display_resolution.cc45
-rw-r--r--src/clients/cave/cmd_fix_linkage.cc2
-rw-r--r--src/clients/cave/cmd_generate_metadata.cc2
-rw-r--r--src/clients/cave/cmd_has_version.cc2
-rw-r--r--src/clients/cave/cmd_import.cc4
-rw-r--r--src/clients/cave/cmd_info.cc32
-rw-r--r--src/clients/cave/cmd_manage_search_index.cc4
-rw-r--r--src/clients/cave/cmd_match.cc53
-rw-r--r--src/clients/cave/cmd_print_best_version.cc2
-rw-r--r--src/clients/cave/cmd_print_dependent_ids.cc4
-rw-r--r--src/clients/cave/cmd_print_id_contents.cc7
-rw-r--r--src/clients/cave/cmd_print_ids.cc2
-rw-r--r--src/clients/cave/cmd_print_repositories.cc2
-rw-r--r--src/clients/cave/cmd_print_unused_distfiles.cc6
-rw-r--r--src/clients/cave/cmd_report.cc33
-rw-r--r--src/clients/cave/cmd_show.cc43
-rw-r--r--src/clients/cave/cmd_sync.cc13
-rw-r--r--src/clients/cave/cmd_uninstall.cc2
-rw-r--r--src/clients/cave/cmd_update_world.cc2
-rw-r--r--src/clients/cave/cmd_verify.cc21
-rw-r--r--src/clients/cave/executables_common.cc14
-rw-r--r--src/clients/cave/format_plain_contents_entry.cc12
-rw-r--r--src/clients/cave/format_plain_metadata_key.cc14
-rw-r--r--src/clients/cave/owner_common.cc10
-rw-r--r--src/clients/cave/resolve_common.cc4
-rw-r--r--src/clients/cave/select_format_for_spec.cc2
-rw-r--r--src/clients/cave/size_common.cc7
-rw-r--r--src/clients/instruo/instruo.cc46
29 files changed, 220 insertions, 191 deletions
diff --git a/src/clients/cave/cmd_contents.cc b/src/clients/cave/cmd_contents.cc
index 60fe2f541..d726f3af8 100644
--- a/src/clients/cave/cmd_contents.cc
+++ b/src/clients/cave/cmd_contents.cc
@@ -82,24 +82,24 @@ namespace
{
std::string visit(const ContentsFileEntry & e) const
{
- return fuc(fs_file(), fv<'s'>(stringify(e.location_key()->value())));
+ return fuc(fs_file(), fv<'s'>(stringify(e.location_key()->parse_value())));
}
std::string visit(const ContentsDirEntry & e) const
{
- return fuc(fs_dir(), fv<'s'>(stringify(e.location_key()->value())));
+ return fuc(fs_dir(), fv<'s'>(stringify(e.location_key()->parse_value())));
}
std::string visit(const ContentsSymEntry & e) const
{
return fuc(fs_sym(),
- fv<'s'>(stringify(e.location_key()->value())),
- fv<'t'>(stringify(e.target_key()->value())));
+ fv<'s'>(stringify(e.location_key()->parse_value())),
+ fv<'t'>(stringify(e.target_key()->parse_value())));
}
std::string visit(const ContentsOtherEntry & e) const
{
- return fuc(fs_other(), fv<'s'>(stringify(e.location_key()->value())));
+ return fuc(fs_other(), fv<'s'>(stringify(e.location_key()->parse_value())));
}
};
@@ -128,22 +128,23 @@ ContentsCommand::run(
throw args::DoHelp("contents takes exactly one parameter");
PackageDepSpec spec(parse_spec_with_nice_error(*cmdline.begin_parameters(), env.get(),
- { }, filter::InstalledAtRoot(env->preferred_root_key()->value())));
+ { }, filter::InstalledAtRoot(env->preferred_root_key()->parse_value())));
std::shared_ptr<const PackageIDSequence> entries(
(*env)[selection::AllVersionsSorted(generator::Matches(spec, make_null_shared_ptr(), { })
- | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
+ | filter::InstalledAtRoot(env->preferred_root_key()->parse_value()))]);
if (entries->empty())
- nothing_matching_error(env.get(), *cmdline.begin_parameters(), filter::InstalledAtRoot(env->preferred_root_key()->value()));
+ nothing_matching_error(env.get(), *cmdline.begin_parameters(), filter::InstalledAtRoot(env->preferred_root_key()->parse_value()));
const std::shared_ptr<const PackageID> id(*entries->last());
if (! id->contents_key())
throw BadIDForCommand(spec, id, "does not support listing contents");
+ auto contents(id->contents_key()->parse_value());
std::transform(
- id->contents_key()->value()->begin(),
- id->contents_key()->value()->end(),
+ contents->begin(),
+ contents->end(),
std::ostream_iterator<std::string>(cout, "\n"),
std::bind(stringify_contents_entry, std::placeholders::_1));
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index cf007d71e..b7d9bc20b 100755
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -517,7 +517,7 @@ namespace
const std::shared_ptr<const PackageID> & id,
const bool is_new)
{
- if (id->short_description_key() && ! id->short_description_key()->value().empty())
+ if (id->short_description_key() && ! id->short_description_key()->parse_value().empty())
{
bool show(false);
if (cmdline.display_options.a_show_descriptions.argument() == "none")
@@ -532,7 +532,7 @@ namespace
+ cmdline.display_options.a_show_descriptions.long_name() + "'");
if (show)
- cout << fuc(fs_description(), fv<'s'>(id->short_description_key()->value()));
+ cout << fuc(fs_description(), fv<'s'>(id->short_description_key()->parse_value()));
}
}
@@ -552,11 +552,11 @@ namespace
std::shared_ptr<const Choices> old_choices;
if (old_id && old_id->choices_key())
- old_choices = old_id->choices_key()->value();
+ old_choices = old_id->choices_key()->parse_value();
std::pair<std::string, bool> changed_s_prefix("", false), unchanged_s_prefix("", false);
- for (Choices::ConstIterator k(id->choices_key()->value()->begin()),
- k_end(id->choices_key()->value()->end()) ;
+ auto choices(id->choices_key()->parse_value());
+ for (Choices::ConstIterator k(choices->begin()), k_end(choices->end()) ;
k != k_end ; ++k)
{
if ((*k)->hidden())
@@ -884,27 +884,27 @@ namespace
void visit(const MetadataValueKey<std::shared_ptr<const PackageID> > & k)
{
- cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(*k.value())));
+ cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(*k.parse_value())));
}
void visit(const MetadataValueKey<std::string> & k)
{
- cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.value())));
+ cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.parse_value())));
}
void visit(const MetadataValueKey<SlotName> & k)
{
- cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.value())));
+ cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.parse_value())));
}
void visit(const MetadataValueKey<long> & k)
{
- cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.value())));
+ cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.parse_value())));
}
void visit(const MetadataValueKey<bool> & k)
{
- cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.value())));
+ cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.parse_value())));
}
void visit(const MetadataSectionKey & k)
@@ -914,7 +914,7 @@ namespace
void visit(const MetadataTimeKey & k)
{
- cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(pretty_print_time(k.value().seconds())));
+ cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(pretty_print_time(k.parse_value().seconds())));
}
void visit(const MetadataValueKey<std::shared_ptr<const Contents> > & k)
@@ -924,7 +924,7 @@ namespace
void visit(const MetadataValueKey<FSPath> & k)
{
- cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.value())));
+ cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.parse_value())));
}
void visit(const MetadataCollectionKey<Set<std::string> > & k)
@@ -1250,16 +1250,13 @@ namespace
cout << fuc(fs_change_not_best());
if ((! decision.destination()->replacing()->empty()) &&
- (*decision.destination()->replacing()->begin())->from_repositories_key() &&
- ! (*decision.destination()->replacing()->begin())->from_repositories_key()->value()->empty() &&
- (*decision.destination()->replacing()->begin())->from_repositories_key()->value()->end() ==
- (*decision.destination()->replacing()->begin())->from_repositories_key()->value()->find(stringify(
- decision.origin_id()->repository_name())))
+ (*decision.destination()->replacing()->begin())->from_repositories_key())
{
- cout << fuc(fs_change_formerly_from(), fv<'r'>(join(
- (*decision.destination()->replacing()->begin())->from_repositories_key()->value()->begin(),
- (*decision.destination()->replacing()->begin())->from_repositories_key()->value()->end(),
- ", ::")));
+ auto from_repositories((*decision.destination()->replacing()->begin())->from_repositories_key()->parse_value());
+ if (! from_repositories->empty() && from_repositories->end() == from_repositories->find(stringify(decision.origin_id()->repository_name())))
+ {
+ cout << fuc(fs_change_formerly_from(), fv<'r'>(join(from_repositories->begin(), from_repositories->end(), ", ::")));
+ }
}
cout << fuc(fs_change_version(), fv<'v'>(decision.origin_id()->canonical_form(idcf_version)));
@@ -1457,11 +1454,11 @@ namespace
{
bool all_same(true);
const std::shared_ptr<const ChoiceValue> first_choice_value(
- (*v->second->begin())->choices_key()->value()->find_by_name_with_prefix(v->first));
+ (*v->second->begin())->choices_key()->parse_value()->find_by_name_with_prefix(v->first));
std::string description(first_choice_value->description());
for (PackageIDSequence::ConstIterator w(next(v->second->begin())), w_end(v->second->end()) ;
w != w_end ; ++w)
- if ((*w)->choices_key()->value()->find_by_name_with_prefix(v->first)->description() != description)
+ if ((*w)->choices_key()->parse_value()->find_by_name_with_prefix(v->first)->description() != description)
{
all_same = false;
break;
@@ -1476,7 +1473,7 @@ namespace
w != w_end ; ++w)
{
const std::shared_ptr<const ChoiceValue> value(
- (*w)->choices_key()->value()->find_by_name_with_prefix(v->first));
+ (*w)->choices_key()->parse_value()->find_by_name_with_prefix(v->first));
cout << fuc(fs_choice_to_explain_one(), fv<'s'>((*w)->canonical_form(idcf_no_version)), fv<'d'>(value->description()));
}
}
diff --git a/src/clients/cave/cmd_fix_linkage.cc b/src/clients/cave/cmd_fix_linkage.cc
index b95eb4384..01c030596 100644
--- a/src/clients/cave/cmd_fix_linkage.cc
+++ b/src/clients/cave/cmd_fix_linkage.cc
@@ -211,7 +211,7 @@ FixLinkageCommand::run(
MutablePackageDepSpecData part_spec({ });
part_spec.require_package((*pkg_it)->name());
if ((*pkg_it)->slot_key())
- part_spec.require_exact_slot((*pkg_it)->slot_key()->value(), false);
+ part_spec.require_exact_slot((*pkg_it)->slot_key()->parse_value(), false);
if (cmdline.a_exact.specified())
part_spec.require_version(vrc_and, vo_equal, (*pkg_it)->version());
diff --git a/src/clients/cave/cmd_generate_metadata.cc b/src/clients/cave/cmd_generate_metadata.cc
index c38b657c8..0081032f9 100644
--- a/src/clients/cave/cmd_generate_metadata.cc
+++ b/src/clients/cave/cmd_generate_metadata.cc
@@ -99,7 +99,7 @@ namespace
template <typename T_>
void visit(const T_ & k) const
{
- auto PALUDIS_ATTRIBUTE((unused)) v(k.value());
+ auto PALUDIS_ATTRIBUTE((unused)) v(k.parse_value());
}
};
diff --git a/src/clients/cave/cmd_has_version.cc b/src/clients/cave/cmd_has_version.cc
index 7d587868e..451cf325a 100644
--- a/src/clients/cave/cmd_has_version.cc
+++ b/src/clients/cave/cmd_has_version.cc
@@ -97,7 +97,7 @@ HasVersionCommand::run(
auto s(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(), { }));
auto ids((*env)[selection::BestVersionOnly(generator::Matches(s, make_null_shared_ptr(), { }) | filter::InstalledAtRoot(
- env->preferred_root_key()->value()))]);
+ env->preferred_root_key()->parse_value()))]);
if (ids->empty())
return EXIT_FAILURE;
diff --git a/src/clients/cave/cmd_import.cc b/src/clients/cave/cmd_import.cc
index 04bb0b4ef..d7a59a638 100644
--- a/src/clients/cave/cmd_import.cc
+++ b/src/clients/cave/cmd_import.cc
@@ -226,7 +226,7 @@ ImportCommand::run(
auto repo(env->fetch_repository((*i)->repository_name()));
if (! repo->format_key())
continue;
- if (repo->format_key()->value() != "installed_unpackaged")
+ if (repo->format_key()->parse_value() != "installed_unpackaged")
continue;
old_id = *i;
break;
@@ -237,7 +237,7 @@ ImportCommand::run(
"no old ID available");
if (old_id->short_description_key())
- description = old_id->short_description_key()->value();
+ description = old_id->short_description_key()->parse_value();
if (old_id->build_dependencies_key())
build_dependencies = old_id->build_dependencies_key()->pretty_print_value(UnformattedPrettyPrinter(), { });
if (old_id->run_dependencies_key())
diff --git a/src/clients/cave/cmd_info.cc b/src/clients/cave/cmd_info.cc
index d04006c58..7eb5fb291 100644
--- a/src/clients/cave/cmd_info.cc
+++ b/src/clients/cave/cmd_info.cc
@@ -117,23 +117,23 @@ namespace
void visit(const ContentsFileEntry & e)
{
- s << fuc(fs_contents_file(), fv<'r'>(stringify(e.location_key()->value())), fv<'b'>(indent ? "true" : ""));
+ s << fuc(fs_contents_file(), fv<'r'>(stringify(e.location_key()->parse_value())), fv<'b'>(indent ? "true" : ""));
}
void visit(const ContentsDirEntry & e)
{
- s << fuc(fs_contents_dir(), fv<'r'>(stringify(e.location_key()->value())), fv<'b'>(indent ? "true" : ""));
+ s << fuc(fs_contents_dir(), fv<'r'>(stringify(e.location_key()->parse_value())), fv<'b'>(indent ? "true" : ""));
}
void visit(const ContentsSymEntry & e)
{
- s << fuc(fs_contents_sym(), fv<'r'>(stringify(e.location_key()->value())), fv<'b'>(indent ? "true" : ""),
- fv<'v'>(e.target_key()->value()));
+ s << fuc(fs_contents_sym(), fv<'r'>(stringify(e.location_key()->parse_value())), fv<'b'>(indent ? "true" : ""),
+ fv<'v'>(e.target_key()->parse_value()));
}
void visit(const ContentsOtherEntry & e)
{
- s << fuc(fs_contents_other(), fv<'r'>(stringify(e.location_key()->value())), fv<'b'>(indent ? "true" : ""));
+ s << fuc(fs_contents_other(), fv<'r'>(stringify(e.location_key()->parse_value())), fv<'b'>(indent ? "true" : ""));
}
};
@@ -194,8 +194,8 @@ namespace
void visit(const MetadataCollectionKey<FSPathSequence> & k)
{
- cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(
- join(k.value()->begin(), k.value()->end(), " ")));
+ auto v(k.parse_value());
+ cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(join(v->begin(), v->end(), " ")));
}
void visit(const MetadataSpecTreeKey<LicenseSpecTree> & k)
@@ -243,37 +243,37 @@ namespace
void visit(const MetadataValueKey<std::string> & k)
{
ColourPrettyPrinter printer(env, make_null_shared_ptr(), indent);
- cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(k.value())));
+ cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(k.parse_value())));
}
void visit(const MetadataValueKey<SlotName> & k)
{
ColourPrettyPrinter printer(env, make_null_shared_ptr(), indent);
- cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(k.value())));
+ cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(k.parse_value())));
}
void visit(const MetadataValueKey<long> & k)
{
ColourPrettyPrinter printer(env, make_null_shared_ptr(), indent);
- cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(k.value())));
+ cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(k.parse_value())));
}
void visit(const MetadataValueKey<bool> & k)
{
ColourPrettyPrinter printer(env, make_null_shared_ptr(), indent);
- cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(k.value())));
+ cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(k.parse_value())));
}
void visit(const MetadataValueKey<FSPath> & k)
{
ColourPrettyPrinter printer(env, make_null_shared_ptr(), indent);
- cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(k.value())));
+ cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(k.parse_value())));
}
void visit(const MetadataValueKey<std::shared_ptr<const PackageID> > & k)
{
ColourPrettyPrinter printer(env, make_null_shared_ptr(), indent);
- cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(*k.value())));
+ cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(*k.parse_value())));
}
void visit(const MetadataValueKey<std::shared_ptr<const Contents> > &)
@@ -286,7 +286,7 @@ namespace
void visit(const MetadataTimeKey & k)
{
- cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(pretty_print_time(k.value().seconds())));
+ cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(pretty_print_time(k.parse_value().seconds())));
}
};
@@ -376,12 +376,12 @@ namespace
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()))]);
+ spec, make_null_shared_ptr(), { }) | filter::InstalledAtRoot(env->preferred_root_key()->parse_value()))]);
const std::shared_ptr<const PackageIDSequence> installable_ids((*env)[selection::BestVersionOnly(generator::Matches(
spec, make_null_shared_ptr(), { }) | filter::SupportsAction<InstallAction>() | filter::NotMasked())]);
if (installed_ids->empty() && installable_ids->empty())
- nothing_matching_error(env.get(), param, filter::InstalledAtRoot(env->preferred_root_key()->value()));
+ nothing_matching_error(env.get(), param, filter::InstalledAtRoot(env->preferred_root_key()->parse_value()));
for (PackageIDSequence::ConstIterator i(installed_ids->begin()), i_end(installed_ids->end()) ;
i != i_end ; ++i)
diff --git a/src/clients/cave/cmd_manage_search_index.cc b/src/clients/cave/cmd_manage_search_index.cc
index 23e74051b..adb0d4e23 100644
--- a/src/clients/cave/cmd_manage_search_index.cc
+++ b/src/clients/cave/cmd_manage_search_index.cc
@@ -272,9 +272,9 @@ ManageSearchIndexCommand::run(
std::string name(stringify((*i)->name())), short_desc, long_desc;
if ((*i)->short_description_key())
- short_desc = (*i)->short_description_key()->value();
+ short_desc = (*i)->short_description_key()->parse_value();
if ((*i)->long_description_key())
- long_desc = (*i)->long_description_key()->value();
+ long_desc = (*i)->long_description_key()->parse_value();
bool is_visible(! (*i)->masked());
diff --git a/src/clients/cave/cmd_match.cc b/src/clients/cave/cmd_match.cc
index c6ad4952e..ce1ebc868 100644
--- a/src/clients/cave/cmd_match.cc
+++ b/src/clients/cave/cmd_match.cc
@@ -244,37 +244,38 @@ namespace
void visit(const MetadataValueKey<std::string> & k)
{
- texts.push_back(stringify(k.value()));
+ texts.push_back(stringify(k.parse_value()));
}
void visit(const MetadataValueKey<FSPath> & k)
{
- texts.push_back(stringify(k.value()));
+ texts.push_back(stringify(k.parse_value()));
}
void visit(const MetadataValueKey<SlotName> & k)
{
- texts.push_back(stringify(k.value()));
+ texts.push_back(stringify(k.parse_value()));
}
void visit(const MetadataValueKey<long> & k)
{
- texts.push_back(stringify(k.value()));
+ texts.push_back(stringify(k.parse_value()));
}
void visit(const MetadataValueKey<bool> & k)
{
- texts.push_back(stringify(k.value()));
+ texts.push_back(stringify(k.parse_value()));
}
void visit(const MetadataValueKey<std::shared_ptr<const PackageID> > & k)
{
- texts.push_back(stringify(*k.value()));
+ texts.push_back(stringify(*k.parse_value()));
}
void visit(const MetadataValueKey<std::shared_ptr<const Choices> > & k)
{
- for (Choices::ConstIterator c(k.value()->begin()), c_end(k.value()->end()) ;
+ auto choices(k.parse_value());
+ for (Choices::ConstIterator c(choices->begin()), c_end(choices->end()) ;
c != c_end ; ++c)
for (Choice::ConstIterator i((*c)->begin()), i_end((*c)->end()) ;
i != i_end ; ++i)
@@ -287,7 +288,7 @@ namespace
void visit(const MetadataTimeKey & k)
{
- texts.push_back(stringify(k.value().seconds()));
+ texts.push_back(stringify(k.parse_value().seconds()));
}
void visit(const MetadataSectionKey & k)
@@ -299,73 +300,79 @@ namespace
void visit(const MetadataSpecTreeKey<PlainTextSpecTree> & k)
{
SpecTreeAsString m = { env, id, texts, match_options };
- k.value()->top()->accept(m);
+ k.parse_value()->top()->accept(m);
}
void visit(const MetadataSpecTreeKey<RequiredUseSpecTree> & k)
{
SpecTreeAsString m = { env, id, texts, match_options };
- k.value()->top()->accept(m);
+ k.parse_value()->top()->accept(m);
}
void visit(const MetadataSpecTreeKey<DependencySpecTree> & k)
{
SpecTreeAsString m = { env, id, texts, match_options };
- k.value()->top()->accept(m);
+ k.parse_value()->top()->accept(m);
}
void visit(const MetadataSpecTreeKey<LicenseSpecTree> & k)
{
SpecTreeAsString m = { env, id, texts, match_options };
- k.value()->top()->accept(m);
+ k.parse_value()->top()->accept(m);
}
void visit(const MetadataSpecTreeKey<ProvideSpecTree> & k)
{
SpecTreeAsString m = { env, id, texts, match_options };
- k.value()->top()->accept(m);
+ k.parse_value()->top()->accept(m);
}
void visit(const MetadataSpecTreeKey<SimpleURISpecTree> & k)
{
SpecTreeAsString m = { env, id, texts, match_options };
- k.value()->top()->accept(m);
+ k.parse_value()->top()->accept(m);
}
void visit(const MetadataSpecTreeKey<FetchableURISpecTree> & k)
{
SpecTreeAsString m = { env, id, texts, match_options };
- k.value()->top()->accept(m);
+ k.parse_value()->top()->accept(m);
}
void visit(const MetadataCollectionKey<Sequence<FSPath> > & k)
{
- std::transform(k.value()->begin(), k.value()->end(), std::back_inserter(texts), &stringify<FSPath>);
+ auto v(k.parse_value());
+ std::transform(v->begin(), v->end(), std::back_inserter(texts), &stringify<FSPath>);
}
void visit(const MetadataCollectionKey<Sequence<std::string> > & k)
{
- std::transform(k.value()->begin(), k.value()->end(), std::back_inserter(texts), &stringify<std::string>);
+ auto v(k.parse_value());
+ std::transform(v->begin(), v->end(), std::back_inserter(texts), &stringify<std::string>);
}
void visit(const MetadataCollectionKey<Set<std::string> > & k)
{
- std::transform(k.value()->begin(), k.value()->end(), std::back_inserter(texts), &stringify<std::string>);
+ auto v(k.parse_value());
+ std::transform(v->begin(), v->end(), std::back_inserter(texts), &stringify<std::string>);
}
void visit(const MetadataCollectionKey<Map<std::string, std::string> > & k)
{
- std::transform(k.value()->begin(), k.value()->end(), std::back_inserter(texts), stringify_string_pair);
+ auto v(k.parse_value());
+ std::transform(v->begin(), v->end(), std::back_inserter(texts), stringify_string_pair);
}
void visit(const MetadataCollectionKey<Set<KeywordName> > & k)
{
- std::transform(k.value()->begin(), k.value()->end(), std::back_inserter(texts), &stringify<KeywordName>);
+ auto v(k.parse_value());
+ std::transform(v->begin(), v->end(), std::back_inserter(texts), &stringify<KeywordName>);
}
void visit(const MetadataCollectionKey<Sequence<std::shared_ptr<const PackageID> > > & k)
{
- std::transform(indirect_iterator(k.value()->begin()), indirect_iterator(k.value()->end()),
+ auto v(k.parse_value());
+ std::transform(indirect_iterator(v->begin()), indirect_iterator(v->end()),
std::back_inserter(texts), &stringify<PackageID>);
}
@@ -420,9 +427,9 @@ MatchCommand::run_hosted(
if (default_names_and_descriptions || match_options.a_description.specified())
{
if (id->short_description_key())
- texts.push_back(stringify(id->short_description_key()->value()));
+ texts.push_back(stringify(id->short_description_key()->parse_value()));
if (id->long_description_key())
- texts.push_back(stringify(id->long_description_key()->value()));
+ texts.push_back(stringify(id->long_description_key()->parse_value()));
}
for (args::StringSetArg::ConstIterator a(match_options.a_key.begin_args()),
diff --git a/src/clients/cave/cmd_print_best_version.cc b/src/clients/cave/cmd_print_best_version.cc
index 1ef5eb044..699c40627 100644
--- a/src/clients/cave/cmd_print_best_version.cc
+++ b/src/clients/cave/cmd_print_best_version.cc
@@ -109,7 +109,7 @@ PrintBestVersionCommand::run(
auto s(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(), { }));
auto ids((*env)[selection::BestVersionOnly(generator::Matches(s, make_null_shared_ptr(), { }) | filter::InstalledAtRoot(
- env->preferred_root_key()->value()))]);
+ env->preferred_root_key()->parse_value()))]);
if (ids->empty())
return EXIT_FAILURE;
diff --git a/src/clients/cave/cmd_print_dependent_ids.cc b/src/clients/cave/cmd_print_dependent_ids.cc
index 7caae7afd..43131fcb7 100644
--- a/src/clients/cave/cmd_print_dependent_ids.cc
+++ b/src/clients/cave/cmd_print_dependent_ids.cc
@@ -99,7 +99,7 @@ namespace
m->insert('c', stringify(i->name().category()));
m->insert('p', stringify(i->name().package()));
m->insert('v', stringify(i->version()));
- m->insert('s', i->slot_key() ? stringify(i->slot_key()->value()) : "");
+ m->insert('s', i->slot_key() ? stringify(i->slot_key()->parse_value()) : "");
m->insert(':', i->slot_key() ? ":" : "");
m->insert('r', stringify(i->repository_name()));
m->insert('F', i->canonical_form(idcf_full));
@@ -128,7 +128,7 @@ PrintDependentIDsCommand::run(
if (1 != std::distance(cmdline.begin_parameters(), cmdline.end_parameters()))
throw args::DoHelp("print-dependent-ids requires exactly one parameter");
- auto installed_filter(filter::InstalledAtRoot(env->system_root_key()->value()));
+ auto installed_filter(filter::InstalledAtRoot(env->system_root_key()->parse_value()));
auto spec(parse_spec_with_nice_error(*cmdline.begin_parameters(), env.get(), { }, installed_filter));
auto ids((*env)[selection::AllVersionsSorted(
generator::Matches(spec, make_null_shared_ptr(), { }) |
diff --git a/src/clients/cave/cmd_print_id_contents.cc b/src/clients/cave/cmd_print_id_contents.cc
index 61e1b9195..1ce38dbe2 100644
--- a/src/clients/cave/cmd_print_id_contents.cc
+++ b/src/clients/cave/cmd_print_id_contents.cc
@@ -158,11 +158,11 @@ PrintIDContentsCommand::run(
throw args::DoHelp("print-id-contents takes exactly one parameter");
PackageDepSpec spec(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(),
- { updso_allow_wildcards }, filter::InstalledAtRoot(env->preferred_root_key()->value())));
+ { updso_allow_wildcards }, filter::InstalledAtRoot(env->preferred_root_key()->parse_value())));
std::shared_ptr<const PackageIDSequence> entries(
(*env)[selection::AllVersionsSorted(generator::Matches(spec, make_null_shared_ptr(), { }) |
- filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
+ filter::InstalledAtRoot(env->preferred_root_key()->parse_value()))]);
if (entries->empty())
throw NothingMatching(spec);
@@ -177,7 +177,8 @@ PrintIDContentsCommand::run(
if (! (*i)->contents_key())
throw BadIDForCommand(spec, (*i), "does not support listing contents");
- for (auto c((*i)->contents_key()->value()->begin()), c_end((*i)->contents_key()->value()->end()) ;
+ auto contents((*i)->contents_key()->parse_value());
+ for (auto c(contents->begin()), c_end(contents->end()) ;
c != c_end ; ++c)
if (match_type(cmdline.a_type, *c))
cout << format_plain_contents_entry(*c, cmdline.a_format.argument());
diff --git a/src/clients/cave/cmd_print_ids.cc b/src/clients/cave/cmd_print_ids.cc
index 3cfae9289..5be52940c 100644
--- a/src/clients/cave/cmd_print_ids.cc
+++ b/src/clients/cave/cmd_print_ids.cc
@@ -258,7 +258,7 @@ namespace
m->insert('c', stringify(i->name().category()));
m->insert('p', stringify(i->name().package()));
m->insert('v', stringify(i->version()));
- m->insert('s', i->slot_key() ? stringify(i->slot_key()->value()) : "");
+ m->insert('s', i->slot_key() ? stringify(i->slot_key()->parse_value()) : "");
m->insert(':', i->slot_key() ? ":" : "");
m->insert('r', stringify(i->repository_name()));
m->insert('F', i->canonical_form(idcf_full));
diff --git a/src/clients/cave/cmd_print_repositories.cc b/src/clients/cave/cmd_print_repositories.cc
index 897cfdaf8..c5afef7b7 100644
--- a/src/clients/cave/cmd_print_repositories.cc
+++ b/src/clients/cave/cmd_print_repositories.cc
@@ -102,7 +102,7 @@ PrintRepositoriesCommand::run(
if (r->format_key())
{
if (cmdline.a_repository_format.end_args() == std::find(cmdline.a_repository_format.begin_args(), cmdline.a_repository_format.end_args(),
- r->format_key()->value()))
+ r->format_key()->parse_value()))
continue;
repository_names.insert(r->name());
diff --git a/src/clients/cave/cmd_print_unused_distfiles.cc b/src/clients/cave/cmd_print_unused_distfiles.cc
index a9a1e3ecc..02c1cab4f 100644
--- a/src/clients/cave/cmd_print_unused_distfiles.cc
+++ b/src/clients/cave/cmd_print_unused_distfiles.cc
@@ -158,7 +158,7 @@ PrintUnusedDistfilesCommand::run(
std::set<std::string> used_distfiles;
std::list<Selection> selections;
- selections.push_back(selection::AllVersionsUnsorted(generator::All() | filter::InstalledAtRoot(env->preferred_root_key()->value())));
+ selections.push_back(selection::AllVersionsUnsorted(generator::All() | filter::InstalledAtRoot(env->preferred_root_key()->parse_value())));
for (auto c(cmdline.a_include.begin_args()), c_end(cmdline.a_include.end_args()) ;
c != c_end ; ++c)
@@ -179,7 +179,7 @@ PrintUnusedDistfilesCommand::run(
if ((*iter)->fetches_key())
{
DistfilesFilter filter(env.get(), *iter, used_distfiles);
- (*iter)->fetches_key()->value()->top()->accept(filter);
+ (*iter)->fetches_key()->parse_value()->top()->accept(filter);
}
}
}
@@ -198,7 +198,7 @@ PrintUnusedDistfilesCommand::run(
{
auto path_key(visitor_cast<const MetadataValueKey<FSPath>>(**distdir_metadata));
if (path_key)
- distdirs.insert(path_key->value().realpath());
+ distdirs.insert(path_key->parse_value().realpath());
}
}
diff --git a/src/clients/cave/cmd_report.cc b/src/clients/cave/cmd_report.cc
index fb34c37f2..1959a6d4c 100644
--- a/src/clients/cave/cmd_report.cc
+++ b/src/clients/cave/cmd_report.cc
@@ -101,7 +101,8 @@ namespace
{
if (id->from_repositories_key())
{
- for (auto r(id->from_repositories_key()->value()->begin()), r_end(id->from_repositories_key()->value()->end()) ;
+ auto from_repositories(id->from_repositories_key()->parse_value());
+ for (auto r(from_repositories->begin()), r_end(from_repositories->end()) ;
r != r_end ; ++r)
{
auto ids((*env)[selection::BestVersionOnly((
@@ -170,7 +171,7 @@ ReportCommand::run(
throw args::DoHelp("report takes no parameters");
auto ids((*env)[selection::AllVersionsSorted(
- generator::All() | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
+ generator::All() | filter::InstalledAtRoot(env->preferred_root_key()->parse_value()))]);
auto insecurity(env->set(SetName("insecurity")));
@@ -195,8 +196,15 @@ ReportCommand::run(
auto origin(find_origin_for(env, *i));
if (! origin)
{
- if ((*i)->behaviours_key() &&
- (*i)->behaviours_key()->value()->end() != (*i)->behaviours_key()->value()->find("transient"))
+ bool is_transient(false);
+
+ if ((*i)->behaviours_key())
+ {
+ auto behaviours((*i)->behaviours_key()->parse_value());
+ is_transient = behaviours->end() != behaviours->find("transient");
+ }
+
+ if (is_transient)
{
/* that's ok */
}
@@ -205,7 +213,10 @@ ReportCommand::run(
need_heading(done_heading, *i);
std::string repos;
if ((*i)->from_repositories_key())
- repos = join((*i)->from_repositories_key()->value()->begin(), (*i)->from_repositories_key()->value()->end(), ", ");
+ {
+ auto from_repositories((*i)->from_repositories_key()->parse_value());
+ repos = join(from_repositories->begin(), from_repositories->end(), ", ");
+ }
cout << fuc(fs_package_no_origin(), fv<'s'>(repos));
}
}
@@ -226,9 +237,15 @@ ReportCommand::run(
if (unused->end() != unused->find(*i))
{
- if (((*i)->behaviours_key() && (*i)->behaviours_key()->value()->end() !=
- (*i)->behaviours_key()->value()->find("used")) ||
- (! (*i)->supports_action(SupportsActionTest<UninstallAction>())))
+ bool is_used(false);
+
+ if ((*i)->behaviours_key())
+ {
+ auto behaviours((*i)->behaviours_key()->parse_value());
+ is_used = behaviours->end() != behaviours->find("used");
+ }
+
+ if (is_used || (! (*i)->supports_action(SupportsActionTest<UninstallAction>())))
{
/* ok, or weird */
}
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index f3c070495..a5c9804f8 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -164,7 +164,7 @@ namespace
std::string slot_as_string(const std::shared_ptr<const PackageID> & id)
{
if (id->slot_key())
- return stringify(id->slot_key()->value());
+ return stringify(id->slot_key()->parse_value());
else
return "";
}
@@ -280,23 +280,23 @@ namespace
void visit(const ContentsFileEntry & e)
{
- s << fuc(fs_contents_file(), fv<'r'>(stringify(e.location_key()->value())), fv<'b'>(indent ? "true" : ""));
+ s << fuc(fs_contents_file(), fv<'r'>(stringify(e.location_key()->parse_value())), fv<'b'>(indent ? "true" : ""));
}
void visit(const ContentsDirEntry & e)
{
- s << fuc(fs_contents_dir(), fv<'r'>(stringify(e.location_key()->value())), fv<'b'>(indent ? "true" : ""));
+ s << fuc(fs_contents_dir(), fv<'r'>(stringify(e.location_key()->parse_value())), fv<'b'>(indent ? "true" : ""));
}
void visit(const ContentsSymEntry & e)
{
- s << fuc(fs_contents_sym(), fv<'r'>(stringify(e.location_key()->value())), fv<'b'>(indent ? "true" : ""),
- fv<'v'>(e.target_key()->value()));
+ s << fuc(fs_contents_sym(), fv<'r'>(stringify(e.location_key()->parse_value())), fv<'b'>(indent ? "true" : ""),
+ fv<'v'>(e.target_key()->parse_value()));
}
void visit(const ContentsOtherEntry & e)
{
- s << fuc(fs_contents_other(), fv<'r'>(stringify(e.location_key()->value())), fv<'b'>(indent ? "true" : ""));
+ s << fuc(fs_contents_other(), fv<'r'>(stringify(e.location_key()->parse_value())), fv<'b'>(indent ? "true" : ""));
}
};
@@ -333,7 +333,7 @@ namespace
{
std::shared_ptr<const ChoiceValue> maybe_old_value;
if (maybe_old_id && maybe_old_id->choices_key())
- maybe_old_value = maybe_old_id->choices_key()->value()->find_by_name_with_prefix(value->name_with_prefix());
+ maybe_old_value = maybe_old_id->choices_key()->parse_value()->find_by_name_with_prefix(value->name_with_prefix());
if (maybe_old_value)
{
@@ -507,10 +507,11 @@ namespace
void visit(const MetadataCollectionKey<FSPathSequence> & k)
{
+ auto v(k.parse_value());
out << fuc(
(cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? k.raw_name() : k.human_name()),
- fv<'v'>(join(k.value()->begin(), k.value()->end(), ", ")),
+ fv<'v'>(join(v->begin(), v->end(), ", ")),
fv<'i'>(std::string(indent, ' ')),
fv<'b'>(important ? "true" : ""),
fv<'p'>("")
@@ -683,7 +684,7 @@ namespace
out << fuc(
(cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? k.raw_name() : k.human_name()),
- fv<'v'>(stringify(k.value())),
+ fv<'v'>(stringify(k.parse_value())),
fv<'i'>(std::string(indent, ' ')),
fv<'b'>(important ? "true" : ""),
fv<'p'>("")
@@ -695,7 +696,7 @@ namespace
out << fuc(
(cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? k.raw_name() : k.human_name()),
- fv<'v'>(stringify(k.value())),
+ fv<'v'>(stringify(k.parse_value())),
fv<'i'>(std::string(indent, ' ')),
fv<'b'>(important ? "true" : ""),
fv<'p'>("")
@@ -707,7 +708,7 @@ namespace
out << fuc(
(cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? k.raw_name() : k.human_name()),
- fv<'v'>(stringify(k.value())),
+ fv<'v'>(stringify(k.parse_value())),
fv<'i'>(std::string(indent, ' ')),
fv<'b'>(important ? "true" : ""),
fv<'p'>("")
@@ -719,7 +720,7 @@ namespace
out << fuc(
(cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? k.raw_name() : k.human_name()),
- fv<'v'>(stringify(k.value())),
+ fv<'v'>(stringify(k.parse_value())),
fv<'i'>(std::string(indent, ' ')),
fv<'b'>(important ? "true" : ""),
fv<'p'>("")
@@ -731,7 +732,7 @@ namespace
out << fuc(
(cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? k.raw_name() : k.human_name()),
- fv<'v'>(stringify(k.value())),
+ fv<'v'>(stringify(k.parse_value())),
fv<'i'>(std::string(indent, ' ')),
fv<'b'>(important ? "true" : ""),
fv<'p'>("")
@@ -743,7 +744,7 @@ namespace
out << fuc(
(cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? k.raw_name() : k.human_name()),
- fv<'v'>(stringify(*k.value())),
+ fv<'v'>(stringify(*k.parse_value())),
fv<'i'>(std::string(indent, ' ')),
fv<'b'>(important ? "true" : ""),
fv<'p'>("")
@@ -752,13 +753,13 @@ namespace
void visit(const MetadataValueKey<std::shared_ptr<const Contents> > & k)
{
+ auto v(k.parse_value());
if (cmdline.a_complex_keys.specified() || important)
{
if (cmdline.a_flat.specified())
{
ContentsDisplayer d(0);
- std::for_each(indirect_iterator(k.value()->begin()),
- indirect_iterator(k.value()->end()), accept_visitor(d));
+ std::for_each(indirect_iterator(v->begin()), indirect_iterator(v->end()), accept_visitor(d));
out << fuc(
(cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? k.raw_name() : k.human_name()),
@@ -771,8 +772,7 @@ namespace
else
{
ContentsDisplayer d(indent);
- std::for_each(indirect_iterator(k.value()->begin()),
- indirect_iterator(k.value()->end()), accept_visitor(d));
+ std::for_each(indirect_iterator(v->begin()), indirect_iterator(v->end()), accept_visitor(d));
out << fuc(
(cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? k.raw_name() : k.human_name()),
@@ -788,11 +788,12 @@ namespace
void visit(const MetadataValueKey<std::shared_ptr<const Choices> > & k)
{
+ auto choices(k.parse_value());
if (cmdline.a_flat.specified())
{
std::stringstream s;
bool empty_prefix(true);
- for (Choices::ConstIterator c(k.value()->begin()), c_end(k.value()->end()) ;
+ for (Choices::ConstIterator c(choices->begin()), c_end(choices->end()) ;
c != c_end ; ++c)
{
if (! cmdline.a_internal_keys.specified())
@@ -873,7 +874,7 @@ namespace
fv<'p'>("")
);
- for (Choices::ConstIterator c(k.value()->begin()), c_end(k.value()->end()) ;
+ for (Choices::ConstIterator c(choices->begin()), c_end(choices->end()) ;
c != c_end ; ++c)
{
if (! cmdline.a_internal_keys.specified())
@@ -994,7 +995,7 @@ namespace
out << fuc(
(cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? k.raw_name() : k.human_name()),
- fv<'v'>(pretty_print_time(k.value().seconds())),
+ fv<'v'>(pretty_print_time(k.parse_value().seconds())),
fv<'i'>(std::string(indent, ' ')),
fv<'b'>(important ? "true" : ""),
fv<'p'>("")
diff --git a/src/clients/cave/cmd_sync.cc b/src/clients/cave/cmd_sync.cc
index b287430f4..87330d721 100644
--- a/src/clients/cave/cmd_sync.cc
+++ b/src/clients/cave/cmd_sync.cc
@@ -140,10 +140,15 @@ namespace
return "";
const std::shared_ptr<const Repository> r(env->fetch_repository(name));
- if (r->sync_host_key() && r->sync_host_key()->value()->end() != r->sync_host_key()->value()->find(cmdline.a_suffix.argument()))
- return r->sync_host_key()->value()->find(cmdline.a_suffix.argument())->second;
- else
- return "";
+
+ if (r->sync_host_key())
+ {
+ auto sync_host(r->sync_host_key()->parse_value());
+ if (sync_host->end() != sync_host->find(cmdline.a_suffix.argument()))
+ return sync_host->find(cmdline.a_suffix.argument())->second;
+ }
+
+ return "";
}
virtual std::string unique_id() const
diff --git a/src/clients/cave/cmd_uninstall.cc b/src/clients/cave/cmd_uninstall.cc
index 6da009bcf..2b622a6f0 100644
--- a/src/clients/cave/cmd_uninstall.cc
+++ b/src/clients/cave/cmd_uninstall.cc
@@ -150,7 +150,7 @@ UninstallCommand::run(
qpns_being_changed.insert((*i)->name());
std::string target("!" + stringify((*i)->name()));
if ((*i)->slot_key())
- target.append(":" + stringify((*i)->slot_key()->value()));
+ target.append(":" + stringify((*i)->slot_key()->parse_value()));
targets->push_back(std::make_pair(target, ""));
}
diff --git a/src/clients/cave/cmd_update_world.cc b/src/clients/cave/cmd_update_world.cc
index e2ebd3e0b..afc5a26d9 100644
--- a/src/clients/cave/cmd_update_world.cc
+++ b/src/clients/cave/cmd_update_world.cc
@@ -137,7 +137,7 @@ UpdateWorldCommand::run(
if (cmdline.a_if_nothing_left.specified())
{
auto ids((*env)[selection::SomeArbitraryVersion(generator::Package(q) |
- filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
+ filter::InstalledAtRoot(env->preferred_root_key()->parse_value()))]);
if (ids->empty())
result = env->remove_from_world(q);
}
diff --git a/src/clients/cave/cmd_verify.cc b/src/clients/cave/cmd_verify.cc
index 8dbe003bd..6590012c4 100644
--- a/src/clients/cave/cmd_verify.cc
+++ b/src/clients/cave/cmd_verify.cc
@@ -123,7 +123,7 @@ namespace
if (e.end_metadata() != k)
{
const MetadataTimeKey * kk(visitor_cast<const MetadataTimeKey>(**k));
- if (kk && (kk->value().seconds() != f.mtim().seconds()))
+ if (kk && (kk->parse_value().seconds() != f.mtim().seconds()))
{
message(p, "Modification time changed");
return false;
@@ -143,7 +143,7 @@ namespace
{
SafeIFStream s(f);
MD5 md5(s);
- if (kk->value() != md5.hexsum())
+ if (kk->parse_value() != md5.hexsum())
{
message(f, "Contents (md5) changed");
return false;
@@ -156,7 +156,7 @@ namespace
void visit(const ContentsFileEntry & e)
{
- FSPath f(e.location_key()->value());
+ FSPath f(e.location_key()->parse_value());
FSStat f_stat(f);
if (! f_stat.exists())
message(f, "Does not exist");
@@ -168,7 +168,7 @@ namespace
void visit(const ContentsSymEntry & e)
{
- FSPath f(e.location_key()->value());
+ FSPath f(e.location_key()->parse_value());
FSStat f_stat(f);
if (! f_stat.exists())
message(f, "Does not exist");
@@ -180,7 +180,7 @@ namespace
void visit(const ContentsDirEntry & e)
{
- FSPath f(e.location_key()->value());
+ FSPath f(e.location_key()->parse_value());
FSStat f_stat(f);
if (! f_stat.exists())
message(f, "Does not exist");
@@ -213,14 +213,14 @@ VerifyCommand::run(
throw args::DoHelp("verify takes exactly one parameter");
PackageDepSpec spec(parse_spec_with_nice_error(*cmdline.begin_parameters(), env.get(),
- { updso_allow_wildcards }, filter::InstalledAtRoot(env->preferred_root_key()->value())));
+ { updso_allow_wildcards }, filter::InstalledAtRoot(env->preferred_root_key()->parse_value())));
std::shared_ptr<const PackageIDSequence> entries(
(*env)[selection::AllVersionsSorted(generator::Matches(spec, make_null_shared_ptr(), { }) |
- filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
+ filter::InstalledAtRoot(env->preferred_root_key()->parse_value()))]);
if (entries->empty())
- nothing_matching_error(env.get(), *cmdline.begin_parameters(), filter::InstalledAtRoot(env->preferred_root_key()->value()));
+ nothing_matching_error(env.get(), *cmdline.begin_parameters(), filter::InstalledAtRoot(env->preferred_root_key()->parse_value()));
int exit_status(0);
for (PackageIDSequence::ConstIterator i(entries->begin()), i_end(entries->end()) ;
@@ -230,9 +230,8 @@ VerifyCommand::run(
continue;
Verifier v(*i);
- std::for_each(indirect_iterator((*i)->contents_key()->value()->begin()),
- indirect_iterator((*i)->contents_key()->value()->end()),
- accept_visitor(v));
+ auto contents((*i)->contents_key()->parse_value());
+ std::for_each(indirect_iterator(contents->begin()), indirect_iterator(contents->end()), accept_visitor(v));
exit_status |= v.exit_status;
}
diff --git a/src/clients/cave/executables_common.cc b/src/clients/cave/executables_common.cc
index 123768003..962f1a485 100644
--- a/src/clients/cave/executables_common.cc
+++ b/src/clients/cave/executables_common.cc
@@ -81,17 +81,17 @@ namespace
void visit(const ContentsFileEntry & e)
{
- if (is_executable_in_path(e.location_key()->value()))
- _displayer(e.location_key()->value());
+ if (is_executable_in_path(e.location_key()->parse_value()))
+ _displayer(e.location_key()->parse_value());
}
void visit(const ContentsSymEntry & e)
{
- FSPath symlink(e.location_key()->value());
+ FSPath symlink(e.location_key()->parse_value());
FSPath real_file(symlink.realpath_if_exists());
if (symlink != real_file && is_executable_in_path(symlink))
- _displayer(e.location_key()->value());
+ _displayer(e.location_key()->parse_value());
}
void visit(const ContentsDirEntry &)
@@ -113,11 +113,11 @@ paludis::cave::executables_common(
const bool best)
{
PackageDepSpec spec(parse_spec_with_nice_error(param, env.get(), { updso_allow_wildcards },
- filter::InstalledAtRoot(env->preferred_root_key()->value())));
+ filter::InstalledAtRoot(env->preferred_root_key()->parse_value())));
std::shared_ptr<const PackageIDSequence> entries(
(*env)[selection::AllVersionsSorted(generator::Matches(spec, make_null_shared_ptr(), { }) |
- filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
+ filter::InstalledAtRoot(env->preferred_root_key()->parse_value()))]);
if (entries->empty())
throw NoSuchPackageError(param);
@@ -135,7 +135,7 @@ paludis::cave::executables_common(
{
if ((*i)->contents_key())
{
- std::shared_ptr<const Contents> contents((*i)->contents_key()->value());
+ std::shared_ptr<const Contents> contents((*i)->contents_key()->parse_value());
std::for_each(indirect_iterator(contents->begin()), indirect_iterator(contents->end()), accept_visitor(ed));
}
}
diff --git a/src/clients/cave/format_plain_contents_entry.cc b/src/clients/cave/format_plain_contents_entry.cc
index 2b1efc719..eafa3778f 100644
--- a/src/clients/cave/format_plain_contents_entry.cc
+++ b/src/clients/cave/format_plain_contents_entry.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010, 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
@@ -48,7 +48,7 @@ namespace
void visit(const ContentsSymEntry & c)
{
- target = c.target_key()->value();
+ target = c.target_key()->parse_value();
}
void visit(const ContentsOtherEntry &)
@@ -75,12 +75,12 @@ paludis::cave::format_plain_contents_entry(
c->accept(v);
std::shared_ptr<Map<char, std::string> > m(std::make_shared<Map<char, std::string>>());
- m->insert('n', stringify(c->location_key()->value()));
- m->insert('d', stringify(c->location_key()->value().dirname()));
- m->insert('b', stringify(c->location_key()->value().basename()));
+ m->insert('n', stringify(c->location_key()->parse_value()));
+ m->insert('d', stringify(c->location_key()->parse_value().dirname()));
+ m->insert('b', stringify(c->location_key()->parse_value().basename()));
m->insert('t', v.target);
m->insert('a', v.target.empty() ? "" : " -> ");
- m->insert('i', std::string(number_of_parents(c->location_key()->value()), ' '));
+ m->insert('i', std::string(number_of_parents(c->location_key()->parse_value()), ' '));
m->insert('/', v.slash);
return format_string(f, m);
diff --git a/src/clients/cave/format_plain_metadata_key.cc b/src/clients/cave/format_plain_metadata_key.cc
index 6845df5ca..fcdbd5abf 100644
--- a/src/clients/cave/format_plain_metadata_key.cc
+++ b/src/clients/cave/format_plain_metadata_key.cc
@@ -42,7 +42,7 @@ namespace
void visit(const MetadataTimeKey & k)
{
- s << k.value().seconds();
+ s << k.parse_value().seconds();
}
void visit(const MetadataValueKey<std::shared_ptr<const Contents> > &)
@@ -57,32 +57,32 @@ namespace
void visit(const MetadataValueKey<std::shared_ptr<const PackageID> > & k)
{
- s << *k.value();
+ s << *k.parse_value();
}
void visit(const MetadataValueKey<FSPath> & k)
{
- s << k.value();
+ s << k.parse_value();
}
void visit(const MetadataValueKey<bool> & k)
{
- s << (k.value() ? "true" : "false");
+ s << (k.parse_value() ? "true" : "false");
}
void visit(const MetadataValueKey<long> & k)
{
- s << k.value();
+ s << k.parse_value();
}
void visit(const MetadataValueKey<std::string> & k)
{
- s << k.value();
+ s << k.parse_value();
}
void visit(const MetadataValueKey<SlotName> & k)
{
- s << k.value();
+ s << k.parse_value();
}
void visit(const MetadataSpecTreeKey<DependencySpecTree> & k)
diff --git a/src/clients/cave/owner_common.cc b/src/clients/cave/owner_common.cc
index 183f26150..5b7a205d8 100644
--- a/src/clients/cave/owner_common.cc
+++ b/src/clients/cave/owner_common.cc
@@ -43,17 +43,17 @@ namespace
{
bool handle_full(const std::string & q, const std::shared_ptr<const ContentsEntry> & e)
{
- return q == stringify(e->location_key()->value());
+ return q == stringify(e->location_key()->parse_value());
}
bool handle_basename(const std::string & q, const std::shared_ptr<const ContentsEntry> & e)
{
- return q == e->location_key()->value().basename();
+ return q == e->location_key()->parse_value().basename();
}
bool handle_partial(const std::string & q, const std::shared_ptr<const ContentsEntry> & e)
{
- return std::string::npos != stringify(e->location_key()->value()).find(q);
+ return std::string::npos != stringify(e->location_key()->parse_value()).find(q);
}
}
@@ -100,14 +100,14 @@ paludis::cave::owner_common(
}
std::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsSorted(generator::All() |
- filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
+ filter::InstalledAtRoot(env->preferred_root_key()->parse_value()))]);
for (PackageIDSequence::ConstIterator p(ids->begin()), p_end(ids->end()); p != p_end; ++p)
{
if (! (*p)->contents_key())
continue;
- std::shared_ptr<const Contents> contents((*p)->contents_key()->value());
+ std::shared_ptr<const Contents> contents((*p)->contents_key()->parse_value());
if (contents->end() != std::find_if(contents->begin(), contents->end(), std::bind(handler, query,
std::placeholders::_1)))
{
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index 1b06e5932..fde788486 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -185,7 +185,7 @@ namespace
if (resolution_options.a_reinstall_dependents_of.specified())
{
- auto installed_filter(filter::InstalledAtRoot(env->system_root_key()->value()));
+ auto installed_filter(filter::InstalledAtRoot(env->system_root_key()->parse_value()));
auto installed_ids((*env)[selection::AllVersionsSorted(
generator::All() |
installed_filter)]);
@@ -637,7 +637,7 @@ namespace
{
if (arg.argument() == "auto")
{
- if (env->preferred_root_key()->value() == FSPath("/"))
+ if (env->preferred_root_key()->parse_value() == FSPath("/"))
return dt_install_to_slash;
else
return dt_install_to_chroot;
diff --git a/src/clients/cave/select_format_for_spec.cc b/src/clients/cave/select_format_for_spec.cc
index 5a59b6d73..7ce380a6c 100644
--- a/src/clients/cave/select_format_for_spec.cc
+++ b/src/clients/cave/select_format_for_spec.cc
@@ -41,7 +41,7 @@ paludis::cave::select_format_for_spec(
const T_ & if_unavailable
)
{
- if (! (*env)[selection::SomeArbitraryVersion(generator::Matches(spec, from_id, { }) | filter::InstalledAtRoot(env->system_root_key()->value()))]->empty())
+ if (! (*env)[selection::SomeArbitraryVersion(generator::Matches(spec, from_id, { }) | filter::InstalledAtRoot(env->system_root_key()->parse_value()))]->empty())
return if_installed;
if (! (*env)[selection::SomeArbitraryVersion(generator::Matches(spec, from_id, { }) | filter::SupportsAction<InstallAction>()
| filter::NotMasked())]->empty())
diff --git a/src/clients/cave/size_common.cc b/src/clients/cave/size_common.cc
index c06927830..f5a7ddfba 100644
--- a/src/clients/cave/size_common.cc
+++ b/src/clients/cave/size_common.cc
@@ -70,7 +70,7 @@ namespace
unsigned long visit(const ContentsFileEntry & e) const
{
- FSPath path(e.location_key()->value());
+ FSPath path(e.location_key()->parse_value());
FSStat stat(path);
if (stat.is_regular_file_or_symlink_to_regular_file())
@@ -95,7 +95,7 @@ paludis::cave::size_common(
{
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()))]);
+ filter::InstalledAtRoot(env->preferred_root_key()->parse_value()))]);
if (entries->empty())
return EXIT_FAILURE;
@@ -109,7 +109,8 @@ paludis::cave::size_common(
throw BadIDForCommand(spec, (*i), "does not support listing contents");
unsigned long size(0);
- for (auto c((*i)->contents_key()->value()->begin()), c_end((*i)->contents_key()->value()->end()) ;
+ auto contents((*i)->contents_key()->parse_value());
+ for (auto c(contents->begin()), c_end(contents->end()) ;
c != c_end ; ++c)
size += (*c)->accept_returning<unsigned long>(GetSize());
diff --git a/src/clients/instruo/instruo.cc b/src/clients/instruo/instruo.cc
index aa26e60c0..67ab6ee85 100644
--- a/src/clients/instruo/instruo.cc
+++ b/src/clients/instruo/instruo.cc
@@ -64,112 +64,112 @@ namespace
{
void visit(const MetadataValueKey<std::string> & k)
{
- const std::string & PALUDIS_ATTRIBUTE((unused)) s(k.value());
+ const std::string & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value());
}
void visit(const MetadataValueKey<SlotName> & k)
{
- const SlotName & PALUDIS_ATTRIBUTE((unused)) s(k.value());
+ const SlotName & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value());
}
void visit(const MetadataValueKey<long> & k)
{
- long PALUDIS_ATTRIBUTE((unused)) t(k.value());
+ long PALUDIS_ATTRIBUTE((unused)) t(k.parse_value());
}
void visit(const MetadataValueKey<bool> & k)
{
- bool PALUDIS_ATTRIBUTE((unused)) t(k.value());
+ bool PALUDIS_ATTRIBUTE((unused)) t(k.parse_value());
}
void visit(const MetadataValueKey<std::shared_ptr<const PackageID> > & k)
{
- const std::shared_ptr<const PackageID> & PALUDIS_ATTRIBUTE((unused)) p(k.value());
+ const std::shared_ptr<const PackageID> & PALUDIS_ATTRIBUTE((unused)) p(k.parse_value());
}
void visit(const MetadataTimeKey & k)
{
- Timestamp PALUDIS_ATTRIBUTE((unused)) t(k.value());
+ Timestamp PALUDIS_ATTRIBUTE((unused)) t(k.parse_value());
}
void visit(const MetadataValueKey<std::shared_ptr<const Contents> > & k)
{
- const std::shared_ptr<const Contents> & PALUDIS_ATTRIBUTE((unused)) c(k.value());
+ const std::shared_ptr<const Contents> & PALUDIS_ATTRIBUTE((unused)) c(k.parse_value());
}
void visit(const MetadataValueKey<FSPath> & k)
{
- const FSPath & PALUDIS_ATTRIBUTE((unused)) c(k.value());
+ const FSPath & PALUDIS_ATTRIBUTE((unused)) c(k.parse_value());
}
void visit(const MetadataSpecTreeKey<PlainTextSpecTree> & k)
{
- const std::shared_ptr<const PlainTextSpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.value());
+ const std::shared_ptr<const PlainTextSpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.parse_value());
}
void visit(const MetadataSpecTreeKey<RequiredUseSpecTree> & k)
{
- const std::shared_ptr<const RequiredUseSpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.value());
+ const std::shared_ptr<const RequiredUseSpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.parse_value());
}
void visit(const MetadataSpecTreeKey<ProvideSpecTree> & k)
{
- const std::shared_ptr<const ProvideSpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.value());
+ const std::shared_ptr<const ProvideSpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.parse_value());
}
void visit(const MetadataSpecTreeKey<FetchableURISpecTree> & k)
{
- const std::shared_ptr<const FetchableURISpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.value());
+ const std::shared_ptr<const FetchableURISpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.parse_value());
}
void visit(const MetadataSpecTreeKey<SimpleURISpecTree> & k)
{
- const std::shared_ptr<const SimpleURISpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.value());
+ const std::shared_ptr<const SimpleURISpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.parse_value());
}
void visit(const MetadataSpecTreeKey<LicenseSpecTree> & k)
{
- const std::shared_ptr<const LicenseSpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.value());
+ const std::shared_ptr<const LicenseSpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.parse_value());
}
void visit(const MetadataSpecTreeKey<DependencySpecTree> & k)
{
- const std::shared_ptr<const DependencySpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.value());
+ const std::shared_ptr<const DependencySpecTree> & PALUDIS_ATTRIBUTE((unused)) t(k.parse_value());
}
void visit(const MetadataCollectionKey<PackageIDSequence> & k)
{
- const std::shared_ptr<const PackageIDSequence> & PALUDIS_ATTRIBUTE((unused)) s(k.value());
+ const std::shared_ptr<const PackageIDSequence> & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value());
}
void visit(const MetadataCollectionKey<Set<std::string> > & k)
{
- const std::shared_ptr<const Set<std::string> > & PALUDIS_ATTRIBUTE((unused)) s(k.value());
+ const std::shared_ptr<const Set<std::string> > & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value());
}
void visit(const MetadataCollectionKey<Map<std::string, std::string> > & k)
{
- const std::shared_ptr<const Map<std::string, std::string> > & PALUDIS_ATTRIBUTE((unused)) s(k.value());
+ const std::shared_ptr<const Map<std::string, std::string> > & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value());
}
void visit(const MetadataCollectionKey<Sequence<std::string> > & k)
{
- const std::shared_ptr<const Sequence<std::string> > & PALUDIS_ATTRIBUTE((unused)) s(k.value());
+ const std::shared_ptr<const Sequence<std::string> > & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value());
}
void visit(const MetadataCollectionKey<FSPathSequence> & k)
{
- const std::shared_ptr<const FSPathSequence> & PALUDIS_ATTRIBUTE((unused)) s(k.value());
+ const std::shared_ptr<const FSPathSequence> & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value());
}
void visit(const MetadataCollectionKey<KeywordNameSet> & k)
{
- const std::shared_ptr<const KeywordNameSet> & PALUDIS_ATTRIBUTE((unused)) s(k.value());
+ const std::shared_ptr<const KeywordNameSet> & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value());
}
void visit(const MetadataValueKey<std::shared_ptr<const Choices> > & k)
{
- const std::shared_ptr<const Choices> & PALUDIS_ATTRIBUTE((unused)) s(k.value());
+ const std::shared_ptr<const Choices> & PALUDIS_ATTRIBUTE((unused)) s(k.parse_value());
}
void visit(const MetadataSectionKey & k)
@@ -220,7 +220,7 @@ namespace
continue;
}
- if (visitor_cast<const MetadataValueKey<std::string> >(**eapi_i)->value() == "UNKNOWN")
+ if (visitor_cast<const MetadataValueKey<std::string> >(**eapi_i)->parse_value() == "UNKNOWN")
{
Lock lock(mutex);
results.insert(std::make_pair(id, "EAPI is 'UNKNOWN'"));