Imported Upstream version 0.7.20
[platform/upstream/libsolv.git] / src / suse.c
index 6106f3f..2533af9 100644 (file)
@@ -211,7 +211,7 @@ repo_fix_supplements(Repo *repo, Offset provides, Offset supplements, Offset fre
 Offset
 repo_fix_conflicts(Repo *repo, Offset conflicts)
 {
-  char buf[1024], *p, *dep;
+  char buf[1024], *dep;
   Pool *pool = repo->pool;
   Id id;
   int i;
@@ -224,11 +224,10 @@ repo_fix_conflicts(Repo *repo, Offset conflicts)
       if (ISRELDEP(id))
        continue;
       dep = (char *)pool_id2str(pool, id);
-      if (!strncmp(dep, "otherproviders(", 15) && strlen(dep) < sizeof(buf) - 2)
+      if (!strncmp(dep, "otherproviders(", 15) && dep[15] && strlen(dep) < sizeof(buf) - 2)
        {
          strcpy(buf, dep + 15);
-         if ((p = strchr(buf, ')')) != 0)
-           *p = 0;
+         buf[strlen(buf) - 1] = 0;
          id = pool_str2id(pool, buf, 1);
          id = pool_rel2id(pool, NAMESPACE_OTHERPROVIDERS, id, REL_NAMESPACE, 1);
          repo->idarraydata[i] = id;
@@ -377,7 +376,11 @@ solvable_is_irrelevant_patch(Solvable *s, Map *installedmap)
   Pool *pool = s->repo->pool;
   Id con, *conp;
   int hadpatchpackage = 0;
+  const char *status;
 
+  status = solvable_lookup_str(s, UPDATE_STATUS);
+  if (status && !strcmp(status, "retracted"))
+    return 1;
   if (!s->conflicts)
     return 0;
   conp = s->repo->idarraydata + s->conflicts;