Mailinglist Archive: zypp-commit (301 mails)

< Previous Next >
[zypp-commit] r7474 - in /trunk/sat-solver: src/solver.c testsuite/yps.c
  • From: mlschroe@xxxxxxxxxxxxxxxx
  • Date: Tue, 09 Oct 2007 15:47:42 -0000
  • Message-id: <20071009154742.5514C17455@xxxxxxxxxxxxxxxx>
Author: mlschroe
Date: Tue Oct  9 17:47:41 2007
New Revision: 7474

URL: http://svn.opensuse.org/viewcvs/zypp?rev=7474&view=rev
Log:
- do not select src packages in yps
- use some buffers to speed things up a bit

Modified:
    trunk/sat-solver/src/solver.c
    trunk/sat-solver/testsuite/yps.c

Modified: trunk/sat-solver/src/solver.c
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.c?rev=7474&r1=7473&r2=7474&view=diff
==============================================================================
--- trunk/sat-solver/src/solver.c (original)
+++ trunk/sat-solver/src/solver.c Tue Oct  9 17:47:41 2007
@@ -665,6 +665,7 @@
   Pool *pool = solv->pool;
   Source *system = solv->system;
   Queue q;
+  Id qbuf[64];
   int i;
   int dontfix;
   Id req, *reqp;
@@ -675,7 +676,7 @@
   Id *dp;
   Id n;
 
-  queueinit(&q);
+  queueinit_buffer(&q, qbuf, sizeof(qbuf)/sizeof(*qbuf));
   queuepush(&q, s - pool->solvables);   /* push solvable Id */
 
   while (q.count)
@@ -927,10 +928,10 @@
          while ((obs = *obsp++) != 0)  /* for all obsoletes */
            {
              FOR_PROVIDES(p2, pp2, obs)   /* and all matching providers of the obsoletes */
-             {
-               if (p2 == n)            /* match ! */
-                 break;
-             }
+               {
+                 if (p2 == n)          /* match ! */
+                   break;
+               }
              if (p2)                   /* match! */
                break;
            }
@@ -960,13 +961,14 @@
 {
   /* system packages get a special upgrade allowed rule */
   Pool *pool = solv->pool;
-  Id d, n;
+  Id p, d;
   Rule *r;
   Queue qs;
+  Id qsbuf[64];
 
-  queueinit(&qs);
+  queueinit_buffer(&qs, qsbuf, sizeof(qsbuf)/sizeof(*qsbuf));
   findupdatepackages(solv, s, &qs, m, allowdowngrade, allowarchchange);
-  n = s - pool->solvables;
+  p = s - pool->solvables;
   if (dontaddrule)     /* we consider update candidates but dont force them */
     {
       queuefree(&qs);
@@ -978,14 +980,14 @@
 #if 0
       printf("new update rule: must keep %s-%s.%s\n", id2str(pool, s->name), id2str(pool, s->evr), id2str(pool, s->arch));
 #endif
-      addrule(solv, n, 0);             /* request 'install' of s */
+      addrule(solv, p, 0);             /* request 'install' of s */
       queuefree(&qs);
       return;
     }
 
   d = pool_queuetowhatprovides(pool, &qs);   /* intern computed provider queue */
   queuefree(&qs);
-  r = addrule(solv, n, d);            /* allow update of s */
+  r = addrule(solv, p, d);            /* allow update of s */
 #if 0
   printf("new update rule ");
   if (r)
@@ -1637,7 +1639,6 @@
   solv->decisionmap = (Id *)xcalloc(pool->nsolvables, sizeof(Id));
   solv->rules = (Rule *)xmalloc((solv->nrules + (RULES_BLOCK + 1)) * sizeof(Rule));
   memset(solv->rules, 0, sizeof(Rule));
-
   solv->nrules = 1;
 
   return solv;

Modified: trunk/sat-solver/testsuite/yps.c
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/testsuite/yps.c?rev=7474&r1=7473&r2=7474&view=diff
==============================================================================
--- trunk/sat-solver/testsuite/yps.c (original)
+++ trunk/sat-solver/testsuite/yps.c Tue Oct  9 17:47:41 2007
@@ -32,6 +32,7 @@
   Id id;
   Queue plist;
   int i, end;
+  Solvable *s;
 
   id = str2id(pool, name, 1);
   queueinit( &plist);
@@ -39,7 +40,10 @@
   end = source ? source->start + source->nsolvables : pool->nsolvables;
   for (; i < end; i++)
     {
-      if (pool->solvables[i].name == id)
+      s = pool->solvables + i;
+      if (s->arch == ARCH_SRC || s->arch == ARCH_NOSRC)
+       continue;
+      if (s->name == id)
        queuepush(&plist, i);
     }
 

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages