- Parse RELEASE tag from contentfile (bnc #444978)
authorMichael Andres <ma@suse.de>
Mon, 17 Nov 2008 13:52:45 +0000 (13:52 +0000)
committerMichael Andres <ma@suse.de>
Mon, 17 Nov 2008 13:52:45 +0000 (13:52 +0000)
VERSION.cmake
package/libsatsolver.changes
tools/repo_content.c

index 23dee8a..39d1ae6 100644 (file)
@@ -46,6 +46,6 @@
 
 SET(LIBSATSOLVER_MAJOR "0")
 SET(LIBSATSOLVER_MINOR "12")
-SET(LIBSATSOLVER_PATCH "2")
+SET(LIBSATSOLVER_PATCH "3")
 
 # last released 0.12.2
index 12d1848..3569818 100644 (file)
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Mon Nov 17 14:30:08 CET 2008 - ma@suse.de
+
+- Parse RELEASE tag from contentfile (bnc #444978)
+- 0.12.3
+
+-------------------------------------------------------------------
 Fri Nov 14 18:00:19 CET 2008 - mls@suse.de
 
 - fix bugs in multiversion handling
index bc016e5..be0b5bb 100644 (file)
@@ -24,7 +24,8 @@
 #include "repo.h"
 #include "util.h"
 #include "repo_content.h"
-
+#define DISABLE_SPLIT
+#include "tools_util.h"
 
 /* split off a word, return null terminated pointer to it.
  * return NULL if there is no word left. */
@@ -50,16 +51,10 @@ struct parsedata {
   Repo *repo;
   char *tmp;
   int tmpl;
-};
-
 
-static Id
-makeevr(Pool *pool, char *s)
-{
-  if (!strncmp(s, "0:", 2) && s[2])
-    s += 2;
-  return str2id(pool, s, 1);
-}
+  const char *tmpvers;
+  const char *tmprel;
+};
 
 /*
  * dependency relations
@@ -322,7 +317,9 @@ repo_add_content(Repo *repo, FILE *fp, int flags)
            }
 
          if (istag ("VERSION"))
-           s->evr = makeevr(pool, value);
+            pd.tmpvers = strdup(value);
+          else if (istag ("RELEASE"))
+            pd.tmprel = strdup(value);
          else if (code11 && istag ("DISTRIBUTION"))
            repo_set_str(repo, s - pool->solvables, SOLVABLE_DISTRIBUTION, value);
          else if (istag ("DATADIR"))
@@ -416,6 +413,20 @@ repo_add_content(Repo *repo, FILE *fp, int flags)
       exit(1);
     }
 
+  if (pd.tmpvers)
+    {
+      if (pd.tmprel)
+        s->evr = makeevr(pool, join2(pd.tmpvers, "-", pd.tmprel));
+      else
+        s->evr = makeevr(pool, pd.tmpvers);
+    }
+  else if (pd.tmprel)
+    {
+      s->evr = makeevr(pool, join2("", "-", pd.tmprel));
+    }
+  pd.tmpvers = sat_free((void *)pd.tmpvers);
+  pd.tmprel = sat_free((void *)pd.tmprel);
+
   if (!s->arch)
     s->arch = ARCH_NOARCH;
   if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)