Imported Upstream version 0.7.1 upstream/0.7.1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 10 Sep 2019 06:38:40 +0000 (15:38 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 10 Sep 2019 06:38:40 +0000 (15:38 +0900)
NEWS
README
VERSION.cmake
ext/repo_autopattern.c
package/libsolv.changes
src/repo_write.c

diff --git a/NEWS b/NEWS
index 16b79a8..1416a16 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@
 This file contains the major changes between
 libsolv versions:
 
+Version 0.7.1
+- fix nasty off-by-one error in repo_write
+
 Version 0.7.0
 - soname bump to "1"
 - incompatible API changes:
diff --git a/README b/README
index 243486a..db680c4 100644 (file)
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
 This is libsolv, a free package dependency solver using a satisfiability
 algorithm.
 
-This code is based on two major, but independent, blocks:
+The code is based on two major, but independent, blocks:
 
  1. Using a dictionary approach to store and retrieve package
     and dependency information.
@@ -16,12 +16,14 @@ problems. It also takes advantage of the repository storage to
 minimize memory usage.
 
 Supported package formats:
+
   - rpm/rpm5
   - deb
   - arch linux
   - haiku
 
 Supported repository formats:
+
   - rpmmd (primary, filelists, comps, deltainfo/presto, updateinfo)
   - susetags, suse product formats
   - mandriva/mageia (synthesis, info, files)
@@ -29,13 +31,16 @@ Supported repository formats:
   - red carpet helix format
   - haiku
 
+Build instructions
+==================
+
 Requires: cmake 2.4.x
 
-mkdir build
-cd build
-cmake ..
-make
+    mkdir build
+    cd build
+    cmake ..
+    make
 
-To create a package:
-make srcpackage
-see package/
+////
+vim: syntax=asciidoc
+////
index 6ed2c6f..bd4e5e6 100644 (file)
@@ -49,5 +49,5 @@ SET(LIBSOLVEXT_SOVERSION "1")
 
 SET(LIBSOLV_MAJOR "0")
 SET(LIBSOLV_MINOR "7")
-SET(LIBSOLV_PATCH "0")
+SET(LIBSOLV_PATCH "1")
 
index f6e1004..4c09e79 100644 (file)
@@ -82,6 +82,33 @@ datestr2timestamp(const char *date)
   return timegm(&tm);
 }
 
+/* we just look at the repodata keys and do not iterate
+ * over the solvables, because iterating would mean a
+ * load of stub repodata areas */
+static void
+find_langkeys(Repo *repo, Id keyname, Queue *q)
+{
+  Pool *pool = repo->pool;
+  int rid;
+  int i;
+  const char *keyname_str;
+  size_t keyname_len;
+
+  keyname_str = pool_id2str(pool, keyname);
+  keyname_len = strlen(keyname_str);
+  queue_empty(q);
+  for (rid = 1; rid < repo->nrepodata; rid++)
+    {
+      Repodata *data = repo_id2repodata(repo, rid);
+      for (i = 1; i < data->nkeys; i++)
+       {
+         const char *s = pool_id2str(pool, data->keys[i].name);
+         if (!strncmp(s, keyname_str, keyname_len) && s[keyname_len] == ':')
+           queue_pushunique(q, data->keys[i].name);
+       }
+    }
+}
+
 int
 repo_add_autopattern(Repo *repo, int flags)
 {
@@ -94,6 +121,7 @@ repo_add_autopattern(Repo *repo, int flags)
   Id pattern_id, product_id;
   Id autopattern_id = 0, autoproduct_id = 0;
   int i, j;
+  Queue categorykeys;
 
   queue_init(&patq);
   queue_init(&patq2);
@@ -105,6 +133,8 @@ repo_add_autopattern(Repo *repo, int flags)
 
   pattern_id = pool_str2id(pool, "pattern()", 9);
   product_id = pool_str2id(pool, "product()", 9);
+
+  queue_init(&categorykeys);
   FOR_REPO_SOLVABLES(repo, p, s)
     {
       const char *n = pool_id2str(pool, s->name);
@@ -159,6 +189,11 @@ repo_add_autopattern(Repo *repo, int flags)
              }
        }
     }
+  if (patq2.count)
+    {
+      find_langkeys(repo, SOLVABLE_CATEGORY, &categorykeys);
+      queue_unshift(&categorykeys, SOLVABLE_CATEGORY);
+    }
   for (i = 0; i < patq2.count; i += 2)
     {
       const char *pn = 0;
@@ -273,9 +308,17 @@ repo_add_autopattern(Repo *repo, int flags)
                repodata_set_str(data, s2 - pool->solvables, SOLVABLE_ISVISIBLE, newname);
            }
        }
+      /* also try to copy the pattern category from the solvable */
+      for (j = 0; j < categorykeys.count; j++)
+       {
+         Id catkey = categorykeys.elements[j];
+         if ((str = solvable_lookup_str(s, catkey)) != 0)
+           repodata_set_str(data, s2 - pool->solvables, catkey, str);
+       }
     }
   queue_free(&patq);
   queue_free(&patq2);
+  queue_free(&categorykeys);
 
   if ((flags & ADD_NO_AUTOPRODUCTS) != 0)
     queue_empty(&prdq2);
index 6146e99..5467ee3 100644 (file)
@@ -1,4 +1,12 @@
 -------------------------------------------------------------------
+Wed Oct 31 13:50:22 CET 2018 - mls@suse.de
+
+- fix nasty off-by-one error in repo_write
+- also copy pattern categories from the rpm that defines the
+  pattern [fate#323785]
+- bump version to 0.7.1
+
+-------------------------------------------------------------------
 Wed Oct 24 10:48:56 CEST 2018 - mls@suse.de
 
 - new repowriter interface
index a975cec..d3b8a83 100644 (file)
@@ -1637,7 +1637,7 @@ for (i = 1; i < target.nkeys; i++)
       /* we have some relations with a non-zero need */
       Reldep *rd;
 
-      for (rd = pool->rels + i; i > 1; i--, rd--)
+      for (rd = pool->rels + i; i > 0; i--, rd--)
        {
          int need = needid[reloff + i].need;
          if (!need)