]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Parse the patch status in the updateinfo xml
authorMichael Schroeder <mls@suse.de>
Fri, 18 Oct 2019 09:04:36 +0000 (11:04 +0200)
committerMichael Schroeder <mls@suse.de>
Thu, 20 May 2021 09:35:08 +0000 (11:35 +0200)
The status is usually 'stable', but can also be things like
'testing' or 'retracted'

ext/repo_updateinfoxml.c

index 7ba006251545293676f340fc4876021cf634deed..dc54ffb258eb28b32aeb424a29a4d868c4fc50cb 100644 (file)
@@ -217,7 +217,7 @@ startElement(struct solv_xmlparser *xmlp, int state, const char *name, const cha
        */
     case STATE_UPDATE:
       {
-       const char *from = 0, *type = 0, *version = 0;
+       const char *from = 0, *type = 0, *version = 0, *status = 0;
        for (; *atts; atts += 2)
          {
            if (!strcmp(*atts, "from"))
@@ -226,6 +226,8 @@ startElement(struct solv_xmlparser *xmlp, int state, const char *name, const cha
              type = atts[1];
            else if (!strcmp(*atts, "version"))
              version = atts[1];
+           else if (!strcmp(*atts, "status"))
+             status = atts[1];
          }
        solvable = pd->solvable = pool_id2solvable(pool, repo_add_solvable(pd->repo));
        pd->handle = pd->solvable - pool->solvables;
@@ -235,6 +237,8 @@ startElement(struct solv_xmlparser *xmlp, int state, const char *name, const cha
        solvable->arch = ARCH_NOARCH;
        if (type)
          repodata_set_str(pd->data, pd->handle, SOLVABLE_PATCHCATEGORY, type);
+       if (status)
+         repodata_set_poolstr(pd->data, pd->handle, UPDATE_STATUS, status);
         pd->buildtime = (time_t)0;
       }
       break;