Mailinglist Archive: zypp-commit (301 mails)

< Previous Next >
[zypp-commit] r7546 - in /trunk/sat-solver/src: solver.c source.c source.h
  • From: mlschroe@xxxxxxxxxxxxxxxx
  • Date: Wed, 17 Oct 2007 13:19:20 -0000
  • Message-id: <20071017131921.15B2623E2D@xxxxxxxxxxxxxxxx>
Author: mlschroe
Date: Wed Oct 17 15:19:20 2007
New Revision: 7546

URL: http://svn.opensuse.org/viewcvs/zypp?rev=7546&view=rev
Log:
- inline source_name function
- fix dependency resolving loop to restart on any action
- fix supplement rule creation, it did not work for complex
  (i.e. AND) supplements

Modified:
    trunk/sat-solver/src/solver.c
    trunk/sat-solver/src/source.c
    trunk/sat-solver/src/source.h

Modified: trunk/sat-solver/src/solver.c
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/solver.c?rev=7546&r1=7545&r2=7546&view=diff
==============================================================================
--- trunk/sat-solver/src/solver.c (original)
+++ trunk/sat-solver/src/solver.c Wed Oct 17 15:19:20 2007
@@ -107,6 +107,32 @@
   return 0;
 }
 
+static inline int
+dep_possible(Solver *solv, Id dep, Map *m)
+{
+  Pool *pool = solv->pool;
+  Id p, *pp;
+
+  if (ISRELDEP(dep))
+    {
+      Reldep *rd = GETRELDEP(pool, dep);
+      if (rd->flags == REL_AND)
+       {
+         if (!dep_possible(solv, rd->name, m))
+           return 0;
+         return dep_possible(solv, rd->evr, m);
+       }
+      if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_INSTALLED)
+       return dep_installed(solv, rd->evr);
+    }
+  FOR_PROVIDES(p, pp, dep)
+    {
+      if (MAPTST(m, p))
+       return 1;
+    }
+  return 0;
+}
+
 /*
  * prune_to_recommended
  *
@@ -876,7 +902,6 @@
   Pool *pool = solv->pool;
   Solvable *s;
   Id sup, *supp;
-  Id p, *pp;
   int i, n;
 
   if (pool->verbose) printf("addrulesforsupplements... (%d)\n", solv->nrules);
@@ -893,27 +918,13 @@
        continue;
       sup = 0;
       if ((supp = s->supplements) != 0)
-       {
-         while ((sup = *supp++) != ID_NULL)
-           {
-             FOR_PROVIDES(p, pp, sup)
-               if (MAPTST(m, p))
-                 break;
-             if (p)
-               break;
-           }
-       }
+       while ((sup = *supp++) != ID_NULL)
+         if (dep_possible(solv, sup, m))
+           break;
       if (!sup && (supp = s->freshens) != 0)
-       {
-         while ((sup = *supp++) != ID_NULL)
-           {
-             FOR_PROVIDES(p, pp, sup)
-               if (MAPTST(m, p))
-                 break;
-             if (p)
-               break;
-           }
-       }
+       while ((sup = *supp++) != ID_NULL)
+         if (dep_possible(solv, sup, m))
+           break;
       if (!sup)
        continue;
       addrulesforsolvable(solv, s, m);
@@ -2078,8 +2089,7 @@
            }
          if (level < systemlevel)
            break;
-         if (level <= olevel)
-           n = 0;
+         n = 0;
        } /* for(), decide */
 
       if (n != solv->nrules)        /* continue if level < systemlevel */

Modified: trunk/sat-solver/src/source.c
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/source.c?rev=7546&r1=7545&r2=7546&view=diff
==============================================================================
--- trunk/sat-solver/src/source.c (original)
+++ trunk/sat-solver/src/source.c Wed Oct 17 15:19:20 2007
@@ -16,16 +16,6 @@
 
 #define IDARRAY_BLOCK     4095
 
-/*
- * get name of source
- */
-
-const char *
-source_name(const Source *source)
-{
-  return source->name;
-}
-
 
 /*
  * create empty source

Modified: trunk/sat-solver/src/source.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/source.h?rev=7546&r1=7545&r2=7546&view=diff
==============================================================================
--- trunk/sat-solver/src/source.h (original)
+++ trunk/sat-solver/src/source.h Wed Oct 17 15:19:20 2007
@@ -28,5 +28,9 @@
 
 extern Source *pool_addsource_empty(Pool *pool);
 
-extern const char *source_name(const Source *source);
+static inline const char *source_name(const Source *source)
+{
+  return source->name;
+}
+
 #endif /* SOURCE_H */

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

< Previous Next >
This Thread
  • No further messages