From: Michael Schroeder Date: Fri, 18 Oct 2019 09:04:36 +0000 (+0200) Subject: Parse the patch status in the updateinfo xml X-Git-Tag: 0.7.8~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6596f2e3281891e880446d481f98f81a6d2b377c;p=thirdparty%2Flibsolv.git Parse the patch status in the updateinfo xml The status is usually 'stable', but can also be things like 'testing' or 'retracted' --- diff --git a/ext/repo_updateinfoxml.c b/ext/repo_updateinfoxml.c index f3757272..984f491b 100644 --- a/ext/repo_updateinfoxml.c +++ b/ext/repo_updateinfoxml.c @@ -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;