aboutsummaryrefslogtreecommitdiff
path: root/paludis/generator_handler.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-26 18:58:38 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-26 19:00:38 +0000
commit5c2a332b70243cb583a29bb74f712bfca2c1fb76 (patch)
tree0a01f8e624caa2c6639181df45fa80bc20adba84 /paludis/generator_handler.cc
parent79d9f02fb355d81c472f3d94b8b85d5a7639210c (diff)
downloadpaludis-5c2a332b70243cb583a29bb74f712bfca2c1fb76.tar.gz
paludis-5c2a332b70243cb583a29bb74f712bfca2c1fb76.tar.xz
Use Environment rather than PackageDatabase
Diffstat (limited to 'paludis/generator_handler.cc')
-rw-r--r--paludis/generator_handler.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/paludis/generator_handler.cc b/paludis/generator_handler.cc
index ec474a7..8ce53c9 100644
--- a/paludis/generator_handler.cc
+++ b/paludis/generator_handler.cc
@@ -18,13 +18,15 @@
*/
#include <paludis/generator_handler.hh>
+#include <paludis/name.hh>
+#include <paludis/environment.hh>
+#include <paludis/repository.hh>
+
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/name.hh>
-#include <paludis/environment.hh>
-#include <paludis/package_database.hh>
+
#include <functional>
#include <algorithm>
@@ -41,7 +43,7 @@ AllGeneratorHandlerBase::repositories(
{
using namespace std::placeholders;
std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
- std::transform(env->package_database()->begin_repositories(), env->package_database()->end_repositories(),
+ std::transform(env->begin_repositories(), env->end_repositories(),
result->inserter(), std::bind(&Repository::name, _1));
return result;
}
@@ -57,7 +59,7 @@ AllGeneratorHandlerBase::categories(
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
{
- std::shared_ptr<const CategoryNamePartSet> cats(env->package_database()->fetch_repository(*r)->category_names(may_exclude));
+ std::shared_ptr<const CategoryNamePartSet> cats(env->fetch_repository(*r)->category_names(may_exclude));
std::copy(cats->begin(), cats->end(), result->inserter());
}
@@ -80,7 +82,7 @@ AllGeneratorHandlerBase::packages(
c != c_end ; ++c)
{
std::shared_ptr<const QualifiedPackageNameSet> pkgs(
- env->package_database()->fetch_repository(*r)->package_names(*c, may_exclude));
+ env->fetch_repository(*r)->package_names(*c, may_exclude));
std::copy(pkgs->begin(), pkgs->end(), result->inserter());
}
}
@@ -103,8 +105,7 @@ AllGeneratorHandlerBase::ids(
for (QualifiedPackageNameSet::ConstIterator q(qpns->begin()), q_end(qpns->end()) ;
q != q_end ; ++q)
{
- std::shared_ptr<const PackageIDSequence> i(
- env->package_database()->fetch_repository(*r)->package_ids(*q, may_exclude));
+ std::shared_ptr<const PackageIDSequence> i(env->fetch_repository(*r)->package_ids(*q, may_exclude));
std::copy(i->begin(), i->end(), result->inserter());
}
}