remove 'kind' handling ( will re-appear in applayer ;-) )
authorKlaus Kaempf <kkaempf@suse.de>
Fri, 15 Feb 2008 12:27:56 +0000 (12:27 +0000)
committerKlaus Kaempf <kkaempf@suse.de>
Fri, 15 Feb 2008 12:27:56 +0000 (12:27 +0000)
src/policy.c
src/pool.c
src/pooltypes.h
src/repo_solv.c
src/solvable.h
src/solver.c
src/solver.h

index 6280abb..4ce160d 100644 (file)
@@ -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)
index f16b724..6e02c0e 100644 (file)
 #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
  */
index f190959..9681f9d 100644 (file)
@@ -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
index e7ca7ee..176742f 100644 (file)
@@ -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)
index c11689f..785128d 100644 (file)
 
 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 */
index d678557..9e4ade6 100644 (file)
@@ -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);
index 35b7e8c..7b766b5 100644 (file)
@@ -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 */