pool_rel2id;
pool_search;
pool_selection2str;
+ pool_set_custom_vendorcheck;
pool_set_flag;
pool_set_installed;
pool_set_languages;
static void
prune_best_arch_name_version(const Solver *solv, Pool *pool, Queue *plist)
{
- if (solv && solv->bestSolvableCb)
- { /* The application is responsible for */
- return solv->bestSolvableCb(solv->pool, plist);
- }
-
if (plist->count > 1)
prune_to_best_arch(pool, plist);
if (plist->count > 1)
Pool *pool = solv->pool;
Id a1 = s1->arch, a2 = s2->arch;
- if (solv && solv->archCheckCb)
- { /* The application is responsible for */
- return solv->archCheckCb(solv->pool, s1, s2);
- }
-
/* we allow changes to/from noarch */
if (a1 == a2 || a1 == pool->noarchid || a2 == pool->noarchid)
return 0;
Id v1, v2;
Id vendormask1, vendormask2;
- if (solv->vendorCheckCb)
- { /* The application is responsible for */
- return solv->vendorCheckCb(pool, s1, s2);
- }
+ if (pool->custom_vendorcheck)
+ return pool->custom_vendorcheck(pool, s1, s2);
+
/* treat a missing vendor as empty string */
v1 = s1->vendor ? s1->vendor : ID_EMPTY;
v2 = s2->vendor ? s2->vendor : ID_EMPTY;
queue_empty(qs);
- if (solv && solv->updateCandidateCb)
- { /* The application is responsible for */
- return solv->updateCandidateCb(solv->pool, s, qs);
- }
-
n = s - pool->solvables;
/*
return pool->rootdir;
}
+/* only used in libzypp */
+void
+pool_set_custom_vendorcheck(Pool *pool, int (*vendorcheck)(Pool *, Solvable *, Solvable *))
+{
+ pool->custom_vendorcheck = vendorcheck;
+}
+
/* EOF */
char *rootdir;
+ int (*custom_vendorcheck)(struct _Pool *, Solvable *, Solvable *);
#endif
-
};
#define DISTTYPE_RPM 0
extern void pool_setdebugcallback(Pool *pool, void (*debugcallback)(struct _Pool *, void *data, int type, const char *str), void *debugcallbackdata);
extern void pool_setdebugmask(Pool *pool, int mask);
extern void pool_setloadcallback(Pool *pool, int (*cb)(struct _Pool *, struct _Repodata *, void *), void *loadcbdata);
+extern void pool_set_custom_vendorcheck(Pool *pool, int (*vendorcheck)(struct _Pool *, Solvable *, Solvable *));
extern char *pool_alloctmpspace(Pool *pool, int len);
#include "rules.h"
#include "problems.h"
-/*
- * Callback definitions in order to "overwrite" the policies by an external application.
- */
-
-typedef void (*BestSolvableCb) (Pool *pool, Queue *canditates);
-typedef int (*ArchCheckCb) (Pool *pool, Solvable *solvable1, Solvable *solvable2);
-typedef int (*VendorCheckCb) (Pool *pool, Solvable *solvable1, Solvable *solvable2);
-typedef void (*UpdateCandidateCb) (Pool *pool, Solvable *solvable, Queue *canditates);
-
struct _Solver {
Pool *pool; /* back pointer to pool */
int (*solution_callback)(struct _Solver *solv, void *data);
void *solution_callback_data;
- /* Callbacks for defining the bahaviour of the solver */
-
- /* Finding best candidate
- *
- * Callback definition:
- * void bestSolvable (Pool *pool, Queue *canditates)
- * candidates : List of canditates which has to be sorted by the function call
- * return candidates: Sorted list of the candidates(first is the best).
- */
- BestSolvableCb bestSolvableCb;
-
- /* Checking if two solvables has compatible architectures
- *
- * Callback definition:
- * int archCheck (Pool *pool, Solvable *solvable1, Solvable *solvable2);
- *
- * return 0 it the two solvables has compatible architectures
- */
- ArchCheckCb archCheckCb;
-
- /* Checking if two solvables has compatible vendors
- *
- * Callback definition:
- * int vendorCheck (Pool *pool, Solvable *solvable1, Solvable *solvable2);
- *
- * return 0 it the two solvables has compatible architectures
- */
- VendorCheckCb vendorCheckCb;
-
- /* Evaluate update candidate
- *
- * Callback definition:
- * void UpdateCandidateCb (Pool *pool, Solvable *solvable, Queue *canditates)
- * solvable : for which updates should be search
- * candidates : List of candidates (This list depends on other
- * restrictions like architecture and vendor policies too)
- */
- UpdateCandidateCb updateCandidateCb;
-
- int pooljobcnt; /* number of pooljob entries in job queue */
+ int pooljobcnt; /* number of pooljob entries in job queue */
#ifdef LIBSOLV_INTERNAL
Repo *installed; /* copy of pool->installed */