diff options
author | Michael Schroeder <mls@suse.de> | 2013-02-25 13:13:10 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2013-02-25 13:13:10 +0100 |
commit | d5458e958779f9d9785bef4c5ca93c20a6d1150a (patch) | |
tree | 0a32e29dd74b646f774a491eb6e4bc71befea70d | |
parent | 9479459e0d255af627f0310b2407b04d653fff3f (diff) | |
download | libsolv-d5458e958779f9d9785bef4c5ca93c20a6d1150a.tar.gz libsolv-d5458e958779f9d9785bef4c5ca93c20a6d1150a.tar.bz2 libsolv-d5458e958779f9d9785bef4c5ca93c20a6d1150a.zip |
add other.xml support to repomd parser
-rw-r--r-- | ext/repo_rpmmd.c | 18 | ||||
-rw-r--r-- | src/knownid.h | 4 |
2 files changed, 22 insertions, 0 deletions
diff --git a/ext/repo_rpmmd.c b/ext/repo_rpmmd.c index 81790a8..50e5a99 100644 --- a/ext/repo_rpmmd.c +++ b/ext/repo_rpmmd.c @@ -114,6 +114,8 @@ enum state { STATE_FILE, + STATE_CHANGELOG, + /* general */ NUMSTATES }; @@ -203,6 +205,7 @@ static struct stateswitch stateswitches[] = { { STATE_SOLVABLE, "rpm:sourcerpm", STATE_SOURCERPM, 1 }, { STATE_SOLVABLE, "rpm:header-range", STATE_HEADERRANGE, 0 }, { STATE_SOLVABLE, "file", STATE_FILE, 1 }, + { STATE_SOLVABLE, "changelog", STATE_CHANGELOG, 1 }, /* extended Novell/SUSE diskusage attributes (susedata.xml) */ { STATE_DISKUSAGE, "dirs", STATE_DIRS, 0 }, @@ -256,6 +259,8 @@ struct parsedata { char *lastdirstr; int lastdirstrl; + Id changelog_handle; + /** Hash to maps checksums to solv */ Stringpool cspool; /** Cache of known checksums to solvable id */ @@ -828,6 +833,13 @@ startElement(void *userData, const char *name, const char **atts) pd->ndirs++; break; } + case STATE_CHANGELOG: + pd->changelog_handle = repodata_new_handle(pd->data); + if ((str = find_attr("date", atts)) != 0) + repodata_set_num(pd->data, pd->changelog_handle, SOLVABLE_CHANGELOG_TIME, strtoull(str, 0, 10)); + if ((str = find_attr("author", atts)) != 0) + repodata_set_str(pd->data, pd->changelog_handle, SOLVABLE_CHANGELOG_AUTHOR, str); + break; default: break; } @@ -1039,6 +1051,12 @@ endElement(void *userData, const char *name) case STATE_ORDER: if (pd->content[0]) repodata_set_str(pd->data, pd->handle, SOLVABLE_ORDER, pd->content); + break; + case STATE_CHANGELOG: + repodata_set_str(pd->data, pd->changelog_handle, SOLVABLE_CHANGELOG_DESCRIPTION, pd->content); + repodata_add_flexarray(pd->data, pd->handle, SOLVABLE_CHANGELOG, pd->changelog_handle); + pd->changelog_handle = 0; + break; default: break; } diff --git a/src/knownid.h b/src/knownid.h index ad8b4a4..1b680ba 100644 --- a/src/knownid.h +++ b/src/knownid.h @@ -245,6 +245,10 @@ KNOWNID(SUSETAGS_SHARE_ARCH, "susetags:share:arch"), KNOWNID(ARCH_ANY, "any"), KNOWNID(REPOSITORY_REPOMD_SIZE, "repository:repomd:size"), +KNOWNID(SOLVABLE_CHANGELOG, "solvable:changelog"), +KNOWNID(SOLVABLE_CHANGELOG_AUTHOR, "solvable:changelog:author"), +KNOWNID(SOLVABLE_CHANGELOG_TIME, "solvable:changelog:time"), +KNOWNID(SOLVABLE_CHANGELOG_DESCRIPTION, "solvable:changelog:description"), KNOWNID(ID_NUM_INTERNAL, 0) |