MetadataKey value -> parse_value
This commit is contained in:
parent
271074eb11
commit
120c583239
@ -35,23 +35,23 @@ namespace
|
||||
public:
|
||||
void visit(const ContentsFileEntry & d)
|
||||
{
|
||||
cout << left << setw(10) << "file" << d.location_key()->value() << endl;
|
||||
cout << left << setw(10) << "file" << d.location_key()->parse_value() << endl;
|
||||
}
|
||||
|
||||
void visit(const ContentsDirEntry & d)
|
||||
{
|
||||
cout << left << setw(10) << "dir" << d.location_key()->value() << endl;
|
||||
cout << left << setw(10) << "dir" << d.location_key()->parse_value() << endl;
|
||||
}
|
||||
|
||||
void visit(const ContentsSymEntry & d)
|
||||
{
|
||||
cout << left << setw(10) << "sym" << d.location_key()->value()
|
||||
<< " -> " << d.target_key()->value() << endl;
|
||||
cout << left << setw(10) << "sym" << d.location_key()->parse_value()
|
||||
<< " -> " << d.target_key()->parse_value() << endl;
|
||||
}
|
||||
|
||||
void visit(const ContentsOtherEntry & d)
|
||||
{
|
||||
cout << left << setw(10) << "other" << d.location_key()->value() << endl;
|
||||
cout << left << setw(10) << "other" << d.location_key()->parse_value() << endl;
|
||||
}
|
||||
|
||||
};
|
||||
@ -90,12 +90,13 @@ int main(int argc, char * argv[])
|
||||
cout << "ID '" << **i << "' provides contents key:" << endl;
|
||||
|
||||
/* Visit the contents key's value's entries with our visitor. We use
|
||||
* indirect_iterator because value()->begin() and ->end() return
|
||||
* indirect_iterator because choices->begin() and ->end() return
|
||||
* iterators to std::shared_ptr<>s rather than raw objects. */
|
||||
ContentsPrinter p;
|
||||
auto contents((*i)->contents_key()->parse_value());
|
||||
std::for_each(
|
||||
indirect_iterator((*i)->contents_key()->value()->begin()),
|
||||
indirect_iterator((*i)->contents_key()->value()->end()),
|
||||
indirect_iterator(contents->begin()),
|
||||
indirect_iterator(contents->end()),
|
||||
accept_visitor(p));
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ int main(int argc, char * argv[])
|
||||
|
||||
/* Create a visitor that will collect distfiles, and do the collecting. */
|
||||
DistfilesCollector collector(results, is_initial_label_restricted.result);
|
||||
(*i)->fetches_key()->value()->top()->accept(collector);
|
||||
(*i)->fetches_key()->parse_value()->top()->accept(collector);
|
||||
}
|
||||
|
||||
/* Display summary of results */
|
||||
|
@ -60,7 +60,7 @@ int main(int argc, char * argv[])
|
||||
DepSpecFlattener<ProvideSpecTree, PackageDepSpec> provides(env.get(), *i);
|
||||
|
||||
/* Populate it by making it visit the key's value */
|
||||
(*i)->provide_key()->value()->top()->accept(provides);
|
||||
(*i)->provide_key()->parse_value()->top()->accept(provides);
|
||||
|
||||
/* The results are available through DepSpecFlattener::begin()
|
||||
* and ::end(). These return an iterator to a std::shared_ptr<>,
|
||||
@ -74,7 +74,7 @@ int main(int argc, char * argv[])
|
||||
if ((*i)->homepage_key())
|
||||
{
|
||||
DepSpecFlattener<SimpleURISpecTree, SimpleURIDepSpec> homepages(env.get(), *i);
|
||||
(*i)->homepage_key()->value()->top()->accept(homepages);
|
||||
(*i)->homepage_key()->parse_value()->top()->accept(homepages);
|
||||
|
||||
cout << " " << left << setw(24) << "Homepages:" << " "
|
||||
<< join(indirect_iterator(homepages.begin()), indirect_iterator(homepages.end()), " ")
|
||||
@ -93,7 +93,7 @@ int main(int argc, char * argv[])
|
||||
DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(env.get(), *i);
|
||||
|
||||
visitor_cast<const MetadataSpecTreeKey<PlainTextSpecTree> >(
|
||||
**(*i)->find_metadata("RESTRICT"))->value()->top()->accept(restricts);
|
||||
**(*i)->find_metadata("RESTRICT"))->parse_value()->top()->accept(restricts);
|
||||
|
||||
cout << " " << left << setw(24) << "Restricts:" << " "
|
||||
<< join(indirect_iterator(restricts.begin()), indirect_iterator(restricts.end()), " ")
|
||||
|
@ -58,45 +58,45 @@ namespace
|
||||
void visit(const MetadataValueKey<std::string> & key)
|
||||
{
|
||||
cout << indent << left << setw(30) << " Class:" << " " << "MetadataValueKey<std::string>" << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << key.value() << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << key.parse_value() << endl;
|
||||
}
|
||||
|
||||
void visit(const MetadataValueKey<SlotName> & key)
|
||||
{
|
||||
cout << indent << left << setw(30) << " Class:" << " " << "MetadataValueKey<SlotName>" << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << key.value() << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << key.parse_value() << endl;
|
||||
}
|
||||
|
||||
void visit(const MetadataValueKey<long> & key)
|
||||
{
|
||||
cout << indent << left << setw(30) << " Class:" << " " << "MetadataValueKey<long>" << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << key.value() << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << key.parse_value() << endl;
|
||||
}
|
||||
|
||||
void visit(const MetadataValueKey<bool> & key)
|
||||
{
|
||||
cout << indent << left << setw(30) << " Class:" << " " << "MetadataValueKey<bool>" << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << key.value() << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << key.parse_value() << endl;
|
||||
}
|
||||
|
||||
void visit(const MetadataValueKey<FSPath> & key)
|
||||
{
|
||||
cout << indent << left << setw(30) << " Class:" << " " << "MetadataValueKey<FSPath>" << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << key.value() << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << key.parse_value() << endl;
|
||||
}
|
||||
|
||||
void visit(const MetadataValueKey<std::shared_ptr<const PackageID> > & key)
|
||||
{
|
||||
cout << indent << left << setw(30) << " Class:" << " " <<
|
||||
"MetadataValueKey<std::shared_ptr<const PackageID> >" << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << *key.value() << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << *key.parse_value() << endl;
|
||||
}
|
||||
|
||||
void visit(const MetadataTimeKey & key)
|
||||
{
|
||||
cout << indent << left << setw(30) << " Class:" << " " << "MetadataTimeKey" << endl;
|
||||
|
||||
cout << indent << left << setw(30) << " Value:" << " " << pretty_print_time(key.value().seconds()) << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << pretty_print_time(key.parse_value().seconds()) << endl;
|
||||
}
|
||||
|
||||
void visit(const MetadataValueKey<std::shared_ptr<const Contents> > &)
|
||||
@ -167,37 +167,41 @@ namespace
|
||||
|
||||
void visit(const MetadataCollectionKey<Set<std::string> > & key)
|
||||
{
|
||||
auto value(key.parse_value());
|
||||
cout << indent << left << setw(30) << " Class:" << " " << "MetadataCollectionKey<Set<std::string> >" << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << join(key.value()->begin(), key.value()->end(), " ") << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << join(value->begin(), value->end(), " ") << endl;
|
||||
}
|
||||
|
||||
void visit(const MetadataCollectionKey<Map<std::string, std::string> > & key)
|
||||
{
|
||||
auto value(key.parse_value());
|
||||
cout << indent << left << setw(30) << " Class:" << " " << "MetadataCollectionKey<Map<std::string, std::string> >" << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << join(
|
||||
key.value()->begin(), key.value()->end(), " ", stringify_string_pair) << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << join(value->begin(), value->end(), " ", stringify_string_pair) << endl;
|
||||
}
|
||||
|
||||
void visit(const MetadataCollectionKey<Sequence<std::string> > & key)
|
||||
{
|
||||
auto value(key.parse_value());
|
||||
cout << indent << left << setw(30) << " Class:" << " " << "MetadataCollectionKey<Sequence<std::string> >" << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << join(key.value()->begin(), key.value()->end(), " ") << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << join(value->begin(), value->end(), " ") << endl;
|
||||
}
|
||||
|
||||
void visit(const MetadataCollectionKey<FSPathSequence> & key)
|
||||
{
|
||||
auto value(key.parse_value());
|
||||
cout << indent << left << setw(30) << " Class:" << " " << "MetadataCollectionKey<FSPathSequence>" << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << join(key.value()->begin(), key.value()->end(), " ") << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << join(value->begin(), value->end(), " ") << endl;
|
||||
}
|
||||
|
||||
void visit(const MetadataCollectionKey<PackageIDSequence> & key)
|
||||
{
|
||||
auto value(key.parse_value());
|
||||
cout << indent << left << setw(30) << " Class:" << " " << "MetadataCollectionKey<PackageIDSequence>" << endl;
|
||||
/* Slight trickery: a PackageIDSequence stores shared pointers
|
||||
* to PackageID instances, so we need indirect_iterator to get
|
||||
* an extra level of dereferencing. */
|
||||
cout << indent << left << setw(30) << " Value:" << " " << join(indirect_iterator(key.value()->begin()),
|
||||
indirect_iterator(key.value()->end()), " ") << endl;
|
||||
cout << indent << left << setw(30) << " Value:" << " " << join(indirect_iterator(value->begin()),
|
||||
indirect_iterator(value->end()), " ") << endl;
|
||||
}
|
||||
|
||||
void visit(const MetadataSectionKey & key)
|
||||
|
@ -30,20 +30,20 @@ ids.each do | id |
|
||||
puts "ID '#{id}' provides contents key:"
|
||||
|
||||
# Contents is made up of a collection of ContentsEntry instances.
|
||||
id.contents_key.value.each do | c |
|
||||
id.contents_key.parse_value.each do | c |
|
||||
|
||||
# Some ContentsEntry subclasses contain more information than others
|
||||
if c.kind_of? ContentsOtherEntry
|
||||
puts "other #{c.location_key.value}"
|
||||
puts "other #{c.location_key.parse_value}"
|
||||
|
||||
elsif c.kind_of? ContentsFileEntry
|
||||
puts "file #{c.location_key.value}"
|
||||
puts "file #{c.location_key.parse_value}"
|
||||
|
||||
elsif c.kind_of? ContentsDirEntry
|
||||
puts "dir #{c.location_key.value}"
|
||||
puts "dir #{c.location_key.parse_value}"
|
||||
|
||||
elsif c.kind_of? ContentsSymEntry
|
||||
puts "sym #{c.location_key.value} -> #{c.target_key.value}"
|
||||
puts "sym #{c.location_key.parse_value} -> #{c.target_key.parse_value}"
|
||||
|
||||
else
|
||||
puts "unknown #{c}"
|
||||
|
@ -134,13 +134,13 @@ ids.each do | id |
|
||||
[ :build_dependencies_key, :run_dependencies_key, :post_dependencies_key,
|
||||
:suggested_dependencies_key ].each do | key |
|
||||
if id.send(key)
|
||||
collect_dependencies(env, id, id.send(key).value, results)
|
||||
collect_dependencies(env, id, id.send(key).parse_value, results)
|
||||
end
|
||||
end
|
||||
|
||||
# And the same for '.zip' file extensions
|
||||
if id.fetches_key
|
||||
collect_extensions(env, id, id.fetches_key.value, results)
|
||||
collect_extensions(env, id, id.fetches_key.parse_value, results)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -91,7 +91,7 @@ namespace paludis
|
||||
|
||||
Imp(const Environment * the_env, const std::shared_ptr<const Sequence<std::string>> & the_libraries) :
|
||||
env(the_env),
|
||||
config(the_env->preferred_root_key()->value()),
|
||||
config(the_env->preferred_root_key()->parse_value()),
|
||||
libraries(the_libraries),
|
||||
has_files(false)
|
||||
{
|
||||
@ -145,16 +145,16 @@ BrokenLinkageFinder::BrokenLinkageFinder(const Environment * env, const std::sha
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
|
||||
Context ctx("When checking for broken linkage in '" + stringify(env->preferred_root_key()->value()) + "':");
|
||||
Context ctx("When checking for broken linkage in '" + stringify(env->preferred_root_key()->parse_value()) + "':");
|
||||
|
||||
_imp->checkers.push_back(std::shared_ptr<LinkageChecker>(std::make_shared<ElfLinkageChecker>(env->preferred_root_key()->value(), libraries)));
|
||||
_imp->checkers.push_back(std::shared_ptr<LinkageChecker>(std::make_shared<ElfLinkageChecker>(env->preferred_root_key()->parse_value(), libraries)));
|
||||
if (libraries->empty())
|
||||
_imp->checkers.push_back(std::shared_ptr<LinkageChecker>(std::make_shared<LibtoolLinkageChecker>(env->preferred_root_key()->value())));
|
||||
_imp->checkers.push_back(std::shared_ptr<LinkageChecker>(std::make_shared<LibtoolLinkageChecker>(env->preferred_root_key()->parse_value())));
|
||||
|
||||
std::vector<FSPath> search_dirs_nosyms, search_dirs_pruned;
|
||||
std::transform(_imp->config.begin_search_dirs(), _imp->config.end_search_dirs(),
|
||||
std::back_inserter(search_dirs_nosyms),
|
||||
std::bind(realpath_with_current_and_root, _1, FSPath("/"), env->preferred_root_key()->value()));
|
||||
std::bind(realpath_with_current_and_root, _1, FSPath("/"), env->preferred_root_key()->parse_value()));
|
||||
std::sort(search_dirs_nosyms.begin(), search_dirs_nosyms.end(), FSPathComparator());
|
||||
|
||||
for (std::vector<FSPath>::const_iterator it(search_dirs_nosyms.begin()),
|
||||
@ -169,7 +169,7 @@ BrokenLinkageFinder::BrokenLinkageFinder(const Environment * env, const std::sha
|
||||
|
||||
std::transform(_imp->config.begin_ld_so_conf(), _imp->config.end_ld_so_conf(),
|
||||
std::inserter(_imp->extra_lib_dirs, _imp->extra_lib_dirs.begin()),
|
||||
std::bind(realpath_with_current_and_root, _1, FSPath("/"), env->preferred_root_key()->value()));
|
||||
std::bind(realpath_with_current_and_root, _1, FSPath("/"), env->preferred_root_key()->parse_value()));
|
||||
|
||||
std::for_each(search_dirs_pruned.begin(), search_dirs_pruned.end(),
|
||||
std::bind(&Imp<BrokenLinkageFinder>::search_directory, _imp.get(), _1));
|
||||
@ -178,9 +178,9 @@ BrokenLinkageFinder::BrokenLinkageFinder(const Environment * env, const std::sha
|
||||
it_end(_imp->extra_lib_dirs.end()); it_end != it; ++it)
|
||||
{
|
||||
Log::get_instance()->message("broken_linkage_finder.config", ll_debug, lc_context)
|
||||
<< "Need to check for extra libraries in '" << (env->preferred_root_key()->value() / *it) << "'";
|
||||
<< "Need to check for extra libraries in '" << (env->preferred_root_key()->parse_value() / *it) << "'";
|
||||
std::for_each(indirect_iterator(_imp->checkers.begin()), indirect_iterator(_imp->checkers.end()),
|
||||
std::bind(&LinkageChecker::add_extra_lib_dir, _1, env->preferred_root_key()->value() / *it));
|
||||
std::bind(&LinkageChecker::add_extra_lib_dir, _1, env->preferred_root_key()->parse_value() / *it));
|
||||
}
|
||||
|
||||
std::function<void (const FSPath &, const std::string &)> callback(
|
||||
@ -213,7 +213,7 @@ Imp<BrokenLinkageFinder>::search_directory(const FSPath & directory)
|
||||
}
|
||||
while (FSPath("/") != dir);
|
||||
|
||||
FSPath with_root(env->preferred_root_key()->value() / directory);
|
||||
FSPath with_root(env->preferred_root_key()->parse_value() / directory);
|
||||
if (with_root.stat().is_directory())
|
||||
walk_directory(with_root);
|
||||
else
|
||||
@ -226,7 +226,7 @@ Imp<BrokenLinkageFinder>::walk_directory(const FSPath & directory)
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
|
||||
FSPath without_root(directory.strip_leading(env->preferred_root_key()->value()));
|
||||
FSPath without_root(directory.strip_leading(env->preferred_root_key()->parse_value()));
|
||||
if (config.dir_is_masked(without_root))
|
||||
{
|
||||
Log::get_instance()->message("broken_linkage_finder.masked", ll_debug, lc_context)
|
||||
@ -263,7 +263,7 @@ Imp<BrokenLinkageFinder>::check_file(const FSPath & file)
|
||||
|
||||
if (file_stat.is_symlink())
|
||||
{
|
||||
FSPath target(dereference_with_root(file, env->preferred_root_key()->value()));
|
||||
FSPath target(dereference_with_root(file, env->preferred_root_key()->parse_value()));
|
||||
if (target.stat().is_regular_file())
|
||||
{
|
||||
std::for_each(indirect_iterator(checkers.begin()), indirect_iterator(checkers.end()),
|
||||
@ -306,13 +306,13 @@ Imp<BrokenLinkageFinder>::add_breakage(const FSPath & file, const std::string &
|
||||
Context ctx("When building map from files to packages:");
|
||||
|
||||
std::shared_ptr<const PackageIDSequence> pkgs((*env)[selection::AllVersionsUnsorted(
|
||||
generator::All() | filter::InstalledAtRoot(env->preferred_root_key()->value()))]);
|
||||
generator::All() | filter::InstalledAtRoot(env->preferred_root_key()->parse_value()))]);
|
||||
|
||||
std::for_each(pkgs->begin(), pkgs->end(),
|
||||
std::bind(&Imp<BrokenLinkageFinder>::gather_package, this, _1));
|
||||
}
|
||||
|
||||
FSPath without_root(file.strip_leading(env->preferred_root_key()->value()));
|
||||
FSPath without_root(file.strip_leading(env->preferred_root_key()->parse_value()));
|
||||
std::pair<Files::const_iterator, Files::const_iterator> range(files.equal_range(without_root));
|
||||
if (range.first == range.second)
|
||||
orphan_breakage[without_root].insert(req);
|
||||
@ -334,7 +334,7 @@ Imp<BrokenLinkageFinder>::gather_package(const std::shared_ptr<const PackageID>
|
||||
std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Contents> > > key(pkg->contents_key());
|
||||
if (! key)
|
||||
return;
|
||||
std::shared_ptr<const Contents> contents(key->value());
|
||||
std::shared_ptr<const Contents> contents(key->parse_value());
|
||||
if (! contents)
|
||||
return;
|
||||
|
||||
@ -345,7 +345,7 @@ Imp<BrokenLinkageFinder>::gather_package(const std::shared_ptr<const PackageID>
|
||||
if (0 != file)
|
||||
{
|
||||
Lock l(mutex);
|
||||
files.insert(std::make_pair(file->location_key()->value(), pkg));
|
||||
files.insert(std::make_pair(file->location_key()->parse_value(), pkg));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ namespace
|
||||
result->top()->append(std::make_shared<PackageDepSpec>(
|
||||
MutablePackageDepSpecData({ })
|
||||
.require_package((*i)->name())
|
||||
.require_exact_slot((*i)->slot_key()->value(), false)
|
||||
.require_exact_slot((*i)->slot_key()->parse_value(), false)
|
||||
));
|
||||
else
|
||||
result->top()->append(std::make_shared<PackageDepSpec>(
|
||||
|
@ -55,12 +55,13 @@ namespace
|
||||
return false;
|
||||
}
|
||||
|
||||
const std::shared_ptr<const ChoiceValue> v(id.choices_key()->value()->find_by_name_with_prefix(f));
|
||||
auto choices(id.choices_key()->parse_value());
|
||||
auto v(choices->find_by_name_with_prefix(f));
|
||||
if (v)
|
||||
return v->enabled();
|
||||
|
||||
if (! no_warning_for_unlisted)
|
||||
if (! id.choices_key()->value()->has_matching_contains_every_value_prefix(f))
|
||||
if (! choices->has_matching_contains_every_value_prefix(f))
|
||||
Log::get_instance()->message("elike_conditional_dep_spec.query", ll_warning, lc_context) <<
|
||||
"ID '" << id << "' has no flag named '" << f << "'";
|
||||
return false;
|
||||
@ -75,12 +76,13 @@ namespace
|
||||
return false;
|
||||
}
|
||||
|
||||
const std::shared_ptr<const ChoiceValue> v(id.choices_key()->value()->find_by_name_with_prefix(f));
|
||||
auto choices(id.choices_key()->parse_value());
|
||||
auto v(choices->find_by_name_with_prefix(f));
|
||||
if (v)
|
||||
return v->locked();
|
||||
|
||||
if (! no_warning_for_unlisted)
|
||||
if (! id.choices_key()->value()->has_matching_contains_every_value_prefix(f))
|
||||
if (! choices->has_matching_contains_every_value_prefix(f))
|
||||
Log::get_instance()->message("elike_conditional_dep_spec.query", ll_warning, lc_context) <<
|
||||
"ID '" << id << "' has no flag named '" << f << "'";
|
||||
return false;
|
||||
|
@ -64,12 +64,12 @@ namespace
|
||||
return c.is_true();
|
||||
}
|
||||
|
||||
const std::shared_ptr<const ChoiceValue> v(id->choices_key()->value()->find_by_name_with_prefix(f));
|
||||
auto choices(id->choices_key()->parse_value());
|
||||
auto v(choices->find_by_name_with_prefix(f));
|
||||
if (v)
|
||||
return v->enabled();
|
||||
|
||||
if (default_value.is_indeterminate() && ! id->choices_key()->value()->has_matching_contains_every_value_prefix(f) &&
|
||||
options[euro_missing_is_qa])
|
||||
if (default_value.is_indeterminate() && ! choices->has_matching_contains_every_value_prefix(f) && options[euro_missing_is_qa])
|
||||
Log::get_instance()->message("elike_use_requirement.query", ll_qa, lc_context) <<
|
||||
"ID '" << *id << "' has no flag named '" << f << "'";
|
||||
return default_value.is_true();
|
||||
@ -121,8 +121,9 @@ namespace
|
||||
ChoicePrefixName prefix((std::string::npos == p) ? "" : _flags.substr(0, p));
|
||||
if (! id->choices_key())
|
||||
return true;
|
||||
Choices::ConstIterator k(id->choices_key()->value()->find(prefix));
|
||||
if (id->choices_key()->value()->end() == k)
|
||||
auto choices(id->choices_key()->parse_value());
|
||||
Choices::ConstIterator k(choices->find(prefix));
|
||||
if (choices->end() == k)
|
||||
return true;
|
||||
if ((*k)->begin() == (*k)->end())
|
||||
return true;
|
||||
@ -160,8 +161,9 @@ namespace
|
||||
}
|
||||
|
||||
ChoicePrefixName prefix(_flags.substr(0, _flags.length() - 2));
|
||||
Choices::ConstIterator cc(from_id->choices_key()->value()->find(prefix));
|
||||
if (cc == from_id->choices_key()->value()->end())
|
||||
auto choices(from_id->choices_key()->parse_value());
|
||||
Choices::ConstIterator cc(choices->find(prefix));
|
||||
if (cc == choices->end())
|
||||
Log::get_instance()->message("elike_use_requirement.prefix_star_unmatching", ll_warning, lc_context) <<
|
||||
"ID '" << *from_id << "' uses requirement '" << _flags << "' but has no choice prefix '" << prefix << "'";
|
||||
else
|
||||
@ -234,8 +236,9 @@ namespace
|
||||
}
|
||||
|
||||
ChoicePrefixName prefix(_flags.substr(0, _flags.length() - 2));
|
||||
Choices::ConstIterator cc(from_id->choices_key()->value()->find(prefix));
|
||||
if (cc == from_id->choices_key()->value()->end())
|
||||
auto choices(from_id->choices_key()->parse_value());
|
||||
Choices::ConstIterator cc(choices->find(prefix));
|
||||
if (cc == choices->end())
|
||||
Log::get_instance()->message("elike_use_requirement.prefix_star_unmatching", ll_warning, lc_context) <<
|
||||
"ID '" << *from_id << "' uses requirement '" << _flags << "' but has no choice prefix '" << prefix << "'";
|
||||
else
|
||||
@ -260,7 +263,7 @@ namespace
|
||||
ChangedChoices & changed_choices,
|
||||
const ChoiceNameWithPrefix & flag) const
|
||||
{
|
||||
const std::shared_ptr<const ChoiceValue> v(id->choices_key()->value()->find_by_name_with_prefix(flag));
|
||||
const std::shared_ptr<const ChoiceValue> v(id->choices_key()->parse_value()->find_by_name_with_prefix(flag));
|
||||
|
||||
if (! v)
|
||||
{
|
||||
|
@ -444,7 +444,7 @@ namespace
|
||||
bool operator() (const QualifiedPackageName & qpn) const
|
||||
{
|
||||
return ! (*_env)[selection::SomeArbitraryVersion(generator::Package(qpn) |
|
||||
filter::InstalledAtRoot(_env->preferred_root_key()->value()))]->empty();
|
||||
filter::InstalledAtRoot(_env->preferred_root_key()->parse_value()))]->empty();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -418,7 +418,7 @@ NoConfigEnvironment::accept_keywords(
|
||||
|
||||
std::list<KeywordName> accepted;
|
||||
if (_imp->main_repo->accept_keywords_key())
|
||||
tokenise_whitespace(_imp->main_repo->accept_keywords_key()->value(),
|
||||
tokenise_whitespace(_imp->main_repo->accept_keywords_key()->parse_value(),
|
||||
create_inserter<KeywordName>(std::back_inserter(accepted)));
|
||||
|
||||
tokenise_whitespace(_imp->params.extra_accept_keywords(),
|
||||
|
@ -275,7 +275,7 @@ namespace
|
||||
m->insert("id", escape(stringify(*i.package_id())));
|
||||
m->insert("full_name", escape(stringify(*i.package_id())));
|
||||
if (i.package_id()->slot_key())
|
||||
m->insert("slot", stringify(i.package_id()->slot_key()->value()));
|
||||
m->insert("slot", stringify(i.package_id()->slot_key()->parse_value()));
|
||||
m->insert("version", stringify(i.package_id()->version()));
|
||||
m->insert("repository", stringify(i.package_id()->repository_name()));
|
||||
m->insert("category", stringify(i.package_id()->name().category()));
|
||||
|
@ -46,7 +46,7 @@ namespace
|
||||
{
|
||||
bool get_use(const std::string & f, const std::shared_ptr<const PackageID> & id)
|
||||
{
|
||||
const std::shared_ptr<const ChoiceValue> v(id->choices_key()->value()->find_by_name_with_prefix(ChoiceNameWithPrefix(f)));
|
||||
const std::shared_ptr<const ChoiceValue> v(id->choices_key()->parse_value()->find_by_name_with_prefix(ChoiceNameWithPrefix(f)));
|
||||
if (! v)
|
||||
return false;
|
||||
return v->enabled();
|
||||
@ -92,7 +92,8 @@ TEST(PaludisEnvironment, KnownUse)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
|
||||
env.get(), { })), make_null_shared_ptr(), { }))]->begin());
|
||||
std::shared_ptr<const Choice> foo_cards;
|
||||
for (Choices::ConstIterator c(id1->choices_key()->value()->begin()), c_end(id1->choices_key()->value()->end()) ;
|
||||
auto choices(id1->choices_key()->parse_value());
|
||||
for (Choices::ConstIterator c(choices->begin()), c_end(choices->end()) ;
|
||||
c != c_end ; ++c)
|
||||
if ((*c)->raw_name() == "FOO_CARDS")
|
||||
foo_cards = *c;
|
||||
|
@ -476,7 +476,7 @@ PortageEnvironment::_add_installed_virtuals_repository()
|
||||
{
|
||||
#ifdef ENABLE_VIRTUALS_REPOSITORY
|
||||
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
|
||||
keys->insert("root", stringify(preferred_root_key()->value()));
|
||||
keys->insert("root", stringify(preferred_root_key()->parse_value()));
|
||||
keys->insert("format", "installed_virtuals");
|
||||
add_repository(-1, RepositoryFactory::get_instance()->create(this, std::bind(from_keys, keys, std::placeholders::_1)));
|
||||
#endif
|
||||
@ -494,7 +494,7 @@ PortageEnvironment::_add_ebuild_repository(const FSPath & portdir, const std::st
|
||||
const std::string & sync, int importance)
|
||||
{
|
||||
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
|
||||
keys->insert("root", stringify(preferred_root_key()->value()));
|
||||
keys->insert("root", stringify(preferred_root_key()->parse_value()));
|
||||
keys->insert("location", stringify(portdir));
|
||||
keys->insert("profiles", stringify((_imp->conf_dir / "make.profile").realpath()) + " " +
|
||||
((_imp->conf_dir / "portage" / "profile").stat().is_directory() ?
|
||||
@ -525,8 +525,8 @@ PortageEnvironment::_add_vdb_repository()
|
||||
Context context("When creating vdb repository:");
|
||||
|
||||
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
|
||||
keys->insert("root", stringify(preferred_root_key()->value()));
|
||||
keys->insert("location", stringify(preferred_root_key()->value() / "/var/db/pkg"));
|
||||
keys->insert("root", stringify(preferred_root_key()->parse_value()));
|
||||
keys->insert("location", stringify(preferred_root_key()->parse_value() / "/var/db/pkg"));
|
||||
keys->insert("format", "vdb");
|
||||
keys->insert("names_cache", "/var/empty");
|
||||
keys->insert("provides_cache", "/var/empty");
|
||||
|
@ -67,7 +67,7 @@ namespace
|
||||
|
||||
bool get_use(const std::string & f, const Environment &, const std::shared_ptr<const PackageID> & id)
|
||||
{
|
||||
const std::shared_ptr<const ChoiceValue> v(id->choices_key()->value()->find_by_name_with_prefix(ChoiceNameWithPrefix(f)));
|
||||
const std::shared_ptr<const ChoiceValue> v(id->choices_key()->parse_value()->find_by_name_with_prefix(ChoiceNameWithPrefix(f)));
|
||||
if (! v)
|
||||
throw InternalError(PALUDIS_HERE, "oops");
|
||||
return v->enabled();
|
||||
@ -112,7 +112,8 @@ TEST(PortageEnvironment, KnownUseFlagNames)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
std::shared_ptr<const Choice> foo_cards;
|
||||
for (Choices::ConstIterator c(id1->choices_key()->value()->begin()), c_end(id1->choices_key()->value()->end()) ;
|
||||
auto choices(id1->choices_key()->parse_value());
|
||||
for (Choices::ConstIterator c(choices->begin()), c_end(choices->end()) ;
|
||||
c != c_end ; ++c)
|
||||
if ((*c)->raw_name() == "FOO_CARDS")
|
||||
foo_cards = *c;
|
||||
|
@ -243,7 +243,7 @@ namespace
|
||||
r != r_end ; ++r)
|
||||
{
|
||||
const std::shared_ptr<const Repository> repo(env->fetch_repository(*r));
|
||||
if (repo->installed_root_key() && (equal == (root == repo->installed_root_key()->value())))
|
||||
if (repo->installed_root_key() && (equal == (root == repo->installed_root_key()->parse_value())))
|
||||
result->insert(*r);
|
||||
}
|
||||
|
||||
@ -348,7 +348,7 @@ namespace
|
||||
i != i_end ; ++i)
|
||||
if (as_id->slot_key())
|
||||
{
|
||||
if ((*i)->slot_key() && (*i)->slot_key()->value() == as_id->slot_key()->value())
|
||||
if ((*i)->slot_key() && (*i)->slot_key()->parse_value() == as_id->slot_key()->parse_value())
|
||||
result->insert(*i);
|
||||
}
|
||||
else
|
||||
@ -389,7 +389,7 @@ namespace
|
||||
|
||||
for (PackageIDSet::ConstIterator i(id->begin()), i_end(id->end()) ;
|
||||
i != i_end ; ++i)
|
||||
if ((*i)->slot_key() && (*i)->slot_key()->value() == slot)
|
||||
if ((*i)->slot_key() && (*i)->slot_key()->parse_value() == slot)
|
||||
result->insert(*i);
|
||||
|
||||
return result;
|
||||
|
@ -64,7 +64,7 @@ FormattedPrettyPrinter::prettify(const PackageDepSpec & v) const
|
||||
{
|
||||
{
|
||||
auto ids((*_imp->env)[selection::SomeArbitraryVersion(generator::Matches(v, _imp->package_id, { }) |
|
||||
filter::InstalledAtRoot(_imp->env->preferred_root_key()->value()))]);
|
||||
filter::InstalledAtRoot(_imp->env->preferred_root_key()->parse_value()))]);
|
||||
if (! ids->empty())
|
||||
return format_installed(stringify(v));
|
||||
}
|
||||
@ -88,7 +88,7 @@ FormattedPrettyPrinter::prettify(const BlockDepSpec & v) const
|
||||
{
|
||||
{
|
||||
auto ids((*_imp->env)[selection::SomeArbitraryVersion(generator::Matches(v.blocking(), _imp->package_id, { }) |
|
||||
filter::InstalledAtRoot(_imp->env->preferred_root_key()->value()))]);
|
||||
filter::InstalledAtRoot(_imp->env->preferred_root_key()->parse_value()))]);
|
||||
if (! ids->empty())
|
||||
return format_masked(stringify(v));
|
||||
}
|
||||
|
@ -184,9 +184,12 @@ namespace
|
||||
std::shared_ptr<const PackageIDSequence> id(env->fetch_repository(*r)->package_ids(*q, x));
|
||||
for (PackageIDSequence::ConstIterator i(id->begin()), i_end(id->end()) ;
|
||||
i != i_end ; ++i)
|
||||
if ((*i)->from_repositories_key() && ((*i)->from_repositories_key()->value()->end() !=
|
||||
(*i)->from_repositories_key()->value()->find(stringify(name))))
|
||||
result->insert(*i);
|
||||
if ((*i)->from_repositories_key())
|
||||
{
|
||||
auto v((*i)->from_repositories_key()->parse_value());
|
||||
if (v->end() != v->find(stringify(name)))
|
||||
result->insert(*i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -333,7 +336,7 @@ namespace
|
||||
std::shared_ptr<const Repository> repo(env->fetch_repository(spec.in_repository_requirement()->name()));
|
||||
if (! repo->installed_root_key())
|
||||
return result;
|
||||
if (repo->installed_root_key()->value() != spec.installed_at_path_requirement()->path())
|
||||
if (repo->installed_root_key()->parse_value() != spec.installed_at_path_requirement()->path())
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -350,7 +353,7 @@ namespace
|
||||
if (! (*i)->installed_root_key())
|
||||
continue;
|
||||
|
||||
if ((*i)->installed_root_key()->value() != spec.installed_at_path_requirement()->path())
|
||||
if ((*i)->installed_root_key()->parse_value() != spec.installed_at_path_requirement()->path())
|
||||
continue;
|
||||
|
||||
result->insert((*i)->name());
|
||||
|
@ -172,7 +172,7 @@ BashHookFile::run(
|
||||
|
||||
Process process(ProcessCommand({ "bash", stringify(file_name()) }));
|
||||
process
|
||||
.setenv("ROOT", stringify(_env->preferred_root_key()->value()))
|
||||
.setenv("ROOT", stringify(_env->preferred_root_key()->parse_value()))
|
||||
.setenv("HOOK", hook.name())
|
||||
.setenv("HOOK_FILE", stringify(file_name()))
|
||||
.setenv("HOOK_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
|
||||
@ -233,7 +233,7 @@ FancyHookFile::run(const Hook & hook,
|
||||
"/hooker.bash '" + stringify(file_name()) + "' 'hook_run_" + stringify(hook.name()) + "'" }));
|
||||
|
||||
process
|
||||
.setenv("ROOT", stringify(_env->preferred_root_key()->value()))
|
||||
.setenv("ROOT", stringify(_env->preferred_root_key()->parse_value()))
|
||||
.setenv("HOOK", hook.name())
|
||||
.setenv("HOOK_FILE", stringify(file_name()))
|
||||
.setenv("HOOK_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
|
||||
@ -294,7 +294,7 @@ FancyHookFile::auto_hook_names() const
|
||||
"/hooker.bash '" + stringify(file_name()) + "' 'hook_auto_names'" }));
|
||||
|
||||
process
|
||||
.setenv("ROOT", stringify(_env->preferred_root_key()->value()))
|
||||
.setenv("ROOT", stringify(_env->preferred_root_key()->parse_value()))
|
||||
.setenv("HOOK_FILE", stringify(file_name()))
|
||||
.setenv("HOOK_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
|
||||
.setenv("PALUDIS_EBUILD_DIR", getenv_with_default(env_vars::ebuild_dir, LIBEXECDIR "/paludis"))
|
||||
@ -351,7 +351,7 @@ FancyHookFile::_add_dependency_class(const Hook & hook, DirectedGraph<std::strin
|
||||
stringify(hook.name()) + "'" }));
|
||||
|
||||
process
|
||||
.setenv("ROOT", stringify(_env->preferred_root_key()->value()))
|
||||
.setenv("ROOT", stringify(_env->preferred_root_key()->parse_value()))
|
||||
.setenv("HOOK", hook.name())
|
||||
.setenv("HOOK_FILE", stringify(file_name()))
|
||||
.setenv("HOOK_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
|
||||
|
@ -136,7 +136,7 @@ LiteralMetadataFSPathSequenceKey::~LiteralMetadataFSPathSequenceKey()
|
||||
}
|
||||
|
||||
const std::shared_ptr<const FSPathSequence>
|
||||
LiteralMetadataFSPathSequenceKey::value() const
|
||||
LiteralMetadataFSPathSequenceKey::parse_value() const
|
||||
{
|
||||
return _imp->value;
|
||||
}
|
||||
@ -145,7 +145,7 @@ const std::string
|
||||
LiteralMetadataFSPathSequenceKey::pretty_print_value(
|
||||
const PrettyPrinter & p, const PrettyPrintOptions &) const
|
||||
{
|
||||
return join(value()->begin(), value()->end(), " ", CallPrettyPrinter(p));
|
||||
return join(_imp->value->begin(), _imp->value->end(), " ", CallPrettyPrinter(p));
|
||||
}
|
||||
|
||||
const std::string
|
||||
@ -177,7 +177,7 @@ LiteralMetadataStringSetKey::~LiteralMetadataStringSetKey()
|
||||
}
|
||||
|
||||
const std::shared_ptr<const Set<std::string> >
|
||||
LiteralMetadataStringSetKey::value() const
|
||||
LiteralMetadataStringSetKey::parse_value() const
|
||||
{
|
||||
return _imp->value;
|
||||
}
|
||||
@ -193,7 +193,7 @@ LiteralMetadataStringStringMapKey::~LiteralMetadataStringStringMapKey()
|
||||
}
|
||||
|
||||
const std::shared_ptr<const Map<std::string, std::string> >
|
||||
LiteralMetadataStringStringMapKey::value() const
|
||||
LiteralMetadataStringStringMapKey::parse_value() const
|
||||
{
|
||||
return _imp->value;
|
||||
}
|
||||
@ -209,7 +209,7 @@ LiteralMetadataStringSequenceKey::~LiteralMetadataStringSequenceKey()
|
||||
}
|
||||
|
||||
const std::shared_ptr<const Sequence<std::string> >
|
||||
LiteralMetadataStringSequenceKey::value() const
|
||||
LiteralMetadataStringSequenceKey::parse_value() const
|
||||
{
|
||||
return _imp->value;
|
||||
}
|
||||
@ -236,21 +236,21 @@ const std::string
|
||||
LiteralMetadataStringSetKey::pretty_print_value(
|
||||
const PrettyPrinter & p, const PrettyPrintOptions &) const
|
||||
{
|
||||
return join(value()->begin(), value()->end(), " ", CallPrettyPrinter(p));
|
||||
return join(_imp->value->begin(), _imp->value->end(), " ", CallPrettyPrinter(p));
|
||||
}
|
||||
|
||||
const std::string
|
||||
LiteralMetadataStringStringMapKey::pretty_print_value(
|
||||
const PrettyPrinter & p, const PrettyPrintOptions &) const
|
||||
{
|
||||
return join(value()->begin(), value()->end(), " ", CallPrettyPrinter(p));
|
||||
return join(_imp->value->begin(), _imp->value->end(), " ", CallPrettyPrinter(p));
|
||||
}
|
||||
|
||||
const std::string
|
||||
LiteralMetadataStringSequenceKey::pretty_print_value(
|
||||
const PrettyPrinter & p, const PrettyPrintOptions &) const
|
||||
{
|
||||
return join(value()->begin(), value()->end(), " ", CallPrettyPrinter(p));
|
||||
return join(_imp->value->begin(), _imp->value->end(), " ", CallPrettyPrinter(p));
|
||||
}
|
||||
|
||||
const std::string
|
||||
@ -331,7 +331,7 @@ LiteralMetadataValueKey<T_>::~LiteralMetadataValueKey()
|
||||
|
||||
template <typename T_>
|
||||
const T_
|
||||
LiteralMetadataValueKey<T_>::value() const
|
||||
LiteralMetadataValueKey<T_>::parse_value() const
|
||||
{
|
||||
return _imp->value;
|
||||
}
|
||||
@ -342,7 +342,7 @@ PrettyPrintableLiteralMetadataValueKey<T_>::pretty_print_value(
|
||||
const PrettyPrinter & printer,
|
||||
const PrettyPrintOptions &) const
|
||||
{
|
||||
return printer.prettify(this->value());
|
||||
return printer.prettify(this->parse_value());
|
||||
}
|
||||
|
||||
namespace paludis
|
||||
@ -394,7 +394,7 @@ LiteralMetadataTimeKey::type() const
|
||||
}
|
||||
|
||||
Timestamp
|
||||
LiteralMetadataTimeKey::value() const
|
||||
LiteralMetadataTimeKey::parse_value() const
|
||||
{
|
||||
return _imp->value;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ namespace paludis
|
||||
|
||||
///\}
|
||||
|
||||
virtual const T_ value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const T_ parse_value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
@ -107,7 +107,7 @@ namespace paludis
|
||||
|
||||
///\}
|
||||
|
||||
virtual const std::shared_ptr<const FSPathSequence> value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::shared_ptr<const FSPathSequence> parse_value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
@ -141,7 +141,7 @@ namespace paludis
|
||||
|
||||
///\}
|
||||
|
||||
virtual const std::shared_ptr<const Set<std::string> > value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::shared_ptr<const Set<std::string> > parse_value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
@ -175,7 +175,7 @@ namespace paludis
|
||||
|
||||
///\}
|
||||
|
||||
virtual const std::shared_ptr<const Sequence<std::string> > value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::shared_ptr<const Sequence<std::string> > parse_value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
@ -209,7 +209,7 @@ namespace paludis
|
||||
|
||||
///\}
|
||||
|
||||
virtual Timestamp value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual Timestamp parse_value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
@ -239,7 +239,7 @@ namespace paludis
|
||||
|
||||
///\}
|
||||
|
||||
virtual const std::shared_ptr<const Map<std::string, std::string> > value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::shared_ptr<const Map<std::string, std::string> > parse_value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
@ -98,8 +98,8 @@ paludis::match_package_with_maybe_changes(
|
||||
if (! id->from_repositories_key())
|
||||
return false;
|
||||
|
||||
if (id->from_repositories_key()->value()->end() == id->from_repositories_key()->value()->find(
|
||||
stringify(spec.from_repository_requirement()->name())))
|
||||
auto v(id->from_repositories_key()->parse_value());
|
||||
if (v->end() == v->find(stringify(spec.from_repository_requirement()->name())))
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ paludis::match_package_with_maybe_changes(
|
||||
auto repo(env.fetch_repository(id->repository_name()));
|
||||
if (! repo->installed_root_key())
|
||||
return false;
|
||||
if (repo->installed_root_key()->value() != spec.installed_at_path_requirement()->path())
|
||||
if (repo->installed_root_key()->parse_value() != spec.installed_at_path_requirement()->path())
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@ paludis::match_package_with_maybe_changes(
|
||||
continue;
|
||||
if (! (*d)->installed_root_key())
|
||||
continue;
|
||||
if ((*d)->installed_root_key()->value() != spec.installable_to_path_requirement()->path())
|
||||
if ((*d)->installed_root_key()->parse_value() != spec.installable_to_path_requirement()->path())
|
||||
continue;
|
||||
if (! (*d)->destination_interface()->is_suitable_destination_for(id))
|
||||
continue;
|
||||
@ -159,7 +159,7 @@ paludis::match_package_with_maybe_changes(
|
||||
|
||||
if (spec.exact_slot_requirement())
|
||||
{
|
||||
if ((! id->slot_key()) || (id->slot_key()->value() != spec.exact_slot_requirement()->name()))
|
||||
if ((! id->slot_key()) || (id->slot_key()->parse_value() != spec.exact_slot_requirement()->name()))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -74,9 +74,8 @@ namespace paludis
|
||||
* should be displayed when outputting information about a package ID
|
||||
* or Repository.
|
||||
*
|
||||
* Subclasses provide additional information, including the 'value' of the
|
||||
* key. A ConstVisitor using MetadataKeyVisitorTypes can be used to get more
|
||||
* detail.
|
||||
* Subclasses provide additional information, including the value of the
|
||||
* key via a 'parse_value' method. A visitor can be used to get more detail.
|
||||
*
|
||||
* The header \ref paludis/literal_metadata_key.hh "literal_metadata_key.hh"
|
||||
* contains various concrete implementations of MetadataKey subclasses.
|
||||
@ -231,8 +230,10 @@ namespace paludis
|
||||
|
||||
/**
|
||||
* Fetch our value.
|
||||
*
|
||||
* \since 0.61 is called parse_value
|
||||
*/
|
||||
virtual const C_ value() const
|
||||
virtual const C_ parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
|
||||
};
|
||||
|
||||
@ -255,8 +256,9 @@ namespace paludis
|
||||
* Fetch our value.
|
||||
*
|
||||
* \since 0.44 Timestamp instead of time_t
|
||||
* \since 0.61 is called parse_value
|
||||
*/
|
||||
virtual Timestamp value() const
|
||||
virtual Timestamp parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
|
||||
};
|
||||
|
||||
@ -277,9 +279,12 @@ namespace paludis
|
||||
virtual ~MetadataCollectionKey() = 0;
|
||||
|
||||
/**
|
||||
* Fetch our value.
|
||||
* Fetch our value, parse not necessarily cached (so
|
||||
* multiple calls may return different shared_ptrs).
|
||||
*
|
||||
* \since 0.61
|
||||
*/
|
||||
virtual const std::shared_ptr<const C_> value() const
|
||||
virtual const std::shared_ptr<const C_> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
|
||||
};
|
||||
|
||||
@ -300,9 +305,12 @@ namespace paludis
|
||||
virtual ~MetadataSpecTreeKey() = 0;
|
||||
|
||||
/**
|
||||
* Fetch our value.
|
||||
* Fetch our value, parse not necessarily cached (so
|
||||
* multiple calls may return different shared_ptrs).
|
||||
*
|
||||
* \since 0.61
|
||||
*/
|
||||
virtual const std::shared_ptr<const C_> value() const
|
||||
virtual const std::shared_ptr<const C_> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
|
||||
};
|
||||
|
||||
@ -326,9 +334,12 @@ namespace paludis
|
||||
virtual ~MetadataSpecTreeKey() = 0;
|
||||
|
||||
/**
|
||||
* Fetch our value.
|
||||
* Fetch our value, parse not necessarily cached (so
|
||||
* multiple calls may return different shared_ptrs).
|
||||
*
|
||||
* \since 0.61
|
||||
*/
|
||||
virtual const std::shared_ptr<const FetchableURISpecTree> value() const
|
||||
virtual const std::shared_ptr<const FetchableURISpecTree> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
|
||||
|
||||
/**
|
||||
@ -359,9 +370,12 @@ namespace paludis
|
||||
virtual ~MetadataSpecTreeKey() = 0;
|
||||
|
||||
/**
|
||||
* Fetch our value.
|
||||
* Fetch our value, parse not necessarily cached (so
|
||||
* multiple calls may return different shared_ptrs).
|
||||
*
|
||||
* \since 0.61
|
||||
*/
|
||||
virtual const std::shared_ptr<const DependencySpecTree> value() const
|
||||
virtual const std::shared_ptr<const DependencySpecTree> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
|
||||
|
||||
/**
|
||||
|
@ -444,7 +444,7 @@ NDBAM::parse_contents(const PackageID & id,
|
||||
if (! id.fs_location_key())
|
||||
throw InternalError(PALUDIS_HERE, "No id.fs_location_key");
|
||||
|
||||
FSPath ff(id.fs_location_key()->value() / "contents");
|
||||
FSPath ff(id.fs_location_key()->parse_value() / "contents");
|
||||
if (! ff.stat().is_regular_file_or_symlink_to_regular_file())
|
||||
{
|
||||
Log::get_instance()->message("ndbam.contents.skipping", ll_warning, lc_context)
|
||||
|
@ -103,7 +103,7 @@ NDBAMMerger::extend_hook(const Hook & h)
|
||||
std::string pn(stringify(_imp->params.package_id()->name().package()));
|
||||
std::string pvr(stringify(_imp->params.package_id()->version()));
|
||||
std::string pv(stringify(_imp->params.package_id()->version().remove_revision()));
|
||||
std::string slot(_imp->params.package_id()->slot_key() ? stringify(_imp->params.package_id()->slot_key()->value()) : "");
|
||||
std::string slot(_imp->params.package_id()->slot_key() ? stringify(_imp->params.package_id()->slot_key()->parse_value()) : "");
|
||||
|
||||
return FSMerger::extend_hook(h)
|
||||
("P", pn + "-" + pv)
|
||||
|
@ -101,7 +101,7 @@ NDBAMUnmerger::extend_hook(const Hook & h) const
|
||||
std::string pn(stringify(_imp->options.package_id()->name().package()));
|
||||
std::string pvr(stringify(_imp->options.package_id()->version()));
|
||||
std::string pv(stringify(_imp->options.package_id()->version().remove_revision()));
|
||||
std::string slot(_imp->options.package_id()->slot_key() ? stringify(_imp->options.package_id()->slot_key()->value()) : "");
|
||||
std::string slot(_imp->options.package_id()->slot_key() ? stringify(_imp->options.package_id()->slot_key()->parse_value()) : "");
|
||||
|
||||
return result
|
||||
("P", pn + "-" + pv)
|
||||
@ -205,7 +205,7 @@ namespace
|
||||
bool
|
||||
NDBAMUnmerger::check_file(const std::shared_ptr<const ContentsEntry> & e) const
|
||||
{
|
||||
const FSPath f(e->location_key()->value());
|
||||
const FSPath f(e->location_key()->parse_value());
|
||||
const FSPath root_f(_imp->options.root() / f);
|
||||
const FSStat root_f_stat(root_f);
|
||||
|
||||
@ -213,7 +213,7 @@ NDBAMUnmerger::check_file(const std::shared_ptr<const ContentsEntry> & e) const
|
||||
display("--- [gone ] " + stringify(f));
|
||||
else if (! root_f_stat.is_regular_file())
|
||||
display("--- [!type] " + stringify(f));
|
||||
else if (root_f_stat.mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").value().seconds())
|
||||
else if (root_f_stat.mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").parse_value().seconds())
|
||||
display("--- [!time] " + stringify(f));
|
||||
else
|
||||
{
|
||||
@ -223,7 +223,7 @@ NDBAMUnmerger::check_file(const std::shared_ptr<const ContentsEntry> & e) const
|
||||
Log::get_instance()->message("ndbam.unmerger.md5_failed", ll_warning, lc_no_context) << "Cannot get md5 for '" << root_f << "'";
|
||||
display("--- [!md5?] " + stringify(f));
|
||||
}
|
||||
else if (MD5(md5_file).hexsum() != require_key<MetadataValueKey<std::string> >(*e, "md5").value())
|
||||
else if (MD5(md5_file).hexsum() != require_key<MetadataValueKey<std::string> >(*e, "md5").parse_value())
|
||||
display("--- [!md5 ] " + stringify(f));
|
||||
else if (config_protected(root_f))
|
||||
display("--- [cfgpr] " + stringify(f));
|
||||
@ -237,7 +237,7 @@ NDBAMUnmerger::check_file(const std::shared_ptr<const ContentsEntry> & e) const
|
||||
bool
|
||||
NDBAMUnmerger::check_sym(const std::shared_ptr<const ContentsEntry> & e) const
|
||||
{
|
||||
const FSPath f(e->location_key()->value());
|
||||
const FSPath f(e->location_key()->parse_value());
|
||||
const FSPath root_f(_imp->options.root() / f);
|
||||
const FSStat root_f_stat(root_f);
|
||||
|
||||
@ -245,9 +245,9 @@ NDBAMUnmerger::check_sym(const std::shared_ptr<const ContentsEntry> & e) const
|
||||
display("--- [gone ] " + stringify(f));
|
||||
else if (! root_f_stat.is_symlink())
|
||||
display("--- [!type] " + stringify(f));
|
||||
else if (root_f_stat.mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").value().seconds())
|
||||
else if (root_f_stat.mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").parse_value().seconds())
|
||||
display("--- [!time] " + stringify(f));
|
||||
else if (root_f.readlink() != require_key<MetadataValueKey<std::string> >(*e, "target").value())
|
||||
else if (root_f.readlink() != require_key<MetadataValueKey<std::string> >(*e, "target").parse_value())
|
||||
display("--- [!dest] " + stringify(f));
|
||||
else
|
||||
return true;
|
||||
@ -264,7 +264,7 @@ NDBAMUnmerger::check_misc(const std::shared_ptr<const ContentsEntry> &) const
|
||||
bool
|
||||
NDBAMUnmerger::check_dir(const std::shared_ptr<const ContentsEntry> & e) const
|
||||
{
|
||||
const FSPath f(e->location_key()->value());
|
||||
const FSPath f(e->location_key()->parse_value());
|
||||
const FSPath root_f(_imp->options.root() / f);
|
||||
const FSStat root_f_stat(root_f);
|
||||
|
||||
|
@ -343,7 +343,7 @@ namespace
|
||||
{
|
||||
std::string stringify_contents_entry(const ContentsEntry & e)
|
||||
{
|
||||
return stringify(e.location_key()->value());
|
||||
return stringify(e.location_key()->parse_value());
|
||||
}
|
||||
|
||||
struct StringifyEqual
|
||||
@ -486,13 +486,13 @@ namespace
|
||||
switch (op)
|
||||
{
|
||||
case kro_equals:
|
||||
return pattern == stringify(k.value().seconds());
|
||||
return pattern == stringify(k.parse_value().seconds());
|
||||
case kro_tilde:
|
||||
return std::string::npos != stringify(k.value().seconds()).find(pattern);
|
||||
return std::string::npos != stringify(k.parse_value().seconds()).find(pattern);
|
||||
case kro_less_than:
|
||||
return k.value().seconds() < destringify<time_t>(pattern);
|
||||
return k.parse_value().seconds() < destringify<time_t>(pattern);
|
||||
case kro_greater_than:
|
||||
return k.value().seconds() > destringify<time_t>(pattern);
|
||||
return k.parse_value().seconds() > destringify<time_t>(pattern);
|
||||
case kro_question:
|
||||
case last_kro:
|
||||
break;
|
||||
@ -506,9 +506,9 @@ namespace
|
||||
switch (op)
|
||||
{
|
||||
case kro_equals:
|
||||
return pattern == stringify(k.value());
|
||||
return pattern == stringify(k.parse_value());
|
||||
case kro_tilde:
|
||||
return std::string::npos != stringify(k.value()).find(pattern);
|
||||
return std::string::npos != stringify(k.parse_value()).find(pattern);
|
||||
case kro_less_than:
|
||||
case kro_greater_than:
|
||||
case kro_question:
|
||||
@ -524,9 +524,9 @@ namespace
|
||||
switch (op)
|
||||
{
|
||||
case kro_equals:
|
||||
return pattern == stringify(k.value());
|
||||
return pattern == stringify(k.parse_value());
|
||||
case kro_tilde:
|
||||
return std::string::npos != stringify(k.value()).find(pattern);
|
||||
return std::string::npos != stringify(k.parse_value()).find(pattern);
|
||||
case kro_less_than:
|
||||
case kro_greater_than:
|
||||
case kro_question:
|
||||
@ -542,9 +542,9 @@ namespace
|
||||
switch (op)
|
||||
{
|
||||
case kro_equals:
|
||||
return pattern == stringify(k.value());
|
||||
return pattern == stringify(k.parse_value());
|
||||
case kro_tilde:
|
||||
return std::string::npos != stringify(k.value()).find(pattern);
|
||||
return std::string::npos != stringify(k.parse_value()).find(pattern);
|
||||
case kro_less_than:
|
||||
case kro_greater_than:
|
||||
case kro_question:
|
||||
@ -560,9 +560,9 @@ namespace
|
||||
switch (op)
|
||||
{
|
||||
case kro_equals:
|
||||
return pattern == stringify(k.value());
|
||||
return pattern == stringify(k.parse_value());
|
||||
case kro_tilde:
|
||||
return std::string::npos != stringify(k.value()).find(pattern);
|
||||
return std::string::npos != stringify(k.parse_value()).find(pattern);
|
||||
case kro_less_than:
|
||||
case kro_greater_than:
|
||||
case kro_question:
|
||||
@ -578,13 +578,13 @@ namespace
|
||||
switch (op)
|
||||
{
|
||||
case kro_equals:
|
||||
return pattern == stringify(k.value());
|
||||
return pattern == stringify(k.parse_value());
|
||||
case kro_tilde:
|
||||
return std::string::npos != stringify(k.value()).find(pattern);
|
||||
return std::string::npos != stringify(k.parse_value()).find(pattern);
|
||||
case kro_less_than:
|
||||
return k.value() < destringify<long>(pattern);
|
||||
return k.parse_value() < destringify<long>(pattern);
|
||||
case kro_greater_than:
|
||||
return k.value() > destringify<long>(pattern);
|
||||
return k.parse_value() > destringify<long>(pattern);
|
||||
case kro_question:
|
||||
case last_kro:
|
||||
break;
|
||||
@ -600,15 +600,16 @@ namespace
|
||||
|
||||
bool visit(const MetadataValueKey<std::shared_ptr<const Contents> > & s) const
|
||||
{
|
||||
auto v(s.parse_value());
|
||||
switch (op)
|
||||
{
|
||||
case kro_equals:
|
||||
return pattern == join(indirect_iterator(s.value()->begin()), indirect_iterator(s.value()->end()), " ",
|
||||
return pattern == join(indirect_iterator(v->begin()), indirect_iterator(v->end()), " ",
|
||||
stringify_contents_entry);
|
||||
case kro_less_than:
|
||||
return indirect_iterator(s.value()->end()) != std::find_if(
|
||||
indirect_iterator(s.value()->begin()),
|
||||
indirect_iterator(s.value()->end()),
|
||||
return indirect_iterator(v->end()) != std::find_if(
|
||||
indirect_iterator(v->begin()),
|
||||
indirect_iterator(v->end()),
|
||||
StringifyEqual(pattern));
|
||||
|
||||
case kro_greater_than:
|
||||
@ -626,9 +627,9 @@ namespace
|
||||
switch (op)
|
||||
{
|
||||
case kro_equals:
|
||||
return pattern == stringify(*k.value());
|
||||
return pattern == stringify(*k.parse_value());
|
||||
case kro_tilde:
|
||||
return std::string::npos != stringify(*k.value()).find(pattern);
|
||||
return std::string::npos != stringify(*k.parse_value()).find(pattern);
|
||||
case kro_less_than:
|
||||
case kro_greater_than:
|
||||
case kro_question:
|
||||
@ -646,7 +647,7 @@ namespace
|
||||
case kro_equals:
|
||||
return false;
|
||||
case kro_less_than:
|
||||
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
return s.parse_value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
|
||||
case kro_tilde:
|
||||
case kro_greater_than:
|
||||
@ -665,7 +666,7 @@ namespace
|
||||
case kro_equals:
|
||||
return false;
|
||||
case kro_less_than:
|
||||
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
return s.parse_value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
|
||||
case kro_tilde:
|
||||
case kro_greater_than:
|
||||
@ -684,7 +685,7 @@ namespace
|
||||
case kro_equals:
|
||||
return false;
|
||||
case kro_less_than:
|
||||
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
return s.parse_value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
|
||||
case kro_tilde:
|
||||
case kro_greater_than:
|
||||
@ -703,7 +704,7 @@ namespace
|
||||
case kro_equals:
|
||||
return false;
|
||||
case kro_less_than:
|
||||
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
return s.parse_value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
|
||||
case kro_tilde:
|
||||
case kro_greater_than:
|
||||
@ -722,7 +723,7 @@ namespace
|
||||
case kro_equals:
|
||||
return false;
|
||||
case kro_less_than:
|
||||
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
return s.parse_value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
|
||||
case kro_tilde:
|
||||
case kro_greater_than:
|
||||
@ -741,7 +742,7 @@ namespace
|
||||
case kro_equals:
|
||||
return false;
|
||||
case kro_less_than:
|
||||
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
return s.parse_value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
|
||||
case kro_tilde:
|
||||
case kro_greater_than:
|
||||
@ -760,7 +761,7 @@ namespace
|
||||
case kro_equals:
|
||||
return false;
|
||||
case kro_less_than:
|
||||
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
return s.parse_value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
|
||||
case kro_tilde:
|
||||
case kro_greater_than:
|
||||
@ -779,7 +780,7 @@ namespace
|
||||
case kro_equals:
|
||||
return false;
|
||||
case kro_less_than:
|
||||
return s.value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
return s.parse_value()->top()->accept_returning<bool>(SpecTreeSearcher(env, id, pattern));
|
||||
|
||||
case kro_tilde:
|
||||
case kro_greater_than:
|
||||
@ -793,13 +794,13 @@ namespace
|
||||
|
||||
bool visit(const MetadataCollectionKey<FSPathSequence> & s) const
|
||||
{
|
||||
auto v(s.parse_value());
|
||||
switch (op)
|
||||
{
|
||||
case kro_equals:
|
||||
return pattern == join(s.value()->begin(), s.value()->end(), " ");
|
||||
return pattern == join(v->begin(), v->end(), " ");
|
||||
case kro_less_than:
|
||||
return s.value()->end() != std::find_if(s.value()->begin(), s.value()->end(),
|
||||
StringifyEqual(pattern));
|
||||
return v->end() != std::find_if(v->begin(), v->end(), StringifyEqual(pattern));
|
||||
|
||||
case kro_tilde:
|
||||
case kro_greater_than:
|
||||
@ -813,14 +814,15 @@ namespace
|
||||
|
||||
bool visit(const MetadataCollectionKey<PackageIDSequence> & s) const
|
||||
{
|
||||
auto v(s.parse_value());
|
||||
switch (op)
|
||||
{
|
||||
case kro_equals:
|
||||
return pattern == join(indirect_iterator(s.value()->begin()), indirect_iterator(s.value()->end()), " ");
|
||||
return pattern == join(indirect_iterator(v->begin()), indirect_iterator(v->end()), " ");
|
||||
case kro_less_than:
|
||||
return indirect_iterator(s.value()->end()) != std::find_if(
|
||||
indirect_iterator(s.value()->begin()),
|
||||
indirect_iterator(s.value()->end()),
|
||||
return indirect_iterator(v->end()) != std::find_if(
|
||||
indirect_iterator(v->begin()),
|
||||
indirect_iterator(v->end()),
|
||||
StringifyEqual(pattern));
|
||||
|
||||
case kro_tilde:
|
||||
@ -835,13 +837,13 @@ namespace
|
||||
|
||||
bool visit(const MetadataCollectionKey<Sequence<std::string> > & s) const
|
||||
{
|
||||
auto v(s.parse_value());
|
||||
switch (op)
|
||||
{
|
||||
case kro_equals:
|
||||
return pattern == join(s.value()->begin(), s.value()->end(), " ");
|
||||
return pattern == join(v->begin(), v->end(), " ");
|
||||
case kro_less_than:
|
||||
return s.value()->end() != std::find_if(s.value()->begin(), s.value()->end(),
|
||||
StringifyEqual(pattern));
|
||||
return v->end() != std::find_if(v->begin(), v->end(), StringifyEqual(pattern));
|
||||
|
||||
case kro_tilde:
|
||||
case kro_greater_than:
|
||||
@ -855,13 +857,13 @@ namespace
|
||||
|
||||
bool visit(const MetadataCollectionKey<Set<std::string> > & s) const
|
||||
{
|
||||
auto v(s.parse_value());
|
||||
switch (op)
|
||||
{
|
||||
case kro_equals:
|
||||
return pattern == join(s.value()->begin(), s.value()->end(), " ");
|
||||
return pattern == join(v->begin(), v->end(), " ");
|
||||
case kro_less_than:
|
||||
return s.value()->end() != std::find_if(s.value()->begin(), s.value()->end(),
|
||||
StringifyEqual(pattern));
|
||||
return v->end() != std::find_if(v->begin(), v->end(), StringifyEqual(pattern));
|
||||
|
||||
case kro_tilde:
|
||||
case kro_greater_than:
|
||||
@ -880,13 +882,13 @@ namespace
|
||||
|
||||
bool visit(const MetadataCollectionKey<KeywordNameSet> & s) const
|
||||
{
|
||||
auto v(s.parse_value());
|
||||
switch (op)
|
||||
{
|
||||
case kro_equals:
|
||||
return pattern == join(s.value()->begin(), s.value()->end(), " ");
|
||||
return pattern == join(v->begin(), v->end(), " ");
|
||||
case kro_less_than:
|
||||
return s.value()->end() != std::find_if(s.value()->begin(), s.value()->end(),
|
||||
StringifyEqual(pattern));
|
||||
return v->end() != std::find_if(v->begin(), v->end(), StringifyEqual(pattern));
|
||||
|
||||
case kro_tilde:
|
||||
case kro_greater_than:
|
||||
|
@ -113,7 +113,7 @@ AccountsDepKey::type() const
|
||||
}
|
||||
|
||||
const std::shared_ptr<const DependencySpecTree>
|
||||
AccountsDepKey::value() const
|
||||
AccountsDepKey::parse_value() const
|
||||
{
|
||||
return _imp->tree;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ namespace paludis
|
||||
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::shared_ptr<const DependencySpecTree> value() const
|
||||
virtual const std::shared_ptr<const DependencySpecTree> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::shared_ptr<const DependenciesLabelSequence> initial_labels() const
|
||||
|
@ -175,7 +175,7 @@ AccountsID::_need_file_keys() const
|
||||
|
||||
Lock lock(_imp->mutex);
|
||||
|
||||
KeyValueConfigFile k(_imp->fs_location_key->value(), { },
|
||||
KeyValueConfigFile k(_imp->fs_location_key->parse_value(), { },
|
||||
&KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation);
|
||||
|
||||
/* also need to change the handlers if any of the raw names are changed */
|
||||
@ -507,7 +507,7 @@ AccountsID::perform_action(Action & action) const
|
||||
n::build_start_time() = build_start_time,
|
||||
n::check() = true,
|
||||
n::environment_file() = FSPath("/dev/null"),
|
||||
n::image_dir() = fs_location_key()->value(),
|
||||
n::image_dir() = fs_location_key()->parse_value(),
|
||||
n::merged_entries() = std::make_shared<FSPathSet>(),
|
||||
n::options() = MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
|
||||
n::output_manager() = output_manager,
|
||||
@ -561,7 +561,7 @@ AccountsID::perform_action(Action & action) const
|
||||
{
|
||||
Context local_context("When cleaning '" + stringify(**i) + "':");
|
||||
auto repo(_imp->env->fetch_repository((*i)->repository_name()));
|
||||
if (repo->format_key() && repo->format_key()->value() == "installed-accounts"
|
||||
if (repo->format_key() && repo->format_key()->parse_value() == "installed-accounts"
|
||||
&& (*i)->name() == name())
|
||||
continue;
|
||||
else
|
||||
|
@ -397,7 +397,7 @@ AccountsRepository::is_suitable_destination_for(const std::shared_ptr<const Pack
|
||||
{
|
||||
auto env(_imp->params_if_installed ? _imp->params_if_installed->environment() : _imp->params_if_not_installed->environment());
|
||||
auto repo(env->fetch_repository(id->repository_name()));
|
||||
std::string f(repo->format_key() ? repo->format_key()->value() : "");
|
||||
std::string f(repo->format_key() ? repo->format_key()->parse_value() : "");
|
||||
return _imp->handler_if_installed && f == "accounts";
|
||||
}
|
||||
|
||||
@ -405,7 +405,7 @@ bool
|
||||
AccountsRepository::is_default_destination() const
|
||||
{
|
||||
return _imp->handler_if_installed &&
|
||||
_imp->params_if_installed->environment()->preferred_root_key()->value() == installed_root_key()->value();
|
||||
_imp->params_if_installed->environment()->preferred_root_key()->parse_value() == installed_root_key()->parse_value();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -121,7 +121,7 @@ AccountsRepositoryStore::_load(const RepositoryName & repository_name)
|
||||
continue;
|
||||
}
|
||||
|
||||
FSPath dir(k->value());
|
||||
FSPath dir(k->parse_value());
|
||||
if (! dir.stat().is_directory_or_symlink_to_directory())
|
||||
{
|
||||
Log::get_instance()->message("accounts.empty_key_from_repository", ll_warning, lc_context) <<
|
||||
|
@ -66,7 +66,7 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
|
||||
if (! k)
|
||||
throw ActionFailedError("Key 'username' for '" + stringify(*params.package_id()) + "' is not a string key");
|
||||
|
||||
username = k->value();
|
||||
username = k->parse_value();
|
||||
|
||||
if (0 != getpwnam(username.c_str()))
|
||||
throw ActionFailedError("User '" + username + "' already exists");
|
||||
@ -83,7 +83,7 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
|
||||
if (! k)
|
||||
throw ActionFailedError("Key 'gecos' for '" + stringify(*params.package_id()) + "' is not a string key");
|
||||
|
||||
gecos = k->value();
|
||||
gecos = k->parse_value();
|
||||
|
||||
if (std::string::npos != gecos.find('\''))
|
||||
throw ActionFailedError("Value for key 'gecos' for '" + stringify(*params.package_id()) + "' must not contain a quote");
|
||||
@ -103,7 +103,7 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
|
||||
if (! k)
|
||||
throw ActionFailedError("Key 'preferred_uid' for '" + stringify(*params.package_id()) + "' is not a string key");
|
||||
|
||||
preferred_uid = k->value();
|
||||
preferred_uid = k->parse_value();
|
||||
|
||||
if (std::string::npos != preferred_uid.find_first_not_of("0123456789"))
|
||||
throw ActionFailedError("Value for key 'preferred_uid' for '" + stringify(*params.package_id()) + "' must be a number");
|
||||
@ -130,7 +130,7 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
|
||||
if (! k)
|
||||
throw ActionFailedError("Key 'primary_group' for '" + stringify(*params.package_id()) + "' is not a string key");
|
||||
|
||||
primary_group = k->value();
|
||||
primary_group = k->parse_value();
|
||||
|
||||
if (std::string::npos != primary_group.find('\''))
|
||||
throw ActionFailedError("Value for key 'primary_group' for '" + stringify(*params.package_id()) + "' must not contain a quote");
|
||||
@ -150,7 +150,8 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
|
||||
if (! k)
|
||||
throw ActionFailedError("Key 'extra_groups' for '" + stringify(*params.package_id()) + "' is not a string set key");
|
||||
|
||||
extra_groups = join(k->value()->begin(), k->value()->end(), ",");
|
||||
auto v(k->parse_value());
|
||||
extra_groups = join(v->begin(), v->end(), ",");
|
||||
|
||||
if (std::string::npos != extra_groups.find('\''))
|
||||
throw ActionFailedError("Value for key 'extra_groups' for '" + stringify(*params.package_id()) + "' must not contain a quote");
|
||||
@ -170,7 +171,7 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
|
||||
if (! k)
|
||||
throw ActionFailedError("Key 'shell' for '" + stringify(*params.package_id()) + "' is not a string key");
|
||||
|
||||
shell = k->value();
|
||||
shell = k->parse_value();
|
||||
|
||||
if (std::string::npos != shell.find('\''))
|
||||
throw ActionFailedError("Value for key 'shell' for '" + stringify(*params.package_id()) + "' must not contain a quote");
|
||||
@ -190,7 +191,7 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
|
||||
if (! k)
|
||||
throw ActionFailedError("Key 'home' for '" + stringify(*params.package_id()) + "' is not a string key");
|
||||
|
||||
home = k->value();
|
||||
home = k->parse_value();
|
||||
|
||||
if (std::string::npos != home.find('\''))
|
||||
throw ActionFailedError("Value for key 'home' for '" + stringify(*params.package_id()) + "' must not contain a quote");
|
||||
@ -222,7 +223,7 @@ PasswdAccountsHandler::merge_group(const MergeParams & params)
|
||||
if (! k)
|
||||
throw ActionFailedError("Key 'groupname' for '" + stringify(*params.package_id()) + "' is not a string key");
|
||||
|
||||
groupname = k->value();
|
||||
groupname = k->parse_value();
|
||||
|
||||
if (0 != getgrnam(groupname.c_str()))
|
||||
throw ActionFailedError("Group '" + groupname + "' already exists");
|
||||
@ -239,7 +240,7 @@ PasswdAccountsHandler::merge_group(const MergeParams & params)
|
||||
if (! k)
|
||||
throw ActionFailedError("Key 'preferred_gid' for '" + stringify(*params.package_id()) + "' is not a string key");
|
||||
|
||||
preferred_gid = k->value();
|
||||
preferred_gid = k->parse_value();
|
||||
|
||||
if (std::string::npos != preferred_gid.find_first_not_of("0123456789"))
|
||||
throw ActionFailedError("Value for key 'preferred_gid' for '" + stringify(*params.package_id()) + "' must be a number");
|
||||
|
@ -72,6 +72,7 @@ noinst_HEADERS = \
|
||||
fix_locked_dependencies.hh \
|
||||
glsa.hh \
|
||||
layout.hh \
|
||||
make_archive_strings.hh \
|
||||
make_use.hh \
|
||||
manifest2_reader.hh \
|
||||
mask_info.hh \
|
||||
@ -150,6 +151,7 @@ libpaludiserepository_la_SOURCES = \
|
||||
fix_locked_dependencies.cc \
|
||||
glsa.cc \
|
||||
layout.cc \
|
||||
make_archive_strings.cc \
|
||||
make_use.cc \
|
||||
manifest2_reader.cc \
|
||||
mask_info.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
|
||||
@ -94,14 +94,15 @@ paludis::erepository::can_skip_phase(
|
||||
if (id->fetches_key())
|
||||
{
|
||||
FindAnyFetchesFinder f(env, id);
|
||||
id->fetches_key()->value()->top()->accept(f);
|
||||
id->fetches_key()->parse_value()->top()->accept(f);
|
||||
if (! f.result)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (id->defined_phases_key()->value()->end() != id->defined_phases_key()->value()->find(*i))
|
||||
auto d(id->defined_phases_key()->parse_value());
|
||||
if (d->end() != d->find(*i))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <paludis/repositories/e/make_use.hh>
|
||||
#include <paludis/repositories/e/can_skip_phase.hh>
|
||||
#include <paludis/repositories/e/ebuild.hh>
|
||||
#include <paludis/repositories/e/make_archive_strings.hh>
|
||||
|
||||
#include <paludis/util/strip.hh>
|
||||
#include <paludis/util/make_named_values.hh>
|
||||
@ -63,7 +64,7 @@ paludis::erepository::do_fetch_action(
|
||||
{
|
||||
DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(env, id);
|
||||
if (id->restrict_key())
|
||||
id->restrict_key()->value()->top()->accept(restricts);
|
||||
id->restrict_key()->parse_value()->top()->accept(restricts);
|
||||
|
||||
for (DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec>::ConstIterator i(restricts.begin()), i_end(restricts.end()) ;
|
||||
i != i_end ; ++i)
|
||||
@ -82,47 +83,7 @@ paludis::erepository::do_fetch_action(
|
||||
id->eapi()->supported()->userpriv_cannot_use_root()));
|
||||
|
||||
std::string archives, all_archives;
|
||||
{
|
||||
std::set<std::string> already_in_archives;
|
||||
|
||||
/* make A */
|
||||
AFinder f(env, id);
|
||||
if (id->fetches_key())
|
||||
id->fetches_key()->value()->top()->accept(f);
|
||||
|
||||
for (AFinder::ConstIterator i(f.begin()), i_end(f.end()) ; i != i_end ; ++i)
|
||||
{
|
||||
const FetchableURIDepSpec * const spec(static_cast<const FetchableURIDepSpec *>(i->first));
|
||||
|
||||
if (already_in_archives.end() == already_in_archives.find(spec->filename()))
|
||||
{
|
||||
archives.append(spec->filename());
|
||||
already_in_archives.insert(spec->filename());
|
||||
}
|
||||
archives.append(" ");
|
||||
}
|
||||
|
||||
/* make AA */
|
||||
if (! id->eapi()->supported()->ebuild_environment_variables()->env_aa().empty())
|
||||
{
|
||||
AAVisitor g;
|
||||
if (id->fetches_key())
|
||||
id->fetches_key()->value()->top()->accept(g);
|
||||
std::set<std::string> already_in_all_archives;
|
||||
|
||||
for (AAVisitor::ConstIterator gg(g.begin()), gg_end(g.end()) ; gg != gg_end ; ++gg)
|
||||
{
|
||||
if (already_in_all_archives.end() == already_in_all_archives.find(*gg))
|
||||
{
|
||||
all_archives.append(*gg);
|
||||
already_in_all_archives.insert(*gg);
|
||||
}
|
||||
all_archives.append(" ");
|
||||
}
|
||||
}
|
||||
else
|
||||
all_archives = "AA-not-set-for-this-EAPI";
|
||||
}
|
||||
std::tie(archives, all_archives) = make_archives_strings(env, id);
|
||||
|
||||
/* Strip trailing space. Some ebuilds rely upon this. From kde-meta.eclass:
|
||||
* [[ -n ${A/${TARBALL}/} ]] && unpack ${A/${TARBALL}/}
|
||||
@ -143,6 +104,8 @@ paludis::erepository::do_fetch_action(
|
||||
|
||||
if (id->fetches_key())
|
||||
{
|
||||
auto fetches(id->fetches_key()->parse_value());
|
||||
|
||||
/* always use mirror://gentoo/, where gentoo is the name of our first master repository,
|
||||
* or our name if there's no master. */
|
||||
std::string mirrors_name(
|
||||
@ -157,10 +120,10 @@ paludis::erepository::do_fetch_action(
|
||||
fetch_userpriv_ok, mirrors_name,
|
||||
id->fetches_key()->initial_label(), fetch_action.options.safe_resume(),
|
||||
output_manager, std::bind(&ERepository::get_mirrors, repo, std::placeholders::_1));
|
||||
id->fetches_key()->value()->top()->accept(f);
|
||||
fetches->top()->accept(f);
|
||||
}
|
||||
|
||||
id->fetches_key()->value()->top()->accept(c);
|
||||
fetches->top()->accept(c);
|
||||
}
|
||||
|
||||
if ( (fetch_action.options.fetch_parts()[fp_extras]) && ((c.need_nofetch()) ||
|
||||
@ -218,7 +181,7 @@ paludis::erepository::do_fetch_action(
|
||||
n::commands() = join(phase->begin_commands(), phase->end_commands(), " "),
|
||||
n::distdir() = repo->params().distdir(),
|
||||
n::ebuild_dir() = repo->layout()->package_directory(id->name()),
|
||||
n::ebuild_file() = id->fs_location_key()->value(),
|
||||
n::ebuild_file() = id->fs_location_key()->parse_value(),
|
||||
n::eclassdirs() = repo->params().eclassdirs(),
|
||||
n::environment() = env,
|
||||
n::exlibsdirs() = exlibsdirs,
|
||||
@ -242,7 +205,7 @@ paludis::erepository::do_fetch_action(
|
||||
n::loadsaveenv_dir() = package_builddir / "temp",
|
||||
n::profiles() = repo->params().profiles(),
|
||||
n::profiles_with_parents() = repo->profile()->profiles_with_parents(),
|
||||
n::slot() = id->slot_key() ? stringify(id->slot_key()->value()) : "",
|
||||
n::slot() = id->slot_key() ? stringify(id->slot_key()->parse_value()) : "",
|
||||
n::use() = use,
|
||||
n::use_expand() = join(repo->profile()->use_expand()->begin(), repo->profile()->use_expand()->end(), " "),
|
||||
n::use_expand_hidden() = join(repo->profile()->use_expand_hidden()->begin(), repo->profile()->use_expand_hidden()->end(), " ")
|
||||
@ -265,7 +228,7 @@ paludis::erepository::do_fetch_action(
|
||||
n::commands() = join(phase->begin_commands(), phase->end_commands(), " "),
|
||||
n::distdir() = repo->params().distdir(),
|
||||
n::ebuild_dir() = repo->layout()->package_directory(id->name()),
|
||||
n::ebuild_file() = id->fs_location_key()->value(),
|
||||
n::ebuild_file() = id->fs_location_key()->parse_value(),
|
||||
n::eclassdirs() = repo->params().eclassdirs(),
|
||||
n::environment() = env,
|
||||
n::exlibsdirs() = exlibsdirs,
|
||||
|
@ -57,7 +57,7 @@ paludis::erepository::do_info_action(
|
||||
{
|
||||
DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(env, id);
|
||||
if (id->restrict_key())
|
||||
id->restrict_key()->value()->top()->accept(restricts);
|
||||
id->restrict_key()->parse_value()->top()->accept(restricts);
|
||||
|
||||
userpriv_restrict =
|
||||
indirect_iterator(restricts.end()) != std::find_if(indirect_iterator(restricts.begin()), indirect_iterator(restricts.end()),
|
||||
@ -91,7 +91,7 @@ paludis::erepository::do_info_action(
|
||||
n::commands() = join(phase->begin_commands(), phase->end_commands(), " "),
|
||||
n::distdir() = repo->params().distdir(),
|
||||
n::ebuild_dir() = repo->layout()->package_directory(id->name()),
|
||||
n::ebuild_file() = id->fs_location_key()->value(),
|
||||
n::ebuild_file() = id->fs_location_key()->parse_value(),
|
||||
n::eclassdirs() = repo->params().eclassdirs(),
|
||||
n::environment() = env,
|
||||
n::exlibsdirs() = exlibsdirs,
|
||||
@ -102,7 +102,7 @@ paludis::erepository::do_info_action(
|
||||
n::portdir() =
|
||||
(repo->params().master_repositories() && ! repo->params().master_repositories()->empty()) ?
|
||||
(*repo->params().master_repositories()->begin())->params().location() : repo->params().location(),
|
||||
n::root() = stringify(env->preferred_root_key()->value()),
|
||||
n::root() = stringify(env->preferred_root_key()->parse_value()),
|
||||
n::sandbox() = phase->option("sandbox"),
|
||||
n::sydbox() = phase->option("sydbox"),
|
||||
n::userpriv() = phase->option("userpriv") && userpriv_ok
|
||||
@ -112,7 +112,7 @@ paludis::erepository::do_info_action(
|
||||
make_named_values<EbuildInfoCommandParams>(
|
||||
n::expand_vars() = expand_vars,
|
||||
n::info_vars() = repo->info_vars_key() ?
|
||||
repo->info_vars_key()->value() : std::make_shared<const Set<std::string>>(),
|
||||
repo->info_vars_key()->parse_value() : std::make_shared<const Set<std::string>>(),
|
||||
n::load_environment() = static_cast<const FSPath *>(0),
|
||||
n::profiles() = repo->params().profiles(),
|
||||
n::profiles_with_parents() = repo->profile()->profiles_with_parents(),
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <paludis/repositories/e/can_skip_phase.hh>
|
||||
#include <paludis/repositories/e/e_stripper.hh>
|
||||
#include <paludis/repositories/e/ebuild.hh>
|
||||
#include <paludis/repositories/e/make_archive_strings.hh>
|
||||
|
||||
#include <paludis/util/indirect_iterator-impl.hh>
|
||||
#include <paludis/util/accept_visitor.hh>
|
||||
@ -97,7 +98,7 @@ namespace
|
||||
const std::shared_ptr<const PackageID> & b)
|
||||
{
|
||||
if (a->slot_key())
|
||||
return b->slot_key() && a->slot_key()->value() == b->slot_key()->value();
|
||||
return b->slot_key() && a->slot_key()->parse_value() == b->slot_key()->parse_value();
|
||||
else
|
||||
return ! b->slot_key();
|
||||
}
|
||||
@ -133,7 +134,7 @@ paludis::erepository::do_install_action(
|
||||
{
|
||||
DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(env, id);
|
||||
if (id->restrict_key())
|
||||
id->restrict_key()->value()->top()->accept(restricts);
|
||||
id->restrict_key()->parse_value()->top()->accept(restricts);
|
||||
|
||||
userpriv_restrict =
|
||||
indirect_iterator(restricts.end()) != std::find_if(indirect_iterator(restricts.begin()), indirect_iterator(restricts.end()),
|
||||
@ -153,59 +154,19 @@ paludis::erepository::do_install_action(
|
||||
}
|
||||
|
||||
std::string archives, all_archives, accept_license;
|
||||
std::tie(archives, all_archives) = make_archives_strings(env, id);
|
||||
|
||||
/* make ACCEPT_LICENSE */
|
||||
if (! id->eapi()->supported()->ebuild_environment_variables()->env_accept_license().empty())
|
||||
{
|
||||
std::set<std::string> already_in_archives;
|
||||
AcceptLicenseFinder g(env, id);
|
||||
if (id->license_key())
|
||||
id->license_key()->parse_value()->top()->accept(g);
|
||||
|
||||
/* make A */
|
||||
AFinder f(env, id);
|
||||
if (id->fetches_key())
|
||||
id->fetches_key()->value()->top()->accept(f);
|
||||
|
||||
for (AFinder::ConstIterator i(f.begin()), i_end(f.end()) ; i != i_end ; ++i)
|
||||
{
|
||||
const FetchableURIDepSpec * const spec(static_cast<const FetchableURIDepSpec *>(i->first));
|
||||
|
||||
if (already_in_archives.end() == already_in_archives.find(spec->filename()))
|
||||
{
|
||||
archives.append(spec->filename());
|
||||
already_in_archives.insert(spec->filename());
|
||||
}
|
||||
archives.append(" ");
|
||||
}
|
||||
|
||||
/* make AA */
|
||||
if (! id->eapi()->supported()->ebuild_environment_variables()->env_aa().empty())
|
||||
{
|
||||
AAVisitor g;
|
||||
if (id->fetches_key())
|
||||
id->fetches_key()->value()->top()->accept(g);
|
||||
std::set<std::string> already_in_all_archives;
|
||||
|
||||
for (AAVisitor::ConstIterator gg(g.begin()), gg_end(g.end()) ; gg != gg_end ; ++gg)
|
||||
{
|
||||
if (already_in_all_archives.end() == already_in_all_archives.find(*gg))
|
||||
{
|
||||
all_archives.append(*gg);
|
||||
already_in_all_archives.insert(*gg);
|
||||
}
|
||||
all_archives.append(" ");
|
||||
}
|
||||
}
|
||||
else
|
||||
all_archives = "AA-not-set-for-this-EAPI";
|
||||
|
||||
/* make ACCEPT_LICENSE */
|
||||
if (! id->eapi()->supported()->ebuild_environment_variables()->env_accept_license().empty())
|
||||
{
|
||||
AcceptLicenseFinder g(env, id);
|
||||
if (id->license_key())
|
||||
id->license_key()->value()->top()->accept(g);
|
||||
|
||||
accept_license = g.s.str();
|
||||
}
|
||||
else
|
||||
accept_license = "ACCEPT_LICENSE-not-set-for-this-EAPI";
|
||||
accept_license = g.s.str();
|
||||
}
|
||||
else
|
||||
accept_license = "ACCEPT_LICENSE-not-set-for-this-EAPI";
|
||||
|
||||
/* Strip trailing space. Some ebuilds rely upon this. From kde-meta.eclass:
|
||||
* [[ -n ${A/${TARBALL}/} ]] && unpack ${A/${TARBALL}/}
|
||||
@ -233,9 +194,8 @@ paludis::erepository::do_install_action(
|
||||
std::string used_config_protect;
|
||||
auto merged_entries(std::make_shared<FSPathSet>());
|
||||
|
||||
std::shared_ptr<const ChoiceValue> preserve_work_choice(
|
||||
id->choices_key()->value()->find_by_name_with_prefix(
|
||||
ELikePreserveWorkChoiceValue::canonical_name_with_prefix()));
|
||||
auto choices(id->choices_key()->parse_value());
|
||||
std::shared_ptr<const ChoiceValue> preserve_work_choice(choices->find_by_name_with_prefix(ELikePreserveWorkChoiceValue::canonical_name_with_prefix()));
|
||||
|
||||
EAPIPhases phases(id->eapi()->supported()->ebuild_phases()->ebuild_install());
|
||||
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
|
||||
@ -313,7 +273,7 @@ paludis::erepository::do_install_action(
|
||||
{
|
||||
std::string libdir("lib");
|
||||
FSPath root(install_action.options.destination()->installed_root_key() ?
|
||||
stringify(install_action.options.destination()->installed_root_key()->value()) : "/");
|
||||
stringify(install_action.options.destination()->installed_root_key()->parse_value()) : "/");
|
||||
if ((root / "usr" / "lib").stat().is_symlink())
|
||||
{
|
||||
libdir = (root / "usr" / "lib").readlink();
|
||||
@ -323,7 +283,7 @@ paludis::erepository::do_install_action(
|
||||
|
||||
Log::get_instance()->message("e.ebuild.libdir", ll_debug, lc_context) << "Using '" << libdir << "' for libdir";
|
||||
|
||||
std::shared_ptr<const ChoiceValue> symbols_choice(id->choices_key()->value()->find_by_name_with_prefix(
|
||||
std::shared_ptr<const ChoiceValue> symbols_choice(choices->find_by_name_with_prefix(
|
||||
ELikeSymbolsChoiceValue::canonical_name_with_prefix()));
|
||||
|
||||
EStripper stripper(make_named_values<EStripperOptions>(
|
||||
@ -348,7 +308,7 @@ paludis::erepository::do_install_action(
|
||||
if (test_restrict)
|
||||
continue;
|
||||
|
||||
std::shared_ptr<const ChoiceValue> choice(id->choices_key()->value()->find_by_name_with_prefix(
|
||||
std::shared_ptr<const ChoiceValue> choice(choices->find_by_name_with_prefix(
|
||||
ELikeOptionalTestsChoiceValue::canonical_name_with_prefix()));
|
||||
if (choice && ! choice->enabled())
|
||||
continue;
|
||||
@ -358,14 +318,14 @@ paludis::erepository::do_install_action(
|
||||
if (test_restrict)
|
||||
continue;
|
||||
|
||||
std::shared_ptr<const ChoiceValue> choice(id->choices_key()->value()->find_by_name_with_prefix(
|
||||
std::shared_ptr<const ChoiceValue> choice(choices->find_by_name_with_prefix(
|
||||
ELikeRecommendedTestsChoiceValue::canonical_name_with_prefix()));
|
||||
if (choice && ! choice->enabled())
|
||||
continue;
|
||||
}
|
||||
else if (phase->option("expensive_tests"))
|
||||
{
|
||||
std::shared_ptr<const ChoiceValue> choice(id->choices_key()->value()->find_by_name_with_prefix(
|
||||
std::shared_ptr<const ChoiceValue> choice(choices->find_by_name_with_prefix(
|
||||
ELikeExpensiveTestsChoiceValue::canonical_name_with_prefix()));
|
||||
if (choice && ! choice->enabled())
|
||||
continue;
|
||||
@ -377,7 +337,7 @@ paludis::erepository::do_install_action(
|
||||
n::commands() = join(phase->begin_commands(), phase->end_commands(), " "),
|
||||
n::distdir() = repo->params().distdir(),
|
||||
n::ebuild_dir() = repo->layout()->package_directory(id->name()),
|
||||
n::ebuild_file() = id->fs_location_key()->value(),
|
||||
n::ebuild_file() = id->fs_location_key()->parse_value(),
|
||||
n::eclassdirs() = repo->params().eclassdirs(),
|
||||
n::environment() = env,
|
||||
n::exlibsdirs() = exlibsdirs,
|
||||
@ -389,7 +349,7 @@ paludis::erepository::do_install_action(
|
||||
(repo->params().master_repositories() && ! repo->params().master_repositories()->empty()) ?
|
||||
(*repo->params().master_repositories()->begin())->params().location() : repo->params().location(),
|
||||
n::root() = install_action.options.destination()->installed_root_key() ?
|
||||
stringify(install_action.options.destination()->installed_root_key()->value()) :
|
||||
stringify(install_action.options.destination()->installed_root_key()->parse_value()) :
|
||||
"/",
|
||||
n::sandbox() = phase->option("sandbox"),
|
||||
n::sydbox() = phase->option("sydbox"),
|
||||
@ -410,7 +370,7 @@ paludis::erepository::do_install_action(
|
||||
n::profiles() = repo->params().profiles(),
|
||||
n::profiles_with_parents() = repo->profile()->profiles_with_parents(),
|
||||
n::replacing_ids() = install_action.options.replacing(),
|
||||
n::slot() = id->slot_key() ? stringify(id->slot_key()->value()) : "",
|
||||
n::slot() = id->slot_key() ? stringify(id->slot_key()->parse_value()) : "",
|
||||
n::use() = use,
|
||||
n::use_expand() = join(repo->profile()->use_expand()->begin(), repo->profile()->use_expand()->end(), " "),
|
||||
n::use_expand_hidden() = join(repo->profile()->use_expand_hidden()->begin(), repo->profile()->use_expand_hidden()->end(), " ")
|
||||
|
@ -66,7 +66,7 @@ paludis::erepository::do_pretend_action(
|
||||
{
|
||||
DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(env, id);
|
||||
if (id->restrict_key())
|
||||
id->restrict_key()->value()->top()->accept(restricts);
|
||||
id->restrict_key()->parse_value()->top()->accept(restricts);
|
||||
|
||||
userpriv_restrict =
|
||||
indirect_iterator(restricts.end()) != std::find_if(indirect_iterator(restricts.begin()), indirect_iterator(restricts.end()),
|
||||
@ -88,7 +88,7 @@ paludis::erepository::do_pretend_action(
|
||||
if (id->raw_myoptions_key())
|
||||
{
|
||||
MyOptionsRequirementsVerifier verifier(env, id);
|
||||
id->raw_myoptions_key()->value()->top()->accept(verifier);
|
||||
id->raw_myoptions_key()->parse_value()->top()->accept(verifier);
|
||||
|
||||
if (verifier.unmet_requirements() && ! verifier.unmet_requirements()->empty())
|
||||
{
|
||||
@ -108,7 +108,7 @@ paludis::erepository::do_pretend_action(
|
||||
n::commands() = join(phase->begin_commands(), phase->end_commands(), " "),
|
||||
n::distdir() = repo->params().distdir(),
|
||||
n::ebuild_dir() = repo->layout()->package_directory(id->name()),
|
||||
n::ebuild_file() = id->fs_location_key()->value(),
|
||||
n::ebuild_file() = id->fs_location_key()->parse_value(),
|
||||
n::eclassdirs() = repo->params().eclassdirs(),
|
||||
n::environment() = env,
|
||||
n::exlibsdirs() = exlibsdirs,
|
||||
@ -120,7 +120,7 @@ paludis::erepository::do_pretend_action(
|
||||
(repo->params().master_repositories() && ! repo->params().master_repositories()->empty()) ?
|
||||
(*repo->params().master_repositories()->begin())->params().location() : repo->params().location(),
|
||||
n::root() = a.options.destination()->installed_root_key() ?
|
||||
stringify(a.options.destination()->installed_root_key()->value()) :
|
||||
stringify(a.options.destination()->installed_root_key()->parse_value()) :
|
||||
"/",
|
||||
n::sandbox() = phase->option("sandbox"),
|
||||
n::sydbox() = phase->option("sydbox"),
|
||||
@ -149,7 +149,7 @@ paludis::erepository::do_pretend_action(
|
||||
if (id->required_use_key())
|
||||
{
|
||||
RequiredUseVerifier verifier(env, id);
|
||||
id->required_use_key()->value()->top()->accept(verifier);
|
||||
id->required_use_key()->parse_value()->top()->accept(verifier);
|
||||
|
||||
if (verifier.unmet_requirements() && ! verifier.unmet_requirements()->empty())
|
||||
{
|
||||
@ -169,7 +169,7 @@ paludis::erepository::do_pretend_action(
|
||||
n::commands() = join(phase->begin_commands(), phase->end_commands(), " "),
|
||||
n::distdir() = repo->params().distdir(),
|
||||
n::ebuild_dir() = repo->layout()->package_directory(id->name()),
|
||||
n::ebuild_file() = id->fs_location_key()->value(),
|
||||
n::ebuild_file() = id->fs_location_key()->parse_value(),
|
||||
n::eclassdirs() = repo->params().eclassdirs(),
|
||||
n::environment() = env,
|
||||
n::exlibsdirs() = exlibsdirs,
|
||||
@ -181,7 +181,7 @@ paludis::erepository::do_pretend_action(
|
||||
(repo->params().master_repositories() && ! repo->params().master_repositories()->empty()) ?
|
||||
(*repo->params().master_repositories()->begin())->params().location() : repo->params().location(),
|
||||
n::root() = a.options.destination()->installed_root_key() ?
|
||||
stringify(a.options.destination()->installed_root_key()->value()) :
|
||||
stringify(a.options.destination()->installed_root_key()->parse_value()) :
|
||||
"/",
|
||||
n::sandbox() = phase->option("sandbox"),
|
||||
n::sydbox() = phase->option("sydbox"),
|
||||
@ -228,7 +228,7 @@ paludis::erepository::do_pretend_action(
|
||||
n::commands() = join(phase->begin_commands(), phase->end_commands(), " "),
|
||||
n::distdir() = repo->params().distdir(),
|
||||
n::ebuild_dir() = repo->layout()->package_directory(id->name()),
|
||||
n::ebuild_file() = id->fs_location_key()->value(),
|
||||
n::ebuild_file() = id->fs_location_key()->parse_value(),
|
||||
n::eclassdirs() = repo->params().eclassdirs(),
|
||||
n::environment() = env,
|
||||
n::exlibsdirs() = exlibsdirs,
|
||||
@ -240,7 +240,7 @@ paludis::erepository::do_pretend_action(
|
||||
(repo->params().master_repositories() && ! repo->params().master_repositories()->empty()) ?
|
||||
(*repo->params().master_repositories()->begin())->params().location() : repo->params().location(),
|
||||
n::root() = a.options.destination()->installed_root_key() ?
|
||||
stringify(a.options.destination()->installed_root_key()->value()) :
|
||||
stringify(a.options.destination()->installed_root_key()->parse_value()) :
|
||||
"/",
|
||||
n::sandbox() = phase->option("sandbox"),
|
||||
n::sydbox() = phase->option("sydbox"),
|
||||
|
@ -44,7 +44,7 @@ paludis::erepository::do_pretend_fetch_action(
|
||||
PretendFetchVisitor f(env, id, *id->eapi(),
|
||||
repo->params().distdir(), a.options.fetch_parts()[fp_unneeded],
|
||||
id->fetches_key()->initial_label(), a);
|
||||
id->fetches_key()->value()->top()->accept(f);
|
||||
id->fetches_key()->parse_value()->top()->accept(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -255,7 +255,7 @@ namespace
|
||||
}
|
||||
|
||||
const std::shared_ptr<const Choices>
|
||||
EChoicesKey::value() const
|
||||
EChoicesKey::parse_value() const
|
||||
{
|
||||
Lock l(_imp->mutex);
|
||||
if (_imp->value)
|
||||
@ -293,15 +293,16 @@ EChoicesKey::populate_myoptions() const
|
||||
|
||||
std::shared_ptr<const Set<std::string> > hidden;
|
||||
if (_imp->id->raw_use_expand_hidden_key())
|
||||
hidden = _imp->id->raw_use_expand_hidden_key()->value();
|
||||
hidden = _imp->id->raw_use_expand_hidden_key()->parse_value();
|
||||
|
||||
/* yay. myoptions is easy. */
|
||||
MyOptionsFinder myoptions;
|
||||
_imp->id->raw_myoptions_key()->value()->top()->accept(myoptions);
|
||||
_imp->id->raw_myoptions_key()->parse_value()->top()->accept(myoptions);
|
||||
|
||||
if (_imp->id->raw_use_expand_key())
|
||||
for (Set<std::string>::ConstIterator u(_imp->id->raw_use_expand_key()->value()->begin()),
|
||||
u_end(_imp->id->raw_use_expand_key()->value()->end()) ;
|
||||
{
|
||||
auto raw_use_expand(_imp->id->raw_use_expand_key()->parse_value());
|
||||
for (Set<std::string>::ConstIterator u(raw_use_expand->begin()), u_end(raw_use_expand->end()) ;
|
||||
u != u_end ; ++u)
|
||||
{
|
||||
Context local_local_context("When using raw_use_expand_key value '" + *u + "' to populate choices:");
|
||||
@ -328,6 +329,7 @@ EChoicesKey::populate_myoptions() const
|
||||
myoptions.prefixes.erase(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MyOptionsFinder::Prefixes::iterator p(myoptions.prefixes.find(ChoicePrefixName("")));
|
||||
if (myoptions.prefixes.end() != p)
|
||||
@ -369,7 +371,7 @@ EChoicesKey::populate_iuse() const
|
||||
|
||||
std::shared_ptr<const Set<std::string> > hidden;
|
||||
if (_imp->id->raw_use_expand_hidden_key())
|
||||
hidden = _imp->id->raw_use_expand_hidden_key()->value();
|
||||
hidden = _imp->id->raw_use_expand_hidden_key()->parse_value();
|
||||
|
||||
/* ugh. iuse and all that mess. */
|
||||
|
||||
@ -383,15 +385,19 @@ EChoicesKey::populate_iuse() const
|
||||
std::map<ChoiceNameWithPrefix, ChoiceOptions> values;
|
||||
|
||||
std::map<std::string, bool> iuse_with_implicit;
|
||||
for (Set<std::string>::ConstIterator u(_imp->id->raw_iuse_key()->value()->begin()), u_end(_imp->id->raw_iuse_key()->value()->end()) ;
|
||||
auto raw_iuse(_imp->id->raw_iuse_key()->parse_value());
|
||||
for (Set<std::string>::ConstIterator u(raw_iuse->begin()), u_end(raw_iuse->end()) ;
|
||||
u != u_end ; ++u)
|
||||
iuse_with_implicit.insert(std::make_pair(*u, false));
|
||||
|
||||
if (_imp->id->raw_iuse_effective_key())
|
||||
for (Set<std::string>::ConstIterator u(_imp->id->raw_iuse_effective_key()->value()->begin()),
|
||||
u_end(_imp->id->raw_iuse_effective_key()->value()->end()) ;
|
||||
{
|
||||
auto raw_iuse_effective(_imp->id->raw_iuse_effective_key()->parse_value());
|
||||
for (Set<std::string>::ConstIterator u(raw_iuse_effective->begin()),
|
||||
u_end(raw_iuse_effective->end()) ;
|
||||
u != u_end ; ++u)
|
||||
iuse_with_implicit.insert(std::make_pair(*u, true));
|
||||
}
|
||||
|
||||
for (std::map<std::string, bool>::const_iterator u(iuse_with_implicit.begin()), u_end(iuse_with_implicit.end()) ;
|
||||
u != u_end ; ++u)
|
||||
@ -403,13 +409,19 @@ EChoicesKey::populate_iuse() const
|
||||
));
|
||||
|
||||
iuse_sanitised.insert(stringify(flag.first));
|
||||
if (_imp->id->raw_use_expand_key() &&
|
||||
_imp->id->raw_use_expand_key()->value()->end() != std::find_if(
|
||||
_imp->id->raw_use_expand_key()->value()->begin(),
|
||||
_imp->id->raw_use_expand_key()->value()->end(),
|
||||
IsExpand(flag.first, delim)))
|
||||
add_choice_to_map(i_values, flag_with_options, _imp->id->raw_iuse_key());
|
||||
else
|
||||
|
||||
bool was_expand(false);
|
||||
if (_imp->id->raw_use_expand_key())
|
||||
{
|
||||
auto raw_use_expand(_imp->id->raw_use_expand_key()->parse_value());
|
||||
if (raw_use_expand->end() != std::find_if(raw_use_expand->begin(), raw_use_expand->end(), IsExpand(flag.first, delim)))
|
||||
{
|
||||
add_choice_to_map(i_values, flag_with_options, _imp->id->raw_iuse_key());
|
||||
was_expand = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (! was_expand)
|
||||
{
|
||||
if (stringify(flag.first) == _imp->id->eapi()->supported()->choices_options()->fancy_test_flag())
|
||||
/* have to add this right at the end, after build_options is there */
|
||||
@ -432,7 +444,8 @@ EChoicesKey::populate_iuse() const
|
||||
* even if x86 isn't listed in IUSE. */
|
||||
if (_imp->id->raw_use_key() && ! _imp->id->eapi()->supported()->choices_options()->profile_iuse_injection())
|
||||
{
|
||||
for (Set<std::string>::ConstIterator u(_imp->id->raw_use_key()->value()->begin()), u_end(_imp->id->raw_use_key()->value()->end()) ;
|
||||
auto raw_use(_imp->id->raw_use_key()->parse_value());
|
||||
for (Set<std::string>::ConstIterator u(raw_use->begin()), u_end(raw_use->end()) ;
|
||||
u != u_end ; ++u)
|
||||
{
|
||||
if (iuse_sanitised.end() != iuse_sanitised.find(*u))
|
||||
@ -444,11 +457,15 @@ EChoicesKey::populate_iuse() const
|
||||
else
|
||||
flag = std::make_pair(ChoiceNameWithPrefix(*u), true);
|
||||
|
||||
if (_imp->id->raw_use_expand_key() &&
|
||||
_imp->id->raw_use_expand_key()->value()->end() != std::find_if(
|
||||
_imp->id->raw_use_expand_key()->value()->begin(),
|
||||
_imp->id->raw_use_expand_key()->value()->end(),
|
||||
IsExpand(flag.first, delim)))
|
||||
bool was_expand(false);
|
||||
if (_imp->id->raw_use_expand_key())
|
||||
{
|
||||
auto raw_use_expand(_imp->id->raw_use_expand_key()->parse_value());
|
||||
if (raw_use_expand->end() != std::find_if(raw_use_expand->begin(), raw_use_expand->end(), IsExpand(flag.first, delim)))
|
||||
was_expand = true;
|
||||
}
|
||||
|
||||
if (was_expand)
|
||||
{
|
||||
/* don't need to worry */
|
||||
}
|
||||
@ -480,8 +497,8 @@ EChoicesKey::populate_iuse() const
|
||||
|
||||
if (_imp->id->raw_use_expand_key())
|
||||
{
|
||||
for (Set<std::string>::ConstIterator u(_imp->id->raw_use_expand_key()->value()->begin()),
|
||||
u_end(_imp->id->raw_use_expand_key()->value()->end()) ;
|
||||
auto raw_use_expand(_imp->id->raw_use_expand_key()->parse_value());
|
||||
for (Set<std::string>::ConstIterator u(raw_use_expand->begin()), u_end(raw_use_expand->end()) ;
|
||||
u != u_end ; ++u)
|
||||
{
|
||||
std::string lower_u;
|
||||
@ -513,8 +530,8 @@ EChoicesKey::populate_iuse() const
|
||||
|
||||
if (_imp->id->raw_use_key())
|
||||
{
|
||||
for (Set<std::string>::ConstIterator it(_imp->id->raw_use_key()->value()->begin()),
|
||||
it_end(_imp->id->raw_use_key()->value()->end()); it_end != it; ++it)
|
||||
auto raw_use(_imp->id->raw_use_key()->parse_value());
|
||||
for (Set<std::string>::ConstIterator it(raw_use->begin()), it_end(raw_use->end()); it_end != it; ++it)
|
||||
{
|
||||
std::string flag(0 == it->compare(0, 1, "-", 0, 1) ? it->substr(1) : *it);
|
||||
if (IsExpand(ChoiceNameWithPrefix(flag), delim)(*u))
|
||||
|
@ -54,7 +54,7 @@ namespace paludis
|
||||
|
||||
~EChoicesKey();
|
||||
|
||||
const std::shared_ptr<const Choices> value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
const std::shared_ptr<const Choices> parse_value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
@ -143,14 +143,14 @@ bool
|
||||
EInstalledRepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> & id) const
|
||||
{
|
||||
auto repo(_imp->params.environment()->fetch_repository(id->repository_name()));
|
||||
std::string f(repo->format_key() ? repo->format_key()->value() : "");
|
||||
std::string f(repo->format_key() ? repo->format_key()->parse_value() : "");
|
||||
return f == "e" || f == "ebuild" || f == "exheres" || f == "portage";
|
||||
}
|
||||
|
||||
bool
|
||||
EInstalledRepository::is_default_destination() const
|
||||
{
|
||||
return _imp->params.environment()->preferred_root_key()->value() == installed_root_key()->value();
|
||||
return _imp->params.environment()->preferred_root_key()->parse_value() == installed_root_key()->parse_value();
|
||||
}
|
||||
|
||||
bool
|
||||
@ -193,7 +193,7 @@ EInstalledRepository::get_environment_variable(
|
||||
Context context("When fetching environment variable '" + var + "' for '" +
|
||||
stringify(*id) + "':");
|
||||
|
||||
FSPath ver_dir(id->fs_location_key()->value());
|
||||
FSPath ver_dir(id->fs_location_key()->parse_value());
|
||||
|
||||
if (! ver_dir.stat().is_directory_or_symlink_to_directory())
|
||||
throw ActionFailedError("Could not find Exndbam entry for '" + stringify(*id) + "'");
|
||||
@ -235,7 +235,7 @@ EInstalledRepository::perform_config(
|
||||
|
||||
std::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
|
||||
|
||||
FSPath ver_dir(id->fs_location_key()->value());
|
||||
FSPath ver_dir(id->fs_location_key()->parse_value());
|
||||
|
||||
std::shared_ptr<FSPathSequence> eclassdirs(std::make_shared<FSPathSequence>());
|
||||
eclassdirs->push_back(ver_dir);
|
||||
@ -290,7 +290,7 @@ EInstalledRepository::perform_info(
|
||||
|
||||
std::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
|
||||
|
||||
FSPath ver_dir(id->fs_location_key()->value());
|
||||
FSPath ver_dir(id->fs_location_key()->parse_value());
|
||||
|
||||
auto eclassdirs(std::make_shared<FSPathSequence>());
|
||||
eclassdirs->push_back(ver_dir);
|
||||
@ -309,8 +309,8 @@ EInstalledRepository::perform_info(
|
||||
std::shared_ptr<const Set<std::string> > i;
|
||||
if (id->from_repositories_key())
|
||||
{
|
||||
for (Set<std::string>::ConstIterator o(id->from_repositories_key()->value()->begin()),
|
||||
o_end(id->from_repositories_key()->value()->end()) ;
|
||||
auto fr(id->from_repositories_key()->parse_value());
|
||||
for (Set<std::string>::ConstIterator o(fr->begin()), o_end(fr->end()) ;
|
||||
o != o_end ; ++o)
|
||||
{
|
||||
RepositoryName rn(*o);
|
||||
@ -325,7 +325,7 @@ EInstalledRepository::perform_info(
|
||||
visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**m));
|
||||
if (mm)
|
||||
{
|
||||
i = mm->value();
|
||||
i = mm->parse_value();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -346,7 +346,7 @@ EInstalledRepository::perform_info(
|
||||
visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**m));
|
||||
if (mm)
|
||||
{
|
||||
i = mm->value();
|
||||
i = mm->parse_value();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -601,14 +601,14 @@ EInstalledRepositoryID::canonical_form(const PackageIDCanonicalForm f) const
|
||||
{
|
||||
case idcf_full:
|
||||
if (_imp->keys && _imp->keys->slot)
|
||||
return stringify(name()) + "-" + stringify(version()) + ":" + stringify(_imp->keys->slot->value()) + "::" +
|
||||
return stringify(name()) + "-" + stringify(version()) + ":" + stringify(_imp->keys->slot->parse_value()) + "::" +
|
||||
stringify(repository_name());
|
||||
|
||||
return stringify(name()) + "-" + stringify(version()) + "::" + stringify(repository_name());
|
||||
|
||||
case idcf_no_version:
|
||||
if (_imp->keys && _imp->keys->slot)
|
||||
return stringify(name()) + ":" + stringify(_imp->keys->slot->value()) + "::" +
|
||||
return stringify(name()) + ":" + stringify(_imp->keys->slot->parse_value()) + "::" +
|
||||
stringify(repository_name());
|
||||
|
||||
return stringify(name()) + "::" + stringify(repository_name());
|
||||
@ -618,7 +618,7 @@ EInstalledRepositoryID::canonical_form(const PackageIDCanonicalForm f) const
|
||||
|
||||
case idcf_no_name:
|
||||
if (_imp->keys && _imp->keys->slot)
|
||||
return stringify(version()) + ":" + stringify(_imp->keys->slot->value()) + "::" +
|
||||
return stringify(version()) + ":" + stringify(_imp->keys->slot->parse_value()) + "::" +
|
||||
stringify(repository_name());
|
||||
|
||||
return stringify(version()) + "::" + stringify(repository_name());
|
||||
@ -634,7 +634,7 @@ PackageDepSpec
|
||||
EInstalledRepositoryID::uniquely_identifying_spec() const
|
||||
{
|
||||
return parse_user_package_dep_spec("=" + stringify(name()) + "-" + stringify(version()) +
|
||||
(slot_key() ? ":" + stringify(slot_key()->value()) : "") + "::" + stringify(repository_name()),
|
||||
(slot_key() ? ":" + stringify(slot_key()->parse_value()) : "") + "::" + stringify(repository_name()),
|
||||
_imp->environment, { });
|
||||
}
|
||||
|
||||
@ -1060,7 +1060,10 @@ EInstalledRepositoryID::make_choice_value(const std::shared_ptr<const Choice> &
|
||||
|
||||
bool enabled(false);
|
||||
if (raw_use_key())
|
||||
enabled = (raw_use_key()->value()->end() != raw_use_key()->value()->find(name_with_prefix));
|
||||
{
|
||||
auto ru(raw_use_key()->parse_value());
|
||||
enabled = (ru->end() != ru->find(name_with_prefix));
|
||||
}
|
||||
|
||||
return create_e_choice_value(make_named_values<EChoiceValueParams>(
|
||||
n::choice_name_with_prefix() = ChoiceNameWithPrefix(name_with_prefix),
|
||||
|
@ -108,7 +108,7 @@ EDependenciesKey::~EDependenciesKey()
|
||||
}
|
||||
|
||||
const std::shared_ptr<const DependencySpecTree>
|
||||
EDependenciesKey::value() const
|
||||
EDependenciesKey::parse_value() const
|
||||
{
|
||||
Lock l(_imp->value_mutex);
|
||||
if (_imp->value)
|
||||
@ -131,7 +131,7 @@ EDependenciesKey::pretty_print_value(
|
||||
const PrettyPrintOptions & options) const
|
||||
{
|
||||
SpecTreePrettyPrinter p(pretty_printer, options);
|
||||
value()->top()->accept(p);
|
||||
parse_value()->top()->accept(p);
|
||||
return stringify(p);
|
||||
}
|
||||
|
||||
@ -200,7 +200,7 @@ ELicenseKey::~ELicenseKey()
|
||||
}
|
||||
|
||||
const std::shared_ptr<const LicenseSpecTree>
|
||||
ELicenseKey::value() const
|
||||
ELicenseKey::parse_value() const
|
||||
{
|
||||
Lock l(_imp->value_mutex);
|
||||
if (_imp->value)
|
||||
@ -217,7 +217,7 @@ ELicenseKey::pretty_print_value(
|
||||
const PrettyPrintOptions & options) const
|
||||
{
|
||||
SpecTreePrettyPrinter p(pretty_printer, options);
|
||||
value()->top()->accept(p);
|
||||
parse_value()->top()->accept(p);
|
||||
return stringify(p);
|
||||
}
|
||||
|
||||
@ -279,7 +279,7 @@ EFetchableURIKey::~EFetchableURIKey()
|
||||
}
|
||||
|
||||
const std::shared_ptr<const FetchableURISpecTree>
|
||||
EFetchableURIKey::value() const
|
||||
EFetchableURIKey::parse_value() const
|
||||
{
|
||||
Lock l(_imp->value_mutex);
|
||||
|
||||
@ -297,7 +297,7 @@ EFetchableURIKey::pretty_print_value(
|
||||
const PrettyPrintOptions & options) const
|
||||
{
|
||||
SpecTreePrettyPrinter p(pretty_printer, options);
|
||||
value()->top()->accept(p);
|
||||
parse_value()->top()->accept(p);
|
||||
return stringify(p);
|
||||
}
|
||||
|
||||
@ -310,7 +310,7 @@ EFetchableURIKey::initial_label() const
|
||||
{
|
||||
DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> f(_imp->env, _imp->id);
|
||||
if (_imp->id->restrict_key())
|
||||
_imp->id->restrict_key()->value()->top()->accept(f);
|
||||
_imp->id->restrict_key()->parse_value()->top()->accept(f);
|
||||
for (DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec>::ConstIterator i(f.begin()), i_end(f.end()) ;
|
||||
i != i_end ; ++i)
|
||||
{
|
||||
@ -399,7 +399,7 @@ ESimpleURIKey::~ESimpleURIKey()
|
||||
}
|
||||
|
||||
const std::shared_ptr<const SimpleURISpecTree>
|
||||
ESimpleURIKey::value() const
|
||||
ESimpleURIKey::parse_value() const
|
||||
{
|
||||
Lock l(_imp->value_mutex);
|
||||
|
||||
@ -417,7 +417,7 @@ ESimpleURIKey::pretty_print_value(
|
||||
const PrettyPrintOptions & options) const
|
||||
{
|
||||
SpecTreePrettyPrinter p(pretty_printer, options);
|
||||
value()->top()->accept(p);
|
||||
parse_value()->top()->accept(p);
|
||||
return stringify(p);
|
||||
}
|
||||
|
||||
@ -482,7 +482,7 @@ EPlainTextSpecKey::~EPlainTextSpecKey()
|
||||
}
|
||||
|
||||
const std::shared_ptr<const PlainTextSpecTree>
|
||||
EPlainTextSpecKey::value() const
|
||||
EPlainTextSpecKey::parse_value() const
|
||||
{
|
||||
Lock l(_imp->value_mutex);
|
||||
|
||||
@ -500,7 +500,7 @@ EPlainTextSpecKey::pretty_print_value(
|
||||
const PrettyPrintOptions & options) const
|
||||
{
|
||||
SpecTreePrettyPrinter p(pretty_printer, options);
|
||||
value()->top()->accept(p);
|
||||
parse_value()->top()->accept(p);
|
||||
return stringify(p);
|
||||
}
|
||||
|
||||
@ -568,7 +568,7 @@ EMyOptionsKey::~EMyOptionsKey()
|
||||
}
|
||||
|
||||
const std::shared_ptr<const PlainTextSpecTree>
|
||||
EMyOptionsKey::value() const
|
||||
EMyOptionsKey::parse_value() const
|
||||
{
|
||||
Lock l(_imp->value_mutex);
|
||||
if (_imp->value)
|
||||
@ -585,7 +585,7 @@ EMyOptionsKey::pretty_print_value(
|
||||
const PrettyPrintOptions & options) const
|
||||
{
|
||||
SpecTreePrettyPrinter p(pretty_printer, options);
|
||||
value()->top()->accept(p);
|
||||
parse_value()->top()->accept(p);
|
||||
return stringify(p);
|
||||
}
|
||||
|
||||
@ -654,7 +654,7 @@ ERequiredUseKey::~ERequiredUseKey()
|
||||
}
|
||||
|
||||
const std::shared_ptr<const RequiredUseSpecTree>
|
||||
ERequiredUseKey::value() const
|
||||
ERequiredUseKey::parse_value() const
|
||||
{
|
||||
Lock l(_imp->value_mutex);
|
||||
if (_imp->value)
|
||||
@ -671,7 +671,7 @@ ERequiredUseKey::pretty_print_value(
|
||||
const PrettyPrintOptions & options) const
|
||||
{
|
||||
SpecTreePrettyPrinter p(pretty_printer, options);
|
||||
value()->top()->accept(p);
|
||||
parse_value()->top()->accept(p);
|
||||
return stringify(p);
|
||||
}
|
||||
|
||||
@ -738,7 +738,7 @@ EProvideKey::~EProvideKey()
|
||||
}
|
||||
|
||||
const std::shared_ptr<const ProvideSpecTree>
|
||||
EProvideKey::value() const
|
||||
EProvideKey::parse_value() const
|
||||
{
|
||||
Lock l(_imp->value_mutex);
|
||||
if (_imp->value)
|
||||
@ -755,7 +755,7 @@ EProvideKey::pretty_print_value(
|
||||
const PrettyPrintOptions & options) const
|
||||
{
|
||||
SpecTreePrettyPrinter p(pretty_printer, options);
|
||||
value()->top()->accept(p);
|
||||
parse_value()->top()->accept(p);
|
||||
return stringify(p);
|
||||
}
|
||||
|
||||
@ -810,7 +810,7 @@ EContentsKey::~EContentsKey()
|
||||
}
|
||||
|
||||
const std::shared_ptr<const Contents>
|
||||
EContentsKey::value() const
|
||||
EContentsKey::parse_value() const
|
||||
{
|
||||
Lock l(_imp->value_mutex);
|
||||
|
||||
@ -927,7 +927,7 @@ EMTimeKey::~EMTimeKey()
|
||||
}
|
||||
|
||||
Timestamp
|
||||
EMTimeKey::value() const
|
||||
EMTimeKey::parse_value() const
|
||||
{
|
||||
Lock l(_imp->value_mutex);
|
||||
|
||||
|
@ -48,7 +48,7 @@ namespace paludis
|
||||
const MetadataKeyType);
|
||||
~EDependenciesKey();
|
||||
|
||||
virtual const std::shared_ptr<const DependencySpecTree> value() const
|
||||
virtual const std::shared_ptr<const DependencySpecTree> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::shared_ptr<const DependenciesLabelSequence> initial_labels() const
|
||||
@ -77,7 +77,7 @@ namespace paludis
|
||||
const MetadataKeyType);
|
||||
~EFetchableURIKey();
|
||||
|
||||
virtual const std::shared_ptr<const FetchableURISpecTree> value() const
|
||||
virtual const std::shared_ptr<const FetchableURISpecTree> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::shared_ptr<const URILabel> initial_label() const
|
||||
@ -106,7 +106,7 @@ namespace paludis
|
||||
const bool is_installed);
|
||||
~ESimpleURIKey();
|
||||
|
||||
virtual const std::shared_ptr<const SimpleURISpecTree> value() const
|
||||
virtual const std::shared_ptr<const SimpleURISpecTree> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
@ -132,7 +132,7 @@ namespace paludis
|
||||
bool is_installed);
|
||||
~EPlainTextSpecKey();
|
||||
|
||||
virtual const std::shared_ptr<const PlainTextSpecTree> value() const
|
||||
virtual const std::shared_ptr<const PlainTextSpecTree> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
@ -158,7 +158,7 @@ namespace paludis
|
||||
bool);
|
||||
~EMyOptionsKey();
|
||||
|
||||
virtual const std::shared_ptr<const PlainTextSpecTree> value() const
|
||||
virtual const std::shared_ptr<const PlainTextSpecTree> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
@ -184,7 +184,7 @@ namespace paludis
|
||||
bool i);
|
||||
~ERequiredUseKey();
|
||||
|
||||
virtual const std::shared_ptr<const RequiredUseSpecTree> value() const
|
||||
virtual const std::shared_ptr<const RequiredUseSpecTree> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
@ -210,7 +210,7 @@ namespace paludis
|
||||
const bool is_installed);
|
||||
~EProvideKey();
|
||||
|
||||
virtual const std::shared_ptr<const ProvideSpecTree> value() const
|
||||
virtual const std::shared_ptr<const ProvideSpecTree> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
@ -237,7 +237,7 @@ namespace paludis
|
||||
bool is_installed);
|
||||
~ELicenseKey();
|
||||
|
||||
virtual const std::shared_ptr<const LicenseSpecTree> value() const
|
||||
virtual const std::shared_ptr<const LicenseSpecTree> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
@ -259,7 +259,7 @@ namespace paludis
|
||||
EContentsKey(const std::string &, const std::string &, const FSPath &, const MetadataKeyType);
|
||||
~EContentsKey();
|
||||
|
||||
const std::shared_ptr<const Contents> value() const
|
||||
const std::shared_ptr<const Contents> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
@ -277,7 +277,7 @@ namespace paludis
|
||||
EMTimeKey(const std::string &, const std::string &, const FSPath &, const MetadataKeyType);
|
||||
~EMTimeKey();
|
||||
|
||||
Timestamp value() const
|
||||
Timestamp parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
@ -63,7 +63,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
const std::shared_ptr<const Set<KeywordName> > value() const
|
||||
const std::shared_ptr<const Set<KeywordName> > parse_value() const
|
||||
{
|
||||
return parsed_value;
|
||||
}
|
||||
@ -87,7 +87,7 @@ namespace
|
||||
const PrettyPrinter & p,
|
||||
const PrettyPrintOptions &) const
|
||||
{
|
||||
return join(value()->begin(), value()->end(), " ", CallPrettyPrinter(p));
|
||||
return join(parsed_value->begin(), parsed_value->end(), " ", CallPrettyPrinter(p));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -150,7 +150,7 @@ namespace
|
||||
result = std::make_shared<FSPathSequence>();
|
||||
for (ERepositorySequence::ConstIterator e(r->begin()), e_end(r->end()) ;
|
||||
e != e_end ; ++e)
|
||||
result->push_back((*e)->location_key()->value());
|
||||
result->push_back((*e)->location_key()->parse_value());
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -927,7 +927,7 @@ bool
|
||||
ERepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> & id) const
|
||||
{
|
||||
auto repo(_imp->params.environment()->fetch_repository(id->repository_name()));
|
||||
std::string f(repo->format_key() ? repo->format_key()->value() : "");
|
||||
std::string f(repo->format_key() ? repo->format_key()->parse_value() : "");
|
||||
if (f == "e")
|
||||
return static_cast<const ERepositoryID &>(*id).eapi()->supported()->can_be_pbin();
|
||||
else
|
||||
@ -1082,7 +1082,7 @@ ERepository::make_manifest(const QualifiedPackageName & qpn)
|
||||
if (! id->fetches_key())
|
||||
continue;
|
||||
AAVisitor aa;
|
||||
id->fetches_key()->value()->top()->accept(aa);
|
||||
id->fetches_key()->parse_value()->top()->accept(aa);
|
||||
|
||||
for (AAVisitor::ConstIterator d(aa.begin()) ;
|
||||
d != aa.end() ; ++d)
|
||||
@ -1218,7 +1218,7 @@ ERepository::repository_factory_create(
|
||||
|
||||
std::string format("unknown");
|
||||
if (master_repository_uncasted->format_key())
|
||||
format = master_repository_uncasted->format_key()->value();
|
||||
format = master_repository_uncasted->format_key()->parse_value();
|
||||
|
||||
if (format != "e")
|
||||
throw ERepositoryConfigurationError("Master repository format is '" + stringify(format) + "', not 'ebuild'");
|
||||
@ -1252,7 +1252,7 @@ ERepository::repository_factory_create(
|
||||
|
||||
std::string format("unknown");
|
||||
if (master_repository_uncasted->format_key())
|
||||
format = master_repository_uncasted->format_key()->value();
|
||||
format = master_repository_uncasted->format_key()->parse_value();
|
||||
|
||||
if (format != "e")
|
||||
throw ERepositoryConfigurationError("Master repository format is '" + stringify(format) + "', not 'ebuild'");
|
||||
@ -1705,7 +1705,7 @@ ERepository::get_environment_variable(
|
||||
|
||||
DepSpecFlattener<PlainTextSpecTree, PlainTextDepSpec> restricts(_imp->params.environment(), id_uncasted);
|
||||
if (id->restrict_key())
|
||||
id->restrict_key()->value()->top()->accept(restricts);
|
||||
id->restrict_key()->parse_value()->top()->accept(restricts);
|
||||
|
||||
userpriv_restrict =
|
||||
indirect_iterator(restricts.end()) != std::find_if(indirect_iterator(restricts.begin()), indirect_iterator(restricts.end()),
|
||||
@ -1724,7 +1724,7 @@ ERepository::get_environment_variable(
|
||||
n::commands() = join(phases.begin_phases()->begin_commands(), phases.begin_phases()->end_commands(), " "),
|
||||
n::distdir() = _imp->params.distdir(),
|
||||
n::ebuild_dir() = layout()->package_directory(id->name()),
|
||||
n::ebuild_file() = id->fs_location_key()->value(),
|
||||
n::ebuild_file() = id->fs_location_key()->parse_value(),
|
||||
n::eclassdirs() = _imp->params.eclassdirs(),
|
||||
n::environment() = _imp->params.environment(),
|
||||
n::exlibsdirs() = exlibsdirs,
|
||||
@ -1818,9 +1818,10 @@ ERepository::merge(const MergeParams & m)
|
||||
std::string binary_keywords;
|
||||
if (m.package_id()->keywords_key())
|
||||
{
|
||||
for (auto k(m.package_id()->keywords_key()->value()->begin()), k_end(m.package_id()->keywords_key()->value()->end()) ;
|
||||
k != k_end ; ++k)
|
||||
if (_imp->binary_keywords_filter->value()->end() != _imp->binary_keywords_filter->value()->find(stringify(*k)))
|
||||
auto kk(m.package_id()->keywords_key()->parse_value());
|
||||
auto binary_keywords_filter(_imp->binary_keywords_filter->parse_value());
|
||||
for (auto k(kk->begin()), k_end(kk->end()) ; k != k_end ; ++k)
|
||||
if (binary_keywords_filter->end() != binary_keywords_filter->find(stringify(*k)))
|
||||
{
|
||||
if (! binary_keywords.empty())
|
||||
binary_keywords.append(" ");
|
||||
@ -1852,9 +1853,9 @@ ERepository::merge(const MergeParams & m)
|
||||
if (is_replace)
|
||||
{
|
||||
/* 0.1 replacing 00.1 etc */
|
||||
if (is_replace->fs_location_key()->value() != binary_ebuild_location)
|
||||
if (is_replace->fs_location_key()->parse_value() != binary_ebuild_location)
|
||||
{
|
||||
FSPath p(is_replace->fs_location_key()->value());
|
||||
FSPath p(is_replace->fs_location_key()->parse_value());
|
||||
m.output_manager()->stdout_stream() << "Deleting replaced pbin " << p << std::endl;
|
||||
p.unlink();
|
||||
}
|
||||
@ -1871,7 +1872,7 @@ ERepository::merge(const MergeParams & m)
|
||||
if ((*r)->repository_name() != name())
|
||||
continue;
|
||||
|
||||
FSPath p((*r)->fs_location_key()->value());
|
||||
FSPath p((*r)->fs_location_key()->parse_value());
|
||||
FSStat p_stat(p);
|
||||
if (p_stat.exists())
|
||||
{
|
||||
|
@ -406,17 +406,17 @@ TEST(ERepository, MetadataUncached)
|
||||
|
||||
EXPECT_TRUE(id1->end_metadata() != id1->find_metadata("EAPI"));
|
||||
EXPECT_TRUE(visitor_cast<const MetadataValueKey<std::string> >(**id1->find_metadata("EAPI")));
|
||||
EXPECT_EQ("0", visitor_cast<const MetadataValueKey<std::string> >(**id1->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("0", visitor_cast<const MetadataValueKey<std::string> >(**id1->find_metadata("EAPI"))->parse_value());
|
||||
ASSERT_TRUE(bool(id1->short_description_key()));
|
||||
EXPECT_EQ("The Description", id1->short_description_key()->value());
|
||||
EXPECT_EQ("The Description", id1->short_description_key()->parse_value());
|
||||
UnformattedPrettyPrinter ff;
|
||||
erepository::SpecTreePrettyPrinter pd(ff, { });
|
||||
ASSERT_TRUE(bool(id1->build_dependencies_key()));
|
||||
id1->build_dependencies_key()->value()->top()->accept(pd);
|
||||
id1->build_dependencies_key()->parse_value()->top()->accept(pd);
|
||||
EXPECT_EQ("foo/bar", stringify(pd));
|
||||
erepository::SpecTreePrettyPrinter pr(ff, { });
|
||||
ASSERT_TRUE(bool(id1->run_dependencies_key()));
|
||||
id1->run_dependencies_key()->value()->top()->accept(pr);
|
||||
id1->run_dependencies_key()->parse_value()->top()->accept(pr);
|
||||
EXPECT_EQ("foo/bar", stringify(pr));
|
||||
|
||||
const std::shared_ptr<const PackageID> id2(*env[selection::RequireExactlyOne(generator::Matches(
|
||||
@ -425,14 +425,14 @@ TEST(ERepository, MetadataUncached)
|
||||
|
||||
ASSERT_TRUE(id2->end_metadata() != id2->find_metadata("EAPI"));
|
||||
ASSERT_TRUE(bool(id2->short_description_key()));
|
||||
EXPECT_EQ("dquote \" squote ' backslash \\ dollar $", id2->short_description_key()->value());
|
||||
EXPECT_EQ("dquote \" squote ' backslash \\ dollar $", id2->short_description_key()->parse_value());
|
||||
erepository::SpecTreePrettyPrinter pd2(ff, { });
|
||||
ASSERT_TRUE(bool(id2->build_dependencies_key()));
|
||||
id2->build_dependencies_key()->value()->top()->accept(pd2);
|
||||
id2->build_dependencies_key()->parse_value()->top()->accept(pd2);
|
||||
EXPECT_EQ("foo/bar bar/baz", stringify(pd2));
|
||||
erepository::SpecTreePrettyPrinter pr2(ff, { });
|
||||
ASSERT_TRUE(bool(id2->run_dependencies_key()));
|
||||
id2->run_dependencies_key()->value()->top()->accept(pr2);
|
||||
id2->run_dependencies_key()->parse_value()->top()->accept(pr2);
|
||||
EXPECT_EQ("foo/bar", stringify(pr2));
|
||||
|
||||
const std::shared_ptr<const PackageID> id3(*env[selection::RequireExactlyOne(generator::Matches(
|
||||
@ -441,9 +441,9 @@ TEST(ERepository, MetadataUncached)
|
||||
|
||||
ASSERT_TRUE(id3->end_metadata() != id3->find_metadata("EAPI"));
|
||||
ASSERT_TRUE(bool(id3->short_description_key()));
|
||||
EXPECT_EQ("This is the short description", id3->short_description_key()->value());
|
||||
EXPECT_EQ("This is the short description", id3->short_description_key()->parse_value());
|
||||
ASSERT_TRUE(bool(id3->long_description_key()));
|
||||
EXPECT_EQ("This is the long description", id3->long_description_key()->value());
|
||||
EXPECT_EQ("This is the long description", id3->long_description_key()->parse_value());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -480,7 +480,7 @@ namespace
|
||||
{
|
||||
void test_choice(const std::shared_ptr<const PackageID> & p, const std::string & n, bool enabled, bool enabled_by_default, bool locked, const std::string & u = "")
|
||||
{
|
||||
std::shared_ptr<const ChoiceValue> choice(p->choices_key()->value()->find_by_name_with_prefix(ChoiceNameWithPrefix(n)));
|
||||
std::shared_ptr<const ChoiceValue> choice(p->choices_key()->parse_value()->find_by_name_with_prefix(ChoiceNameWithPrefix(n)));
|
||||
ASSERT_TRUE(bool(choice));
|
||||
EXPECT_EQ(choice->unprefixed_name(), UnprefixedChoiceName(u.empty() ? n : u));
|
||||
EXPECT_EQ(enabled, choice->enabled());
|
||||
@ -783,7 +783,7 @@ TEST(ERepository, Fetch)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(no_files_id));
|
||||
ASSERT_TRUE(bool(no_files_id->short_description_key()));
|
||||
EXPECT_EQ("The Short Description", no_files_id->short_description_key()->value());
|
||||
EXPECT_EQ("The Short Description", no_files_id->short_description_key()->parse_value());
|
||||
no_files_id->perform_action(action);
|
||||
}
|
||||
|
||||
|
@ -262,7 +262,7 @@ TEST(ERepository, InstallEAPI0)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-source-0",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("0", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("0", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
ASSERT_THROW(id->perform_action(action), ActionFailedError);
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@ TEST(ERepository, InstallEAPI0)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/doman-0",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("0", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("0", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -280,7 +280,7 @@ TEST(ERepository, InstallEAPI0)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/src_prepare-0",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("0", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("0", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -289,7 +289,7 @@ TEST(ERepository, InstallEAPI0)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/src_configure-0",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("0", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("0", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -338,7 +338,7 @@ TEST(ERepository, InstallEAPI0)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-disable-dependency-tracking-0",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("0", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("0", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ TEST(ERepository, InstallEAPI1)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-source-1",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("1", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("1", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ TEST(ERepository, InstallEAPI1)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/dosym-success-1",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("1", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("1", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ TEST(ERepository, InstallEAPI1)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/doman-1",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("1", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("1", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ TEST(ERepository, InstallEAPI1)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/src_prepare-1",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("1", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("1", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ TEST(ERepository, InstallEAPI1)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/src_configure-1",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("1", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("1", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ TEST(ERepository, InstallEAPI2)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-source-2",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ TEST(ERepository, InstallEAPI2)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/doman-2",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ TEST(ERepository, InstallEAPI2)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/src_prepare-2",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
ASSERT_THROW(id->perform_action(action), ActionFailedError);
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ TEST(ERepository, InstallEAPI2)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/src_configure-2",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
ASSERT_THROW(id->perform_action(action), ActionFailedError);
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ TEST(ERepository, InstallEAPI2)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/default-src_configure-2",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ TEST(ERepository, InstallEAPI2)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/default-src_compile-2",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -182,7 +182,7 @@ TEST(ERepository, InstallEAPI2)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/default_src_compile-2",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ TEST(ERepository, InstallEAPI2)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/src_compile-via-default-func-2",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("2", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ TEST(ERepository, InstallEAPI3)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/prefix-3",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("3", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("3", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ TEST(ERepository, InstallEAPI4)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/pkg_pretend-4",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(pretend_action);
|
||||
ASSERT_TRUE(! pretend_action.failed());
|
||||
}
|
||||
@ -145,7 +145,7 @@ TEST(ERepository, InstallEAPI4)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/pkg_pretend-failure-4",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(pretend_action);
|
||||
ASSERT_TRUE(pretend_action.failed());
|
||||
}
|
||||
@ -155,7 +155,7 @@ TEST(ERepository, InstallEAPI4)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/default_src_install-4",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ TEST(ERepository, InstallEAPI4)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/docompress-4",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ TEST(ERepository, InstallEAPI4)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/dodoc-r-4",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -182,7 +182,7 @@ TEST(ERepository, InstallEAPI4)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/doins-symlink-4",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ TEST(ERepository, InstallEAPI4)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/banned-functions-4",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
EXPECT_THROW(id->perform_action(action), ActionFailedError);
|
||||
}
|
||||
|
||||
@ -200,7 +200,7 @@ TEST(ERepository, InstallEAPI4)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-disable-dependency-tracking-4_beta",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -209,7 +209,7 @@ TEST(ERepository, InstallEAPI4)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/econf-disable-dependency-tracking-4",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@ TEST(ERepository, InstallEAPI4)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/global-scope-use-4",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -227,7 +227,7 @@ TEST(ERepository, InstallEAPI4)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/doman-4",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -284,7 +284,7 @@ TEST(ERepository, EAPI4MergeType)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/merge-type-4::test-repo",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
}
|
||||
@ -355,7 +355,7 @@ TEST(ERepository, EAPI4MergeTypeBin)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/merge-type-bin-4::test-repo",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
|
||||
@ -373,7 +373,7 @@ TEST(ERepository, EAPI4MergeTypeBin)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/merge-type-bin-4::binrepo",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("pbin-1+4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("pbin-1+4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(action);
|
||||
}
|
||||
}
|
||||
@ -420,7 +420,7 @@ TEST(ERepository, RequiredUse)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-all-good-4::test-repo",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(pretend_action);
|
||||
ASSERT_TRUE(! pretend_action.failed());
|
||||
}
|
||||
@ -436,7 +436,7 @@ TEST(ERepository, RequiredUse)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-all-empty-4::test-repo",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(pretend_action);
|
||||
ASSERT_TRUE(! pretend_action.failed());
|
||||
}
|
||||
@ -452,7 +452,7 @@ TEST(ERepository, RequiredUse)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-all-one-not-good-4::test-repo",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(pretend_action);
|
||||
ASSERT_TRUE(pretend_action.failed());
|
||||
}
|
||||
@ -468,7 +468,7 @@ TEST(ERepository, RequiredUse)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-any-good-4::test-repo",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(pretend_action);
|
||||
ASSERT_TRUE(! pretend_action.failed());
|
||||
}
|
||||
@ -484,7 +484,7 @@ TEST(ERepository, RequiredUse)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-any-empty-4::test-repo",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(pretend_action);
|
||||
ASSERT_TRUE(! pretend_action.failed());
|
||||
}
|
||||
@ -500,7 +500,7 @@ TEST(ERepository, RequiredUse)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-any-none-4::test-repo",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(pretend_action);
|
||||
ASSERT_TRUE(pretend_action.failed());
|
||||
}
|
||||
@ -516,7 +516,7 @@ TEST(ERepository, RequiredUse)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-one-none-4::test-repo",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(pretend_action);
|
||||
ASSERT_TRUE(pretend_action.failed());
|
||||
}
|
||||
@ -532,7 +532,7 @@ TEST(ERepository, RequiredUse)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-one-none-4::test-repo",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(pretend_action);
|
||||
ASSERT_TRUE(pretend_action.failed());
|
||||
}
|
||||
@ -548,7 +548,7 @@ TEST(ERepository, RequiredUse)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/required-use-one-good-4::test-repo",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("4", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(pretend_action);
|
||||
ASSERT_TRUE(! pretend_action.failed());
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ TEST_P(ERepositoryInstallEAPIPBinTest, Works)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/simple-1",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ(base_eapi, visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ(base_eapi, visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(bin_action);
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@ TEST_P(ERepositoryInstallEAPIPBinTest, Works)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/simple-1::binrepo" + base_eapi,
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("pbin-1+" + base_eapi, visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("pbin-1+" + base_eapi, visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(install_action);
|
||||
}
|
||||
|
||||
@ -264,7 +264,7 @@ TEST(Symlinks, Works)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/symlinks-1",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("exheres-0", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("exheres-0", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(bin_action);
|
||||
}
|
||||
|
||||
@ -286,7 +286,7 @@ TEST(Symlinks, Works)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/symlinks-1::binrepoexheres-0",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ("pbin-1+exheres-0", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value());
|
||||
EXPECT_EQ("pbin-1+exheres-0", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
|
||||
id->perform_action(install_action);
|
||||
}
|
||||
|
||||
|
@ -168,7 +168,7 @@ TEST_P(PhasesTest, Works)
|
||||
PackageDepSpec(parse_user_package_dep_spec("cat/" + info.test,
|
||||
&env, { })), make_null_shared_ptr(), { }))]->last());
|
||||
ASSERT_TRUE(bool(id));
|
||||
EXPECT_EQ(info.expect_expensive_test, !! id->choices_key()->value()->find_by_name_with_prefix(
|
||||
EXPECT_EQ(info.expect_expensive_test, !! id->choices_key()->parse_value()->find_by_name_with_prefix(
|
||||
ChoiceNameWithPrefix("build_options:expensive_tests")));
|
||||
|
||||
if (info.expect_pass)
|
||||
|
@ -141,7 +141,7 @@ TEST_P(ReplacingTest, Works)
|
||||
const std::shared_ptr<const PackageIDSequence> rlist(env[selection::AllVersionsSorted(generator::Matches(
|
||||
PackageDepSpec(parse_user_package_dep_spec(info.replacing, &env, { })),
|
||||
make_null_shared_ptr(), { }) |
|
||||
filter::InstalledAtRoot(env.preferred_root_key()->value()))]);
|
||||
filter::InstalledAtRoot(env.preferred_root_key()->parse_value()))]);
|
||||
|
||||
InstallAction action(make_named_values<InstallActionOptions>(
|
||||
n::destination() = installed_repo,
|
||||
|
@ -82,9 +82,9 @@ namespace paludis
|
||||
news_directory(EExtraDistributionData::get_instance()->data_from_distribution(
|
||||
*DistributionData::get_instance()->distribution_from_string(
|
||||
e->distribution()))->news_directory()),
|
||||
skip_file(e->preferred_root_key()->value() / news_directory /
|
||||
skip_file(e->preferred_root_key()->parse_value() / news_directory /
|
||||
("news-" + stringify(e_repository->name()) + ".skip")),
|
||||
unread_file(e->preferred_root_key()->value() / news_directory /
|
||||
unread_file(e->preferred_root_key()->parse_value() / news_directory /
|
||||
("news-" + stringify(e_repository->name()) + ".unread"))
|
||||
{
|
||||
}
|
||||
@ -178,7 +178,7 @@ ERepositoryNews::update_news() const
|
||||
generator::Matches(PackageDepSpec(parse_elike_package_dep_spec(*i,
|
||||
eapi.supported()->package_dep_spec_parse_options(),
|
||||
eapi.supported()->version_spec_options())), make_null_shared_ptr(), { }) |
|
||||
filter::InstalledAtRoot(_imp->environment->preferred_root_key()->value()))]->empty())
|
||||
filter::InstalledAtRoot(_imp->environment->preferred_root_key()->parse_value()))]->empty())
|
||||
local_show = true;
|
||||
show &= local_show;
|
||||
}
|
||||
@ -205,7 +205,7 @@ ERepositoryNews::update_news() const
|
||||
{
|
||||
std::string profile(strip_leading_string(strip_trailing_string(
|
||||
strip_leading_string(stringify(p->realpath()),
|
||||
stringify(_imp->e_repository->location_key()->value().realpath() / "profiles")), "/"), "/"));
|
||||
stringify(_imp->e_repository->location_key()->parse_value().realpath() / "profiles")), "/"), "/"));
|
||||
Log::get_instance()->message("e.news.profile_path", ll_debug, lc_no_context) <<
|
||||
"Profile path is '" << profile << "'";
|
||||
for (NewsFile::DisplayIfProfileConstIterator i(news.begin_display_if_profile()),
|
||||
|
@ -173,7 +173,7 @@ namespace
|
||||
{
|
||||
try
|
||||
{
|
||||
if ((! e.slot_key()) || (e.slot_key()->value() != SlotName(r.slot())))
|
||||
if ((! e.slot_key()) || (e.slot_key()->parse_value() != SlotName(r.slot())))
|
||||
return false;
|
||||
}
|
||||
catch (const SlotNameError &)
|
||||
@ -282,7 +282,7 @@ ERepositorySets::security_set(bool insecurity) const
|
||||
else
|
||||
candidates = (*_imp->environment)[selection::AllVersionsSorted(
|
||||
generator::Package(glsa_pkg->name()) |
|
||||
filter::InstalledAtRoot(_imp->environment->preferred_root_key()->value()))];
|
||||
filter::InstalledAtRoot(_imp->environment->preferred_root_key()->parse_value()))];
|
||||
|
||||
for (PackageIDSequence::ConstIterator c(candidates->begin()), c_end(candidates->end()) ;
|
||||
c != c_end ; ++c)
|
||||
@ -302,7 +302,7 @@ ERepositorySets::security_set(bool insecurity) const
|
||||
else
|
||||
{
|
||||
Context local_local_local_context("When finding upgrade for '" + stringify(glsa_pkg->name()) + ":"
|
||||
+ ((*c)->slot_key() ? stringify((*c)->slot_key()->value()) : "(none)") + "'");
|
||||
+ ((*c)->slot_key() ? stringify((*c)->slot_key()->parse_value()) : "(none)") + "'");
|
||||
|
||||
/* we need to find the best not vulnerable installable package that isn't masked
|
||||
* that's in the same slot as our vulnerable installed package. */
|
||||
|
@ -53,7 +53,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
virtual const SlotName value() const
|
||||
virtual const SlotName parse_value() const
|
||||
{
|
||||
return slot_value;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
const std::shared_ptr<const Set<std::string> > value() const
|
||||
const std::shared_ptr<const Set<std::string> > parse_value() const
|
||||
{
|
||||
return parsed_value;
|
||||
}
|
||||
@ -86,7 +86,7 @@ namespace
|
||||
const PrettyPrinter & p,
|
||||
const PrettyPrintOptions &) const
|
||||
{
|
||||
return join(value()->begin(), value()->end(), " ", CallPrettyPrinter(p));
|
||||
return join(parsed_value->begin(), parsed_value->end(), " ", CallPrettyPrinter(p));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -96,8 +96,7 @@ namespace
|
||||
{
|
||||
std::shared_ptr<const ChoiceValue> choice;
|
||||
if (id->choices_key())
|
||||
choice = id->choices_key()->value()->find_by_name_with_prefix(
|
||||
ELikeJobsChoiceValue::canonical_name_with_prefix());
|
||||
choice = id->choices_key()->parse_value()->find_by_name_with_prefix(ELikeJobsChoiceValue::canonical_name_with_prefix());
|
||||
if (choice && choice->enabled())
|
||||
return choice->parameter();
|
||||
else
|
||||
@ -108,8 +107,7 @@ namespace
|
||||
{
|
||||
std::shared_ptr<const ChoiceValue> choice;
|
||||
if (id->choices_key())
|
||||
choice = id->choices_key()->value()->find_by_name_with_prefix(
|
||||
ELikeTraceChoiceValue::canonical_name_with_prefix());
|
||||
choice = id->choices_key()->parse_value()->find_by_name_with_prefix(ELikeTraceChoiceValue::canonical_name_with_prefix());
|
||||
return choice && choice->enabled();
|
||||
}
|
||||
}
|
||||
@ -298,9 +296,10 @@ EbuildCommand::operator() ()
|
||||
|
||||
if (! params.package_id()->eapi()->supported()->ebuild_metadata_variables()->iuse_effective()->name().empty())
|
||||
if (params.package_id()->raw_iuse_effective_key())
|
||||
process.setenv(params.package_id()->eapi()->supported()->ebuild_metadata_variables()->iuse_effective()->name(),
|
||||
join(params.package_id()->raw_iuse_effective_key()->value()->begin(),
|
||||
params.package_id()->raw_iuse_effective_key()->value()->end(), " "));
|
||||
{
|
||||
auto iu(params.package_id()->raw_iuse_effective_key()->parse_value());
|
||||
process.setenv(params.package_id()->eapi()->supported()->ebuild_metadata_variables()->iuse_effective()->name(), join(iu->begin(), iu->end(), " "));
|
||||
}
|
||||
|
||||
if (params.package_id()->eapi()->supported()->ebuild_options()->support_eclasses())
|
||||
process
|
||||
@ -1059,14 +1058,16 @@ WriteVDBEntryCommand::operator() ()
|
||||
|
||||
if (! params.package_id()->eapi()->supported()->ebuild_metadata_variables()->iuse_effective()->name().empty())
|
||||
if (params.package_id()->raw_iuse_effective_key())
|
||||
{
|
||||
auto iu(params.package_id()->raw_iuse_effective_key()->parse_value());
|
||||
process.setenv(params.package_id()->eapi()->supported()->ebuild_metadata_variables()->iuse_effective()->name(),
|
||||
join(params.package_id()->raw_iuse_effective_key()->value()->begin(),
|
||||
params.package_id()->raw_iuse_effective_key()->value()->end(), " "));
|
||||
join(iu->begin(), iu->end(), " "));
|
||||
}
|
||||
|
||||
if (! params.package_id()->eapi()->supported()->ebuild_metadata_variables()->scm_revision()->name().empty())
|
||||
if (params.package_id()->scm_revision_key())
|
||||
process.setenv(params.package_id()->eapi()->supported()->ebuild_metadata_variables()->scm_revision()->name(),
|
||||
params.package_id()->scm_revision_key()->value());;
|
||||
params.package_id()->scm_revision_key()->parse_value());;
|
||||
|
||||
if (params.maybe_output_manager())
|
||||
process
|
||||
@ -1077,8 +1078,10 @@ WriteVDBEntryCommand::operator() ()
|
||||
std::string defined_phases(params.package_id()->eapi()->supported()->ebuild_metadata_variables()->defined_phases()->name());
|
||||
if (! defined_phases.empty())
|
||||
if (params.package_id()->defined_phases_key())
|
||||
process.setenv(defined_phases, join(params.package_id()->defined_phases_key()->value()->begin(),
|
||||
params.package_id()->defined_phases_key()->value()->end(), " "));
|
||||
{
|
||||
auto dp(params.package_id()->defined_phases_key()->parse_value());
|
||||
process.setenv(defined_phases, join(dp->begin(), dp->end(), " "));
|
||||
}
|
||||
|
||||
if (0 != process.run().wait())
|
||||
throw ActionFailedError("Write VDB Entry command failed");
|
||||
@ -1311,7 +1314,7 @@ WriteBinaryEbuildCommand::operator() ()
|
||||
if (! params.package_id()->eapi()->supported()->ebuild_metadata_variables()->scm_revision()->name().empty())
|
||||
if (params.package_id()->scm_revision_key())
|
||||
process.setenv(params.package_id()->eapi()->supported()->ebuild_metadata_variables()->scm_revision()->name(),
|
||||
params.package_id()->scm_revision_key()->value());;
|
||||
params.package_id()->scm_revision_key()->parse_value());;
|
||||
|
||||
if (0 != process.run().wait())
|
||||
throw ActionFailedError("Write binary command failed");
|
||||
|
@ -135,7 +135,7 @@ namespace
|
||||
std::set<std::string> tokens;
|
||||
tokenise_whitespace(lines[m.inherited()->flat_list_index()], std::inserter(tokens, tokens.begin()));
|
||||
auto repo(_imp->env->fetch_repository(id->repository_name()));
|
||||
FSPath eclassdir((repo->location_key()->value() / "eclass").realpath_if_exists());
|
||||
FSPath eclassdir((repo->location_key()->parse_value() / "eclass").realpath_if_exists());
|
||||
for (std::set<std::string>::const_iterator it(tokens.begin()),
|
||||
it_end(tokens.end()); it_end != it; ++it)
|
||||
{
|
||||
@ -403,7 +403,7 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
|
||||
std::vector<std::string> eclasses;
|
||||
tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(keys["_eclasses_"], "\t", "", std::back_inserter(eclasses));
|
||||
auto repo(_imp->env->fetch_repository(id->repository_name()));
|
||||
FSPath eclassdir((repo->location_key()->value() / "eclass").realpath_if_exists());
|
||||
FSPath eclassdir((repo->location_key()->parse_value() / "eclass").realpath_if_exists());
|
||||
for (std::vector<std::string>::const_iterator it(eclasses.begin()),
|
||||
it_end(eclasses.end()); it_end != it; ++it)
|
||||
{
|
||||
@ -742,8 +742,9 @@ EbuildFlatMetadataCache::save(const std::shared_ptr<const EbuildID> & id)
|
||||
if (id->eapi()->supported()->ebuild_options()->support_eclasses() && id->inherited_key())
|
||||
{
|
||||
std::vector<std::string> eclasses;
|
||||
for (Set<std::string>::ConstIterator it(id->inherited_key()->value()->begin()),
|
||||
it_end(id->inherited_key()->value()->end()); it_end != it; ++it)
|
||||
auto inherited(id->inherited_key()->parse_value());
|
||||
for (auto it(inherited->begin()), it_end(inherited->end()) ;
|
||||
it != it_end ; ++it)
|
||||
{
|
||||
auto eclass(_imp->eclass_mtimes->eclass(*it));
|
||||
if (! eclass)
|
||||
@ -758,8 +759,9 @@ EbuildFlatMetadataCache::save(const std::shared_ptr<const EbuildID> & id)
|
||||
else if (id->eapi()->supported()->ebuild_options()->support_exlibs() && id->inherited_key())
|
||||
{
|
||||
std::vector<std::string> exlibs;
|
||||
for (Set<std::string>::ConstIterator it(id->inherited_key()->value()->begin()),
|
||||
it_end(id->inherited_key()->value()->end()); it_end != it; ++it)
|
||||
auto inherited(id->inherited_key()->parse_value());
|
||||
for (auto it(inherited->begin()), it_end(inherited->end()) ;
|
||||
it != it_end ; ++it)
|
||||
{
|
||||
auto exlib(_imp->eclass_mtimes->exlib(*it, id->name()));
|
||||
if (! exlib)
|
||||
@ -780,104 +782,117 @@ EbuildFlatMetadataCache::save(const std::shared_ptr<const EbuildID> & id)
|
||||
std::string s;
|
||||
|
||||
if (id->dependencies_key())
|
||||
s.append(flatten(id->dependencies_key()->value()));
|
||||
s.append(flatten(id->dependencies_key()->parse_value()));
|
||||
else
|
||||
{
|
||||
if (id->build_dependencies_key())
|
||||
s.append(flatten(id->build_dependencies_key()->value()) + " ");
|
||||
s.append(flatten(id->build_dependencies_key()->parse_value()) + " ");
|
||||
if (id->run_dependencies_key())
|
||||
s.append(flatten(id->run_dependencies_key()->value()) + " ");
|
||||
s.append(flatten(id->run_dependencies_key()->parse_value()) + " ");
|
||||
if (id->post_dependencies_key())
|
||||
s.append(flatten(id->post_dependencies_key()->value()) + " ");
|
||||
s.append(flatten(id->post_dependencies_key()->parse_value()) + " ");
|
||||
}
|
||||
|
||||
write_kv(cache, m.dependencies()->name(), s);
|
||||
}
|
||||
|
||||
if (! m.use()->name().empty() && id->raw_use_key())
|
||||
write_kv(cache, m.use()->name(), join(id->raw_use_key()->value()->begin(), id->raw_use_key()->value()->end(), " "));
|
||||
{
|
||||
auto v(id->raw_use_key()->parse_value());
|
||||
write_kv(cache, m.use()->name(), join(v->begin(), v->end(), " "));
|
||||
}
|
||||
|
||||
if (! m.build_depend()->name().empty() && id->build_dependencies_key())
|
||||
write_kv(cache, m.build_depend()->name(), flatten(id->build_dependencies_key()->value()));
|
||||
write_kv(cache, m.build_depend()->name(), flatten(id->build_dependencies_key()->parse_value()));
|
||||
|
||||
if (! m.run_depend()->name().empty() && id->run_dependencies_key())
|
||||
write_kv(cache, m.run_depend()->name(), flatten(id->run_dependencies_key()->value()));
|
||||
write_kv(cache, m.run_depend()->name(), flatten(id->run_dependencies_key()->parse_value()));
|
||||
|
||||
if (! m.slot()->name().empty() && id->slot_key())
|
||||
write_kv(cache, m.slot()->name(), normalise(id->slot_key()->value()));
|
||||
write_kv(cache, m.slot()->name(), normalise(id->slot_key()->parse_value()));
|
||||
|
||||
if (! m.src_uri()->name().empty() && id->fetches_key())
|
||||
write_kv(cache, m.src_uri()->name(), flatten(id->fetches_key()->value()));
|
||||
write_kv(cache, m.src_uri()->name(), flatten(id->fetches_key()->parse_value()));
|
||||
|
||||
if (! m.restrictions()->name().empty() && id->restrict_key())
|
||||
write_kv(cache, m.restrictions()->name(), flatten(id->restrict_key()->value()));
|
||||
write_kv(cache, m.restrictions()->name(), flatten(id->restrict_key()->parse_value()));
|
||||
|
||||
if (! m.properties()->name().empty() && id->properties_key())
|
||||
write_kv(cache, m.properties()->name(), flatten(id->properties_key()->value()));
|
||||
write_kv(cache, m.properties()->name(), flatten(id->properties_key()->parse_value()));
|
||||
|
||||
if (! m.homepage()->name().empty() && id->homepage_key())
|
||||
write_kv(cache, m.homepage()->name(), flatten(id->homepage_key()->value()));
|
||||
write_kv(cache, m.homepage()->name(), flatten(id->homepage_key()->parse_value()));
|
||||
|
||||
if (! m.license()->name().empty() && id->license_key())
|
||||
write_kv(cache, m.license()->name(), flatten(id->license_key()->value()));
|
||||
write_kv(cache, m.license()->name(), flatten(id->license_key()->parse_value()));
|
||||
|
||||
if (! m.short_description()->name().empty() && id->short_description_key())
|
||||
write_kv(cache, m.short_description()->name(), normalise(id->short_description_key()->value()));
|
||||
write_kv(cache, m.short_description()->name(), normalise(id->short_description_key()->parse_value()));
|
||||
|
||||
if (! m.keywords()->name().empty() && id->keywords_key())
|
||||
write_kv(cache, m.keywords()->name(), join(id->keywords_key()->value()->begin(), id->keywords_key()->value()->end(), " "));
|
||||
{
|
||||
auto v(id->keywords_key()->parse_value());
|
||||
write_kv(cache, m.keywords()->name(), join(v->begin(), v->end(), " "));
|
||||
}
|
||||
|
||||
if (! m.iuse()->name().empty() && id->raw_iuse_key())
|
||||
write_kv(cache, m.iuse()->name(), join(id->raw_iuse_key()->value()->begin(), id->raw_iuse_key()->value()->end(), " "));
|
||||
{
|
||||
auto v(id->raw_iuse_key()->parse_value());
|
||||
write_kv(cache, m.iuse()->name(), join(v->begin(), v->end(), " "));
|
||||
}
|
||||
|
||||
if (! m.myoptions()->name().empty() && id->raw_myoptions_key())
|
||||
write_kv(cache, m.myoptions()->name(), flatten(id->raw_myoptions_key()->value()));
|
||||
write_kv(cache, m.myoptions()->name(), flatten(id->raw_myoptions_key()->parse_value()));
|
||||
|
||||
if (! m.required_use()->name().empty() && id->required_use_key())
|
||||
write_kv(cache, m.required_use()->name(), flatten(id->required_use_key()->value()));
|
||||
write_kv(cache, m.required_use()->name(), flatten(id->required_use_key()->parse_value()));
|
||||
|
||||
if (! m.pdepend()->name().empty() && id->post_dependencies_key())
|
||||
write_kv(cache, m.pdepend()->name(), flatten(id->post_dependencies_key()->value()));
|
||||
write_kv(cache, m.pdepend()->name(), flatten(id->post_dependencies_key()->parse_value()));
|
||||
|
||||
if (! m.provide()->name().empty() && id->provide_key())
|
||||
write_kv(cache, m.provide()->name(), flatten(id->provide_key()->value()));
|
||||
write_kv(cache, m.provide()->name(), flatten(id->provide_key()->parse_value()));
|
||||
|
||||
write_kv(cache, "EAPI", normalise(id->eapi()->name()));
|
||||
|
||||
if (! m.long_description()->name().empty() && id->long_description_key())
|
||||
write_kv(cache, m.long_description()->name(), normalise(id->long_description_key()->value()));
|
||||
write_kv(cache, m.long_description()->name(), normalise(id->long_description_key()->parse_value()));
|
||||
|
||||
if (! m.bugs_to()->name().empty() && id->bugs_to_key())
|
||||
write_kv(cache, m.bugs_to()->name(), flatten(id->bugs_to_key()->value()));
|
||||
write_kv(cache, m.bugs_to()->name(), flatten(id->bugs_to_key()->parse_value()));
|
||||
|
||||
if (! m.remote_ids()->name().empty() && id->remote_ids_key())
|
||||
write_kv(cache, m.remote_ids()->name(), flatten(id->remote_ids_key()->value()));
|
||||
write_kv(cache, m.remote_ids()->name(), flatten(id->remote_ids_key()->parse_value()));
|
||||
|
||||
if (! m.generated_using()->name().empty() && id->generated_using_key())
|
||||
write_kv(cache, m.generated_using()->name(), id->generated_using_key()->value());
|
||||
write_kv(cache, m.generated_using()->name(), id->generated_using_key()->parse_value());
|
||||
|
||||
if (! m.generated_time()->name().empty() && id->generated_time_key())
|
||||
write_kv(cache, m.generated_time()->name(), stringify(id->generated_time_key()->value().seconds()));
|
||||
write_kv(cache, m.generated_time()->name(), stringify(id->generated_time_key()->parse_value().seconds()));
|
||||
|
||||
if (! m.generated_from()->name().empty() && id->generated_from_key())
|
||||
write_kv(cache, m.generated_from()->name(), join(id->generated_from_key()->value()->begin(),
|
||||
id->generated_from_key()->value()->end(), " "));
|
||||
{
|
||||
auto v(id->generated_from_key()->parse_value());
|
||||
write_kv(cache, m.generated_from()->name(), join(v->begin(), v->end(), " "));
|
||||
}
|
||||
|
||||
if (! m.upstream_changelog()->name().empty() && id->upstream_changelog_key())
|
||||
write_kv(cache, m.upstream_changelog()->name(), flatten(id->upstream_changelog_key()->value()));
|
||||
write_kv(cache, m.upstream_changelog()->name(), flatten(id->upstream_changelog_key()->parse_value()));
|
||||
|
||||
if (! m.upstream_documentation()->name().empty() && id->upstream_documentation_key())
|
||||
write_kv(cache, m.upstream_documentation()->name(), flatten(id->upstream_documentation_key()->value()));
|
||||
write_kv(cache, m.upstream_documentation()->name(), flatten(id->upstream_documentation_key()->parse_value()));
|
||||
|
||||
if (! m.upstream_release_notes()->name().empty() && id->upstream_release_notes_key())
|
||||
write_kv(cache, m.upstream_release_notes()->name(), flatten(id->upstream_release_notes_key()->value()));
|
||||
write_kv(cache, m.upstream_release_notes()->name(), flatten(id->upstream_release_notes_key()->parse_value()));
|
||||
|
||||
if (! m.defined_phases()->name().empty() && id->defined_phases_key())
|
||||
write_kv(cache, m.defined_phases()->name(), join(id->defined_phases_key()->value()->begin(),
|
||||
id->defined_phases_key()->value()->end(), " "));
|
||||
{
|
||||
auto v(id->defined_phases_key()->parse_value());
|
||||
write_kv(cache, m.defined_phases()->name(), join(v->begin(), v->end(), " "));
|
||||
}
|
||||
|
||||
if (! m.scm_revision()->name().empty() && id->scm_revision_key())
|
||||
write_kv(cache, m.scm_revision()->name(), id->scm_revision_key()->value());
|
||||
write_kv(cache, m.scm_revision()->name(), id->scm_revision_key()->parse_value());
|
||||
|
||||
}
|
||||
catch (const InternalError &)
|
||||
|
@ -85,7 +85,7 @@ TEST(EbuildFlatMetadataCache, FlatList)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("the-description-flat_list", id->short_description_key()->value());
|
||||
EXPECT_EQ("the-description-flat_list", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, FlatListStale)
|
||||
@ -107,7 +107,7 @@ TEST(EbuildFlatMetadataCache, FlatListStale)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id1->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_list-stale", id1->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_list-stale", id1->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, GuessedEAPI)
|
||||
@ -130,7 +130,7 @@ TEST(EbuildFlatMetadataCache, GuessedEAPI)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id1->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_list-guessed-eapi", id1->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_list-guessed-eapi", id1->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, EclassCached)
|
||||
@ -152,10 +152,10 @@ TEST(EbuildFlatMetadataCache, EclassCached)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("the-description-flat_list-eclass", id->short_description_key()->value());
|
||||
ASSERT_EQ("foo", join(
|
||||
visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->value()->begin(),
|
||||
visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->value()->end(), " "));
|
||||
EXPECT_EQ("the-description-flat_list-eclass", id->short_description_key()->parse_value());
|
||||
|
||||
auto v(visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->parse_value());
|
||||
ASSERT_EQ("foo", join(v->begin(), v->end(), " "));
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, EclassStale)
|
||||
@ -177,7 +177,7 @@ TEST(EbuildFlatMetadataCache, EclassStale)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id1->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_list-eclass-stale", id1->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_list-eclass-stale", id1->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, EclassWrong)
|
||||
@ -199,7 +199,7 @@ TEST(EbuildFlatMetadataCache, EclassWrong)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id1->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_list-eclass-wrong", id1->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_list-eclass-wrong", id1->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, EclassGone)
|
||||
@ -221,7 +221,7 @@ TEST(EbuildFlatMetadataCache, EclassGone)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id1->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_list-eclass-gone", id1->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_list-eclass-gone", id1->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, FlatListDetection)
|
||||
@ -243,7 +243,7 @@ TEST(EbuildFlatMetadataCache, FlatListDetection)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("the-description-flat_list-detection", id->short_description_key()->value());
|
||||
EXPECT_EQ("the-description-flat_list-detection", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, FlatHash)
|
||||
@ -265,7 +265,7 @@ TEST(EbuildFlatMetadataCache, FlatHash)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("the-description-flat_hash", id->short_description_key()->value());
|
||||
EXPECT_EQ("the-description-flat_hash", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, FlatHashGuessedEAPI)
|
||||
@ -288,7 +288,7 @@ TEST(EbuildFlatMetadataCache, FlatHashGuessedEAPI)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id1->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-guessed-eapi", id1->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-guessed-eapi", id1->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, FlatHashGuessedExtension)
|
||||
@ -310,7 +310,7 @@ TEST(EbuildFlatMetadataCache, FlatHashGuessedExtension)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id1->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-guessed-eapi-extension", id1->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-guessed-eapi-extension", id1->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, FlatHashNoGuessedEAPI)
|
||||
@ -332,7 +332,7 @@ TEST(EbuildFlatMetadataCache, FlatHashNoGuessedEAPI)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("the-description-flat_hash-no-guessed-eapi", id->short_description_key()->value());
|
||||
EXPECT_EQ("the-description-flat_hash-no-guessed-eapi", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, EmptyValue)
|
||||
@ -354,8 +354,8 @@ TEST(EbuildFlatMetadataCache, EmptyValue)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("", id->short_description_key()->value());
|
||||
EXPECT_EQ("the-slot", stringify(id->slot_key()->value()));
|
||||
EXPECT_EQ("", id->short_description_key()->parse_value());
|
||||
EXPECT_EQ("the-slot", stringify(id->slot_key()->parse_value()));
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashStale)
|
||||
@ -377,7 +377,7 @@ TEST(EbuildFlatMetadataCache, HashStale)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id1->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-stale", id1->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-stale", id1->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashNoMTime)
|
||||
@ -399,7 +399,7 @@ TEST(EbuildFlatMetadataCache, HashNoMTime)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id1->short_description_key()));
|
||||
EXPECT_EQ("the-description-flat_hash-no-mtime", id1->short_description_key()->value());
|
||||
EXPECT_EQ("the-description-flat_hash-no-mtime", id1->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashNoMTimeStale)
|
||||
@ -421,7 +421,7 @@ TEST(EbuildFlatMetadataCache, HashNoMTimeStale)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id1->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-no-mtime-stale", id1->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-no-mtime-stale", id1->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashBadMtime)
|
||||
@ -443,7 +443,7 @@ TEST(EbuildFlatMetadataCache, HashBadMtime)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id1->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-bad-mtime", id1->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-bad-mtime", id1->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashNoEAPI)
|
||||
@ -465,7 +465,7 @@ TEST(EbuildFlatMetadataCache, HashNoEAPI)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id1->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-no-eapi", id1->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-no-eapi", id1->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashDuplicateKey)
|
||||
@ -487,7 +487,7 @@ TEST(EbuildFlatMetadataCache, HashDuplicateKey)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id1->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-duplicate-key", id1->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-duplicate-key", id1->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashEclass)
|
||||
@ -509,10 +509,9 @@ TEST(EbuildFlatMetadataCache, HashEclass)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("the-description-flat_hash-eclass", id->short_description_key()->value());
|
||||
ASSERT_EQ("foo", join(
|
||||
visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->value()->begin(),
|
||||
visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->value()->end(), " "));
|
||||
EXPECT_EQ("the-description-flat_hash-eclass", id->short_description_key()->parse_value());
|
||||
auto v(visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->parse_value());
|
||||
ASSERT_EQ("foo", join(v->begin(), v->end(), " "));
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashEclassStale)
|
||||
@ -534,7 +533,7 @@ TEST(EbuildFlatMetadataCache, HashEclassStale)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-eclass-stale", id->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-eclass-stale", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashEclassWrong)
|
||||
@ -556,7 +555,7 @@ TEST(EbuildFlatMetadataCache, HashEclassWrong)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-eclass-wrong", id->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-eclass-wrong", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashEclassGone)
|
||||
@ -577,7 +576,7 @@ TEST(EbuildFlatMetadataCache, HashEclassGone)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-eclass-gone", id->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-eclass-gone", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashFullEclass)
|
||||
@ -599,10 +598,9 @@ TEST(EbuildFlatMetadataCache, HashFullEclass)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("the-description-flat_hash-full-eclass", id->short_description_key()->value());
|
||||
ASSERT_EQ("foo", join(
|
||||
visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->value()->begin(),
|
||||
visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->value()->end(), " "));
|
||||
EXPECT_EQ("the-description-flat_hash-full-eclass", id->short_description_key()->parse_value());
|
||||
auto v(visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->parse_value());
|
||||
ASSERT_EQ("foo", join(v->begin(), v->end(), " "));
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashFullEclassNonStandard)
|
||||
@ -624,10 +622,9 @@ TEST(EbuildFlatMetadataCache, HashFullEclassNonStandard)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("the-description-flat_hash-full-eclass-nonstandard", id->short_description_key()->value());
|
||||
ASSERT_EQ("bar foo", join(
|
||||
visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->value()->begin(),
|
||||
visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->value()->end(), " "));
|
||||
EXPECT_EQ("the-description-flat_hash-full-eclass-nonstandard", id->short_description_key()->parse_value());
|
||||
auto v(visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->parse_value());
|
||||
ASSERT_EQ("bar foo", join(v->begin(), v->end(), " "));
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashFullEclassStale)
|
||||
@ -649,7 +646,7 @@ TEST(EbuildFlatMetadataCache, HashFullEclassStale)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-full-eclass-stale", id->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-full-eclass-stale", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashFullEclassWrong)
|
||||
@ -671,7 +668,7 @@ TEST(EbuildFlatMetadataCache, HashFullEclassWrong)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-full-eclass-wrong", id->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-full-eclass-wrong", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashFullEclassGone)
|
||||
@ -693,7 +690,7 @@ TEST(EbuildFlatMetadataCache, HashFullEclassGone)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-full-eclass-gone", id->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-full-eclass-gone", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashEclassTruncated)
|
||||
@ -715,14 +712,14 @@ TEST(EbuildFlatMetadataCache, HashEclassTruncated)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-eclasses-truncated", id->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-eclasses-truncated", id->short_description_key()->parse_value());
|
||||
|
||||
std::shared_ptr<const PackageID> id2(*env[selection::RequireExactlyOne(generator::Matches(
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-eclasses-truncated-2",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id2->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-eclasses-truncated-2", id2->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-eclasses-truncated-2", id2->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashEclassBadMtime)
|
||||
@ -744,7 +741,7 @@ TEST(EbuildFlatMetadataCache, HashEclassBadMtime)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-eclasses-bad-mtime", id->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-eclasses-bad-mtime", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashEclassSpaces)
|
||||
@ -766,7 +763,7 @@ TEST(EbuildFlatMetadataCache, HashEclassSpaces)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-eclasses-spaces", id->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-eclasses-spaces", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashExlib)
|
||||
@ -789,10 +786,9 @@ TEST(EbuildFlatMetadataCache, HashExlib)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("the-description-flat_hash-exlib", id->short_description_key()->value());
|
||||
ASSERT_EQ("foo", join(
|
||||
visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->value()->begin(),
|
||||
visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->value()->end(), " "));
|
||||
EXPECT_EQ("the-description-flat_hash-exlib", id->short_description_key()->parse_value());
|
||||
auto v(visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->parse_value());
|
||||
ASSERT_EQ("foo", join(v->begin(), v->end(), " "));
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashExlibPerCategory)
|
||||
@ -815,10 +811,9 @@ TEST(EbuildFlatMetadataCache, HashExlibPerCategory)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("the-description-flat_hash-exlib-percat", id->short_description_key()->value());
|
||||
ASSERT_EQ("bar foo", join(
|
||||
visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->value()->begin(),
|
||||
visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->value()->end(), " "));
|
||||
EXPECT_EQ("the-description-flat_hash-exlib-percat", id->short_description_key()->parse_value());
|
||||
auto v(visitor_cast<const MetadataCollectionKey<Set<std::string> > >(**id->find_metadata("INHERITED"))->parse_value());
|
||||
ASSERT_EQ("bar foo", join(v->begin(), v->end(), " "));
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashExlibStale)
|
||||
@ -841,7 +836,7 @@ TEST(EbuildFlatMetadataCache, HashExlibStale)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-exlib-stale", id->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-exlib-stale", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashExlibWrong)
|
||||
@ -864,7 +859,7 @@ TEST(EbuildFlatMetadataCache, HashExlibWrong)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-exlib-wrong", id->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-exlib-wrong", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashExlibGone)
|
||||
@ -887,7 +882,7 @@ TEST(EbuildFlatMetadataCache, HashExlibGone)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-exlib-gone", id->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-exlib-gone", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashExlibTruncated)
|
||||
@ -910,14 +905,14 @@ TEST(EbuildFlatMetadataCache, HashExlibTruncated)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-exlibs-truncated", id->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-exlibs-truncated", id->short_description_key()->parse_value());
|
||||
|
||||
std::shared_ptr<const PackageID> id2(*env[selection::RequireExactlyOne(generator::Matches(
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat/flat_hash-exlibs-truncated-2",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id2->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-exlibs-truncated-2", id2->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-exlibs-truncated-2", id2->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashExlibBadMtime)
|
||||
@ -940,7 +935,7 @@ TEST(EbuildFlatMetadataCache, HashExlibBadMtime)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-exlibs-bad-mtime", id->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-exlibs-bad-mtime", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, HashExlibSpaces)
|
||||
@ -963,7 +958,7 @@ TEST(EbuildFlatMetadataCache, HashExlibSpaces)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(id->short_description_key()));
|
||||
EXPECT_EQ("The Generated Description flat_hash-exlibs-spaces", id->short_description_key()->value());
|
||||
EXPECT_EQ("The Generated Description flat_hash-exlibs-spaces", id->short_description_key()->parse_value());
|
||||
}
|
||||
|
||||
TEST(EbuildFlatMetadataCache, Write)
|
||||
|
@ -258,7 +258,7 @@ EbuildID::need_keys_added() const
|
||||
bool ok(false);
|
||||
if (e_repo->params().cache().basename() != "empty")
|
||||
{
|
||||
EbuildFlatMetadataCache metadata_cache(_imp->environment, cache_file, _imp->fs_location->value(), _imp->master_mtime, _imp->eclass_mtimes, false);
|
||||
EbuildFlatMetadataCache metadata_cache(_imp->environment, cache_file, _imp->fs_location->parse_value(), _imp->master_mtime, _imp->eclass_mtimes, false);
|
||||
if (metadata_cache.load(shared_from_this(), false))
|
||||
ok = true;
|
||||
}
|
||||
@ -266,7 +266,7 @@ EbuildID::need_keys_added() const
|
||||
if ((! ok) && e_repo->params().write_cache().basename() != "empty")
|
||||
{
|
||||
EbuildFlatMetadataCache write_metadata_cache(_imp->environment,
|
||||
write_cache_file, _imp->fs_location->value(), _imp->master_mtime, _imp->eclass_mtimes, true);
|
||||
write_cache_file, _imp->fs_location->parse_value(), _imp->master_mtime, _imp->eclass_mtimes, true);
|
||||
if (write_metadata_cache.load(shared_from_this(), false))
|
||||
ok = true;
|
||||
else if (write_cache_file.stat().exists())
|
||||
@ -311,7 +311,7 @@ EbuildID::need_keys_added() const
|
||||
n::commands() = join(phases.begin_phases()->begin_commands(), phases.begin_phases()->end_commands(), " "),
|
||||
n::distdir() = e_repo->params().distdir(),
|
||||
n::ebuild_dir() = e_repo->layout()->package_directory(name()),
|
||||
n::ebuild_file() = _imp->fs_location->value(),
|
||||
n::ebuild_file() = _imp->fs_location->parse_value(),
|
||||
n::eclassdirs() = e_repo->params().eclassdirs(),
|
||||
n::environment() = _imp->environment,
|
||||
n::exlibsdirs() = e_repo->layout()->exlibsdirs(name()),
|
||||
@ -339,7 +339,7 @@ EbuildID::need_keys_added() const
|
||||
|
||||
if (e_repo->params().write_cache().basename() != "empty" && _imp->eapi->supported())
|
||||
{
|
||||
EbuildFlatMetadataCache metadata_cache(_imp->environment, write_cache_file, _imp->fs_location->value(), _imp->master_mtime,
|
||||
EbuildFlatMetadataCache metadata_cache(_imp->environment, write_cache_file, _imp->fs_location->parse_value(), _imp->master_mtime,
|
||||
_imp->eclass_mtimes, false);
|
||||
metadata_cache.save(shared_from_this());
|
||||
}
|
||||
@ -368,7 +368,7 @@ EbuildID::need_keys_added() const
|
||||
e_repo->profile()->use_expand_hidden());
|
||||
|
||||
std::shared_ptr<const MetadataXML> m(MetadataXMLPool::get_instance()->metadata_if_exists(
|
||||
_imp->fs_location->value().dirname() / "metadata.xml"));
|
||||
_imp->fs_location->parse_value().dirname() / "metadata.xml"));
|
||||
if (m)
|
||||
{
|
||||
if (! m->long_description().empty())
|
||||
@ -387,7 +387,8 @@ EbuildID::need_keys_added() const
|
||||
if (! _imp->raw_iuse)
|
||||
throw InternalError(PALUDIS_HERE, "no raw_iuse?");
|
||||
|
||||
std::copy(_imp->raw_iuse->value()->begin(), _imp->raw_iuse->value()->end(), iuse_effective->inserter());
|
||||
auto iu(_imp->raw_iuse->parse_value());
|
||||
std::copy(iu->begin(), iu->end(), iuse_effective->inserter());
|
||||
std::copy(e_repo->profile()->iuse_implicit()->begin(), e_repo->profile()->iuse_implicit()->end(),
|
||||
iuse_effective->inserter());
|
||||
|
||||
@ -532,14 +533,14 @@ EbuildID::need_masks_added() const
|
||||
|
||||
if (keywords_key())
|
||||
{
|
||||
if (! _imp->environment->accept_keywords(keywords_key()->value(), shared_from_this()))
|
||||
auto keywords(keywords_key()->parse_value());
|
||||
if (! _imp->environment->accept_keywords(keywords, shared_from_this()))
|
||||
{
|
||||
add_mask(create_e_unaccepted_mask('K',
|
||||
DistributionData::get_instance()->distribution_from_string(
|
||||
_imp->environment->distribution())->concept_keyword(), keywords_key()->raw_name()));
|
||||
}
|
||||
else if (keywords_key()->value()->end() == std::find_if(keywords_key()->value()->begin(),
|
||||
keywords_key()->value()->end(), &is_stable_keyword))
|
||||
else if (keywords->end() == std::find_if(keywords->begin(), keywords->end(), &is_stable_keyword))
|
||||
{
|
||||
add_overridden_mask(std::make_shared<OverriddenMask>(
|
||||
make_named_values<OverriddenMask>(
|
||||
@ -554,7 +555,7 @@ EbuildID::need_masks_added() const
|
||||
if (license_key())
|
||||
{
|
||||
LicenceChecker c(_imp->environment, &Environment::accept_license, shared_from_this());
|
||||
license_key()->value()->top()->accept(c);
|
||||
license_key()->parse_value()->top()->accept(c);
|
||||
if (! c.ok)
|
||||
add_mask(create_e_unaccepted_mask('L',
|
||||
DistributionData::get_instance()->distribution_from_string(
|
||||
@ -621,14 +622,14 @@ EbuildID::canonical_form(const PackageIDCanonicalForm f) const
|
||||
{
|
||||
case idcf_full:
|
||||
if (_imp->slot)
|
||||
return stringify(name()) + "-" + stringify(version()) + ":" + stringify(_imp->slot->value()) +
|
||||
return stringify(name()) + "-" + stringify(version()) + ":" + stringify(_imp->slot->parse_value()) +
|
||||
"::" + stringify(repository_name());
|
||||
|
||||
return stringify(name()) + "-" + stringify(version()) + "::" + stringify(repository_name());
|
||||
|
||||
case idcf_no_version:
|
||||
if (_imp->slot)
|
||||
return stringify(name()) + ":" + stringify(_imp->slot->value()) +
|
||||
return stringify(name()) + ":" + stringify(_imp->slot->parse_value()) +
|
||||
"::" + stringify(repository_name());
|
||||
|
||||
return stringify(name()) + "::" + stringify(repository_name());
|
||||
@ -638,7 +639,7 @@ EbuildID::canonical_form(const PackageIDCanonicalForm f) const
|
||||
|
||||
case idcf_no_name:
|
||||
if (_imp->slot)
|
||||
return stringify(version()) + ":" + stringify(_imp->slot->value()) + "::" +
|
||||
return stringify(version()) + ":" + stringify(_imp->slot->parse_value()) + "::" +
|
||||
stringify(repository_name());
|
||||
|
||||
return stringify(version()) + "::" + stringify(repository_name());
|
||||
@ -654,7 +655,7 @@ PackageDepSpec
|
||||
EbuildID::uniquely_identifying_spec() const
|
||||
{
|
||||
return parse_user_package_dep_spec("=" + stringify(name()) + "-" + stringify(version()) +
|
||||
(slot_key() ? ":" + stringify(slot_key()->value()) : "") + "::" + stringify(repository_name()),
|
||||
(slot_key() ? ":" + stringify(slot_key()->parse_value()) : "") + "::" + stringify(repository_name()),
|
||||
_imp->environment, { });
|
||||
}
|
||||
|
||||
@ -1448,7 +1449,8 @@ EbuildID::make_choice_value(
|
||||
if (raw_use_key())
|
||||
{
|
||||
locked = true;
|
||||
enabled = enabled_by_default = (raw_use_key()->value()->end() != raw_use_key()->value()->find(name_with_prefix_s));
|
||||
auto raw_use(raw_use_key()->parse_value());
|
||||
enabled = enabled_by_default = (raw_use->end() != raw_use->find(name_with_prefix_s));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1558,7 +1560,7 @@ EbuildID::add_build_options(const std::shared_ptr<Choices> & choices) const
|
||||
if (restrict_key())
|
||||
{
|
||||
UnconditionalRestrictFinder f;
|
||||
restrict_key()->value()->top()->accept(f);
|
||||
restrict_key()->parse_value()->top()->accept(f);
|
||||
may_be_unrestricted_test = f.s.end() == f.s.find("test");
|
||||
may_be_unrestricted_strip = f.s.end() == f.s.find("strip");
|
||||
}
|
||||
@ -1586,7 +1588,8 @@ EbuildID::add_build_options(const std::shared_ptr<Choices> & choices) const
|
||||
{
|
||||
if (phase->option("expensive_tests"))
|
||||
{
|
||||
if (_imp->defined_phases->value()->end() != _imp->defined_phases->value()->find(phase->equal_option("skipname")))
|
||||
auto defined_phases(_imp->defined_phases->parse_value());
|
||||
if (defined_phases->end() != defined_phases->find(phase->equal_option("skipname")))
|
||||
{
|
||||
has_expensive_test_phase = true;
|
||||
break;
|
||||
@ -1640,7 +1643,7 @@ EbuildID::purge_invalid_cache() const
|
||||
if (e_repo->params().write_cache().basename() != "empty")
|
||||
{
|
||||
EbuildFlatMetadataCache write_metadata_cache(_imp->environment,
|
||||
write_cache_file, _imp->fs_location->value(), _imp->master_mtime, _imp->eclass_mtimes, true);
|
||||
write_cache_file, _imp->fs_location->parse_value(), _imp->master_mtime, _imp->eclass_mtimes, true);
|
||||
if (! write_metadata_cache.load(shared_from_this(), true))
|
||||
write_cache_file.unlink();
|
||||
}
|
||||
@ -1650,7 +1653,7 @@ EbuildID::purge_invalid_cache() const
|
||||
bool
|
||||
EbuildID::might_be_binary() const
|
||||
{
|
||||
auto path(stringify(_imp->fs_location->value()));
|
||||
auto path(stringify(_imp->fs_location->parse_value()));
|
||||
auto dot_pos(path.rfind('.'));
|
||||
|
||||
if (std::string::npos != dot_pos)
|
||||
|
@ -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
|
||||
@ -47,7 +47,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
const std::shared_ptr<const Contents> value() const
|
||||
const std::shared_ptr<const Contents> parse_value() const
|
||||
{
|
||||
Lock l(_mutex);
|
||||
if (_v)
|
||||
|
@ -316,7 +316,7 @@ namespace
|
||||
const std::shared_ptr<const PackageID> & b)
|
||||
{
|
||||
if (a->slot_key())
|
||||
return b->slot_key() && a->slot_key()->value() == b->slot_key()->value();
|
||||
return b->slot_key() && a->slot_key()->parse_value() == b->slot_key()->parse_value();
|
||||
else
|
||||
return ! b->slot_key();
|
||||
}
|
||||
@ -359,7 +359,7 @@ ExndbamRepository::merge(const MergeParams & m)
|
||||
|
||||
FSPath uid_dir(_imp->params.location());
|
||||
if (if_same_name_id)
|
||||
uid_dir = if_same_name_id->fs_location_key()->value().dirname();
|
||||
uid_dir = if_same_name_id->fs_location_key()->parse_value().dirname();
|
||||
else
|
||||
{
|
||||
std::string uid(stringify(m.package_id()->name().category()) + "---" + stringify(m.package_id()->name().package()));
|
||||
@ -372,7 +372,7 @@ ExndbamRepository::merge(const MergeParams & m)
|
||||
}
|
||||
|
||||
FSPath target_ver_dir(uid_dir);
|
||||
target_ver_dir /= (stringify(m.package_id()->version()) + ":" + stringify(m.package_id()->slot_key()->value()) + ":" + cookie());
|
||||
target_ver_dir /= (stringify(m.package_id()->version()) + ":" + stringify(m.package_id()->slot_key()->parse_value()) + ":" + cookie());
|
||||
|
||||
if (target_ver_dir.stat().exists())
|
||||
throw ActionFailedError("Temporary merge directory '" + stringify(target_ver_dir) + "' already exists, probably "
|
||||
@ -433,7 +433,7 @@ ExndbamRepository::merge(const MergeParams & m)
|
||||
n::options() = m.options(),
|
||||
n::output_manager() = m.output_manager(),
|
||||
n::package_id() = m.package_id(),
|
||||
n::root() = installed_root_key()->value()
|
||||
n::root() = installed_root_key()->parse_value()
|
||||
));
|
||||
|
||||
(m.used_this_for_config_protect())(config_protect);
|
||||
@ -471,7 +471,7 @@ ExndbamRepository::merge(const MergeParams & m)
|
||||
it_end(replace_candidates->end()); it_end != it; ++it)
|
||||
{
|
||||
std::shared_ptr<const ERepositoryID> candidate(std::static_pointer_cast<const ERepositoryID>(*it));
|
||||
if (candidate != if_overwritten_id && candidate->fs_location_key()->value() != target_ver_dir && slot_is_same(candidate, m.package_id()))
|
||||
if (candidate != if_overwritten_id && candidate->fs_location_key()->parse_value() != target_ver_dir && slot_is_same(candidate, m.package_id()))
|
||||
{
|
||||
UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
|
||||
n::config_protect() = config_protect,
|
||||
@ -489,7 +489,7 @@ ExndbamRepository::merge(const MergeParams & m)
|
||||
|
||||
VDBPostMergeUnmergeCommand post_merge_command(
|
||||
make_named_values<VDBPostMergeUnmergeCommandParams>(
|
||||
n::root() = installed_root_key()->value()
|
||||
n::root() = installed_root_key()->parse_value()
|
||||
));
|
||||
post_merge_command();
|
||||
}
|
||||
@ -511,7 +511,7 @@ ExndbamRepository::perform_uninstall(
|
||||
|
||||
std::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
|
||||
|
||||
FSPath ver_dir(id->fs_location_key()->value().realpath());
|
||||
FSPath ver_dir(id->fs_location_key()->parse_value().realpath());
|
||||
std::shared_ptr<FSPath> load_env(std::make_shared<FSPath>(ver_dir / "environment.bz2"));
|
||||
|
||||
auto eclassdirs(std::make_shared<FSPathSequence>());
|
||||
@ -566,14 +566,14 @@ ExndbamRepository::perform_uninstall(
|
||||
n::ndbam() = &_imp->ndbam,
|
||||
n::output_manager() = output_manager,
|
||||
n::package_id() = id,
|
||||
n::root() = installed_root_key()->value()
|
||||
n::root() = installed_root_key()->parse_value()
|
||||
));
|
||||
|
||||
unmerger.unmerge();
|
||||
|
||||
VDBPostMergeUnmergeCommand post_unmerge_command(
|
||||
make_named_values<VDBPostMergeUnmergeCommandParams>(
|
||||
n::root() = installed_root_key()->value()
|
||||
n::root() = installed_root_key()->parse_value()
|
||||
));
|
||||
post_unmerge_command();
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ namespace
|
||||
break;
|
||||
|
||||
std::shared_ptr<const PackageIDSequence> matches((*env)[selection::AllVersionsSorted(
|
||||
generator::Matches(*node.spec(), id, { }) | filter::InstalledAtRoot(env->system_root_key()->value()))]);
|
||||
generator::Matches(*node.spec(), id, { }) | filter::InstalledAtRoot(env->system_root_key()->parse_value()))]);
|
||||
if (matches->empty())
|
||||
break;
|
||||
|
||||
@ -114,7 +114,7 @@ namespace
|
||||
{
|
||||
PackageDepSpec new_s(MutablePackageDepSpecData(*node.spec()->data())
|
||||
.unrequire_any_slot()
|
||||
.require_exact_slot((*matches->last())->slot_key()->value(), true));
|
||||
.require_exact_slot((*matches->last())->slot_key()->parse_value(), true));
|
||||
c = std::make_shared<PackageDepSpec>(new_s);
|
||||
}
|
||||
} while (false);
|
||||
|
@ -99,7 +99,7 @@ InfoVarsMetadataKey::~InfoVarsMetadataKey()
|
||||
}
|
||||
|
||||
const std::shared_ptr<const Set<std::string> >
|
||||
InfoVarsMetadataKey::value() const
|
||||
InfoVarsMetadataKey::parse_value() const
|
||||
{
|
||||
Lock l(_imp->mutex);
|
||||
|
||||
@ -189,7 +189,7 @@ InfoPkgsMetadataKey::need_keys_added() const
|
||||
generator::Matches(parse_elike_package_dep_spec(i->first,
|
||||
eapi->supported()->package_dep_spec_parse_options(),
|
||||
eapi->supported()->version_spec_options()), make_null_shared_ptr(), { }) |
|
||||
filter::InstalledAtRoot(_imp->env->preferred_root_key()->value()))]);
|
||||
filter::InstalledAtRoot(_imp->env->preferred_root_key()->parse_value()))]);
|
||||
|
||||
if (q->empty())
|
||||
key = std::make_shared<LiteralMetadataValueKey<std::string>>(i->first, i->first, mkt_normal, "(none)");
|
||||
@ -215,7 +215,8 @@ InfoVarsMetadataKey::pretty_print_value(
|
||||
const PrettyPrintOptions &) const
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
return join(value()->begin(), value()->end(), " ", CallPrettyPrinter(pretty_printer));
|
||||
auto v(parse_value());
|
||||
return join(v->begin(), v->end(), " ", CallPrettyPrinter(pretty_printer));
|
||||
}
|
||||
|
||||
const std::string
|
||||
|
@ -44,7 +44,7 @@ namespace paludis
|
||||
InfoVarsMetadataKey(const std::shared_ptr<const FSPathSequence> &);
|
||||
~InfoVarsMetadataKey();
|
||||
|
||||
const std::shared_ptr<const Set<std::string> > value() const;
|
||||
const std::shared_ptr<const Set<std::string> > parse_value() const;
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
85
paludis/repositories/e/make_archive_strings.cc
Normal file
85
paludis/repositories/e/make_archive_strings.cc
Normal file
@ -0,0 +1,85 @@
|
||||
/* 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 <paludis/repositories/e/make_archive_strings.hh>
|
||||
#include <paludis/repositories/e/a_finder.hh>
|
||||
#include <paludis/repositories/e/aa_visitor.hh>
|
||||
#include <paludis/repositories/e/eapi.hh>
|
||||
|
||||
#include <paludis/metadata_key.hh>
|
||||
#include <paludis/package_id.hh>
|
||||
|
||||
#include <set>
|
||||
|
||||
using namespace paludis;
|
||||
using namespace paludis::erepository;
|
||||
|
||||
std::pair<std::string, std::string>
|
||||
paludis::erepository::make_archives_strings(
|
||||
const Environment * const env,
|
||||
const std::shared_ptr<const ERepositoryID> & id)
|
||||
{
|
||||
std::string archives, all_archives;
|
||||
std::set<std::string> already_in_archives;
|
||||
|
||||
std::shared_ptr<const FetchableURISpecTree> fetches;
|
||||
if (id->fetches_key())
|
||||
fetches = id->fetches_key()->parse_value();
|
||||
|
||||
/* make A */
|
||||
AFinder f(env, id);
|
||||
if (fetches)
|
||||
fetches->top()->accept(f);
|
||||
|
||||
for (AFinder::ConstIterator i(f.begin()), i_end(f.end()) ; i != i_end ; ++i)
|
||||
{
|
||||
const FetchableURIDepSpec * const spec(static_cast<const FetchableURIDepSpec *>(i->first));
|
||||
|
||||
if (already_in_archives.end() == already_in_archives.find(spec->filename()))
|
||||
{
|
||||
archives.append(spec->filename());
|
||||
already_in_archives.insert(spec->filename());
|
||||
}
|
||||
archives.append(" ");
|
||||
}
|
||||
|
||||
/* make AA */
|
||||
if (! id->eapi()->supported()->ebuild_environment_variables()->env_aa().empty())
|
||||
{
|
||||
AAVisitor g;
|
||||
if (fetches)
|
||||
fetches->top()->accept(g);
|
||||
std::set<std::string> already_in_all_archives;
|
||||
|
||||
for (AAVisitor::ConstIterator gg(g.begin()), gg_end(g.end()) ; gg != gg_end ; ++gg)
|
||||
{
|
||||
if (already_in_all_archives.end() == already_in_all_archives.find(*gg))
|
||||
{
|
||||
all_archives.append(*gg);
|
||||
already_in_all_archives.insert(*gg);
|
||||
}
|
||||
all_archives.append(" ");
|
||||
}
|
||||
}
|
||||
else
|
||||
all_archives = "AA-not-set-for-this-EAPI";
|
||||
|
||||
return std::make_pair(archives, all_archives);
|
||||
}
|
||||
|
37
paludis/repositories/e/make_archive_strings.hh
Normal file
37
paludis/repositories/e/make_archive_strings.hh
Normal file
@ -0,0 +1,37 @@
|
||||
/* 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_PALUDIS_REPOSITORIES_E_MAKE_ARCHIVE_STRINGS_HH
|
||||
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_MAKE_ARCHIVE_STRINGS_HH 1
|
||||
|
||||
#include <paludis/repositories/e/e_repository_id.hh>
|
||||
#include <paludis/package_id-fwd.hh>
|
||||
#include <paludis/environment-fwd.hh>
|
||||
|
||||
namespace paludis
|
||||
{
|
||||
namespace erepository
|
||||
{
|
||||
std::pair<std::string, std::string> make_archives_strings(
|
||||
const Environment * const,
|
||||
const std::shared_ptr<const ERepositoryID> &);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,7 +1,7 @@
|
||||
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010 Ciaran McCreesh
|
||||
* Copyright (c) 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
|
||||
@ -45,8 +45,8 @@ paludis::erepository::make_use(const Environment * const,
|
||||
|
||||
if (id.choices_key())
|
||||
{
|
||||
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)->prefix() == canonical_build_options_prefix())
|
||||
@ -82,15 +82,17 @@ paludis::erepository::make_expand(const Environment * const,
|
||||
if (! e.choices_key())
|
||||
return expand_vars;
|
||||
|
||||
auto choices(e.choices_key()->parse_value());
|
||||
|
||||
for (Set<std::string>::ConstIterator x(profile->use_expand()->begin()), x_end(profile->use_expand()->end()) ;
|
||||
x != x_end ; ++x)
|
||||
{
|
||||
expand_vars->insert(stringify(*x), "");
|
||||
|
||||
Choices::ConstIterator k(std::find_if(e.choices_key()->value()->begin(), e.choices_key()->value()->end(),
|
||||
Choices::ConstIterator k(std::find_if(choices->begin(), choices->end(),
|
||||
std::bind(std::equal_to<std::string>(), *x,
|
||||
std::bind(std::mem_fn(&Choice::raw_name), std::placeholders::_1))));
|
||||
if (k == e.choices_key()->value()->end())
|
||||
if (k == choices->end())
|
||||
continue;
|
||||
|
||||
for (Choice::ConstIterator i((*k)->begin()), i_end((*k)->end()) ;
|
||||
@ -113,3 +115,4 @@ paludis::erepository::make_expand(const Environment * const,
|
||||
|
||||
return expand_vars;
|
||||
}
|
||||
|
||||
|
@ -99,8 +99,10 @@ namespace
|
||||
const ChoiceNameWithPrefix & name_with_prefix)
|
||||
{
|
||||
if (id->choices_key())
|
||||
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)->prefix() != prefix)
|
||||
@ -111,6 +113,7 @@ namespace
|
||||
if ((*i)->name_with_prefix() == name_with_prefix)
|
||||
return *i;
|
||||
}
|
||||
}
|
||||
|
||||
return make_null_shared_ptr();
|
||||
}
|
||||
@ -192,8 +195,9 @@ MyOptionsRequirementsVerifier::verify_one(
|
||||
|
||||
std::shared_ptr<const ChoiceValue> choice_value;
|
||||
if (_imp->id->choices_key())
|
||||
for (Choices::ConstIterator k(_imp->id->choices_key()->value()->begin()),
|
||||
k_end(_imp->id->choices_key()->value()->end()) ;
|
||||
{
|
||||
auto choices(_imp->id->choices_key()->parse_value());
|
||||
for (Choices::ConstIterator k(choices->begin()), k_end(choices->end()) ;
|
||||
k != k_end && ! choice_value ; ++k)
|
||||
{
|
||||
if ((*k)->prefix() != prefix)
|
||||
@ -204,6 +208,7 @@ MyOptionsRequirementsVerifier::verify_one(
|
||||
if ((*i)->unprefixed_name() == suffix)
|
||||
choice_value = *i;
|
||||
}
|
||||
}
|
||||
|
||||
if (choice_value)
|
||||
{
|
||||
|
@ -59,7 +59,7 @@ namespace
|
||||
return false;
|
||||
}
|
||||
|
||||
const std::shared_ptr<const ChoiceValue> v(id->choices_key()->value()->find_by_name_with_prefix(n));
|
||||
const std::shared_ptr<const ChoiceValue> v(id->choices_key()->parse_value()->find_by_name_with_prefix(n));
|
||||
if (! v)
|
||||
{
|
||||
Log::get_instance()->message("e.dep_parser.label_enabled.no_choice", ll_warning, lc_context)
|
||||
|
@ -96,7 +96,7 @@ PbinMerger::extend_hook(const Hook & h)
|
||||
std::string pn(stringify(_imp->params.package_id()->name().package()));
|
||||
std::string pvr(stringify(_imp->params.package_id()->version()));
|
||||
std::string pv(stringify(_imp->params.package_id()->version().remove_revision()));
|
||||
std::string slot(_imp->params.package_id()->slot_key() ? stringify(_imp->params.package_id()->slot_key()->value()) : "");
|
||||
std::string slot(_imp->params.package_id()->slot_key() ? stringify(_imp->params.package_id()->slot_key()->parse_value()) : "");
|
||||
|
||||
return TarMerger::extend_hook(h)
|
||||
("P", pn + "-" + pv)
|
||||
|
@ -155,8 +155,7 @@ namespace
|
||||
|
||||
if ((! seen_description) && (id->choices_key()) && (! desc_from.empty()))
|
||||
{
|
||||
const std::shared_ptr<const ChoiceValue> choice(
|
||||
id->choices_key()->value()->find_by_name_with_prefix(ChoiceNameWithPrefix(desc_from)));
|
||||
auto choice(id->choices_key()->parse_value()->find_by_name_with_prefix(ChoiceNameWithPrefix(desc_from)));
|
||||
if (choice && (! choice->description().empty()) && (! description_annotation.empty()))
|
||||
{
|
||||
if (! done_brackets)
|
||||
@ -312,9 +311,9 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
|
||||
|
||||
Filter root((filter::All()));
|
||||
if (tokens[2] == "--slash")
|
||||
root = filter::InstalledAtRoot(environment->system_root_key()->value());
|
||||
root = filter::InstalledAtRoot(environment->system_root_key()->parse_value());
|
||||
else if (tokens[2] == "--root")
|
||||
root = filter::InstalledAtRoot(environment->preferred_root_key()->value());
|
||||
root = filter::InstalledAtRoot(environment->preferred_root_key()->parse_value());
|
||||
else
|
||||
return "Ebad BEST_VERSION " + tokens[2] + " argument";
|
||||
|
||||
@ -328,10 +327,10 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
|
||||
{
|
||||
Log::get_instance()->message("e.pipe_commands.best_version.is_virtual", ll_qa, lc_context) << "best-version of '" << spec <<
|
||||
"' resolves to '" << **entries->last() << "', which is a virtual for '"
|
||||
<< *(*entries->last())->virtual_for_key()->value() << "'. This will break with "
|
||||
<< *(*entries->last())->virtual_for_key()->parse_value() << "'. This will break with "
|
||||
"new style virtuals.";
|
||||
std::shared_ptr<PackageIDSequence> new_entries(std::make_shared<PackageIDSequence>());
|
||||
new_entries->push_back((*entries->last())->virtual_for_key()->value());
|
||||
new_entries->push_back((*entries->last())->virtual_for_key()->parse_value());
|
||||
entries = new_entries;
|
||||
}
|
||||
|
||||
@ -361,9 +360,9 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
|
||||
|
||||
Filter root((filter::All()));
|
||||
if (tokens[2] == "--slash")
|
||||
root = filter::InstalledAtRoot(environment->system_root_key()->value());
|
||||
root = filter::InstalledAtRoot(environment->system_root_key()->parse_value());
|
||||
else if (tokens[2] == "--root")
|
||||
root = filter::InstalledAtRoot(environment->preferred_root_key()->value());
|
||||
root = filter::InstalledAtRoot(environment->preferred_root_key()->parse_value());
|
||||
else
|
||||
return "Ebad HAS_VERSION " + tokens[2] + " argument";
|
||||
|
||||
@ -395,7 +394,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
|
||||
eapi->supported()->package_dep_spec_parse_options(),
|
||||
eapi->supported()->version_spec_options()));
|
||||
std::shared_ptr<const PackageIDSequence> entries((*environment)[selection::AllVersionsSorted(
|
||||
generator::Matches(spec, package_id, { }) | filter::InstalledAtRoot(environment->preferred_root_key()->value()))]);
|
||||
generator::Matches(spec, package_id, { }) | filter::InstalledAtRoot(environment->preferred_root_key()->parse_value()))]);
|
||||
if (eapi->supported()->pipe_commands()->rewrite_virtuals() && (! entries->empty()))
|
||||
{
|
||||
std::shared_ptr<PackageIDSequence> new_entries(std::make_shared<PackageIDSequence>());
|
||||
@ -406,9 +405,9 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
|
||||
{
|
||||
Log::get_instance()->message("e.pipe_commands.match.is_virtual", ll_qa, lc_context) << "match of '" << spec <<
|
||||
"' resolves to '" << **i << "', which is a virtual for '"
|
||||
<< *(*i)->virtual_for_key()->value() << "'. This will break with "
|
||||
<< *(*i)->virtual_for_key()->parse_value() << "'. This will break with "
|
||||
"new style virtuals.";
|
||||
new_entries->push_back((*i)->virtual_for_key()->value());
|
||||
new_entries->push_back((*i)->virtual_for_key()->parse_value());
|
||||
}
|
||||
else
|
||||
new_entries->push_back(*i);
|
||||
@ -444,7 +443,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
|
||||
return "Einstalled repository has no location key";
|
||||
if (! visitor_cast<const MetadataValueKey<FSPath> >(**key))
|
||||
return "Einstalled repository location key is not a MetadataValueKey<FSPath> ";
|
||||
return "O0;" + stringify(visitor_cast<const MetadataValueKey<FSPath> >(**key)->value());
|
||||
return "O0;" + stringify(visitor_cast<const MetadataValueKey<FSPath> >(**key)->parse_value());
|
||||
}
|
||||
}
|
||||
else if (tokens[0] == "OPTIONQ")
|
||||
@ -467,10 +466,11 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
|
||||
return "EOPTIONQ ID " + stringify(*package_id) + " has no choices";
|
||||
|
||||
ChoiceNameWithPrefix name(tokens[2]);
|
||||
std::shared_ptr<const ChoiceValue> value(package_id->choices_key()->value()->find_by_name_with_prefix(name));
|
||||
auto choices(package_id->choices_key()->parse_value());
|
||||
auto value(choices->find_by_name_with_prefix(name));
|
||||
if (! value)
|
||||
{
|
||||
if (package_id->choices_key()->value()->has_matching_contains_every_value_prefix(name))
|
||||
if (choices->has_matching_contains_every_value_prefix(name))
|
||||
return "O1;";
|
||||
|
||||
return "EOPTIONQ ID " + stringify(*package_id) + " has no choice named '" + stringify(name) + "'";
|
||||
@ -512,9 +512,8 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
|
||||
if (! mm)
|
||||
throw InternalError(PALUDIS_HERE, "oops. key '" + var + "' isn't a DependencySpecTree key");
|
||||
|
||||
std::shared_ptr<const DependencySpecTree> before(mm->value());
|
||||
std::shared_ptr<const DependencySpecTree> after(fix_locked_dependencies(
|
||||
environment, *eapi, package_id, before));
|
||||
std::shared_ptr<const DependencySpecTree> before(mm->parse_value());
|
||||
std::shared_ptr<const DependencySpecTree> after(fix_locked_dependencies(environment, *eapi, package_id, before));
|
||||
UnformattedPrettyPrinter ff;
|
||||
SpecTreePrettyPrinter p(ff, { });
|
||||
after->top()->accept(p);
|
||||
@ -536,7 +535,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
|
||||
MyOptionsRewriter p(package_id,
|
||||
eapi->supported()->annotations()->general_description(),
|
||||
std::string(1, eapi->supported()->choices_options()->use_expand_separator()));
|
||||
mm->value()->top()->accept(p);
|
||||
mm->parse_value()->top()->accept(p);
|
||||
return "O0;" + p.str.str();
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ namespace paludis
|
||||
fetch_unneeded(f),
|
||||
default_label(n),
|
||||
action(a),
|
||||
manifest(id->fs_location_key()->value().dirname() / "Manifest")
|
||||
manifest(id->fs_location_key()->parse_value().dirname() / "Manifest")
|
||||
{
|
||||
labels.push_front(default_label.get());
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ RequiredUseVerifier::matches(const std::string & s)
|
||||
return false;
|
||||
}
|
||||
|
||||
auto c(_imp->id->choices_key()->value()->find_by_name_with_prefix(ChoiceNameWithPrefix(s)));
|
||||
auto c(_imp->id->choices_key()->parse_value()->find_by_name_with_prefix(ChoiceNameWithPrefix(s)));
|
||||
if (! c)
|
||||
{
|
||||
Log::get_instance()->message("e.required_use.no_choice", ll_warning, lc_context)
|
||||
|
@ -53,6 +53,6 @@ VDBID::contents_filename() const
|
||||
std::shared_ptr<MetadataValueKey<std::shared_ptr<const Contents> > >
|
||||
VDBID::make_contents_key() const
|
||||
{
|
||||
return std::make_shared<EContentsKey>("CONTENTS", "Contents", fs_location_key()->value() / "CONTENTS", mkt_internal);
|
||||
return std::make_shared<EContentsKey>("CONTENTS", "Contents", fs_location_key()->parse_value() / "CONTENTS", mkt_internal);
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ VDBMerger::extend_hook(const Hook & h)
|
||||
std::string pn(stringify(_imp->params.package_id()->name().package()));
|
||||
std::string pvr(stringify(_imp->params.package_id()->version()));
|
||||
std::string pv(stringify(_imp->params.package_id()->version().remove_revision()));
|
||||
std::string slot(_imp->params.package_id()->slot_key() ? stringify(_imp->params.package_id()->slot_key()->value()) : "");
|
||||
std::string slot(_imp->params.package_id()->slot_key() ? stringify(_imp->params.package_id()->slot_key()->parse_value()) : "");
|
||||
|
||||
return FSMerger::extend_hook(h)
|
||||
("P", pn + "-" + pv)
|
||||
|
@ -469,7 +469,7 @@ VDBRepository::perform_uninstall(
|
||||
|
||||
std::shared_ptr<const Contents> contents(a.options.override_contents());
|
||||
if (! contents)
|
||||
contents = id->contents_key()->value();
|
||||
contents = id->contents_key()->parse_value();
|
||||
|
||||
/* unmerge */
|
||||
VDBUnmerger unmerger(
|
||||
@ -481,13 +481,13 @@ VDBRepository::perform_uninstall(
|
||||
n::ignore() = a.options.ignore_for_unmerge(),
|
||||
n::output_manager() = output_manager,
|
||||
n::package_id() = id,
|
||||
n::root() = installed_root_key()->value()
|
||||
n::root() = installed_root_key()->parse_value()
|
||||
));
|
||||
unmerger.unmerge();
|
||||
|
||||
VDBPostMergeUnmergeCommand post_unmerge_command(
|
||||
make_named_values<VDBPostMergeUnmergeCommandParams>(
|
||||
n::root() = installed_root_key()->value()
|
||||
n::root() = installed_root_key()->parse_value()
|
||||
));
|
||||
post_unmerge_command();
|
||||
}
|
||||
@ -713,7 +713,7 @@ VDBRepository::provides_from_package_id(const std::shared_ptr<const PackageID> &
|
||||
if (! id->provide_key())
|
||||
return;
|
||||
|
||||
std::shared_ptr<const ProvideSpecTree> provide(id->provide_key()->value());
|
||||
std::shared_ptr<const ProvideSpecTree> provide(id->provide_key()->parse_value());
|
||||
DepSpecFlattener<ProvideSpecTree, PackageDepSpec> f(_imp->params.environment(), id);
|
||||
provide->top()->accept(f);
|
||||
|
||||
@ -871,7 +871,7 @@ namespace
|
||||
const std::shared_ptr<const PackageID> & b)
|
||||
{
|
||||
if (a->slot_key())
|
||||
return b->slot_key() && a->slot_key()->value() == b->slot_key()->value();
|
||||
return b->slot_key() && a->slot_key()->parse_value() == b->slot_key()->parse_value();
|
||||
else
|
||||
return ! b->slot_key();
|
||||
}
|
||||
@ -957,7 +957,7 @@ VDBRepository::merge(const MergeParams & m)
|
||||
n::options() = m.options(),
|
||||
n::output_manager() = m.output_manager(),
|
||||
n::package_id() = m.package_id(),
|
||||
n::root() = installed_root_key()->value()
|
||||
n::root() = installed_root_key()->parse_value()
|
||||
));
|
||||
|
||||
(m.used_this_for_config_protect())(config_protect);
|
||||
@ -972,10 +972,7 @@ VDBRepository::merge(const MergeParams & m)
|
||||
std::shared_ptr<const Contents> is_replace_contents;
|
||||
if (is_replace)
|
||||
{
|
||||
/* hack: before we nuke its vdb dir, preload CONTENTS */
|
||||
if (! is_replace->contents_key())
|
||||
throw InternalError(PALUDIS_HERE, "No contents key in " + stringify(*is_replace) + ". How did that happen?");
|
||||
is_replace_contents = is_replace->contents_key()->value();
|
||||
is_replace_contents = is_replace->contents_key()->parse_value();
|
||||
|
||||
FSPath old_vdb_dir(_imp->params.location());
|
||||
old_vdb_dir /= stringify(is_replace->name().category());
|
||||
@ -1049,7 +1046,7 @@ VDBRepository::merge(const MergeParams & m)
|
||||
|
||||
VDBPostMergeUnmergeCommand post_merge_command(
|
||||
make_named_values<VDBPostMergeUnmergeCommandParams>(
|
||||
n::root() = installed_root_key()->value()
|
||||
n::root() = installed_root_key()->parse_value()
|
||||
));
|
||||
post_merge_command();
|
||||
|
||||
@ -1314,7 +1311,7 @@ namespace
|
||||
const DepRewrites & rewrites)
|
||||
{
|
||||
DepRewriter v(rewrites);
|
||||
key->value()->top()->accept(v);
|
||||
key->parse_value()->top()->accept(v);
|
||||
if (v.changed)
|
||||
{
|
||||
std::cout << " Rewriting " << f << std::endl;
|
||||
@ -1402,7 +1399,7 @@ VDBRepository::perform_updates()
|
||||
continue;
|
||||
}
|
||||
|
||||
FSPath dir(k->value());
|
||||
FSPath dir(k->parse_value());
|
||||
if (! dir.stat().is_directory_or_symlink_to_directory())
|
||||
{
|
||||
Log::get_instance()->message("e.vdb.updates.bad_key", ll_warning, lc_context) <<
|
||||
@ -1410,7 +1407,7 @@ VDBRepository::perform_updates()
|
||||
continue;
|
||||
}
|
||||
|
||||
for (FSIterator d(k->value(), { fsio_want_regular_files, fsio_deref_symlinks_for_wants }), d_end ; d != d_end ; ++d)
|
||||
for (FSIterator d(k->parse_value(), { fsio_want_regular_files, fsio_deref_symlinks_for_wants }), d_end ; d != d_end ; ++d)
|
||||
{
|
||||
Context context_3("When performing updates from '" + stringify(*d) + "':");
|
||||
|
||||
@ -1517,7 +1514,7 @@ VDBRepository::perform_updates()
|
||||
FSPath target_cat_dir(_imp->params.location() / stringify(m->second.category()));
|
||||
target_cat_dir.mkdir(0755, { fspmkdo_ok_if_exists });
|
||||
|
||||
FSPath from_dir(m->first->fs_location_key()->value());
|
||||
FSPath from_dir(m->first->fs_location_key()->parse_value());
|
||||
FSPath to_dir(target_cat_dir / ((stringify(m->second.package()) + "-" + stringify(m->first->version()))));
|
||||
|
||||
if (to_dir.stat().exists())
|
||||
@ -1572,7 +1569,7 @@ VDBRepository::perform_updates()
|
||||
{
|
||||
std::cout << " " << *m->first << " to " << m->second << std::endl;
|
||||
|
||||
SafeOFStream f(m->first->fs_location_key()->value() / "SLOT", -1, true);
|
||||
SafeOFStream f(m->first->fs_location_key()->parse_value() / "SLOT", -1, true);
|
||||
f << m->second << std::endl;
|
||||
}
|
||||
}
|
||||
@ -1604,16 +1601,16 @@ VDBRepository::perform_updates()
|
||||
i != i_end ; ++i)
|
||||
{
|
||||
if ((*i)->build_dependencies_key())
|
||||
rewrite_done |= rewrite_dependencies((*i)->fs_location_key()->value() / (*i)->build_dependencies_key()->raw_name(),
|
||||
rewrite_done |= rewrite_dependencies((*i)->fs_location_key()->parse_value() / (*i)->build_dependencies_key()->raw_name(),
|
||||
(*i)->build_dependencies_key(), dep_rewrites);
|
||||
if ((*i)->run_dependencies_key())
|
||||
rewrite_done |= rewrite_dependencies((*i)->fs_location_key()->value() / (*i)->run_dependencies_key()->raw_name(),
|
||||
rewrite_done |= rewrite_dependencies((*i)->fs_location_key()->parse_value() / (*i)->run_dependencies_key()->raw_name(),
|
||||
(*i)->run_dependencies_key(), dep_rewrites);
|
||||
if ((*i)->post_dependencies_key())
|
||||
rewrite_done |= rewrite_dependencies((*i)->fs_location_key()->value() / (*i)->post_dependencies_key()->raw_name(),
|
||||
rewrite_done |= rewrite_dependencies((*i)->fs_location_key()->parse_value() / (*i)->post_dependencies_key()->raw_name(),
|
||||
(*i)->post_dependencies_key(), dep_rewrites);
|
||||
if ((*i)->suggested_dependencies_key())
|
||||
rewrite_done |= rewrite_dependencies((*i)->fs_location_key()->value() / (*i)->suggested_dependencies_key()->raw_name(),
|
||||
rewrite_done |= rewrite_dependencies((*i)->fs_location_key()->parse_value() / (*i)->suggested_dependencies_key()->raw_name(),
|
||||
(*i)->suggested_dependencies_key(), dep_rewrites);
|
||||
}
|
||||
|
||||
|
@ -97,30 +97,30 @@ namespace
|
||||
void visit(const ContentsFileEntry & e)
|
||||
{
|
||||
_str += "file\n";
|
||||
_str += stringify(e.location_key()->value());
|
||||
_str += stringify(e.location_key()->parse_value());
|
||||
_str += '\n';
|
||||
}
|
||||
|
||||
void visit(const ContentsDirEntry & e)
|
||||
{
|
||||
_str += "directory\n";
|
||||
_str += stringify(e.location_key()->value());
|
||||
_str += stringify(e.location_key()->parse_value());
|
||||
_str += '\n';
|
||||
}
|
||||
|
||||
void visit(const ContentsSymEntry & e)
|
||||
{
|
||||
_str += "symlink\n";
|
||||
_str += stringify(e.location_key()->value());
|
||||
_str += stringify(e.location_key()->parse_value());
|
||||
_str += '\n';
|
||||
_str += stringify(e.target_key()->value());
|
||||
_str += stringify(e.target_key()->parse_value());
|
||||
_str += '\n';
|
||||
}
|
||||
|
||||
void visit(const ContentsOtherEntry & e)
|
||||
{
|
||||
_str += "other\n";
|
||||
_str += stringify(e.location_key()->value());
|
||||
_str += stringify(e.location_key()->parse_value());
|
||||
_str += '\n';
|
||||
}
|
||||
};
|
||||
@ -197,15 +197,15 @@ TEST(VDBRepository, QueryUse)
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
|
||||
ASSERT_TRUE(bool(e1->choices_key()));
|
||||
ASSERT_TRUE(bool(e1->choices_key()->value()));
|
||||
ASSERT_TRUE(bool(e1->choices_key()->value()->find_by_name_with_prefix(ChoiceNameWithPrefix("flag1"))));
|
||||
EXPECT_TRUE(e1->choices_key()->value()->find_by_name_with_prefix(ChoiceNameWithPrefix("flag1"))->enabled());
|
||||
EXPECT_TRUE(e1->choices_key()->value()->find_by_name_with_prefix(ChoiceNameWithPrefix("flag2"))->enabled());
|
||||
EXPECT_TRUE(! e1->choices_key()->value()->find_by_name_with_prefix(ChoiceNameWithPrefix("flag3"))->enabled());
|
||||
EXPECT_TRUE(e1->choices_key()->value()->find_by_name_with_prefix(ChoiceNameWithPrefix("test"))->enabled());
|
||||
EXPECT_TRUE(e1->choices_key()->value()->find_by_name_with_prefix(ChoiceNameWithPrefix("kernel_linux"))->enabled());
|
||||
EXPECT_TRUE(! e1->choices_key()->value()->find_by_name_with_prefix(ChoiceNameWithPrefix("test2")));
|
||||
EXPECT_TRUE(! e1->choices_key()->value()->find_by_name_with_prefix(ChoiceNameWithPrefix("kernel_freebsd")));
|
||||
ASSERT_TRUE(bool(e1->choices_key()->parse_value()));
|
||||
ASSERT_TRUE(bool(e1->choices_key()->parse_value()->find_by_name_with_prefix(ChoiceNameWithPrefix("flag1"))));
|
||||
EXPECT_TRUE(e1->choices_key()->parse_value()->find_by_name_with_prefix(ChoiceNameWithPrefix("flag1"))->enabled());
|
||||
EXPECT_TRUE(e1->choices_key()->parse_value()->find_by_name_with_prefix(ChoiceNameWithPrefix("flag2"))->enabled());
|
||||
EXPECT_TRUE(! e1->choices_key()->parse_value()->find_by_name_with_prefix(ChoiceNameWithPrefix("flag3"))->enabled());
|
||||
EXPECT_TRUE(e1->choices_key()->parse_value()->find_by_name_with_prefix(ChoiceNameWithPrefix("test"))->enabled());
|
||||
EXPECT_TRUE(e1->choices_key()->parse_value()->find_by_name_with_prefix(ChoiceNameWithPrefix("kernel_linux"))->enabled());
|
||||
EXPECT_TRUE(! e1->choices_key()->parse_value()->find_by_name_with_prefix(ChoiceNameWithPrefix("test2")));
|
||||
EXPECT_TRUE(! e1->choices_key()->parse_value()->find_by_name_with_prefix(ChoiceNameWithPrefix("kernel_freebsd")));
|
||||
}
|
||||
|
||||
TEST(VDBRepository, Contents)
|
||||
@ -226,8 +226,9 @@ TEST(VDBRepository, Contents)
|
||||
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
|
||||
&env, { })), make_null_shared_ptr(), { }))]->begin());
|
||||
ContentsGatherer gatherer;
|
||||
std::for_each(indirect_iterator(e1->contents_key()->value()->begin()),
|
||||
indirect_iterator(e1->contents_key()->value()->end()),
|
||||
auto contents(e1->contents_key()->parse_value());
|
||||
std::for_each(indirect_iterator(contents->begin()),
|
||||
indirect_iterator(contents->end()),
|
||||
accept_visitor(gatherer));
|
||||
EXPECT_EQ(
|
||||
"directory\n/directory\n"
|
||||
|
@ -383,7 +383,7 @@ TEST(ProvidesCache, Works)
|
||||
|
||||
for (auto i(seq->begin()), i_end(seq->end()) ;
|
||||
i != i_end ; ++i)
|
||||
ASSERT_TRUE(! stringify(i->provided_by()->slot_key()->value()).empty());
|
||||
ASSERT_TRUE(! stringify(i->provided_by()->slot_key()->parse_value()).empty());
|
||||
|
||||
RepositoryProvidesInterface::ProvidesSequence::ConstIterator it(seq->begin());
|
||||
EXPECT_EQ("virtual/foo", stringify(it->virtual_name()));
|
||||
|
@ -101,7 +101,7 @@ VDBUnmerger::extend_hook(const Hook & h) const
|
||||
std::string pn(stringify(_imp->options.package_id()->name().package()));
|
||||
std::string pvr(stringify(_imp->options.package_id()->version()));
|
||||
std::string pv(stringify(_imp->options.package_id()->version().remove_revision()));
|
||||
std::string slot(_imp->options.package_id()->slot_key() ? stringify(_imp->options.package_id()->slot_key()->value()) : "");
|
||||
std::string slot(_imp->options.package_id()->slot_key() ? stringify(_imp->options.package_id()->slot_key()->parse_value()) : "");
|
||||
|
||||
return result
|
||||
("P", pn + "-" + pv)
|
||||
@ -216,21 +216,21 @@ namespace
|
||||
bool
|
||||
VDBUnmerger::check_file(const std::shared_ptr<const ContentsEntry> & e) const
|
||||
{
|
||||
const FSPath f(e->location_key()->value());
|
||||
const FSPath f(e->location_key()->parse_value());
|
||||
const FSPath root_f(_imp->options.root() / f);
|
||||
const FSStat root_f_stat(root_f);
|
||||
if (! root_f_stat.exists())
|
||||
display("--- [gone ] " + stringify(f));
|
||||
else if (! root_f_stat.is_regular_file())
|
||||
display("--- [!type] " + stringify(f));
|
||||
else if (root_f_stat.mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").value().seconds())
|
||||
else if (root_f_stat.mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").parse_value().seconds())
|
||||
display("--- [!time] " + stringify(f));
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
SafeIFStream md5_file(_imp->options.root() / f);
|
||||
if (MD5(md5_file).hexsum() != require_key<MetadataValueKey<std::string> >(*e, "md5").value())
|
||||
if (MD5(md5_file).hexsum() != require_key<MetadataValueKey<std::string> >(*e, "md5").parse_value())
|
||||
display("--- [!md5 ] " + stringify(f));
|
||||
else if (config_protected(_imp->options.root() / f))
|
||||
display("--- [cfgpr] " + stringify(f));
|
||||
@ -251,7 +251,7 @@ VDBUnmerger::check_file(const std::shared_ptr<const ContentsEntry> & e) const
|
||||
bool
|
||||
VDBUnmerger::check_sym(const std::shared_ptr<const ContentsEntry> & e) const
|
||||
{
|
||||
const FSPath f(e->location_key()->value());
|
||||
const FSPath f(e->location_key()->parse_value());
|
||||
const FSPath root_f(_imp->options.root() / f);
|
||||
const FSStat root_f_stat(root_f);
|
||||
|
||||
@ -259,9 +259,9 @@ VDBUnmerger::check_sym(const std::shared_ptr<const ContentsEntry> & e) const
|
||||
display("--- [gone ] " + stringify(f));
|
||||
else if (! root_f_stat.is_symlink())
|
||||
display("--- [!type] " + stringify(f));
|
||||
else if (root_f_stat.mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").value().seconds())
|
||||
else if (root_f_stat.mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").parse_value().seconds())
|
||||
display("--- [!time] " + stringify(f));
|
||||
else if (root_f.readlink() != require_key<MetadataValueKey<std::string> >(*e, "target").value())
|
||||
else if (root_f.readlink() != require_key<MetadataValueKey<std::string> >(*e, "target").parse_value())
|
||||
display("--- [!dest] " + stringify(f));
|
||||
else
|
||||
return true;
|
||||
@ -272,7 +272,7 @@ VDBUnmerger::check_sym(const std::shared_ptr<const ContentsEntry> & e) const
|
||||
bool
|
||||
VDBUnmerger::check_misc(const std::shared_ptr<const ContentsEntry> & e) const
|
||||
{
|
||||
const FSPath f(e->location_key()->value());
|
||||
const FSPath f(e->location_key()->parse_value());
|
||||
const FSPath root_f(_imp->options.root() / f);
|
||||
const FSStat root_f_stat(root_f);
|
||||
|
||||
@ -284,7 +284,7 @@ VDBUnmerger::check_misc(const std::shared_ptr<const ContentsEntry> & e) const
|
||||
bool
|
||||
VDBUnmerger::check_dir(const std::shared_ptr<const ContentsEntry> & e) const
|
||||
{
|
||||
const FSPath f(e->location_key()->value());
|
||||
const FSPath f(e->location_key()->parse_value());
|
||||
const FSPath root_f(_imp->options.root() / f);
|
||||
const FSStat root_f_stat(root_f);
|
||||
|
||||
|
@ -123,7 +123,7 @@ namespace
|
||||
unmerger = std::make_shared<VDBUnmergerNoDisplay>(make_named_values<VDBUnmergerOptions>(
|
||||
n::config_protect() = "/protected_file /protected_dir",
|
||||
n::config_protect_mask() = "/protected_dir/unprotected_file /protected_dir/unprotected_dir",
|
||||
n::contents() = id->contents_key()->value(),
|
||||
n::contents() = id->contents_key()->parse_value(),
|
||||
n::environment() = &env,
|
||||
n::ignore() = &ignore_nothing,
|
||||
n::output_manager() = std::make_shared<StandardOutputManager>(),
|
||||
|
@ -103,7 +103,7 @@ FakeInstalledRepository::provided_packages() const
|
||||
continue;
|
||||
|
||||
DepSpecFlattener<ProvideSpecTree, PackageDepSpec> f(environment(), *v);
|
||||
(*v)->provide_key()->value()->top()->accept(f);
|
||||
(*v)->provide_key()->parse_value()->top()->accept(f);
|
||||
|
||||
for (DepSpecFlattener<ProvideSpecTree, PackageDepSpec>::ConstIterator q(f.begin()), q_end(f.end()) ; q != q_end ; ++q)
|
||||
result->push_back(make_named_values<RepositoryProvidesEntry>(
|
||||
@ -120,7 +120,7 @@ FakeInstalledRepository::provided_packages() const
|
||||
bool
|
||||
FakeInstalledRepository::is_default_destination() const
|
||||
{
|
||||
return environment()->preferred_root_key()->value() == installed_root_key()->value();
|
||||
return environment()->preferred_root_key()->parse_value() == installed_root_key()->parse_value();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -99,7 +99,7 @@ FakeMetadataCollectionKey<C_>::~FakeMetadataCollectionKey()
|
||||
|
||||
template <typename C_>
|
||||
const std::shared_ptr<const C_>
|
||||
FakeMetadataCollectionKey<C_>::value() const
|
||||
FakeMetadataCollectionKey<C_>::parse_value() const
|
||||
{
|
||||
return this->_imp->collection;
|
||||
}
|
||||
@ -131,7 +131,7 @@ FakeMetadataCollectionKey<C_>::pretty_print_value(
|
||||
const PrettyPrinter & pretty_printer,
|
||||
const PrettyPrintOptions &) const
|
||||
{
|
||||
return join(value()->begin(), value()->end(), " ", CallPrettyPrinter(pretty_printer));
|
||||
return join(_imp->collection->begin(), _imp->collection->end(), " ", CallPrettyPrinter(pretty_printer));
|
||||
}
|
||||
|
||||
FakeMetadataKeywordSetKey::FakeMetadataKeywordSetKey(const std::string & r,
|
||||
@ -243,7 +243,7 @@ FakeMetadataSpecTreeKey<C_>::set_from_string(const std::string & s)
|
||||
|
||||
template <typename C_>
|
||||
const std::shared_ptr<const C_>
|
||||
FakeMetadataSpecTreeKey<C_>::value() const
|
||||
FakeMetadataSpecTreeKey<C_>::parse_value() const
|
||||
{
|
||||
return _imp->value;
|
||||
}
|
||||
@ -314,7 +314,7 @@ FakeMetadataSpecTreeKey<FetchableURISpecTree>::type() const
|
||||
}
|
||||
|
||||
const std::shared_ptr<const FetchableURISpecTree>
|
||||
FakeMetadataSpecTreeKey<FetchableURISpecTree>::value() const
|
||||
FakeMetadataSpecTreeKey<FetchableURISpecTree>::parse_value() const
|
||||
{
|
||||
return _imp->value;
|
||||
}
|
||||
@ -351,7 +351,7 @@ FakeMetadataSpecTreeKey<DependencySpecTree>::set_from_string(const std::string &
|
||||
}
|
||||
|
||||
const std::shared_ptr<const DependencySpecTree>
|
||||
FakeMetadataSpecTreeKey<DependencySpecTree>::value() const
|
||||
FakeMetadataSpecTreeKey<DependencySpecTree>::parse_value() const
|
||||
{
|
||||
return _imp->value;
|
||||
}
|
||||
@ -507,7 +507,7 @@ FakeMetadataChoicesKey::add(const std::string & n, const std::string & v)
|
||||
}
|
||||
|
||||
const std::shared_ptr<const Choices>
|
||||
FakeMetadataChoicesKey::value() const
|
||||
FakeMetadataChoicesKey::parse_value() const
|
||||
{
|
||||
return _imp->value;
|
||||
}
|
||||
@ -689,17 +689,17 @@ FakePackageID::canonical_form(const PackageIDCanonicalForm f) const
|
||||
switch (f)
|
||||
{
|
||||
case idcf_full:
|
||||
return stringify(_imp->name) + "-" + stringify(_imp->version) + ":" + stringify(_imp->slot->value())
|
||||
return stringify(_imp->name) + "-" + stringify(_imp->version) + ":" + stringify(_imp->slot->parse_value())
|
||||
+ "::" + stringify(repository_name());
|
||||
|
||||
case idcf_version:
|
||||
return stringify(_imp->version);
|
||||
|
||||
case idcf_no_version:
|
||||
return stringify(_imp->name) + ":" + stringify(_imp->slot->value()) + "::" + stringify(repository_name());
|
||||
return stringify(_imp->name) + ":" + stringify(_imp->slot->parse_value()) + "::" + stringify(repository_name());
|
||||
|
||||
case idcf_no_name:
|
||||
return stringify(_imp->version) + ":" + stringify(_imp->slot->value())
|
||||
return stringify(_imp->version) + ":" + stringify(_imp->slot->parse_value())
|
||||
+ "::" + stringify(repository_name());
|
||||
|
||||
case last_idcf:
|
||||
@ -713,7 +713,7 @@ PackageDepSpec
|
||||
FakePackageID::uniquely_identifying_spec() const
|
||||
{
|
||||
return parse_user_package_dep_spec("=" + stringify(name()) + "-" + stringify(version()) +
|
||||
(slot_key() ? ":" + stringify(slot_key()->value()) : "") + "::" + stringify(repository_name()),
|
||||
(slot_key() ? ":" + stringify(slot_key()->parse_value()) : "") + "::" + stringify(repository_name()),
|
||||
_imp->env, { });
|
||||
}
|
||||
|
||||
@ -910,7 +910,7 @@ FakePackageID::set_slot(const SlotName & s)
|
||||
bool
|
||||
FakePackageID::arbitrary_less_than_comparison(const PackageID & other) const
|
||||
{
|
||||
return slot_key()->value().value() < (other.slot_key() ? stringify(other.slot_key()->value()) : "");
|
||||
return slot_key()->parse_value().value() < (other.slot_key() ? stringify(other.slot_key()->parse_value()) : "");
|
||||
}
|
||||
|
||||
void
|
||||
@ -979,7 +979,7 @@ FakePackageID::need_keys_added() const
|
||||
std::size_t
|
||||
FakePackageID::extra_hash_value() const
|
||||
{
|
||||
return Hash<SlotName>()(slot_key()->value());
|
||||
return Hash<SlotName>()(slot_key()->parse_value());
|
||||
}
|
||||
|
||||
bool
|
||||
@ -1060,13 +1060,13 @@ FakePackageID::need_masks_added() const
|
||||
Context context("When generating masks for ID '" + canonical_form(idcf_full) + "':");
|
||||
|
||||
if (keywords_key())
|
||||
if (! _imp->env->accept_keywords(keywords_key()->value(), shared_from_this()))
|
||||
if (! _imp->env->accept_keywords(keywords_key()->parse_value(), shared_from_this()))
|
||||
add_mask(std::make_shared<FakeUnacceptedMask>('K', "keywords", keywords_key()->raw_name()));
|
||||
|
||||
if (license_key())
|
||||
{
|
||||
LicenceChecker c(_imp->env, &Environment::accept_license, shared_from_this());
|
||||
license_key()->value()->top()->accept(c);
|
||||
license_key()->parse_value()->top()->accept(c);
|
||||
if (! c.ok)
|
||||
add_mask(std::make_shared<FakeUnacceptedMask>('L', "license", license_key()->raw_name()));
|
||||
}
|
||||
@ -1214,7 +1214,7 @@ const std::string
|
||||
FakeMetadataKeywordSetKey::pretty_print_value(
|
||||
const PrettyPrinter & pretty_printer, const PrettyPrintOptions &) const
|
||||
{
|
||||
return join(value()->begin(), value()->end(), " ", CallPrettyPrinter(pretty_printer));
|
||||
return join(_imp->collection->begin(), _imp->collection->end(), " ", CallPrettyPrinter(pretty_printer));
|
||||
}
|
||||
|
||||
const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Choices> > >
|
||||
|
@ -43,7 +43,7 @@ namespace paludis
|
||||
public:
|
||||
~FakeMetadataCollectionKey();
|
||||
|
||||
virtual const std::shared_ptr<const C_> value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::shared_ptr<const C_> parse_value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
@ -80,7 +80,7 @@ namespace paludis
|
||||
const std::function<const std::shared_ptr<const C_> (const std::string &)> &, const MetadataKeyType);
|
||||
~FakeMetadataSpecTreeKey();
|
||||
|
||||
virtual const std::shared_ptr<const C_> value() const
|
||||
virtual const std::shared_ptr<const C_> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
void set_from_string(const std::string &);
|
||||
@ -107,7 +107,7 @@ namespace paludis
|
||||
const MetadataKeyType);
|
||||
~FakeMetadataSpecTreeKey();
|
||||
|
||||
virtual const std::shared_ptr<const FetchableURISpecTree> value() const
|
||||
virtual const std::shared_ptr<const FetchableURISpecTree> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
void set_from_string(const std::string &);
|
||||
@ -138,7 +138,7 @@ namespace paludis
|
||||
const MetadataKeyType);
|
||||
~FakeMetadataSpecTreeKey();
|
||||
|
||||
virtual const std::shared_ptr<const DependencySpecTree> value() const
|
||||
virtual const std::shared_ptr<const DependencySpecTree> parse_value() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
void set_from_string(const std::string &);
|
||||
@ -168,7 +168,7 @@ namespace paludis
|
||||
~FakeMetadataChoicesKey();
|
||||
|
||||
void add(const std::string &, const std::string &);
|
||||
const std::shared_ptr<const Choices> value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
const std::shared_ptr<const Choices> parse_value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
@ -244,7 +244,7 @@ GemcutterDependenciesKey::GemcutterDependenciesKey(const Environment * const e,
|
||||
GemcutterDependenciesKey::~GemcutterDependenciesKey() = default;
|
||||
|
||||
const std::shared_ptr<const DependencySpecTree>
|
||||
GemcutterDependenciesKey::value() const
|
||||
GemcutterDependenciesKey::parse_value() const
|
||||
{
|
||||
return _imp->value;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ namespace paludis
|
||||
|
||||
///\}
|
||||
|
||||
virtual const std::shared_ptr<const DependencySpecTree> value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::shared_ptr<const DependencySpecTree> parse_value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
@ -122,7 +122,7 @@ GemcutterURIKey::GemcutterURIKey(const std::string * const r, const std::string
|
||||
GemcutterURIKey::~GemcutterURIKey() = default;
|
||||
|
||||
const std::shared_ptr<const SimpleURISpecTree>
|
||||
GemcutterURIKey::value() const
|
||||
GemcutterURIKey::parse_value() const
|
||||
{
|
||||
return _imp->value;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ namespace paludis
|
||||
|
||||
///\}
|
||||
|
||||
virtual const std::shared_ptr<const SimpleURISpecTree> value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::shared_ptr<const SimpleURISpecTree> parse_value() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
virtual const std::string raw_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
@ -336,7 +336,7 @@ bool
|
||||
RepositoryRepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> & id) const
|
||||
{
|
||||
auto repo(_imp->params.environment()->fetch_repository(id->repository_name()));
|
||||
std::string f(repo->format_key() ? repo->format_key()->value() : "");
|
||||
std::string f(repo->format_key() ? repo->format_key()->parse_value() : "");
|
||||
return f == "unavailable";
|
||||
}
|
||||
|
||||
@ -364,7 +364,7 @@ namespace
|
||||
if (! ii)
|
||||
return "";
|
||||
|
||||
return ii->value();
|
||||
return ii->parse_value();
|
||||
}
|
||||
|
||||
std::string replace_vars(
|
||||
@ -442,8 +442,8 @@ RepositoryRepository::merge(const MergeParams & m)
|
||||
if (repo_format.empty())
|
||||
throw InternalError(PALUDIS_HERE, "no REPOSITORY_FORMAT in " + stringify(*m.package_id()));
|
||||
|
||||
std::string config_template(_imp->config_template_key->value());
|
||||
std::string config_filename(_imp->config_filename_key->value());
|
||||
std::string config_template(_imp->config_template_key->parse_value());
|
||||
std::string config_filename(_imp->config_filename_key->parse_value());
|
||||
|
||||
config_template = replace_vars(config_template, repo_sync, repo_format, repo_name);
|
||||
config_filename = replace_vars(config_filename, repo_sync, repo_format, repo_name);
|
||||
|
@ -106,22 +106,22 @@ UnavailablePackageID::canonical_form(const PackageIDCanonicalForm f) const
|
||||
{
|
||||
case idcf_full:
|
||||
return stringify(_imp->name) + "-" + stringify(_imp->version) +
|
||||
":" + stringify(_imp->slot_key->value()) + "::" + stringify(_imp->repository_name) +
|
||||
" (in ::" + *_imp->from_repositories_key->value()->begin() + ")";
|
||||
":" + stringify(_imp->slot_key->parse_value()) + "::" + stringify(_imp->repository_name) +
|
||||
" (in ::" + *_imp->from_repositories_key->parse_value()->begin() + ")";
|
||||
|
||||
case idcf_no_version:
|
||||
return stringify(_imp->name) + ":" + stringify(_imp->slot_key->value()) +
|
||||
return stringify(_imp->name) + ":" + stringify(_imp->slot_key->parse_value()) +
|
||||
"::" + stringify(_imp->repository_name) +
|
||||
" (in ::" + *_imp->from_repositories_key->value()->begin() + ")";
|
||||
" (in ::" + *_imp->from_repositories_key->parse_value()->begin() + ")";
|
||||
|
||||
case idcf_version:
|
||||
return stringify(_imp->version) +
|
||||
" (in ::" + *_imp->from_repositories_key->value()->begin() + ")";
|
||||
" (in ::" + *_imp->from_repositories_key->parse_value()->begin() + ")";
|
||||
|
||||
case idcf_no_name:
|
||||
return stringify(_imp->version) +
|
||||
":" + stringify(_imp->slot_key->value()) + "::" + stringify(_imp->repository_name) +
|
||||
" (in ::" + *_imp->from_repositories_key->value()->begin() + ")";
|
||||
":" + stringify(_imp->slot_key->parse_value()) + "::" + stringify(_imp->repository_name) +
|
||||
" (in ::" + *_imp->from_repositories_key->parse_value()->begin() + ")";
|
||||
|
||||
case last_idcf:
|
||||
break;
|
||||
@ -134,8 +134,8 @@ PackageDepSpec
|
||||
UnavailablePackageID::uniquely_identifying_spec() const
|
||||
{
|
||||
return parse_user_package_dep_spec("=" + stringify(name()) + "-" + stringify(version()) +
|
||||
(slot_key() ? ":" + stringify(slot_key()->value()) : "") + "::" + stringify(repository_name()) +
|
||||
"[." + _imp->from_repositories_key->raw_name() + "=" + *_imp->from_repositories_key->value()->begin() + "]",
|
||||
(slot_key() ? ":" + stringify(slot_key()->parse_value()) : "") + "::" + stringify(repository_name()) +
|
||||
"[." + _imp->from_repositories_key->raw_name() + "=" + *_imp->from_repositories_key->parse_value()->begin() + "]",
|
||||
_imp->env, { });
|
||||
}
|
||||
|
||||
@ -181,25 +181,27 @@ UnavailablePackageID::arbitrary_less_than_comparison(const PackageID & other) co
|
||||
if (! other.slot_key())
|
||||
return false;
|
||||
|
||||
if (slot_key()->value() < other.slot_key()->value())
|
||||
if (slot_key()->parse_value() < other.slot_key()->parse_value())
|
||||
return true;
|
||||
if (slot_key()->value() > other.slot_key()->value())
|
||||
if (slot_key()->parse_value() > other.slot_key()->parse_value())
|
||||
return false;
|
||||
|
||||
std::shared_ptr<const MetadataCollectionKey<Set<std::string > > > k(other.from_repositories_key());
|
||||
if (! k)
|
||||
throw InternalError(PALUDIS_HERE, "other has no from_repositories_key()");
|
||||
if (1 != k->value()->size())
|
||||
|
||||
auto v(k->parse_value());
|
||||
if (1 != v->size())
|
||||
throw InternalError(PALUDIS_HERE, "other has bad from_repositories_key");
|
||||
|
||||
return *_imp->from_repositories_key->value()->begin() < *k->value()->begin();
|
||||
return *_imp->from_repositories_key->parse_value()->begin() < *v->begin();
|
||||
}
|
||||
|
||||
std::size_t
|
||||
UnavailablePackageID::extra_hash_value() const
|
||||
{
|
||||
return Hash<std::pair<SlotName, std::string> >()(std::make_pair(
|
||||
slot_key()->value(), *_imp->from_repositories_key->value()->begin()));
|
||||
slot_key()->parse_value(), *_imp->from_repositories_key->parse_value()->begin()));
|
||||
}
|
||||
|
||||
const std::shared_ptr<const MetadataCollectionKey<PackageIDSequence> >
|
||||
|
@ -84,7 +84,7 @@ UnavailableRepositoryDependenciesKey::~UnavailableRepositoryDependenciesKey()
|
||||
}
|
||||
|
||||
const std::shared_ptr<const DependencySpecTree>
|
||||
UnavailableRepositoryDependenciesKey::value() const
|
||||
UnavailableRepositoryDependenciesKey::parse_value() const
|
||||
{
|
||||
return _imp->value;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ namespace paludis
|
||||
const std::string & v);
|
||||
~UnavailableRepositoryDependenciesKey();
|
||||
|
||||
const std::shared_ptr<const DependencySpecTree> value() const;
|
||||
const std::shared_ptr<const DependencySpecTree> parse_value() const;
|
||||
|
||||
virtual const std::shared_ptr<const DependenciesLabelSequence> initial_labels() const
|
||||
PALUDIS_ATTRIBUTE((warn_unused_result));
|
||||
|
@ -94,7 +94,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
const FSPath value() const
|
||||
const FSPath parse_value() const
|
||||
{
|
||||
return _location;
|
||||
}
|
||||
@ -131,7 +131,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
const std::shared_ptr<const Contents> value() const
|
||||
const std::shared_ptr<const Contents> parse_value() const
|
||||
{
|
||||
Lock l(_mutex);
|
||||
if (_v)
|
||||
@ -175,7 +175,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
Timestamp value() const
|
||||
Timestamp parse_value() const
|
||||
{
|
||||
return _time;
|
||||
}
|
||||
@ -217,7 +217,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
const std::string value() const
|
||||
const std::string parse_value() const
|
||||
{
|
||||
Lock l(_mutex);
|
||||
if (_v)
|
||||
@ -271,7 +271,7 @@ namespace
|
||||
_f.push_back(f);
|
||||
}
|
||||
|
||||
const std::shared_ptr<const Set<std::string> > value() const
|
||||
const std::shared_ptr<const Set<std::string> > parse_value() const
|
||||
{
|
||||
Lock l(_mutex);
|
||||
if (_v)
|
||||
@ -307,7 +307,8 @@ namespace
|
||||
const PrettyPrinter & pretty_printer,
|
||||
const PrettyPrintOptions &) const
|
||||
{
|
||||
return join(value()->begin(), value()->end(), " ", CallPrettyPrinter(pretty_printer));
|
||||
auto v(parse_value());
|
||||
return join(v->begin(), v->end(), " ", CallPrettyPrinter(pretty_printer));
|
||||
}
|
||||
};
|
||||
|
||||
@ -338,7 +339,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
const std::shared_ptr<const DependencySpecTree> value() const
|
||||
const std::shared_ptr<const DependencySpecTree> parse_value() const
|
||||
{
|
||||
Lock l(_mutex);
|
||||
if (_v)
|
||||
@ -377,7 +378,7 @@ namespace
|
||||
const PrettyPrintOptions & options) const
|
||||
{
|
||||
CommaSeparatedDepPrettyPrinter p(printer, options);
|
||||
value()->top()->accept(p);
|
||||
parse_value()->top()->accept(p);
|
||||
return p.result();
|
||||
}
|
||||
};
|
||||
@ -497,18 +498,18 @@ InstalledUnpackagedID::canonical_form(const PackageIDCanonicalForm f) const
|
||||
{
|
||||
case idcf_full:
|
||||
return stringify(_imp->name) + "-" + stringify(_imp->version) + ":" +
|
||||
stringify(slot_key()->value()) + "::" + stringify(_imp->repository_name);
|
||||
stringify(slot_key()->parse_value()) + "::" + stringify(_imp->repository_name);
|
||||
|
||||
case idcf_version:
|
||||
return stringify(_imp->version);
|
||||
|
||||
case idcf_no_version:
|
||||
return stringify(_imp->name) + ":" + stringify(slot_key()->value()) + "::" +
|
||||
return stringify(_imp->name) + ":" + stringify(slot_key()->parse_value()) + "::" +
|
||||
stringify(_imp->repository_name);
|
||||
|
||||
case idcf_no_name:
|
||||
return stringify(_imp->version) + ":" +
|
||||
stringify(slot_key()->value()) + "::" + stringify(_imp->repository_name);
|
||||
stringify(slot_key()->parse_value()) + "::" + stringify(_imp->repository_name);
|
||||
|
||||
case last_idcf:
|
||||
break;
|
||||
@ -521,7 +522,7 @@ PackageDepSpec
|
||||
InstalledUnpackagedID::uniquely_identifying_spec() const
|
||||
{
|
||||
return parse_user_package_dep_spec("=" + stringify(name()) + "-" + stringify(version()) +
|
||||
(slot_key() ? ":" + stringify(slot_key()->value()) : "") + "::" + stringify(repository_name()),
|
||||
(slot_key() ? ":" + stringify(slot_key()->parse_value()) : "") + "::" + stringify(repository_name()),
|
||||
_imp->env, { });
|
||||
}
|
||||
|
||||
@ -682,7 +683,7 @@ InstalledUnpackagedTransientKey::InstalledUnpackagedTransientKey(
|
||||
std::string
|
||||
InstalledUnpackagedTransientKey::pretty_print() const
|
||||
{
|
||||
return stringify(value());
|
||||
return stringify(parse_value());
|
||||
}
|
||||
|
||||
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > >
|
||||
@ -804,13 +805,13 @@ InstalledUnpackagedID::breaks_portage() const
|
||||
bool
|
||||
InstalledUnpackagedID::arbitrary_less_than_comparison(const PackageID & other) const
|
||||
{
|
||||
return slot_key()->value().value() < (other.slot_key() ? stringify(other.slot_key()->value()) : "");
|
||||
return slot_key()->parse_value().value() < (other.slot_key() ? stringify(other.slot_key()->parse_value()) : "");
|
||||
}
|
||||
|
||||
std::size_t
|
||||
InstalledUnpackagedID::extra_hash_value() const
|
||||
{
|
||||
return Hash<SlotName>()(slot_key()->value());
|
||||
return Hash<SlotName>()(slot_key()->parse_value());
|
||||
}
|
||||
|
||||
namespace
|
||||
@ -846,7 +847,7 @@ InstalledUnpackagedID::uninstall(const bool replace,
|
||||
throw ActionFailedError("Couldn't uninstall '" + stringify(*this) +
|
||||
"' because root ('" + stringify(_imp->root) + "') is not a directory");
|
||||
|
||||
FSPath ver_dir(fs_location_key()->value());
|
||||
FSPath ver_dir(fs_location_key()->parse_value());
|
||||
|
||||
NDBAMUnmerger unmerger(
|
||||
make_named_values<NDBAMUnmergerOptions>(
|
||||
@ -869,7 +870,7 @@ InstalledUnpackagedID::uninstall(const bool replace,
|
||||
|
||||
if (last)
|
||||
{
|
||||
FSPath pkg_dir(fs_location_key()->value().dirname());
|
||||
FSPath pkg_dir(fs_location_key()->parse_value().dirname());
|
||||
pkg_dir.rmdir();
|
||||
|
||||
std::static_pointer_cast<const InstalledUnpackagedRepository>(repo)->deindex(name());
|
||||
|
@ -128,7 +128,7 @@ InstalledUnpackagedRepository::package_ids(const QualifiedPackageName & q, const
|
||||
Lock l(*(*e).mutex());
|
||||
if (! (*e).package_id())
|
||||
(*e).package_id() = std::make_shared<InstalledUnpackagedID>(_imp->params.environment(), (*e).name(), (*e).version(),
|
||||
(*e).slot(), name(), (*e).fs_location(), (*e).magic(), installed_root_key()->value(), &_imp->ndbam);
|
||||
(*e).slot(), name(), (*e).fs_location(), (*e).magic(), installed_root_key()->parse_value(), &_imp->ndbam);
|
||||
result->push_back((*e).package_id());
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ namespace
|
||||
const std::shared_ptr<const PackageID> & b)
|
||||
{
|
||||
if (a->slot_key())
|
||||
return b->slot_key() && a->slot_key()->value() == b->slot_key()->value();
|
||||
return b->slot_key() && a->slot_key()->parse_value() == b->slot_key()->parse_value();
|
||||
else
|
||||
return ! b->slot_key();
|
||||
}
|
||||
@ -281,7 +281,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
|
||||
const MetadataValueKey<FSPath> * kk(visitor_cast<const MetadataValueKey<FSPath> >(**k));
|
||||
if (! kk)
|
||||
throw ActionFailedError("Fetched install_under key but did not get an FSPath key from owning repository");
|
||||
install_under = kk->value();
|
||||
install_under = kk->parse_value();
|
||||
}
|
||||
|
||||
int rewrite_ids_over_to_root(-1);
|
||||
@ -292,7 +292,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
|
||||
const MetadataValueKey<long> * kk(visitor_cast<const MetadataValueKey<long> >(**k));
|
||||
if (! kk)
|
||||
throw ActionFailedError("Fetched rewrite_ids_over_to_root key but did not get a long key from owning repository");
|
||||
rewrite_ids_over_to_root = kk->value();
|
||||
rewrite_ids_over_to_root = kk->parse_value();
|
||||
}
|
||||
|
||||
std::shared_ptr<const PackageID> if_overwritten_id, if_same_name_id;
|
||||
@ -312,7 +312,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
|
||||
|
||||
FSPath uid_dir(_imp->params.location());
|
||||
if (if_same_name_id)
|
||||
uid_dir = if_same_name_id->fs_location_key()->value().dirname();
|
||||
uid_dir = if_same_name_id->fs_location_key()->parse_value().dirname();
|
||||
else
|
||||
{
|
||||
std::string uid(stringify(m.package_id()->name().category()) + "---" + stringify(m.package_id()->name().package()));
|
||||
@ -327,7 +327,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
|
||||
}
|
||||
|
||||
FSPath target_ver_dir(uid_dir);
|
||||
target_ver_dir /= (stringify(m.package_id()->version()) + ":" + stringify(m.package_id()->slot_key()->value()) + ":" + cookie());
|
||||
target_ver_dir /= (stringify(m.package_id()->version()) + ":" + stringify(m.package_id()->slot_key()->parse_value()) + ":" + cookie());
|
||||
|
||||
if (target_ver_dir.stat().exists())
|
||||
throw ActionFailedError("Temporary merge directory '" + stringify(target_ver_dir) + "' already exists, probably "
|
||||
@ -346,7 +346,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
|
||||
if (m.package_id()->short_description_key())
|
||||
{
|
||||
SafeOFStream description_file(target_ver_dir / "description", -1, true);
|
||||
description_file << m.package_id()->short_description_key()->value() << std::endl;
|
||||
description_file << m.package_id()->short_description_key()->parse_value() << std::endl;
|
||||
}
|
||||
|
||||
if (m.package_id()->build_dependencies_key())
|
||||
@ -377,7 +377,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
|
||||
n::options() = m.options(),
|
||||
n::output_manager() = m.output_manager(),
|
||||
n::package_id() = m.package_id(),
|
||||
n::root() = installed_root_key()->value()
|
||||
n::root() = installed_root_key()->parse_value()
|
||||
));
|
||||
|
||||
if (m.check())
|
||||
@ -402,14 +402,14 @@ bool
|
||||
InstalledUnpackagedRepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> & id) const
|
||||
{
|
||||
auto repo(_imp->params.environment()->fetch_repository(id->repository_name()));
|
||||
std::string f(repo->format_key() ? repo->format_key()->value() : "");
|
||||
std::string f(repo->format_key() ? repo->format_key()->parse_value() : "");
|
||||
return f == "unpackaged";
|
||||
}
|
||||
|
||||
bool
|
||||
InstalledUnpackagedRepository::is_default_destination() const
|
||||
{
|
||||
return _imp->params.environment()->preferred_root_key()->value() == installed_root_key()->value();
|
||||
return _imp->params.environment()->preferred_root_key()->parse_value() == installed_root_key()->parse_value();
|
||||
}
|
||||
|
||||
bool
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user