]> 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>
Fri, 18 Oct 2019 09:04:36 +0000 (11:04 +0200)
The status is usually 'stable', but can also be things like
'testing' or 'retracted'

ext/repo_updateinfoxml.c

index f3757272fdfbb848e619bddf09f904d675a0800a..984f491bb30a0c1b3ffd28ec8746658d21aaf10a 100644 (file)
@@ -220,7 +220,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"))
@@ -229,6 +229,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;
@@ -238,6 +240,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;