diff options
author | 2011-09-04 22:08:23 +0100 | |
---|---|---|
committer | 2011-09-04 22:08:23 +0100 | |
commit | e4445c29bad5f4b6eca307dcb5927ab7ac021df7 (patch) | |
tree | 506cf193175dba526c81fbec54469fc7b3c1413c /src | |
parent | c90d4dec7920a8d70949d8e2e71e704d2800d2c1 (diff) | |
download | paludis-e4445c29bad5f4b6eca307dcb5927ab7ac021df7.tar.gz paludis-e4445c29bad5f4b6eca307dcb5927ab7ac021df7.tar.xz |
Remove PackageID::contents_key
Diffstat (limited to 'src')
-rw-r--r-- | src/clients/cave/cmd_contents.cc | 4 | ||||
-rw-r--r-- | src/clients/cave/cmd_print_id_contents.cc | 4 | ||||
-rw-r--r-- | src/clients/cave/cmd_verify.cc | 4 | ||||
-rw-r--r-- | src/clients/cave/executables_common.cc | 6 | ||||
-rw-r--r-- | src/clients/cave/owner_common.cc | 4 | ||||
-rw-r--r-- | src/clients/cave/size_common.cc | 4 |
6 files changed, 12 insertions, 14 deletions
diff --git a/src/clients/cave/cmd_contents.cc b/src/clients/cave/cmd_contents.cc index d726f3af8..23f00adc8 100644 --- a/src/clients/cave/cmd_contents.cc +++ b/src/clients/cave/cmd_contents.cc @@ -138,10 +138,10 @@ ContentsCommand::run( nothing_matching_error(env.get(), *cmdline.begin_parameters(), filter::InstalledAtRoot(env->preferred_root_key()->parse_value())); const std::shared_ptr<const PackageID> id(*entries->last()); - if (! id->contents_key()) + auto contents(id->contents()); + if (! contents) throw BadIDForCommand(spec, id, "does not support listing contents"); - auto contents(id->contents_key()->parse_value()); std::transform( contents->begin(), contents->end(), diff --git a/src/clients/cave/cmd_print_id_contents.cc b/src/clients/cave/cmd_print_id_contents.cc index 1ce38dbe2..83f6a095c 100644 --- a/src/clients/cave/cmd_print_id_contents.cc +++ b/src/clients/cave/cmd_print_id_contents.cc @@ -174,10 +174,10 @@ PrintIDContentsCommand::run( for (auto i(cmdline.a_best.specified() ? entries->last() : entries->begin()), i_end(entries->end()) ; i != i_end ; ++i) { - if (! (*i)->contents_key()) + auto contents((*i)->contents()); + if (! contents) throw BadIDForCommand(spec, (*i), "does not support listing contents"); - auto contents((*i)->contents_key()->parse_value()); for (auto c(contents->begin()), c_end(contents->end()) ; c != c_end ; ++c) if (match_type(cmdline.a_type, *c)) diff --git a/src/clients/cave/cmd_verify.cc b/src/clients/cave/cmd_verify.cc index 6590012c4..61badcf25 100644 --- a/src/clients/cave/cmd_verify.cc +++ b/src/clients/cave/cmd_verify.cc @@ -226,11 +226,11 @@ VerifyCommand::run( for (PackageIDSequence::ConstIterator i(entries->begin()), i_end(entries->end()) ; i != i_end ; ++i) { - if (! (*i)->contents_key()) + auto contents((*i)->contents()); + if (! contents) continue; Verifier v(*i); - auto contents((*i)->contents_key()->parse_value()); std::for_each(indirect_iterator(contents->begin()), indirect_iterator(contents->end()), accept_visitor(v)); exit_status |= v.exit_status; } diff --git a/src/clients/cave/executables_common.cc b/src/clients/cave/executables_common.cc index 962f1a485..1e76b3011 100644 --- a/src/clients/cave/executables_common.cc +++ b/src/clients/cave/executables_common.cc @@ -133,11 +133,9 @@ paludis::cave::executables_common( for (auto i(best ? entries->last() : entries->begin()), i_end(entries->end()) ; i != i_end ; ++i) { - if ((*i)->contents_key()) - { - std::shared_ptr<const Contents> contents((*i)->contents_key()->parse_value()); + auto contents((*i)->contents()); + if (contents) std::for_each(indirect_iterator(contents->begin()), indirect_iterator(contents->end()), accept_visitor(ed)); - } } return EXIT_SUCCESS; diff --git a/src/clients/cave/owner_common.cc b/src/clients/cave/owner_common.cc index 66f974ea9..e305f8acd 100644 --- a/src/clients/cave/owner_common.cc +++ b/src/clients/cave/owner_common.cc @@ -105,10 +105,10 @@ paludis::cave::owner_common( for (PackageIDSequence::ConstIterator p(ids->begin()), p_end(ids->end()); p != p_end; ++p) { - if (! (*p)->contents_key()) + std::shared_ptr<const Contents> contents((*p)->contents()); + if (! contents) continue; - std::shared_ptr<const Contents> contents((*p)->contents_key()->parse_value()); if (contents->end() != std::find_if(contents->begin(), contents->end(), std::bind(handler, query, std::placeholders::_1))) { diff --git a/src/clients/cave/size_common.cc b/src/clients/cave/size_common.cc index f5a7ddfba..df7080b33 100644 --- a/src/clients/cave/size_common.cc +++ b/src/clients/cave/size_common.cc @@ -105,11 +105,11 @@ paludis::cave::size_common( for (auto i(best ? entries->last() : entries->begin()), i_end(entries->end()) ; i != i_end ; ++i) { - if (! (*i)->contents_key()) + auto contents((*i)->contents()); + if (! contents) throw BadIDForCommand(spec, (*i), "does not support listing contents"); unsigned long size(0); - auto contents((*i)->contents_key()->parse_value()); for (auto c(contents->begin()), c_end(contents->end()) ; c != c_end ; ++c) size += (*c)->accept_returning<unsigned long>(GetSize()); |