From e5964a745950472bde3600549a2e76ae009008b2 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Thu, 10 Sep 2020 15:17:12 +0200 Subject: [PATCH] Support SOLVABLE_BUILDHOST in rpm and rpmmd parsers Fixes issue #400 --- ext/repo_rpmdb.c | 3 +++ ext/repo_rpmmd.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index ed986281..67ce81da 100644 --- a/ext/repo_rpmdb.c +++ b/ext/repo_rpmdb.c @@ -1189,6 +1189,9 @@ rpmhead2solv(Pool *pool, Repo *repo, Repodata *data, Solvable *s, RpmHead *rpmhe u32 = headint32(rpmhead, TAG_BUILDTIME); if (u32) repodata_set_num(data, handle, SOLVABLE_BUILDTIME, u32); + str = headstring(rpmhead, TAG_BUILDHOST); + if (str) + repodata_set_str(data, handle, SOLVABLE_BUILDHOST, str); u32 = headint32(rpmhead, TAG_INSTALLTIME); if (u32) repodata_set_num(data, handle, SOLVABLE_INSTALLTIME, u32); diff --git a/ext/repo_rpmmd.c b/ext/repo_rpmmd.c index 9bb50a05..1232e433 100644 --- a/ext/repo_rpmmd.c +++ b/ext/repo_rpmmd.c @@ -96,6 +96,7 @@ enum state { STATE_FRESHENS, STATE_SOURCERPM, STATE_HEADERRANGE, + STATE_BUILDHOST, STATE_PROVIDESENTRY, STATE_REQUIRESENTRY, @@ -196,6 +197,7 @@ static struct solv_xmlparser_element stateswitches[] = { { STATE_SOLVABLE, "rpm:freshens", STATE_FRESHENS, 0 }, { STATE_SOLVABLE, "rpm:sourcerpm", STATE_SOURCERPM, 1 }, { STATE_SOLVABLE, "rpm:header-range", STATE_HEADERRANGE, 0 }, + { STATE_SOLVABLE, "rpm:buildhost", STATE_BUILDHOST, 1 }, { STATE_SOLVABLE, "file", STATE_FILE, 1 }, { STATE_SOLVABLE, "changelog", STATE_CHANGELOG, 1 }, @@ -1036,6 +1038,10 @@ endElement(struct solv_xmlparser *xmlp, int state, char *content) if (*content) repodata_set_poolstr(pd->data, handle, SOLVABLE_PACKAGER, content); break; + case STATE_BUILDHOST: + if (*content) + repodata_set_str(pd->data, handle, SOLVABLE_BUILDHOST, content); + break; case STATE_SOURCERPM: if (*content) repodata_set_sourcepkg(pd->data, handle, content); -- 2.47.2