- allow <> dep in susetags, special case pattern: in packageand(), add SOLVER_TRANSAC...
authorMichael Schroeder <mls@suse.de>
Tue, 21 Feb 2012 12:46:19 +0000 (13:46 +0100)
committerMichael Schroeder <mls@suse.de>
Tue, 21 Feb 2012 12:46:19 +0000 (13:46 +0100)
ext/repo_susetags.c
ext/testcase.c
src/evr.c
src/repo.c
src/transaction.c
src/transaction.h

index 9e83572..1a55f65 100644 (file)
@@ -106,8 +106,13 @@ adddep(Pool *pool, struct parsedata *pd, unsigned int olddeps, char *line, Id ma
               break;
           if (flags == 6)
             {
-             pool_debug(pool, SOLV_FATAL, "susetags: unknown relation in %d: '%s'\n", pd->lineno, sp[1]);
-              exit(1);
+             if (!strcmp(sp[1], "<>"))
+               flags = 4;
+             else
+               {
+                 pool_debug(pool, SOLV_FATAL, "susetags: unknown relation in %d: '%s'\n", pd->lineno, sp[1]);
+                 exit(1);
+               }
             }
           id = pool_rel2id(pool, id, evrid, flags + 1, 1);
         }
index 6129657..287c2a6 100644 (file)
@@ -315,7 +315,7 @@ testcase_repoid2str(Pool *pool, Id repoid)
   else
     {
       char buf[20];
-      sprintf(buf, "@#%d", repoid);
+      sprintf(buf, "#%d", repoid);
       return pool_tmpjoin(pool, buf, 0, 0);
     }
 }
@@ -1229,7 +1229,7 @@ testcase_solverresult(Solver *solv, int resultflags)
       for (i = 0; class2str[i].str; i++)
        {
          queue_empty(&q);
-         transaction_classify_pkgs(trans, 0, class2str[i].class, 0, 0, &q);
+         transaction_classify_pkgs(trans, SOLVER_TRANSACTION_KEEP_PSEUDO, class2str[i].class, 0, 0, &q);
          for (j = 0; j < q.count; j++)
            {
              p = q.elements[j];
@@ -1589,20 +1589,23 @@ testcase_read(Pool *pool, FILE *fp, char *testcase, Queue *job, char **resultp,
            }
           repo->priority = prio;
           repo->subpriority = subprio;
-         rdata = pool_tmpjoin(pool, testcasedir, pieces[4], 0);
-          if ((rfp = solv_xfopen(rdata, "r")) == 0)
+         if (strcmp(pieces[3], "empty") != 0)
            {
-             pool_debug(pool, SOLV_ERROR, "testcase_read: could not open '%s'\n", rdata);
-           }
-         else if (!strcmp(pieces[3], "susetags"))
-           {
-             testcase_add_susetags(repo, rfp, 0);
-             fclose(rfp);
-           }
-         else
-           {
-             fclose(rfp);
-             pool_debug(pool, SOLV_ERROR, "testcase_read: unknown repo type for repo '%s'\n", repo->name);
+             rdata = pool_tmpjoin(pool, testcasedir, pieces[4], 0);
+             if ((rfp = solv_xfopen(rdata, "r")) == 0)
+               {
+                 pool_debug(pool, SOLV_ERROR, "testcase_read: could not open '%s'\n", rdata);
+               }
+             else if (!strcmp(pieces[3], "susetags"))
+               {
+                 testcase_add_susetags(repo, rfp, 0);
+                 fclose(rfp);
+               }
+             else
+               {
+                 fclose(rfp);
+                 pool_debug(pool, SOLV_ERROR, "testcase_read: unknown repo type for repo '%s'\n", repo->name);
+               }
            }
        }
       else if (!strcmp(pieces[0], "system") && npieces >= 3)
index 4942d40..c8cc940 100644 (file)
--- a/src/evr.c
+++ b/src/evr.c
@@ -166,6 +166,8 @@ pool_evrcmp_str(const Pool *pool, const char *evr1, const char *evr2, int mode)
       s1 = evr1;
       s2 = evr2;
     }
+
+  /* compare the epoch */
   if (s1 == evr1 || *s1 != ':')
     s1 = 0;
   if (s2 == evr2 || *s2 != ':')
@@ -197,6 +199,8 @@ pool_evrcmp_str(const Pool *pool, const char *evr1, const char *evr2, int mode)
        return -1;
       evr2 = s2 + 1;
     }
+
+  /* same epoch, now split into version/release */
   for (s1 = evr1, r1 = 0; *s1; s1++)
     if (*s1 == '-')
       r1 = s1;
index b61bd0c..4cda481 100644 (file)
@@ -714,6 +714,13 @@ repo_fix_supplements(Repo *repo, Offset provides, Offset supplements, Offset fre
                      dep = p + 1;
                      continue;
                    }
+                 /* argh, allow pattern: prefix. sigh */
+                 if (p - dep == 7 && !strncmp(dep, "pattern", 7))
+                   {
+                     p = strchr(p + 1, ':');
+                     if (!p)
+                       break;
+                   }
                  *p++ = 0;
                  idp = pool_str2id(pool, dep, 1);
                  if (id)
index aa6d77c..d0db631 100644 (file)
@@ -205,16 +205,18 @@ transaction_type(Transaction *trans, Id p, int mode)
   Queue oq, rq;
   Id type, q;
   int i, j, ref = 0;
-  const char *n;
 
   if (!s->repo)
     return SOLVER_TRANSACTION_IGNORE;
 
-  n = pool_id2str(pool, s->name);
-  if (!strncmp(n, "patch:", 6))
-    return SOLVER_TRANSACTION_IGNORE;
-  if (!strncmp(n, "pattern:", 8))
-    return SOLVER_TRANSACTION_IGNORE;
+  if (!(mode & SOLVER_TRANSACTION_KEEP_PSEUDO))
+    {
+      const char *n = pool_id2str(pool, s->name);
+      if (!strncmp(n, "patch:", 6))
+       return SOLVER_TRANSACTION_IGNORE;
+      if (!strncmp(n, "pattern:", 8))
+       return SOLVER_TRANSACTION_IGNORE;
+    }
 
   type = transaction_base_type(trans, p);
 
index 2b55331..c9f9343 100644 (file)
@@ -75,6 +75,8 @@ typedef struct _Transaction {
 
 #define SOLVER_TRANSACTION_RPM_ONLY            (1 << 7)
 
+#define SOLVER_TRANSACTION_KEEP_PSEUDO         (1 << 8)
+
 /* extra classifications */
 #define SOLVER_TRANSACTION_ARCHCHANGE          0x100
 #define SOLVER_TRANSACTION_VENDORCHANGE                0x101