int size, i;
VALUE *o;
queue_init(&$1);
- size = RARRAY($input)->len;
+ size = RARRAY_LEN($input);
i = 0;
- o = RARRAY($input)->ptr;
+ o = RARRAY_PTR($input);
for (i = 0; i < size; i++, o++) {
int v;
int e = SWIG_AsVal_int(*o, &v);
#if defined(SWIGPYTHON)
typedef PyObject *AppObjectPtr;
%typemap(out) AppObjectPtr {
- $result = $1;
+ $result = $1 ? $1 : Py_None;
Py_INCREF($result);
}
#endif
#include "repo_susetags.h"
#include "repo_content.h"
#endif
+#ifdef ENABLE_MDKREPO
+#include "repo_mdk.h"
+#endif
+#ifdef ENABLE_ARCHREPO
+#include "repo_arch.h"
+#endif
#include "solv_xfopen.h"
+/* for old ruby versions */
+#ifndef RARRAY_PTR
+#define RARRAY_PTR(ary) (RARRAY(ary)->ptr)
+#endif
+#ifndef RARRAY_LEN
+#define RARRAY_LEN(ary) (RARRAY(ary)->len)
+#endif
+
#define true 1
#define false 1
%nodefaultctor Repo;
%nodefaultdtor Repo;
-typedef struct _Repo {
+typedef struct {
Pool * const pool;
const char * const name;
int priority;
Pool * const pool;
} Solver;
-typedef struct chksum {
+typedef struct {
} Chksum;
%rename(xfopen) solv_xfopen;
%}
void set_loadcallback(PyObject *callable) {
if ($self->loadcallback == loadcallback) {
- Py_DECREF($self->loadcallbackdata);
+ PyObject *obj = $self->loadcallbackdata;
+ Py_DECREF(obj);
}
if (callable) {
Py_INCREF(callable);
Queue addfileprovides_queue() {
Queue r;
queue_init(&r);
- pool_addfileprovides_queue($self, &r);
+ pool_addfileprovides_queue($self, &r, 0);
return r;
}
void createwhatprovides() {
static const int REPO_USE_LOADING = REPO_USE_LOADING;
static const int REPO_EXTEND_SOLVABLES = REPO_EXTEND_SOLVABLES;
static const int SOLV_ADD_NO_STUBS = SOLV_ADD_NO_STUBS; /* repo_solv */
-#ifdef ENABLE_SUSETAGS
+#ifdef ENABLE_SUSEREPO
static const int SUSETAGS_RECORD_SHARES = SUSETAGS_RECORD_SHARES; /* repo_susetags */
#endif
return 1;
}
#endif
+#ifdef ENABLE_MDKREPO
+ bool add_mdk(FILE *fp, int flags = 0) {
+ repo_add_mdk($self, fp, flags);
+ return 1;
+ }
+ bool add_mdk_info(FILE *fp, int flags = 0) {
+ repo_add_mdk($self, fp, flags);
+ return 1;
+ }
+#endif
+#ifdef ENABLE_ARCHREPO
+ bool add_arch_repo(FILE *fp, int flags = 0) {
+ repo_add_arch_repo($self, fp, flags);
+ return 1;
+ }
+ Id add_arch_pkg(const char *name, int flags = 0) {
+ return repo_add_arch_pkg($self, name, flags);
+ }
+#endif
void internalize() {
repo_internalize($self);
}
Id lookup_id(Id entry, Id keyname) {
return repo_lookup_id($self, entry, keyname);
}
- unsigned int lookup_num(Id entry, Id keyname, unsigned int notfound = 0) {
+ unsigned long long lookup_num(Id entry, Id keyname, unsigned long long notfound = 0) {
return repo_lookup_num($self, entry, keyname, notfound);
}
void write(FILE *fp) {
void each() {
Repo *n;
while ((n = Pool_repo_iterator___next__($self)) != 0) {
- rb_yield(SWIG_NewPointerObj(SWIG_as_voidptr(n), SWIGTYPE_p__Repo, SWIG_POINTER_OWN | 0));
+ rb_yield(SWIG_NewPointerObj(SWIG_as_voidptr(n), SWIGTYPE_p_Repo, SWIG_POINTER_OWN | 0));
}
}
#endif
Id lookup_id(Id keyname) {
return pool_lookup_id($self->pool, $self->id, keyname);
}
- unsigned int lookup_num(Id keyname, unsigned int notfound = 0) {
+ unsigned long long lookup_num(Id keyname, unsigned long long notfound = 0) {
return pool_lookup_num($self->pool, $self->id, keyname, notfound);
}
bool lookup_void(Id keyname) {
%}
%newobject Job;
Job *Job() {
+ Id extraflags = solver_solutionelement_extrajobflags($self->solv, $self->problemid, $self->solutionid);
if ($self->type == SOLVER_SOLUTION_JOB)
return new_Job($self->solv->pool, SOLVER_NOOP, 0);
if ($self->type == SOLVER_SOLUTION_INFARCH || $self->type == SOLVER_SOLUTION_DISTUPGRADE)
- return new_Job($self->solv->pool, SOLVER_INSTALL|SOLVER_SOLVABLE, $self->p);
+ return new_Job($self->solv->pool, SOLVER_INSTALL|SOLVER_SOLVABLE|extraflags, $self->p);
if ($self->type == SOLVER_SOLUTION_REPLACE || $self->type == SOLVER_SOLUTION_REPLACE_DOWNGRADE || $self->type == SOLVER_SOLUTION_REPLACE_ARCHCHANGE || $self->type == SOLVER_SOLUTION_REPLACE_VENDORCHANGE)
- return new_Job($self->solv->pool, SOLVER_INSTALL|SOLVER_SOLVABLE, $self->rp);
+ return new_Job($self->solv->pool, SOLVER_INSTALL|SOLVER_SOLVABLE|extraflags, $self->rp);
if ($self->type == SOLVER_SOLUTION_ERASE)
- return new_Job($self->solv->pool, SOLVER_ERASE|SOLVER_SOLVABLE, $self->p);
+ return new_Job($self->solv->pool, SOLVER_ERASE|SOLVER_SOLVABLE|extraflags, $self->p);
return 0;
}
}