Verified Commit e34cd4ff authored by Jelle van der Waa's avatar Jelle van der Waa 🚧
Browse files

Update alpm_db_update for multiple db support

alpm_db_update now supports updating multiple databases at once the so
called parallel download feature. This requires an adjustment of the
alpm_db_update function call.
parent 2a91ea22
......@@ -23,6 +23,7 @@
#include <pyconfig.h>
#include <alpm.h>
#include <Python.h>
#include "handle.h"
#include "db.h"
#include "package.h"
#include "util.h"
......@@ -190,13 +191,18 @@ static PyObject* pyalpm_db_get_group(PyObject* rawself, PyObject* args) {
static PyObject *pyalpm_db_update(PyObject *rawself, PyObject *args, PyObject *kwargs) {
AlpmDB* self = (AlpmDB*)rawself;
alpm_db_t *db = ALPM_DB(self);
alpm_handle_t *handle = ALPM_HANDLE(self->handle);
alpm_list_t *dbs = NULL;
char* keyword[] = {"force", NULL};
int ret;
PyObject *force;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!", keyword, &PyBool_Type, &force))
return NULL;
ret = alpm_db_update((force == Py_True), self->c_data);
dbs = alpm_list_add(dbs, db);
ret = alpm_db_update(handle, dbs, (force == Py_True));
switch(ret) {
case -1:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment