Author: kkaempf Date: Fri Feb 15 13:27:56 2008 New Revision: 8712 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8712&view=rev Log: remove 'kind' handling ( will re-appear in applayer ;-) ) Modified: trunk/sat-solver/bindings/satsolver.i trunk/sat-solver/src/policy.c trunk/sat-solver/src/pool.c trunk/sat-solver/src/pooltypes.h trunk/sat-solver/src/repo_solv.c trunk/sat-solver/src/solvable.h trunk/sat-solver/src/solver.c trunk/sat-solver/src/solver.h Modified: trunk/sat-solver/bindings/satsolver.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/bindings/satsolver.i?rev=8712&r1=8711&r2=8712&view=diff ============================================================================== --- trunk/sat-solver/bindings/satsolver.i (original) +++ trunk/sat-solver/bindings/satsolver.i Fri Feb 15 13:27:56 2008 @@ -1256,14 +1256,6 @@ void set_allow_downgrade( int bflag ) { $self->allowdowngrade = bflag; } - solvable_kind limit_to_kind() - { return $self->limittokind; } -#if defined(SWIGRUBY) - %rename( "limit_to_kind=" ) set_limit_to_kind( solvable_kind kind ); -#endif - void set_limit_to_kind( solvable_kind kind ) - { $self->limittokind = kind; } - /* * On package removal, also remove dependant packages. * Modified: trunk/sat-solver/src/policy.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/policy.c?rev=8712&r1=8711&r2=8712&view=diff ============================================================================== --- trunk/sat-solver/src/policy.c (original) +++ trunk/sat-solver/src/policy.c Fri Feb 15 13:27:56 2008 @@ -75,28 +75,6 @@ /* - * 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 @@ 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) Modified: trunk/sat-solver/src/pool.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/pool.c?rev=8712&r1=8711&r2=8712&view=diff ============================================================================== --- trunk/sat-solver/src/pool.c (original) +++ trunk/sat-solver/src/pool.c Fri Feb 15 13:27:56 2008 @@ -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 */ Modified: trunk/sat-solver/src/pooltypes.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/pooltypes.h?rev=8712&r1=8711&r2=8712&view=diff ============================================================================== --- trunk/sat-solver/src/pooltypes.h (original) +++ trunk/sat-solver/src/pooltypes.h Fri Feb 15 13:27:56 2008 @@ -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 Modified: trunk/sat-solver/src/repo_solv.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/repo_solv.c?rev=8712&r1=8711&r2=8712&view=diff ============================================================================== --- trunk/sat-solver/src/repo_solv.c (original) +++ trunk/sat-solver/src/repo_solv.c Fri Feb 15 13:27:56 2008 @@ -560,7 +560,6 @@ 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 @@ 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) Modified: trunk/sat-solver/src/solvable.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solvable.h?rev=8712&r1=8711&r2=8712&view=diff ============================================================================== --- trunk/sat-solver/src/solvable.h (original) +++ trunk/sat-solver/src/solvable.h Fri Feb 15 13:27:56 2008 @@ -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 */ Modified: trunk/sat-solver/src/solver.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.c?rev=8712&r1=8711&r2=8712&view=diff ============================================================================== --- trunk/sat-solver/src/solver.c (original) +++ trunk/sat-solver/src/solver.c Fri Feb 15 13:27:56 2008 @@ -2116,16 +2116,6 @@ 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 @@ 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); Modified: trunk/sat-solver/src/solver.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.h?rev=8712&r1=8711&r2=8712&view=diff ============================================================================== --- trunk/sat-solver/src/solver.h (original) +++ trunk/sat-solver/src/solver.h Fri Feb 15 13:27:56 2008 @@ -121,7 +121,6 @@ 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 */ -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org