From 44641167523e492f46d969010394716984a57af4 Mon Sep 17 00:00:00 2001 From: Klaus Kaempf Date: Fri, 15 Feb 2008 12:27:56 +0000 Subject: [PATCH] remove 'kind' handling ( will re-appear in applayer ;-) ) --- src/policy.c | 24 ------------------------ src/pool.c | 23 ----------------------- src/pooltypes.h | 1 - src/repo_solv.c | 11 +---------- src/solvable.h | 13 ------------- src/solver.c | 15 --------------- src/solver.h | 1 - 7 files changed, 1 insertion(+), 87 deletions(-) diff --git a/src/policy.c b/src/policy.c index 6280abb..4ce160d 100644 --- a/src/policy.c +++ b/src/policy.c @@ -75,28 +75,6 @@ prune_best_version_arch_sortcmp(const void *ap, const void *bp) /* - * prune queue, only keep solvables of kind - * - */ - -static void -prune_to_kind(Pool *pool, Queue *plist, solvable_kind kind) -{ - int i, j; - Solvable *s; - - /* prune to highest priority */ - for (i = j = 0; i < plist->count; i++) - { - s = pool->solvables + plist->elements[i]; - if (s->kind == kind) - plist->elements[j++] = plist->elements[i]; - } - plist->count = j; -} - - -/* * prune to repository with highest priority * */ @@ -350,8 +328,6 @@ void policy_filter_unwanted(Solver *solv, Queue *plist, Id inst, int mode) { Pool *pool = solv->pool; - if (plist->count > 1 && solv->limittokind) - prune_to_kind(pool, plist, solv->limittokind-1); if (plist->count > 1 && mode != POLICY_MODE_SUGGEST) prune_to_highest_prio(pool, plist); if (plist->count > 1 && mode == POLICY_MODE_CHOOSE) diff --git a/src/pool.c b/src/pool.c index f16b724..6e02c0e 100644 --- a/src/pool.c +++ b/src/pool.c @@ -30,29 +30,6 @@ #define SOLVABLE_BLOCK 255 /* - * solvable_kind -> string prefix - * - */ - -static const char *kindprefix_data[] = { - NULL, NULL, NULL, NULL, NULL, - "prod:", - "patch:", - "source:", - "pattern:", - "nosource" -}; - -const char * -kind_prefix( solvable_kind kind ) -{ - if (kind >= _KIND_MAX) - return NULL; - return kindprefix_data[kind]; -} - - -/* * list of string constants, so we can do pointer/Id instead of string comparison * index into array matches ID_xxx constants in pool.h */ diff --git a/src/pooltypes.h b/src/pooltypes.h index f190959..9681f9d 100644 --- a/src/pooltypes.h +++ b/src/pooltypes.h @@ -20,7 +20,6 @@ #define SOLV_VERSION_3 3 #define SOLV_VERSION_4 4 #define SOLV_VERSION_5 5 -#define SOLV_VERSION_6 6 /* solvable.kind added */ #define SOLV_FLAG_PACKEDSIZES 1 #define SOLV_FLAG_VERTICAL 2 diff --git a/src/repo_solv.c b/src/repo_solv.c index e7ca7ee..176742f 100644 --- a/src/repo_solv.c +++ b/src/repo_solv.c @@ -560,7 +560,6 @@ repo_add_solv_parent(Repo *repo, FILE *fp, Repodata *parent) case SOLV_VERSION_3: case SOLV_VERSION_4: case SOLV_VERSION_5: - case SOLV_VERSION_6: break; default: pool_debug(pool, SAT_ERROR, "unsupported SOLV version\n"); @@ -1115,16 +1114,8 @@ fprintf(stderr, "solv %d name %d type %d class %d\n", i, id, keys[key].type, key did = read_id(&data, numid + numrel); if (idmap) did = idmap[did]; - if (id == SOLVABLE_NAME) { + if (id == SOLVABLE_NAME) s->name = did; - if (s->name) { - /* Yeah, thats ugly. Better store kind as u8 in .solv files */ - const char *name = id2str(pool, s->name); - const char *colon = strchr(name, ':'); - if (colon) - s->kind = colon - name + 1; - } - } else if (id == SOLVABLE_ARCH) s->arch = did; else if (id == SOLVABLE_EVR) diff --git a/src/solvable.h b/src/solvable.h index c11689f..785128d 100644 --- a/src/solvable.h +++ b/src/solvable.h @@ -18,20 +18,7 @@ struct _Repo; -typedef enum { - KIND_PACKAGE = 0, - KIND_PRODUCT = 5, /* strlen("prod:") */ - KIND_PATCH = 6, /* strlen("patch:") */ - KIND_SOURCE = 7, /* strlen("source:") */ - KIND_PATTERN = 8, /* strlen("pattern:") */ - KIND_NOSOURCE = 9, /* strlen("nosource:") */ - _KIND_MAX -} solvable_kind; - -extern const char *kind_prefix( solvable_kind kind ); - typedef struct _Solvable { - unsigned int kind; /* one of KIND_xxx */ Id name; Id arch; Id evr; /* epoch:version-release */ diff --git a/src/solver.c b/src/solver.c index d678557..9e4ade6 100644 --- a/src/solver.c +++ b/src/solver.c @@ -2116,16 +2116,6 @@ solver_create(Pool *pool, Repo *installed) solv->rules = sat_extend_resize(solv->rules, solv->nrules, sizeof(Rule), RULES_BLOCK); memset(solv->rules, 0, sizeof(Rule)); - /* cannot be zero by default since zero corresponds to KIND_PACKAGE - * so we initialize it with _KIND_MAX to denote 'all kinds' - * if the application sets this to a specific KIND_, the value is - * incremented by 1 at solver start to make 'if (limittokind)' checks easy - * - * A sure candidate for a more clever implementation - */ - - solv->limittokind = _KIND_MAX; - return solv; } @@ -3486,11 +3476,6 @@ solver_solve(Solver *solv, Queue *job) Queue q; Solvable *s; - if (solv->limittokind != _KIND_MAX) /* if application wants to limit, make it non-zero */ - solv->limittokind += 1; - else - solv->limittokind = 0; - /* create whatprovides if not already there */ if (!pool->whatprovides) pool_createwhatprovides(pool); diff --git a/src/solver.h b/src/solver.h index 35b7e8c..7b766b5 100644 --- a/src/solver.h +++ b/src/solver.h @@ -121,7 +121,6 @@ typedef struct solver { int allowvirtualconflicts; /* false: conflicts on package name, true: conflicts on package provides */ int noupdateprovide; /* true: update packages needs not to provide old package */ int dosplitprovides; /* true: consider legacy split provides */ - solvable_kind limittokind; /* Callbacks for defining the bahaviour of the SAT solver */ -- 2.7.4