Hello community,

here is the log from the commit of package libsolv for openSUSE:Factory checked 
in at 2014-07-16 16:49:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libsolv (Old)
 and      /work/SRC/openSUSE:Factory/.libsolv.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libsolv"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libsolv/libsolv.changes  2014-06-23 
11:06:23.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libsolv.new/libsolv.changes     2014-07-16 
16:49:17.000000000 +0200
@@ -1,0 +2,9 @@
+Tue Jul  8 14:13:40 CEST 2014 - [email protected]
+
+- expand solver_identical fix to applications [bnc#885830]
+- fix instbuddy generation code
+- improve autominimizing implementation to also look at
+  supplements
+- bump version to 0.6.4
+
+-------------------------------------------------------------------

Old:
----
  libsolv-0.6.3.tar.bz2

New:
----
  libsolv-0.6.4.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libsolv.spec ++++++
--- /var/tmp/diff_new_pack.WUBjgq/_old  2014-07-16 16:49:18.000000000 +0200
+++ /var/tmp/diff_new_pack.WUBjgq/_new  2014-07-16 16:49:18.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           libsolv
-Version:        0.6.3
+Version:        0.6.4
 Release:        0
 Url:            git://gitorious.org/opensuse/libsolv.git
 Source:         libsolv-%{version}.tar.bz2

++++++ libsolv-0.6.3.tar.bz2 -> libsolv-0.6.4.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.3/VERSION.cmake 
new/libsolv-0.6.4/VERSION.cmake
--- old/libsolv-0.6.3/VERSION.cmake     2014-06-13 12:21:20.000000000 +0200
+++ new/libsolv-0.6.4/VERSION.cmake     2014-07-08 14:16:15.000000000 +0200
@@ -49,5 +49,5 @@
 
 SET(LIBSOLV_MAJOR "0")
 SET(LIBSOLV_MINOR "6")
-SET(LIBSOLV_PATCH "3")
+SET(LIBSOLV_PATCH "4")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.3/bindings/solv.i 
new/libsolv-0.6.4/bindings/solv.i
--- old/libsolv-0.6.3/bindings/solv.i   2014-05-15 14:50:50.000000000 +0200
+++ new/libsolv-0.6.4/bindings/solv.i   2014-07-01 11:09:49.000000000 +0200
@@ -497,6 +497,9 @@
 #ifdef ENABLE_ARCHREPO
 #include "repo_arch.h"
 #endif
+#ifdef SUSE
+#include "repo_autopattern.h"
+#endif
 #include "solv_xfopen.h"
 
 /* for old ruby versions */
@@ -1604,6 +1607,11 @@
     return new_XSolvable($self->pool, repo_add_arch_pkg($self, name, flags));
   }
 #endif
+#ifdef SUSE
+  bool add_autopattern(int flags = 0) {
+    return repo_add_autopattern($self, flags) == 0;
+  }
+#endif
   void internalize() {
     repo_internalize($self);
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.3/package/libsolv.changes 
new/libsolv-0.6.4/package/libsolv.changes
--- old/libsolv-0.6.3/package/libsolv.changes   2014-06-13 12:21:20.000000000 
+0200
+++ new/libsolv-0.6.4/package/libsolv.changes   2014-07-08 14:16:15.000000000 
+0200
@@ -1,4 +1,13 @@
 -------------------------------------------------------------------
+Tue Jul  8 14:13:40 CEST 2014 - [email protected]
+
+- expand solver_identical fix to applications [bnc#885830]
+- fix instbuddy generation code
+- improve autominimizing implementation to also look at
+  supplements
+- bump version to 0.6.4
+
+-------------------------------------------------------------------
 Fri Jun 13 08:28:12 CEST 2014 - [email protected]
 
 - quick fix for [bnc#881320]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.3/src/policy.c 
new/libsolv-0.6.4/src/policy.c
--- old/libsolv-0.6.3/src/policy.c      2014-04-07 13:50:11.000000000 +0200
+++ new/libsolv-0.6.4/src/policy.c      2014-07-01 11:09:49.000000000 +0200
@@ -331,34 +331,14 @@
 
 #endif
 
-/*
- * prune to recommended/suggested packages.
- * does not prune installed packages (they are also somewhat recommended).
- */
 
-static void
-prune_to_recommended(Solver *solv, Queue *plist)
+void
+policy_update_recommendsmap(Solver *solv)
 {
   Pool *pool = solv->pool;
-  int i, j, k, ninst;
   Solvable *s;
   Id p, pp, rec, *recp, sug, *sugp;
 
-  ninst = 0;
-  if (pool->installed)
-    {
-      for (i = 0; i < plist->count; i++)
-       {
-         p = plist->elements[i];
-         s = pool->solvables + p;
-         if (pool->installed && s->repo == pool->installed)
-           ninst++;
-       }
-    }
-  if (plist->count - ninst < 2)
-    return;
-
-  /* update our recommendsmap/suggestsmap */
   if (solv->recommends_index < 0)
     {
       MAPZERO(&solv->recommendsmap);
@@ -424,6 +404,38 @@
            }
        }
     }
+}
+
+/*
+ * prune to recommended/suggested packages.
+ * does not prune installed packages (they are also somewhat recommended).
+ */
+
+static void
+prune_to_recommended(Solver *solv, Queue *plist)
+{
+  Pool *pool = solv->pool;
+  int i, j, k, ninst;
+  Solvable *s;
+  Id p;
+
+  ninst = 0;
+  if (pool->installed)
+    {
+      for (i = 0; i < plist->count; i++)
+       {
+         p = plist->elements[i];
+         s = pool->solvables + p;
+         if (pool->installed && s->repo == pool->installed)
+           ninst++;
+       }
+    }
+  if (plist->count - ninst < 2)
+    return;
+
+  /* update our recommendsmap/suggestsmap */
+  if (solv->recommends_index < solv->decisionq.count)
+    policy_update_recommendsmap(solv);
 
   /* prune to recommended/supplemented */
   ninst = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.3/src/policy.h 
new/libsolv-0.6.4/src/policy.h
--- old/libsolv-0.6.3/src/policy.h      2013-10-04 11:23:38.000000000 +0200
+++ new/libsolv-0.6.4/src/policy.h      2014-07-01 11:09:49.000000000 +0200
@@ -32,6 +32,7 @@
 extern int  policy_is_illegal(Solver *solv, Solvable *s1, Solvable *s2, int 
ignore);
 extern void policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, 
int allowall);
 extern const char *policy_illegal2str(Solver *solv, int illegal, Solvable *s, 
Solvable *rs);
+extern void policy_update_recommendsmap(Solver *solv);
 
 extern void policy_create_obsolete_index(Solver *solv);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.3/src/rules.c 
new/libsolv-0.6.4/src/rules.c
--- old/libsolv-0.6.3/src/rules.c       2014-04-22 18:20:45.000000000 +0200
+++ new/libsolv-0.6.4/src/rules.c       2014-07-08 14:16:15.000000000 +0200
@@ -496,9 +496,9 @@
         solv->instbuddy = solv_calloc(installed->end - installed->start, 
sizeof(Id));
       if (qr->count == 1)
         solv->instbuddy[s - pool->solvables - installed->start] = 
qr->elements[0];
-      for (i = 0; i < qp->count; i++)
+      for (i = 0; i < qr->count; i++)
        {
-         Id p = qp->elements[i];
+         Id p = qr->elements[i];
          if (pool->solvables[p].repo != installed)
            continue;   /* huh? */
          if (qp->count > 1 || (solv->instbuddy[p - installed->start] != 0 && 
solv->instbuddy[p - installed->start] != s - pool->solvables))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.3/src/solvable.c 
new/libsolv-0.6.4/src/solvable.c
--- old/libsolv-0.6.3/src/solvable.c    2014-06-13 12:21:20.000000000 +0200
+++ new/libsolv-0.6.4/src/solvable.c    2014-07-08 14:16:15.000000000 +0200
@@ -746,10 +746,6 @@
  * both solvables need to come from the same pool
  */
 
-#warning HOTFIX [Bug 881493] New: zypper dup does always update sles-release
-inline int isProduct(const char *name)
-{ return name && strncmp(name, "product:", 8) == 0; }
-
 int
 solvable_identical(Solvable *s1, Solvable *s2)
 {
@@ -763,12 +759,14 @@
   if (s1->evr != s2->evr)
     return 0;
 
-  if (isProduct(pool_id2str(s1->repo->pool, s1->name))) // HOTFIX [Bug 881493] 
end check for products here
-    return 1;
-
-  /* map missing vendor to empty string */
+  /* check vendor, map missing vendor to empty string */
   if ((s1->vendor ? s1->vendor : 1) != (s2->vendor ? s2->vendor : 1))
-    return 0;
+    {
+      /* workaround for bug 881493 */
+      if (s1->repo && !strncmp(pool_id2str(s1->repo->pool, s1->name), 
"product:", 8))
+       return 1;
+      return 0;
+    }
 
   /* looking good, try some fancier stuff */
   /* might also look up the package checksum here */
@@ -781,6 +779,13 @@
     }
   else
     {
+      if (s1->repo)
+       {
+          /* workaround for bugs 881493 and 885830*/
+         const char *n = pool_id2str(s1->repo->pool, s1->name);
+         if (!strncmp(n, "product:", 8) || !strncmp(n, "application:", 12))
+           return 1;
+       }
       /* look at requires in a last attempt to find recompiled packages */
       rq1 = rq2 = 0;
       if (s1->requires)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.3/src/solver.c 
new/libsolv-0.6.4/src/solver.c
--- old/libsolv-0.6.3/src/solver.c      2014-06-03 16:36:11.000000000 +0200
+++ new/libsolv-0.6.4/src/solver.c      2014-07-01 11:09:49.000000000 +0200
@@ -1242,11 +1242,13 @@
       solv->decisionq_why.count--;
       solv->propagate_index = solv->decisionq.count;
     }
-  while (solv->branches.count && solv->branches.elements[solv->branches.count 
- 1] <= -level)
+  while (solv->branches.count && solv->branches.elements[solv->branches.count 
- 1] >= level)
     {
       solv->branches.count--;
       while (solv->branches.count && 
solv->branches.elements[solv->branches.count - 1] >= 0)
        solv->branches.count--;
+      while (solv->branches.count && 
solv->branches.elements[solv->branches.count - 1] < 0)
+       solv->branches.count--;
     }
   if (solv->recommends_index > solv->decisionq.count)
     solv->recommends_index = -1;       /* rebuild recommends/suggests maps */
@@ -1457,9 +1459,10 @@
   if (dq->count > 1)
     {
       /* multiple candidates, open a branch */
+      queue_push(&solv->branches, -dq->elements[0]);
       for (i = 1; i < dq->count; i++)
        queue_push(&solv->branches, dq->elements[i]);
-      queue_push(&solv->branches, -level);
+      queue_push(&solv->branches, level);
     }
   p = dq->elements[0];
 
@@ -2672,9 +2675,10 @@
                      if (dq.count > 1)
                        {
                          /* multiple candidates, open a branch */
+                         queue_push(&solv->branches, -dq.elements[0]);
                          for (i = 1; i < dq.count; i++)
                            queue_push(&solv->branches, dq.elements[i]);
-                         queue_push(&solv->branches, -level);
+                         queue_push(&solv->branches, level);
                        }
                      p = dq.elements[0];
                      POOL_DEBUG(SOLV_DEBUG_POLICY, "installing recommended 
%s\n", pool_solvid2str(pool, p));
@@ -2801,31 +2805,45 @@
          solv->solution_callback(solv, solv->solution_callback_data);
          if (solv->branches.count)
            {
-             int i = solv->branches.count - 1;
-             int l = -solv->branches.elements[i];
+             int l, endi = 0;
              Id why;
-
-             for (; i > 0; i--)
-               if (solv->branches.elements[i - 1] < 0)
-                 break;
-             p = solv->branches.elements[i];
-             POOL_DEBUG(SOLV_DEBUG_SOLVER, "branching with %s\n", 
pool_solvid2str(pool, p));
-             queue_empty(&dq);
-             for (j = i + 1; j < solv->branches.count; j++)
-               queue_push(&dq, solv->branches.elements[j]);
-             solv->branches.count = i;
-             level = l;
-             revert(solv, level);
-             if (dq.count > 1)
-               for (j = 0; j < dq.count; j++)
-                 queue_push(&solv->branches, dq.elements[j]);
-             olevel = level;
-             why = -solv->decisionq_why.elements[solv->decisionq_why.count];
-             assert(why >= 0);
-             level = setpropagatelearn(solv, level, p, disablerules, why);
-             if (level == 0)
-               break;
-             continue;
+             p = l = 0;
+             for (i = solv->branches.count - 1; i >= 0; i--)
+               {
+                 p = solv->branches.elements[i];
+                 if (p > 0 && !l)
+                   {
+                     endi = i + 1;
+                     l = p;
+                   }
+                 else if (p > 0)
+                   break;
+                 else if (p < 0)
+                   l = 0;
+               }
+             if (i >= 0)
+               {
+                 while (i > 0 && solv->branches.elements[i - 1] > 0)
+                   i--;
+                 p = solv->branches.elements[i];
+                 solv->branches.elements[i] = -p;
+                 while (i > 0 && solv->branches.elements[i - 1] < 0)
+                   i--;
+                 POOL_DEBUG(SOLV_DEBUG_SOLVER, "branching with %s\n", 
pool_solvid2str(pool, p));
+                 queue_empty(&dq);
+                 queue_insertn(&dq, 0, endi - i, solv->branches.elements + i);
+                 level = l;
+                 revert(solv, level);
+                 queue_insertn(&solv->branches, solv->branches.count, 
dq.count, dq.elements);
+                 /* hack: revert simply sets the count, so we can still access 
the reverted elements */
+                 why = 
-solv->decisionq_why.elements[solv->decisionq_why.count];
+                 assert(why >= 0);
+                 olevel = level;
+                 level = setpropagatelearn(solv, level, p, disablerules, why);
+                 if (level == 0)
+                   break;
+                 continue;
+               }
            }
          /* all branches done, we're finally finished */
          break;
@@ -2834,31 +2852,78 @@
       /* auto-minimization step */
       if (solv->branches.count)
        {
-         int l = 0, lasti = -1, lastl = -1;
+         int l = 0, lasti = -1, lastsi = -1, endi = 0;
          Id why;
-
-         p = 0;
+         p = l = 0;
+         if (solv->recommends_index < solv->decisionq.count)
+           policy_update_recommendsmap(solv);
          for (i = solv->branches.count - 1; i >= 0; i--)
            {
              p = solv->branches.elements[i];
-             if (p < 0)
-               l = -p;
-             else if (p > 0 && solv->decisionmap[p] > l + 1)
+             if (p > 0 && !l)
+               {
+                 l = p;
+                 endi = i + 1;
+                 lastsi = -1;
+               }
+             else if (p > 0)
+               {
+                 if (solv->decisionmap[p] > l + 1)
+                   lasti = i;
+                 else
+                   {
+                     if (MAPTST(&solv->recommendsmap, p) || 
solver_is_supplementing(solv, pool->solvables + p))
+                       {
+                         lastsi = p;
+                       }
+                   }
+               }
+             else if (p < 0)
                {
-                 lasti = i;
-                 lastl = l;
+                 l = 0;
+                 if (lastsi >= 0)
+                   {
+                     p = -p;
+                     if (solv->decisionmap[p] == l)
+                       {
+                         if (!(MAPTST(&solv->recommendsmap, p) || 
solver_is_supplementing(solv, pool->solvables + p)))
+                           lasti = lastsi;
+                       }
+                   }
                }
            }
          if (lasti >= 0)
            {
-             /* kill old solvable so that we do not loop */
+             int starti;
+             /* find start of branch */
+             for (i = lasti; i && solv->branches.elements[i] >= 0; )
+               i--;
+             while (i > 0 && solv->branches.elements[i] < 0)
+               i--;
+             starti = i ? i + 1 : 0;
+#if 0
+             printf("minimization group level %d [%d-%d]:\n", 
solv->branches.elements[endi - 1], starti, endi);
+             for (i = starti; i < endi - 1; i++)
+               printf("%c %c%s\n", i == lasti ? 'x' : ' ', 
solv->branches.elements[i] >= 0 ? ' ' : '-', pool_solvid2str(pool, 
solv->branches.elements[i] >= 0 ? solv->branches.elements[i] : 
-solv->branches.elements[i]));
+#endif
+             l = solv->branches.elements[endi - 1];
              p = solv->branches.elements[lasti];
-             solv->branches.elements[lasti] = 0;
-             POOL_DEBUG(SOLV_DEBUG_SOLVER, "minimizing %d -> %d with %s\n", 
solv->decisionmap[p], lastl, pool_solvid2str(pool, p));
+             solv->branches.elements[lasti] = -p;
+             POOL_DEBUG(SOLV_DEBUG_SOLVER, "minimizing %d -> %d with %s\n", 
solv->decisionmap[p], l, pool_solvid2str(pool, p));
              minimizationsteps++;
-
-             level = lastl;
+             queue_empty(&dq);
+             for (i = starti; i < endi - 1; i++)
+               if (solv->branches.elements[i] < 0)
+                 queue_push(&dq, solv->branches.elements[i]);
+             for (i = starti; i < endi; i++)
+               if (solv->branches.elements[i] > 0)
+                 queue_push(&dq, solv->branches.elements[i]);
+             if (dq.elements[dq.count - 2] <= 0)
+               queue_empty(&dq);
+             level = l;
              revert(solv, level);
+             queue_insertn(&solv->branches, solv->branches.count, dq.count, 
dq.elements);
+             /* hack: revert simply sets the count, so we can still access the 
reverted elements */
              why = -solv->decisionq_why.elements[solv->decisionq_why.count];
              assert(why >= 0);
              olevel = level;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.3/tools/rpmmd2solv.c 
new/libsolv-0.6.4/tools/rpmmd2solv.c
--- old/libsolv-0.6.3/tools/rpmmd2solv.c        2013-03-20 11:31:29.000000000 
+0100
+++ new/libsolv-0.6.4/tools/rpmmd2solv.c        2014-07-01 11:09:49.000000000 
+0200
@@ -19,6 +19,9 @@
 #include "pool.h"
 #include "repo.h"
 #include "repo_rpmmd.h"
+#ifdef SUSE
+#include "repo_autopattern.h"
+#endif
 #include "common_write.h"
 #include "solv_xfopen.h"
 
@@ -44,11 +47,14 @@
   const char *basefile = 0;
   const char *dir = 0;
   const char *locale = 0;
+#ifdef SUSE
+  int add_auto = 0;
+#endif
   
   Pool *pool = pool_create();
   Repo *repo = repo_create(pool, "<stdin>");
 
-  while ((c = getopt (argc, argv, "hn:b:d:l:")) >= 0)
+  while ((c = getopt (argc, argv, "hn:b:d:l:X")) >= 0)
     {
       switch(c)
        {
@@ -67,6 +73,11 @@
        case 'l':
          locale = optarg;
          break;
+       case 'X':
+#ifdef SUSE
+         add_auto = 1;
+#endif
+         break;
         default:
           usage(1);
           break;
@@ -142,6 +153,10 @@
          exit(1);
        }
     }
+#ifdef SUSE
+  if (add_auto)
+    repo_add_autopattern(repo, 0);
+#endif
   tool_write(repo, basefile, attrname);
   pool_free(pool);
   exit(0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.3/tools/testsolv.c 
new/libsolv-0.6.4/tools/testsolv.c
--- old/libsolv-0.6.3/tools/testsolv.c  2014-01-23 14:25:52.000000000 +0100
+++ new/libsolv-0.6.4/tools/testsolv.c  2014-07-01 11:09:49.000000000 +0200
@@ -28,6 +28,37 @@
   exit(ex);
 }
 
+struct reportsolutiondata {
+  int count;
+  char *result;
+};
+
+static int
+reportsolutioncb(Solver *solv, void *cbdata)
+{
+  struct reportsolutiondata *sd = cbdata;
+  char *res;
+
+  sd->count++;
+  res = testcase_solverresult(solv, TESTCASE_RESULT_TRANSACTION);
+  if (*res)
+    {
+      char prefix[64];
+      char *p2, *p = res;
+      sprintf(prefix, "callback%d:", sd->count);
+      while ((p2 = strchr(p, '\n')) != 0)
+       {
+         char c = p2[1];
+         p2[1] = 0;
+         sd->result = solv_dupappend(sd->result, prefix, p);
+         p2[1] = c;
+         p = p2 + 1;
+       }
+    }
+  solv_free(res);
+  return 0;
+}
+
 int
 main(int argc, char **argv)
 {
@@ -40,6 +71,7 @@
   int debuglevel = 0;
   int writeresult = 0;
   int multijob = 0;
+  int rescallback = 0;
   int c;
   int ex = 0;
   const char *list = 0;
@@ -47,7 +79,7 @@
   const char *p;
 
   queue_init(&solq);
-  while ((c = getopt(argc, argv, "vrhl:s:")) >= 0)
+  while ((c = getopt(argc, argv, "vmrhl:s:")) >= 0)
     {
       switch (c)
       {
@@ -57,6 +89,9 @@
         case 'r':
           writeresult++;
           break;
+        case 'm':
+          rescallback = 1;
+          break;
         case 'h':
          usage(0);
           break;
@@ -124,10 +159,25 @@
          else if (result || writeresult)
            {
              char *myresult, *resultdiff;
+             struct reportsolutiondata reportsolutiondata;
+             memset(&reportsolutiondata, 0, sizeof(reportsolutiondata));
+             if (rescallback)
+               {
+                 solv->solution_callback = reportsolutioncb;
+                 solv->solution_callback_data = &reportsolutiondata;
+               }
              solver_solve(solv, &job);
+             solv->solution_callback = 0;
+             solv->solution_callback_data = 0;
              if (!resultflags)
                resultflags = TESTCASE_RESULT_TRANSACTION | 
TESTCASE_RESULT_PROBLEMS;
              myresult = testcase_solverresult(solv, resultflags);
+             if (rescallback && reportsolutiondata.result)
+               {
+                 reportsolutiondata.result = 
solv_dupjoin(reportsolutiondata.result, myresult, 0);
+                 solv_free(myresult);
+                 myresult = reportsolutiondata.result;
+               }
              if (writeresult)
                {
                  if (*myresult)

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to