From: Michael Tremer Date: Fri, 19 Jan 2018 15:47:54 +0000 (+0100) Subject: libpakfire: Drop Pool X-Git-Tag: 0.9.28~1285^2~1157 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=44b27b6ff678b3e6b2e99e4650cf5f931afa5698;p=pakfire.git libpakfire: Drop Pool Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index dda193540..1b7af8691 100644 --- a/Makefile.am +++ b/Makefile.am @@ -196,8 +196,6 @@ _pakfire_la_SOURCES = \ src/_pakfire/package.h \ src/_pakfire/pakfire.c \ src/_pakfire/pakfire.h \ - src/_pakfire/pool.c \ - src/_pakfire/pool.h \ src/_pakfire/problem.c \ src/_pakfire/problem.h \ src/_pakfire/relation.c \ @@ -254,7 +252,6 @@ libpakfire_la_SOURCES = \ src/libpakfire/package.c \ src/libpakfire/packagelist.c \ src/libpakfire/pakfire.c \ - src/libpakfire/pool.c \ src/libpakfire/problem.c \ src/libpakfire/relation.c \ src/libpakfire/relationlist.c \ @@ -279,7 +276,6 @@ pkginclude_HEADERS += \ src/libpakfire/include/pakfire/package.h \ src/libpakfire/include/pakfire/packagelist.h \ src/libpakfire/include/pakfire/pakfire.h \ - src/libpakfire/include/pakfire/pool.h \ src/libpakfire/include/pakfire/private.h \ src/libpakfire/include/pakfire/problem.h \ src/libpakfire/include/pakfire/relation.h \ diff --git a/src/_pakfire/_pakfiremodule.c b/src/_pakfire/_pakfiremodule.c index 0f73f0d43..a922e8cba 100644 --- a/src/_pakfire/_pakfiremodule.c +++ b/src/_pakfire/_pakfiremodule.c @@ -34,7 +34,6 @@ #include "key.h" #include "package.h" #include "pakfire.h" -#include "pool.h" #include "problem.h" #include "relation.h" #include "repo.h" @@ -121,12 +120,6 @@ PyMODINIT_FUNC PyInit__pakfire(void) { Py_INCREF(&PackageType); PyModule_AddObject(module, "Package", (PyObject *)&PackageType); - // Pool - if (PyType_Ready(&PoolType) < 0) - return NULL; - Py_INCREF(&PoolType); - PyModule_AddObject(module, "Pool", (PyObject *)&PoolType); - // Problem if (PyType_Ready(&ProblemType) < 0) return NULL; diff --git a/src/_pakfire/pool.c b/src/_pakfire/pool.c deleted file mode 100644 index 83fde724e..000000000 --- a/src/_pakfire/pool.c +++ /dev/null @@ -1,75 +0,0 @@ -/*############################################################################# -# # -# Pakfire - The IPFire package management system # -# Copyright (C) 2011 Pakfire development team # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program 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, see . # -# # -#############################################################################*/ - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "constants.h" -#include "pakfire.h" -#include "pool.h" -#include "relation.h" -#include "util.h" - -static PyObject* Pool_new(PyTypeObject* type, PyObject* args, PyObject* kwds) { - PoolObject* self = (PoolObject *)type->tp_alloc(type, 0); - if (self) { - self->pool = NULL; - } - - return (PyObject *)self; -} - -static void Pool_dealloc(PoolObject* self) { - if (self->pool) - pakfire_pool_unref(self->pool); - - Py_TYPE(self)->tp_free((PyObject *)self); -} - -static int Pool_init(PoolObject* self, PyObject* args, PyObject* kwds) { - PakfireObject* pakfire = NULL; - - if (!PyArg_ParseTuple(args, "O!", &PakfireType, &pakfire)) - return -1; - - self->pool = pakfire_get_pool(pakfire->pakfire); - if (!self->pool) - return -1; - - return 0; -} - -PyTypeObject PoolType = { - PyVarObject_HEAD_INIT(NULL, 0) - tp_name: "_pakfire.Pool", - tp_basicsize: sizeof(PoolObject), - tp_flags: Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, - tp_new: Pool_new, - tp_dealloc: (destructor)Pool_dealloc, - tp_init: (initproc)Pool_init, - tp_doc: "Pool object", -}; diff --git a/src/_pakfire/pool.h b/src/_pakfire/pool.h deleted file mode 100644 index 80f90e7c1..000000000 --- a/src/_pakfire/pool.h +++ /dev/null @@ -1,35 +0,0 @@ -/*############################################################################# -# # -# Pakfire - The IPFire package management system # -# Copyright (C) 2011 Pakfire development team # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program 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, see . # -# # -#############################################################################*/ - -#ifndef PYTHON_PAKFIRE_POOL_H -#define PYTHON_PAKFIRE_POOL_H - -#include - -#include - -typedef struct { - PyObject_HEAD - PakfirePool pool; -} PoolObject; - -extern PyTypeObject PoolType; - -#endif /* PYTHON_PAKFIRE_POOL_H */ diff --git a/src/_pakfire/problem.c b/src/_pakfire/problem.c index 51f5ca6c5..6792f6c14 100644 --- a/src/_pakfire/problem.c +++ b/src/_pakfire/problem.c @@ -24,7 +24,6 @@ #include #include -#include "pool.h" #include "problem.h" #include "solution.h" diff --git a/src/_pakfire/relation.c b/src/_pakfire/relation.c index 5085df62b..0c0807be5 100644 --- a/src/_pakfire/relation.c +++ b/src/_pakfire/relation.c @@ -58,7 +58,7 @@ static PyObject* Relation_new(PyTypeObject* type, PyObject* args, PyObject* kwds static void Relation_dealloc(RelationObject* self) { pakfire_relation_unref(self->relation); - Py_XDECREF(self->pool); + Py_XDECREF(self->pakfire); Py_TYPE(self)->tp_free((PyObject *)self); } diff --git a/src/_pakfire/relation.h b/src/_pakfire/relation.h index 2c1841495..ee04992a9 100644 --- a/src/_pakfire/relation.h +++ b/src/_pakfire/relation.h @@ -23,21 +23,14 @@ #include -#include -#include +#include #include "pakfire.h" -#include "pool.h" typedef struct { PyObject_HEAD PakfireObject* pakfire; - PoolObject* pool; PakfireRelation relation; - - // XXX COMPAT - Pool* _pool; - Id _id; } RelationObject; extern PyTypeObject RelationType; diff --git a/src/_pakfire/solution.c b/src/_pakfire/solution.c index 9475ed799..309f3c587 100644 --- a/src/_pakfire/solution.c +++ b/src/_pakfire/solution.c @@ -24,7 +24,6 @@ #include #include -#include "pool.h" #include "solution.h" static SolutionObject* Solution_new_core(PyTypeObject* type, PakfireSolution solution) { diff --git a/src/_pakfire/transaction.c b/src/_pakfire/transaction.c index 8c325feac..ee394a897 100644 --- a/src/_pakfire/transaction.c +++ b/src/_pakfire/transaction.c @@ -22,7 +22,6 @@ #include #include -#include #include #include "package.h" diff --git a/src/libpakfire/include/pakfire/pakfire.h b/src/libpakfire/include/pakfire/pakfire.h index 661c83934..d7c34f757 100644 --- a/src/libpakfire/include/pakfire/pakfire.h +++ b/src/libpakfire/include/pakfire/pakfire.h @@ -38,8 +38,6 @@ Pakfire pakfire_unref(Pakfire pakfire); const char* pakfire_get_path(Pakfire pakfire); const char* pakfire_get_arch(Pakfire pakfire); -PakfirePool pakfire_get_pool(Pakfire pakfire); - const char** pakfire_get_installonly(Pakfire pakfire); void pakfire_set_installonly(Pakfire pakfire, const char** installonly); diff --git a/src/libpakfire/include/pakfire/pool.h b/src/libpakfire/include/pakfire/pool.h deleted file mode 100644 index 24d64ab71..000000000 --- a/src/libpakfire/include/pakfire/pool.h +++ /dev/null @@ -1,39 +0,0 @@ -/*############################################################################# -# # -# Pakfire - The IPFire package management system # -# Copyright (C) 2013 Pakfire development team # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program 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, see . # -# # -#############################################################################*/ - -#ifndef PAKFIRE_POOL_H -#define PAKFIRE_POOL_H - -#include - -PakfirePool pakfire_pool_create(Pakfire pakfire); - -PakfirePool pakfire_pool_ref(PakfirePool pool); -PakfirePool pakfire_pool_unref(PakfirePool pool); - -#ifdef PAKFIRE_PRIVATE - -#include - -Pool* pakfire_pool_get_solv_pool(PakfirePool pool); - -#endif - -#endif /* PAKFIRE_POOL_H */ diff --git a/src/libpakfire/include/pakfire/relation.h b/src/libpakfire/include/pakfire/relation.h index 9ab8ded1c..1e6b7b258 100644 --- a/src/libpakfire/include/pakfire/relation.h +++ b/src/libpakfire/include/pakfire/relation.h @@ -25,7 +25,6 @@ #include #include -#include #include PakfireRelation pakfire_relation_create(Pakfire pakfire, const char* name, int cmp_type, const char* evr); diff --git a/src/libpakfire/include/pakfire/repo.h b/src/libpakfire/include/pakfire/repo.h index d65b83b67..192aab5c4 100644 --- a/src/libpakfire/include/pakfire/repo.h +++ b/src/libpakfire/include/pakfire/repo.h @@ -31,8 +31,6 @@ PakfireRepo pakfire_repo_create(Pakfire pakfire, const char* name); PakfireRepo pakfire_repo_ref(PakfireRepo repo); PakfireRepo pakfire_repo_unref(PakfireRepo repo); -PakfirePool pakfire_repo_get_pool(PakfireRepo repo); - int pakfire_repo_identical(PakfireRepo repo1, PakfireRepo repo2); int pakfire_repo_cmp(PakfireRepo repo1, PakfireRepo repo2); int pakfire_repo_count(PakfireRepo repo); diff --git a/src/libpakfire/include/pakfire/request.h b/src/libpakfire/include/pakfire/request.h index 6febc12d6..eda17deb5 100644 --- a/src/libpakfire/include/pakfire/request.h +++ b/src/libpakfire/include/pakfire/request.h @@ -45,8 +45,6 @@ PakfireRequest pakfire_request_create(Pakfire pakfire); PakfireRequest pakfire_request_ref(PakfireRequest request); PakfireRequest pakfire_request_unref(PakfireRequest request); -PakfirePool pakfire_request_get_pool(PakfireRequest request); - int pakfire_request_solve(PakfireRequest request, int flags); PakfireProblem pakfire_request_get_problems(PakfireRequest request); PakfireTransaction pakfire_request_get_transaction(PakfireRequest request); diff --git a/src/libpakfire/include/pakfire/transaction.h b/src/libpakfire/include/pakfire/transaction.h index 0ac7119c3..ae766b2a6 100644 --- a/src/libpakfire/include/pakfire/transaction.h +++ b/src/libpakfire/include/pakfire/transaction.h @@ -30,7 +30,6 @@ PakfireTransaction pakfire_transaction_ref(PakfireTransaction transaction); PakfireTransaction pakfire_transaction_unref(PakfireTransaction transaction); Pakfire pakfire_transaction_get_pakfire(PakfireTransaction transaction); -PakfirePool pakfire_transaction_get_pool(PakfireTransaction transaction); size_t pakfire_transaction_count(PakfireTransaction transaction); ssize_t pakfire_transaction_installsizechange(PakfireTransaction transaction); diff --git a/src/libpakfire/include/pakfire/types.h b/src/libpakfire/include/pakfire/types.h index 2ac08149a..e7f57680f 100644 --- a/src/libpakfire/include/pakfire/types.h +++ b/src/libpakfire/include/pakfire/types.h @@ -31,7 +31,6 @@ typedef struct _PakfireFilter* PakfireFilter; typedef struct _PakfireKey* PakfireKey; typedef struct _PakfirePackage* PakfirePackage; typedef struct _PakfirePackageList* PakfirePackageList; -typedef struct _PakfirePool* PakfirePool; typedef struct _PakfireProblem* PakfireProblem; typedef struct _PakfireRelation* PakfireRelation; typedef struct _PakfireRelationList* PakfireRelationList; diff --git a/src/libpakfire/libpakfire.sym b/src/libpakfire/libpakfire.sym index c9ad4d3e9..901fd9f99 100644 --- a/src/libpakfire/libpakfire.sym +++ b/src/libpakfire/libpakfire.sym @@ -205,11 +205,6 @@ global: pakfire_packagelist_sort; pakfire_packagelist_unref; - # pool - pakfire_pool_create; - pakfire_pool_ref; - pakfire_pool_unref; - # problem pakfire_problem_append; pakfire_problem_create; diff --git a/src/libpakfire/package.c b/src/libpakfire/package.c index c7b31baf0..2a0d55eb9 100644 --- a/src/libpakfire/package.c +++ b/src/libpakfire/package.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -52,12 +51,7 @@ struct _PakfirePackage { }; static Pool* pakfire_package_get_solv_pool(PakfirePackage pkg) { - PakfirePool pool = pakfire_get_pool(pkg->pakfire); - - Pool* p = pakfire_pool_get_solv_pool(pool); - pakfire_pool_unref(pool); - - return p; + return pakfire_get_solv_pool(pkg->pakfire); } static void pakfire_package_add_self_provides(Pakfire pakfire, PakfirePackage pkg, const char* name, const char* evr) { diff --git a/src/libpakfire/packagelist.c b/src/libpakfire/packagelist.c index a6d786792..75d9186b3 100644 --- a/src/libpakfire/packagelist.c +++ b/src/libpakfire/packagelist.c @@ -122,10 +122,9 @@ PAKFIRE_EXPORT void pakfire_packagelist_push_if_not_exists(PakfirePackageList li } PAKFIRE_EXPORT PakfirePackageList pakfire_packagelist_from_queue(Pakfire pakfire, Queue* q) { - PakfirePool _pool = pakfire_get_pool(pakfire); PakfirePackageList list = pakfire_packagelist_create(); - Pool* pool = pakfire_pool_get_solv_pool(_pool); + Pool* pool = pakfire_get_solv_pool(pakfire); Id p, pp; for (int i = 0; i < q->count; i += 2) { FOR_JOB_SELECT(p, pp, q->elements[i], q->elements[i + 1]) { @@ -136,7 +135,5 @@ PAKFIRE_EXPORT PakfirePackageList pakfire_packagelist_from_queue(Pakfire pakfire } } - pakfire_pool_unref(_pool); - return list; } diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index a7cb55927..730d06eb3 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -48,7 +47,6 @@ struct _Pakfire { char* arch; // Pool stuff - PakfirePool _pool; Pool* pool; int pool_ready; Queue installonly; @@ -82,7 +80,6 @@ PAKFIRE_EXPORT Pakfire pakfire_create(const char* path, const char* arch) { DEBUG(" path = %s\n", pakfire_get_path(pakfire)); // Initialize the pool - pakfire->_pool = pakfire_pool_create(pakfire); pakfire->pool = pool_create(); // Set architecture of the pool @@ -121,7 +118,6 @@ PAKFIRE_EXPORT Pakfire pakfire_unref(Pakfire pakfire) { if (--pakfire->nrefs > 0) return pakfire; - pakfire_pool_unref(pakfire->_pool); pakfire_pool_free_repos(pakfire->pool); pool_free(pakfire->pool); queue_free(&pakfire->installonly); @@ -145,10 +141,6 @@ PAKFIRE_EXPORT const char* pakfire_get_arch(Pakfire pakfire) { return pakfire->arch; } -PAKFIRE_EXPORT PakfirePool pakfire_get_pool(Pakfire pakfire) { - return pakfire_pool_ref(pakfire->_pool); -} - PAKFIRE_EXPORT int pakfire_version_compare(Pakfire pakfire, const char* evr1, const char* evr2) { return pool_evrcmp_str(pakfire->pool, evr1, evr2, EVRCMP_COMPARE); } diff --git a/src/libpakfire/pool.c b/src/libpakfire/pool.c deleted file mode 100644 index a86212d36..000000000 --- a/src/libpakfire/pool.c +++ /dev/null @@ -1,82 +0,0 @@ -/*############################################################################# -# # -# Pakfire - The IPFire package management system # -# Copyright (C) 2013 Pakfire development team # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program 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, see . # -# # -#############################################################################*/ - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -// This is just being left here for compatibility -struct _PakfirePool { - Pakfire pakfire; - int nrefs; -}; - -PAKFIRE_EXPORT PakfirePool pakfire_pool_create(Pakfire pakfire) { - PakfirePool pool = pakfire_calloc(1, sizeof(*pool)); - if (pool) { - DEBUG("Allocated Pool at %p\n", pool); - pool->nrefs = 1; - - pool->pakfire = pakfire_ref(pakfire); - } - - return pool; -} - -static void pakfire_pool_free(PakfirePool pool) { - pakfire_unref(pool->pakfire); - pakfire_free(pool); - - DEBUG("Released Pool at %p\n", pool); -} - -PAKFIRE_EXPORT PakfirePool pakfire_pool_ref(PakfirePool pool) { - ++pool->nrefs; - - return pool; -} - -PAKFIRE_EXPORT PakfirePool pakfire_pool_unref(PakfirePool pool) { - if (!pool) - return NULL; - - if (--pool->nrefs > 0) - return pool; - - pakfire_pool_free(pool); - return NULL; -} - -Pool* pakfire_pool_get_solv_pool(PakfirePool pool) { - return pakfire_get_solv_pool(pool->pakfire); -} diff --git a/src/libpakfire/relation.c b/src/libpakfire/relation.c index 0955e216b..49dda85c5 100644 --- a/src/libpakfire/relation.c +++ b/src/libpakfire/relation.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libpakfire/relationlist.c b/src/libpakfire/relationlist.c index 6b48ddc51..0f2d944a2 100644 --- a/src/libpakfire/relationlist.c +++ b/src/libpakfire/relationlist.c @@ -23,7 +23,6 @@ #include #include -#include #include #include #include diff --git a/src/libpakfire/repo.c b/src/libpakfire/repo.c index 0220fc089..4973f0879 100644 --- a/src/libpakfire/repo.c +++ b/src/libpakfire/repo.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -62,11 +61,10 @@ static Repo* get_repo_by_name(Pool* pool, const char* name) { return NULL; } -static PakfireRepo get_pakfire_repo_by_name(PakfirePool pool, const char* name) { - Pool* p = pakfire_pool_get_solv_pool(pool); - - Repo* repo = get_repo_by_name(p, name); +static PakfireRepo get_pakfire_repo_by_name(Pakfire pakfire, const char* name) { + Pool* pool = pakfire_get_solv_pool(pakfire); + Repo* repo = get_repo_by_name(pool, name); if (repo) return repo->appdata; @@ -74,23 +72,17 @@ static PakfireRepo get_pakfire_repo_by_name(PakfirePool pool, const char* name) } PAKFIRE_EXPORT PakfireRepo pakfire_repo_create(Pakfire pakfire, const char* name) { - PakfirePool pool = pakfire_get_pool(pakfire); - - PakfireRepo repo = get_pakfire_repo_by_name(pool, name); + PakfireRepo repo = get_pakfire_repo_by_name(pakfire, name); if (repo) { repo->nrefs++; - - pakfire_pool_unref(pool); - return repo; } - Pool* p = pakfire_pool_get_solv_pool(pool); - pakfire_pool_unref(pool); + Pool* pool = pakfire_get_solv_pool(pakfire); - Repo* r = get_repo_by_name(p, name); + Repo* r = get_repo_by_name(pool, name); if (!r) - r = repo_create(p, name); + r = repo_create(pool, name); return pakfire_repo_create_from_repo(pakfire, r); } @@ -150,19 +142,6 @@ Repodata* pakfire_repo_get_repodata(PakfireRepo repo) { return repo->filelist; } -PAKFIRE_EXPORT PakfirePool pakfire_repo_get_pool(PakfireRepo repo) { - return pakfire_get_pool(repo->pakfire); -} - -static Pool* pakfire_repo_get_solv_pool(PakfireRepo repo) { - PakfirePool pool = pakfire_repo_get_pool(repo); - - Pool* p = pakfire_pool_get_solv_pool(pool); - pakfire_pool_unref(pool); - - return p; -} - PAKFIRE_EXPORT int pakfire_repo_identical(PakfireRepo repo1, PakfireRepo repo2) { Repo* r1 = repo1->repo; Repo* r2 = repo2->repo; @@ -184,7 +163,7 @@ PAKFIRE_EXPORT int pakfire_repo_cmp(PakfireRepo repo1, PakfireRepo repo2) { } PAKFIRE_EXPORT int pakfire_repo_count(PakfireRepo repo) { - Pool* pool = pakfire_repo_get_solv_pool(repo); + Pool* pool = pakfire_get_solv_pool(repo->pakfire); int cnt = 0; for (int i = 2; i < pool->nsolvables; i++) { diff --git a/src/libpakfire/request.c b/src/libpakfire/request.c index 2e8d797f4..ac1024b57 100644 --- a/src/libpakfire/request.c +++ b/src/libpakfire/request.c @@ -90,10 +90,6 @@ PAKFIRE_EXPORT PakfireRequest pakfire_request_unref(PakfireRequest request) { return NULL; } -PAKFIRE_EXPORT PakfirePool pakfire_request_get_pool(PakfireRequest request) { - return pakfire_get_pool(request->pakfire); -} - Solver* pakfire_request_get_solver(PakfireRequest request) { return request->solver; } diff --git a/src/libpakfire/selector.c b/src/libpakfire/selector.c index 37da16c8b..d185b250b 100644 --- a/src/libpakfire/selector.c +++ b/src/libpakfire/selector.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libpakfire/step.c b/src/libpakfire/step.c index 1aa7a0579..66e8f1404 100644 --- a/src/libpakfire/step.c +++ b/src/libpakfire/step.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libpakfire/transaction.c b/src/libpakfire/transaction.c index 81a101302..249e6d606 100644 --- a/src/libpakfire/transaction.c +++ b/src/libpakfire/transaction.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -106,10 +105,6 @@ PAKFIRE_EXPORT Pakfire pakfire_transaction_get_pakfire(PakfireTransaction transa return pakfire_ref(transaction->pakfire); } -PAKFIRE_EXPORT PakfirePool pakfire_transaction_get_pool(PakfireTransaction transaction) { - return pakfire_get_pool(transaction->pakfire); -} - Transaction* pakfire_transaction_get_transaction(PakfireTransaction transaction) { return transaction->transaction; } diff --git a/src/pakfire/base.py b/src/pakfire/base.py index e4bf75751..daeb099ab 100644 --- a/src/pakfire/base.py +++ b/src/pakfire/base.py @@ -59,7 +59,6 @@ class Pakfire(_pakfire.Pakfire): # Load configuration self.config = config or Config("general.conf") - self.pool = _pakfire.Pool(self) self.cache_path = cache_path or \ os.path.join(CACHE_DIR, self.distro.sname, self.distro.release) @@ -181,7 +180,7 @@ class PakfireContext(object): pkgs.append(pkg) else: - pkgs += self.pakfire.pool.whatprovides(pattern, name_only=True) + pkgs += self.pakfire.whatprovides(pattern, name_only=True) return sorted(pkgs) @@ -189,7 +188,7 @@ class PakfireContext(object): pkgs = [] for pattern in patterns: - for pkg in self.pakfire.pool.whatprovides(self, pattern): + for pkg in self.pakfire.whatprovides(self, pattern): if pkg in pkgs: continue @@ -198,7 +197,7 @@ class PakfireContext(object): return sorted(pkgs) def search(self, pattern): - return self.pakfire.pool.search(pattern) + return self.pakfire.search(pattern) # Transactions @@ -208,7 +207,7 @@ class PakfireContext(object): # XXX handle files and URLs for req in requires: - relation = _pakfire.Relation(self.pakfire.pool, req) + relation = _pakfire.Relation(self.pakfire, req) request.install(relation) return request.solve(**kwargs) @@ -223,7 +222,7 @@ class PakfireContext(object): request = _pakfire.Request(self.pakfire) for pkg in pkgs: - relation = _pakfire.Relation(self.pakfire.pool, pkg) + relation = _pakfire.Relation(self.pakfire, pkg) request.erase(relation) return request.solve(**kwargs) @@ -233,7 +232,7 @@ class PakfireContext(object): # Add all packages that should be updated to the request for req in reqs or []: - relation = _pakfire.Relation(self.pakfire.pool, req) + relation = _pakfire.Relation(self.pakfire, req) request.upgrade(relation) # Otherwise we will try to upgrade everything @@ -242,7 +241,7 @@ class PakfireContext(object): # Exclude packages that should not be updated for exclude in excludes or []: - relation = _pakfire.Relation(self.pakfire.pool, exclude) + relation = _pakfire.Relation(self.pakfire, exclude) request.lock(relation) return request.solve(**kwargs) @@ -254,7 +253,7 @@ class PakfireContext(object): logger = logging.getLogger("pakfire") # Create a new request. - request = self.pakfire.pool.create_request() + request = self.pakfire.create_request() # Fill request. for pattern in pkgs: @@ -272,11 +271,11 @@ class PakfireContext(object): if best is None: logger.warning(_("\"%s\" package does not seem to be installed.") % pattern) else: - rel = self.pakfire.pool.create_relation("%s < %s" % (best.name, best.friendly_version)) + rel = self.pakfire.create_relation("%s < %s" % (best.name, best.friendly_version)) request.install(rel) # Solve the request. - solver = self.pakfire.pool.solve(request, allow_downgrade=True, **kwargs) + solver = self.pakfire.solve(request, allow_downgrade=True, **kwargs) assert solver.status is True # Create the transaction. diff --git a/src/pakfire/packages/base.py b/src/pakfire/packages/base.py index de2b9b621..b4bef3f7a 100644 --- a/src/pakfire/packages/base.py +++ b/src/pakfire/packages/base.py @@ -53,8 +53,7 @@ class Package(object): #log.debug("%s is equal to %s by UUID" % (self, other)) return 0 - ret = util.version_compare(self.pakfire.pool, - self.friendly_version, other.friendly_version) + ret = self.pakfire.version_compare(self.friendly_version, other.friendly_version) # XXX this is to move packages that have been built a while ago and # do not have all the meta information that they won't be evaluated diff --git a/src/pakfire/repository/__init__.py b/src/pakfire/repository/__init__.py index 1cbcb1ed8..54899e8c6 100644 --- a/src/pakfire/repository/__init__.py +++ b/src/pakfire/repository/__init__.py @@ -88,10 +88,6 @@ class Repositories(object): def distro(self): return self.pakfire.distro - @property - def pool(self): - return self.pakfire.pool - def load_configuration(self, *paths): c = config.Config() @@ -191,7 +187,7 @@ class Repositories(object): repo.enabled = False def whatprovides(self, *args, **kwargs): - return self.pool.whatprovides(self.pakfire, *args, **kwargs) + return self.pakfire.whatprovides(*args, **kwargs) def clean(self): log.info("Cleaning up all repository caches...") diff --git a/src/pakfire/util.py b/src/pakfire/util.py index 1b7fe27e9..85fd6ce64 100644 --- a/src/pakfire/util.py +++ b/src/pakfire/util.py @@ -35,7 +35,7 @@ from .constants import * from .i18n import _ # Import binary version of version_compare and capability functions -from ._pakfire import version_compare, get_capabilities, set_capabilities, personality +from ._pakfire import get_capabilities, set_capabilities, personality def cli_is_interactive(): """