Hello community,

here is the log from the commit of package libsolv for openSUSE:Factory checked 
in at 2014-04-25 11:33:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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-04-13 
13:13:36.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libsolv.new/libsolv.changes     2014-04-25 
11:33:41.000000000 +0200
@@ -1,0 +2,9 @@
+Thu Apr 17 14:47:42 CEST 2014 - m...@suse.de
+
+- support BREAK_ORPHANS and KEEP_ORPHANS solver flags
+- adapt to AppStream 0.6
+- reduce memory usage in repo_write and repodata_internalize
+- make repodata_stringify return the result string
+- bump version to 0.6.1
+
+-------------------------------------------------------------------

Old:
----
  libsolv-0.6.0.tar.bz2

New:
----
  libsolv-0.6.1.tar.bz2

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

Other differences:
------------------
++++++ libsolv.spec ++++++
--- /var/tmp/diff_new_pack.aZtVY8/_old  2014-04-25 11:33:42.000000000 +0200
+++ /var/tmp/diff_new_pack.aZtVY8/_new  2014-04-25 11:33:42.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           libsolv
-Version:        0.6.0
+Version:        0.6.1
 Release:        0
 Url:            git://gitorious.org/opensuse/libsolv.git
 Source:         libsolv-%{version}.tar.bz2

++++++ libsolv-0.6.0.tar.bz2 -> libsolv-0.6.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.0/VERSION.cmake 
new/libsolv-0.6.1/VERSION.cmake
--- old/libsolv-0.6.0/VERSION.cmake     2014-04-07 15:45:11.000000000 +0200
+++ new/libsolv-0.6.1/VERSION.cmake     2014-04-17 14:50:44.000000000 +0200
@@ -49,5 +49,5 @@
 
 SET(LIBSOLV_MAJOR "0")
 SET(LIBSOLV_MINOR "6")
-SET(LIBSOLV_PATCH "0")
+SET(LIBSOLV_PATCH "1")
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.0/ext/repo_appdata.c 
new/libsolv-0.6.1/ext/repo_appdata.c
--- old/libsolv-0.6.0/ext/repo_appdata.c        2014-03-05 15:50:54.000000000 
+0100
+++ new/libsolv-0.6.1/ext/repo_appdata.c        2014-04-17 11:25:45.000000000 
+0200
@@ -62,7 +62,9 @@
 /* !! must be sorted by first column !! */
 static struct stateswitch stateswitches[] = {
   { STATE_START,       "applications",  STATE_START,         0 },
+  { STATE_START,       "components",    STATE_START,         0 },
   { STATE_START,       "application",   STATE_APPLICATION,   0 },
+  { STATE_START,       "component",     STATE_APPLICATION,   0 },
   { STATE_APPLICATION, "id",            STATE_ID,            1 },
   { STATE_APPLICATION, "pkgname",       STATE_PKGNAME,       1 },
   { STATE_APPLICATION, "product_license", STATE_LICENCE,     1 },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.0/ext/repo_content.c 
new/libsolv-0.6.1/ext/repo_content.c
--- old/libsolv-0.6.0/ext/repo_content.c        2014-03-12 15:35:49.000000000 
+0100
+++ new/libsolv-0.6.1/ext/repo_content.c        2014-04-16 14:00:44.000000000 
+0200
@@ -408,7 +408,6 @@
                }
              /* create new solvable */
              s = pool_id2solvable(pool, repo_add_solvable(repo));
-             repodata_extend(data, s - pool->solvables);
              handle = s - pool->solvables;
              s->name = pool_str2id(pool, join(&pd, "product", ":", value), 1);
              if (datadir)
@@ -425,7 +424,6 @@
          if (!s)
            {
              s = pool_id2solvable(pool, repo_add_solvable(repo));
-             repodata_extend(data, s - pool->solvables);
              handle = s - pool->solvables;
            }
 
@@ -546,7 +544,6 @@
       for (i = 0; i < numotherarchs; ++i)
        {
          Solvable *p = pool_id2solvable(pool, repo_add_solvable(repo));
-         repodata_extend(data, p - pool->solvables);
          p->name = s->name;
          p->evr = s->evr;
          p->vendor = s->vendor;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.0/ext/repo_rpmdb.c 
new/libsolv-0.6.1/ext/repo_rpmdb.c
--- old/libsolv-0.6.0/ext/repo_rpmdb.c  2014-04-07 13:07:13.000000000 +0200
+++ new/libsolv-0.6.1/ext/repo_rpmdb.c  2014-04-15 18:15:59.000000000 +0200
@@ -1045,6 +1045,7 @@
   DB_ENV *dbenv;       /* database environment */
   DB *db;              /* packages database */
   int byteswapped;     /* endianess of packages database */
+  int is_ostree;       /* read-only db that lives in /usr/share/rpm */
 };
 
 struct rpmdbentry {
@@ -1135,6 +1136,10 @@
   snprintf(dbpath, PATH_MAX, "%s/var/lib/rpm", rootdir ? rootdir : "");
   if (access(dbpath, W_OK) == -1)
     {
+      snprintf(dbpath, PATH_MAX, "%s/usr/share/rpm/Packages", rootdir ? 
rootdir : "");
+      if (access(dbpath, R_OK) == 0)
+       state->is_ostree = 1;
+      snprintf(dbpath, PATH_MAX, "%s%s", rootdir ? rootdir : "", 
state->is_ostree ? "/usr/share/rpm" : "/var/lib/rpm");
       r = dbenv->open(dbenv, dbpath, DB_CREATE|DB_PRIVATE|DB_INIT_MPOOL, 0);
     }
   else
@@ -1448,7 +1453,7 @@
   DBT dbkey;
   DBT dbdata;
 
-  snprintf(dbpath, PATH_MAX, "%s/var/lib/rpm/Name", state->rootdir ? 
state->rootdir : "");
+  snprintf(dbpath, PATH_MAX, "%s%s/Name", state->rootdir ? state->rootdir : 
"", state->is_ostree ? "/usr/share/rpm" : "/var/lib/rpm");
   if (stat(dbpath, &statbuf))
     return 0;
   memset(&dbkey, 0, sizeof(dbkey));
@@ -1766,7 +1771,7 @@
     }
 
   /* XXX: should get ro lock of Packages database! */
-  snprintf(dbpath, PATH_MAX, "%s/var/lib/rpm/Packages", state.rootdir ? 
state.rootdir : "");
+  snprintf(dbpath, PATH_MAX, "%s%s/Packages", state.rootdir ? state.rootdir : 
"", state.is_ostree ? "/usr/share/rpm" : "/var/lib/rpm");
   if (stat(dbpath, &packagesstat))
     {
       pool_error(pool, -1, "%s: %s", dbpath, strerror(errno));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.0/ext/repo_zyppdb.c 
new/libsolv-0.6.1/ext/repo_zyppdb.c
--- old/libsolv-0.6.0/ext/repo_zyppdb.c 2014-03-05 15:50:54.000000000 +0100
+++ new/libsolv-0.6.1/ext/repo_zyppdb.c 2014-04-16 14:00:44.000000000 +0200
@@ -161,7 +161,6 @@
        /* parse 'type' */
        const char *type = find_attr("type", atts);
        s = pd->solvable = pool_id2solvable(pool, repo_add_solvable(pd->repo));
-       repodata_extend(pd->data, s - pool->solvables);
        pd->handle = s - pool->solvables;
        if (type)
          repodata_set_str(pd->data, pd->handle, PRODUCT_TYPE, type);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.0/ext/testcase.c 
new/libsolv-0.6.1/ext/testcase.c
--- old/libsolv-0.6.0/ext/testcase.c    2014-04-07 12:55:11.000000000 +0200
+++ new/libsolv-0.6.1/ext/testcase.c    2014-04-16 15:20:44.000000000 +0200
@@ -102,6 +102,8 @@
   { SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE,       "dupallowarchchange", 1 },
   { SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE,     "dupallowvendorchange", 1 },
   { SOLVER_FLAG_DUP_ALLOW_NAMECHANGE,       "dupallownamechange", 1 },
+  { SOLVER_FLAG_KEEP_ORPHANS,               "keeporphans", 0 },
+  { SOLVER_FLAG_BREAK_ORPHANS,              "breakorphans", 0 },
   { 0, 0, 0 }
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.0/package/libsolv.changes 
new/libsolv-0.6.1/package/libsolv.changes
--- old/libsolv-0.6.0/package/libsolv.changes   2014-04-07 15:45:11.000000000 
+0200
+++ new/libsolv-0.6.1/package/libsolv.changes   2014-04-17 14:50:44.000000000 
+0200
@@ -1,4 +1,13 @@
 -------------------------------------------------------------------
+Thu Apr 17 14:47:42 CEST 2014 - m...@suse.de
+
+- support BREAK_ORPHANS and KEEP_ORPHANS solver flags
+- adapt to AppStream 0.6
+- reduce memory usage in repo_write and repodata_internalize
+- make repodata_stringify return the result string
+- bump version to 0.6.1
+
+-------------------------------------------------------------------
 Mon Apr  7 15:36:07 CEST 2014 - m...@suse.de
 
 - add support for sha224/sha384/sha512
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.0/src/pool.c new/libsolv-0.6.1/src/pool.c
--- old/libsolv-0.6.0/src/pool.c        2014-02-18 13:10:52.000000000 +0100
+++ new/libsolv-0.6.1/src/pool.c        2014-04-14 19:10:44.000000000 +0200
@@ -1296,8 +1296,6 @@
 
 struct searchfiles {
   Id *ids;
-  char **dirs;
-  char **names;
   int nfiles;
   Map seen;
 };
@@ -1308,7 +1306,7 @@
 pool_addfileprovides_dep(Pool *pool, Id *ida, struct searchfiles *sf, struct 
searchfiles *isf)
 {
   Id dep, sid;
-  const char *s, *sr;
+  const char *s;
   struct searchfiles *csf;
 
   while ((dep = *ida++) != 0)
@@ -1366,16 +1364,7 @@
       if (csf != isf && pool->addedfileprovides == 1 && 
!repodata_filelistfilter_matches(0, s))
        continue;       /* skip non-standard locations csf == isf: installed 
case */
       csf->ids = solv_extend(csf->ids, csf->nfiles, 1, sizeof(Id), 
SEARCHFILES_BLOCK);
-      csf->dirs = solv_extend(csf->dirs, csf->nfiles, 1, sizeof(const char *), 
SEARCHFILES_BLOCK);
-      csf->names = solv_extend(csf->names, csf->nfiles, 1, sizeof(const char 
*), SEARCHFILES_BLOCK);
-      csf->ids[csf->nfiles] = dep;
-      sr = strrchr(s, '/');
-      csf->names[csf->nfiles] = solv_strdup(sr + 1);
-      csf->dirs[csf->nfiles] = solv_malloc(sr - s + 1);
-      if (sr != s)
-        strncpy(csf->dirs[csf->nfiles], s, sr - s);
-      csf->dirs[csf->nfiles][sr - s] = 0;
-      csf->nfiles++;
+      csf->ids[csf->nfiles++] = dep;
     }
 }
 
@@ -1401,6 +1390,19 @@
   if (!cbd->useddirs.size)
     {
       map_init(&cbd->useddirs, data->dirpool.ndirs + 1);
+      if (!cbd->dirs)
+       {
+         cbd->dirs = solv_malloc2(cbd->nfiles, sizeof(char *));
+         cbd->names = solv_malloc2(cbd->nfiles, sizeof(char *));
+         for (i = 0; i < cbd->nfiles; i++)
+           {
+             char *s = solv_strdup(pool_id2str(data->repo->pool, cbd->ids[i]));
+             cbd->dirs[i] = s;
+             s = strrchr(s, '/');
+             *s = 0;
+             cbd->names[i] = s + 1;
+           }
+       }
       for (i = 0; i < cbd->nfiles; i++)
        {
          Id did;
@@ -1419,15 +1421,8 @@
   if (value->id >= data->dirpool.ndirs || !MAPTST(&cbd->useddirs, value->id))
     return 0;
   for (i = 0; i < cbd->nfiles; i++)
-    {
-      if (cbd->dids[i] != value->id)
-       continue;
-      if (!strcmp(cbd->names[i], value->str))
-       break;
-    }
-  if (i == cbd->nfiles)
-    return 0;
-  s->provides = repo_addid_dep(s->repo, s->provides, cbd->ids[i], 
SOLVABLE_FILEMARKER);
+    if (cbd->dids[i] == value->id && !strcmp(cbd->names[i], value->str))
+      s->provides = repo_addid_dep(s->repo, s->provides, cbd->ids[i], 
SOLVABLE_FILEMARKER);
   return 0;
 }
 
@@ -1448,8 +1443,8 @@
 
   cbd->nfiles = sf->nfiles;
   cbd->ids = sf->ids;
-  cbd->dirs = sf->dirs;
-  cbd->names = sf->names;
+  cbd->dirs = 0;
+  cbd->names = 0;
   cbd->dids = solv_realloc2(cbd->dids, sf->nfiles, sizeof(Id));
   map_init(&cbd->providedids, pool->ss.nstrings);
 
@@ -1553,6 +1548,13 @@
   map_free(&donemap);
   queue_free(&fileprovidesq);
   map_free(&cbd->providedids);
+  if (cbd->dirs)
+    {
+      for (i = 0; i < cbd->nfiles; i++)
+       solv_free(cbd->dirs[i]);
+      cbd->dirs = solv_free(cbd->dirs);
+      cbd->names = solv_free(cbd->names);
+    }
 }
 
 void
@@ -1616,13 +1618,6 @@
         for (i = 0; i < sf.nfiles; i++)
          queue_push(idqinst, sf.ids[i]);
       solv_free(sf.ids);
-      for (i = 0; i < sf.nfiles; i++)
-       {
-         solv_free(sf.dirs[i]);
-         solv_free(sf.names[i]);
-       }
-      solv_free(sf.dirs);
-      solv_free(sf.names);
     }
   if (isf.nfiles)
     {
@@ -1636,13 +1631,6 @@
         for (i = 0; i < isf.nfiles; i++)
          queue_pushunique(idqinst, isf.ids[i]);
       solv_free(isf.ids);
-      for (i = 0; i < isf.nfiles; i++)
-       {
-         solv_free(isf.dirs[i]);
-         solv_free(isf.names[i]);
-       }
-      solv_free(isf.dirs);
-      solv_free(isf.names);
     }
   solv_free(cbd.dids);
   pool_freewhatprovides(pool); /* as we have added provides */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.0/src/problems.c 
new/libsolv-0.6.1/src/problems.c
--- old/libsolv-0.6.0/src/problems.c    2014-04-04 18:50:12.000000000 +0200
+++ new/libsolv-0.6.1/src/problems.c    2014-04-17 14:20:44.000000000 +0200
@@ -160,6 +160,10 @@
        continue;
       solver_enablerule(solv, r);
     }
+  /* make sure broken orphan rules stay disabled */
+  if (solv->brokenorphanrules)
+    for (i = 0; i < solv->brokenorphanrules->count; i++)
+      solver_disablerule(solv, solv->rules + 
solv->brokenorphanrules->elements[i]);
 }
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.0/src/repodata.c 
new/libsolv-0.6.1/src/repodata.c
--- old/libsolv-0.6.0/src/repodata.c    2014-04-08 19:10:14.000000000 +0200
+++ new/libsolv-0.6.1/src/repodata.c    2014-04-16 14:00:44.000000000 +0200
@@ -2102,6 +2102,7 @@
     return;
   if (!data->incoreoffset)
     {
+      /* this also means that data->attrs is NULL */
       data->incoreoffset = solv_calloc_block(num, sizeof(Id), REPODATA_BLOCK);
       data->start = start;
       data->end = start + num;
@@ -2812,6 +2813,10 @@
   Id *tmpattrs;
   if (!data->attrs || dest == src)
     return;
+  if (dest < data->start || dest >= data->end)
+    repodata_extend(data, dest);
+  if (src < data->start || src >= data->end)
+    repodata_extend(data, src);
   tmpattrs = data->attrs[dest - data->start];
   data->attrs[dest - data->start] = data->attrs[src - data->start];
   data->attrs[src - data->start] = tmpattrs;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.0/src/rules.c 
new/libsolv-0.6.1/src/rules.c
--- old/libsolv-0.6.0/src/rules.c       2014-04-04 16:30:12.000000000 +0200
+++ new/libsolv-0.6.1/src/rules.c       2014-04-17 14:20:44.000000000 +0200
@@ -1246,6 +1246,13 @@
     }
 #endif
 
+  if (!allow_all && !p && solv->dupmap_all)
+    {
+      queue_push(&solv->orphaned, s - pool->solvables);                /* an 
orphaned package */
+      if (solv->keep_orphans)
+       p = s - pool->solvables;
+    }
+
   if (!allow_all && qs.count && solv->multiversion.size)
     {
       int i, j;
@@ -1286,7 +1293,7 @@
                }
              if (j == 0 && p == -SYSTEMSOLVABLE && solv->dupmap_all)
                {
-                 queue_push(&solv->orphaned, s - pool->solvables);     /* 
treat as orphaned */
+                 queue_push(&solv->orphaned, s - pool->solvables);     /* also 
treat as orphaned */
                  j = qs.count;
                }
              qs.count = j;
@@ -4322,4 +4329,96 @@
   map_free(&cleandepsmap);
 }
 
-/* EOF */
+
+void
+solver_breakorphans(Solver *solv)
+{
+  Pool *pool = solv->pool;
+  Repo *installed = solv->installed;
+  int i, rid;
+  Map m;
+
+  if (!installed || solv->droporphanedmap_all)
+    return;
+  solv->brokenorphanrules = solv_calloc(1, sizeof(Queue));
+  queue_init(solv->brokenorphanrules);
+  map_init(&m, installed->end - installed->start);
+  for (i = 0; i < solv->orphaned.count; i++)
+    {
+      Id p = solv->orphaned.elements[i];
+      if (pool->solvables[p].repo != installed)
+       continue;
+      if (solv->droporphanedmap.size && MAPTST(&solv->droporphanedmap, p - 
installed->start))
+       continue;
+      MAPSET(&m, p - installed->start);
+    }
+  for (rid = 1; rid < solv->rpmrules_end ; rid++)
+    {
+      Id p, *dp;
+      Rule *r = solv->rules + rid;
+      /* ignore non-deps and simple conflicts */
+      if (r->p >= 0 || ((r->d == 0 || r->d == -1) && r->w2 < 0))
+       continue;
+      p = -r->p;
+      if (p < installed->start || p >= installed->end || !MAPTST(&m, p - 
installed->start))
+       {
+         /* need to check other literals */
+         if (r->d == 0 || r->d == -1)
+           continue;
+         for (dp = pool->whatprovidesdata + (r->d < 0 ? -r->d - 1 : r->d); *dp 
< 0; dp++)
+           {
+             p = -*dp;
+             if (p >= installed->start && p < installed->end && MAPTST(&m, p - 
installed->start))
+               break;
+           }
+         if (*dp >= 0)
+           continue;
+       }
+      /* ok, disable this rule */
+      queue_push(solv->brokenorphanrules, rid);
+      if (r->d >= 0)
+       solver_disablerule(solv, r);
+    }
+  map_free(&m);
+  if (!solv->brokenorphanrules->count)
+    {
+      queue_free(solv->brokenorphanrules);
+      solv->brokenorphanrules = solv_free(solv->brokenorphanrules);
+    }
+}
+
+void
+solver_check_brokenorphanrules(Solver *solv, Queue *dq)
+{
+  Pool *pool = solv->pool;
+  int i;
+  Id l, pp;
+  
+  queue_empty(dq);
+  if (!solv->brokenorphanrules)
+    return;
+  for (i = 0; i < solv->brokenorphanrules->count; i++)
+    {
+      int rid = solv->brokenorphanrules->elements[i];
+      Rule *r = solv->rules + rid;
+      FOR_RULELITERALS(l, pp, r)
+       {
+         if (l < 0)
+           {
+             if (solv->decisionmap[-l] <= 0)
+               break;
+           }
+         else
+           {
+             if (solv->decisionmap[l] > 0 && pool->solvables[l].repo != 
solv->installed)
+               break;
+           }
+       }
+      if (l)
+       continue;
+      FOR_RULELITERALS(l, pp, r)
+        if (l > 0 && solv->decisionmap[l] == 0 && pool->solvables[l].repo != 
solv->installed)
+         queue_pushunique(dq, l);
+    }
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.0/src/rules.h 
new/libsolv-0.6.1/src/rules.h
--- old/libsolv-0.6.0/src/rules.h       2013-10-14 17:26:33.000000000 +0200
+++ new/libsolv-0.6.1/src/rules.h       2014-04-17 14:20:44.000000000 +0200
@@ -142,6 +142,9 @@
 extern Id   solver_rule2solvable(struct _Solver *solv, Id rid);
 extern void solver_rule2rules(struct _Solver *solv, Id rid, Queue *q, int 
recursive);
 
+/* orphan handling */
+extern void solver_breakorphans(struct _Solver *solv);
+extern void solver_check_brokenorphanrules(struct _Solver *solv, Queue *dq);
 
 #ifdef __cplusplus
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.0/src/solver.c 
new/libsolv-0.6.1/src/solver.c
--- old/libsolv-0.6.0/src/solver.c      2014-04-04 18:50:12.000000000 +0200
+++ new/libsolv-0.6.1/src/solver.c      2014-04-17 14:20:44.000000000 +0200
@@ -1573,6 +1573,7 @@
   queuep_free(&solv->installsuppdepq);
   queuep_free(&solv->recommendscplxq);
   queuep_free(&solv->suggestscplxq);
+  queuep_free(&solv->brokenorphanrules);
 
   map_free(&solv->recommendsmap);
   map_free(&solv->suggestsmap);
@@ -1639,6 +1640,10 @@
     return solv->dup_allowarchchange;
   case SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE:
     return solv->dup_allowvendorchange;
+  case SOLVER_FLAG_KEEP_ORPHANS:
+    return solv->keep_orphans;
+  case SOLVER_FLAG_BREAK_ORPHANS:
+    return solv->break_orphans;
   default:
     break;
   }
@@ -1702,6 +1707,12 @@
   case SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE:
     solv->dup_allowvendorchange = value;
     break;
+  case SOLVER_FLAG_KEEP_ORPHANS:
+    solv->keep_orphans = value;
+    break;
+  case SOLVER_FLAG_BREAK_ORPHANS:
+    solv->break_orphans = value;
+    break;
   default:
     break;
   }
@@ -2677,6 +2688,26 @@
                break;
              continue;         /* back to main loop */
            }
+          if (solv->brokenorphanrules)
+           {
+             solver_check_brokenorphanrules(solv, &dq);
+             if (dq.count)
+               {
+                 policy_filter_unwanted(solv, &dq, POLICY_MODE_CHOOSE);
+                 for (i = 0; i < dq.count; i++)
+                   {
+                     p = dq.elements[i];
+                     POOL_DEBUG(SOLV_DEBUG_POLICY, "installing orphaned dep 
%s\n", pool_solvid2str(pool, p));
+                     olevel = level;
+                     level = setpropagatelearn(solv, level, p, 0, 0);
+                     if (level < olevel)
+                       break;
+                   }
+                 if (level == 0)
+                   break;
+                 continue;
+               }
+           }
        }
 
      /* one final pass to make sure we decided all installed packages */
@@ -3293,6 +3324,7 @@
       queuep_free(&solv->suggestscplxq);
       solv->recommends_index = 0;
     }
+  queuep_free(&solv->brokenorphanrules);
   solv->specialupdaters = solv_free(solv->specialupdaters);
 
 
@@ -3574,20 +3606,16 @@
           * check for and remove duplicate
           */
          r = solv->rules + solv->nrules - 1;           /* r: update rule */
+          if (!r->p)
+           continue;
          sr = r - (installed->end - installed->start); /* sr: feature rule */
-         /* it's orphaned if there is no feature rule or the feature rule
-           * consists just of the installed package */
-         if (!sr->p || (sr->p == i && !sr->d && !sr->w2))
+         /* it's also orphaned if the feature rule consists just of the 
installed package */
+         if (!solv->dupmap_all && sr->p == i && !sr->d && !sr->w2)
            queue_push(&solv->orphaned, i);
-          if (!r->p)
-           {
-             /* assert(solv->dupmap_all && !sr->p); */
-             continue;
-           }
          if (!solver_rulecmp(solv, r, sr))
            memset(sr, 0, sizeof(*sr));         /* delete unneeded feature rule 
*/
          else
-           solver_disablerule(solv, sr);       /* disable feature rule */
+           solver_disablerule(solv, sr);       /* disable feature rule for now 
*/
        }
       /* consistency check: we added a rule for _every_ installed solvable */
       assert(solv->nrules - solv->updaterules == installed->end - 
installed->start);
@@ -3874,6 +3902,10 @@
   /* disable update rules that conflict with our job */
   solver_disablepolicyrules(solv);
 
+  /* break orphans if requested */
+  if (solv->dupmap_all && solv->orphaned.count && solv->break_orphans)
+    solver_breakorphans(solv);
+
   /* make initial decisions based on assertion rules */
   makeruledecisions(solv);
   POOL_DEBUG(SOLV_DEBUG_SOLVER, "problems so far: %d\n", solv->problems.count);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libsolv-0.6.0/src/solver.h 
new/libsolv-0.6.1/src/solver.h
--- old/libsolv-0.6.0/src/solver.h      2014-04-04 18:50:12.000000000 +0200
+++ new/libsolv-0.6.1/src/solver.h      2014-04-17 14:20:44.000000000 +0200
@@ -185,6 +185,9 @@
 
   Queue addedmap_deduceq;              /* deduce addedmap from rpm rules */
   Id *instbuddy;                       /* buddies of installed packages */
+  int keep_orphans;                    /* how to treat orphans */
+  int break_orphans;                   /* how to treat orphans */
+  Queue *brokenorphanrules;            /* broken rules of orphaned packages */
 #endif /* LIBSOLV_INTERNAL */
 };
 
@@ -282,6 +285,8 @@
 #define SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE       15
 #define SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE     16
 #define SOLVER_FLAG_DUP_ALLOW_NAMECHANGE       17
+#define SOLVER_FLAG_KEEP_ORPHANS               18
+#define SOLVER_FLAG_BREAK_ORPHANS              19
 
 #define GET_USERINSTALLED_NAMES                        (1 << 0)        /* 
package names instead if ids */
 #define GET_USERINSTALLED_INVERTED             (1 << 1)        /* 
autoinstalled */

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to