diff options
author | Michael Andres <ma@suse.de> | 2010-03-11 22:20:39 +0100 |
---|---|---|
committer | Michael Andres <ma@suse.de> | 2010-03-11 22:22:43 +0100 |
commit | c7958161830f18034f7cae65efbf3fcbf6e26b97 (patch) | |
tree | 47621290c2ea8a86da70b2358becf95795473da4 /ext | |
parent | 3d0587cb800b29f45f24ca370c623834ac2e8de4 (diff) | |
download | libsolv-c7958161830f18034f7cae65efbf3fcbf6e26b97.tar.gz libsolv-c7958161830f18034f7cae65efbf3fcbf6e26b97.tar.bz2 libsolv-c7958161830f18034f7cae65efbf3fcbf6e26b97.zip |
parse global repository ids. [bnc#377568]
Diffstat (limited to 'ext')
-rw-r--r-- | ext/repo_content.c | 6 | ||||
-rw-r--r-- | ext/repo_repomdxml.c | 36 |
2 files changed, 27 insertions, 15 deletions
diff --git a/ext/repo_content.c b/ext/repo_content.c index 5fe8b9b..2a19223 100644 --- a/ext/repo_content.c +++ b/ext/repo_content.c @@ -280,6 +280,12 @@ repo_add_content(Repo *repo, FILE *fp, int flags) /* we also replicate some of them into the product solvables * to be backward compatible */ + if (istag ("REPOTAGS")) + { + repodata_add_poolstr_array(data, SOLVID_META, REPOSITORY_GLOBALID, value); + continue; + } + if (istag ("DESCRDIR")) { if (descrdir) diff --git a/ext/repo_repomdxml.c b/ext/repo_repomdxml.c index 915bf1e..18a080b 100644 --- a/ext/repo_repomdxml.c +++ b/ext/repo_repomdxml.c @@ -98,6 +98,7 @@ enum state { STATE_REPOMD, STATE_REVISION, STATE_TAGS, + STATE_REPO, STATE_CONTENT, STATE_DISTRO, STATE_UPDATES, @@ -123,25 +124,26 @@ static struct stateswitch stateswitches[] = { { STATE_START, "suseinfo", STATE_SUSEINFO, 0 }, /* we support the tags element in suseinfo in case createrepo version does not support it yet */ - { STATE_SUSEINFO, "tags", STATE_TAGS, 0 }, - { STATE_SUSEINFO, "expire", STATE_EXPIRE, 1 }, - { STATE_SUSEINFO, "keywords", STATE_KEYWORDS, 0 }, + { STATE_SUSEINFO, "tags", STATE_TAGS, 0 }, + { STATE_SUSEINFO, "expire", STATE_EXPIRE, 1 }, + { STATE_SUSEINFO, "keywords", STATE_KEYWORDS, 0 }, /* keywords is the suse extension equivalent of tags/content when this one was not yet available. - therefore we parse both */ - { STATE_KEYWORDS, "k", STATE_KEYWORD, 1 }, + therefore we parse both */ + { STATE_KEYWORDS, "k", STATE_KEYWORD, 1 }, /* standard tags */ { STATE_REPOMD, "revision", STATE_REVISION, 1 }, { STATE_REPOMD, "tags", STATE_TAGS, 0 }, { STATE_REPOMD, "data", STATE_DATA, 0 }, - - { STATE_TAGS, "content", STATE_CONTENT, 1 }, + + { STATE_TAGS, "repo", STATE_REPO, 1 }, + { STATE_TAGS, "content", STATE_CONTENT, 1 }, { STATE_TAGS, "distro", STATE_DISTRO, 1 }, /* this tag is only valid in suseinfo.xml for now */ { STATE_TAGS, "updates", STATE_UPDATES, 1 }, { STATE_DATA, "location", STATE_LOCATION, 0 }, - { STATE_DATA, "checksum", STATE_CHECKSUM, 1 }, + { STATE_DATA, "checksum", STATE_CHECKSUM, 1 }, { STATE_DATA, "timestamp", STATE_TIMESTAMP, 1 }, { STATE_DATA, "open-checksum", STATE_OPENCHECKSUM, 1 }, { NUMSTATES } @@ -159,7 +161,7 @@ struct parsedata { Pool *pool; Repo *repo; Repodata *data; - + XML_Parser *parser; struct stateswitch *swtab[NUMSTATES]; enum state sbtab[NUMSTATES]; @@ -214,7 +216,7 @@ startElement(void *userData, const char *name, const char **atts) for (sw = pd->swtab[pd->state]; sw->from == pd->state; sw++) /* find name in statetable */ if (!strcmp(sw->ename, name)) break; - + if (sw->from != pd->state) { #if 0 @@ -266,7 +268,7 @@ startElement(void *userData, const char *name, const char **atts) was designed for */ const char *cpeid = find_attr("cpeid", atts); pd->rphandle = repodata_new_handle(pd->data); - /* set the cpeid for the product + /* set the cpeid for the product the label is set in the content of the tag */ if (cpeid) repodata_set_poolstr(pd->data, pd->rphandle, REPOSITORY_PRODUCT_CPEID, cpeid); @@ -278,7 +280,7 @@ startElement(void *userData, const char *name, const char **atts) was designed for */ const char *cpeid = find_attr("cpeid", atts); pd->ruhandle = repodata_new_handle(pd->data); - /* set the cpeid for the product + /* set the cpeid for the product the label is set in the content of the tag */ if (cpeid) repodata_set_poolstr(pd->data, pd->ruhandle, REPOSITORY_PRODUCT_CPEID, cpeid); @@ -331,7 +333,7 @@ endElement(void *userData, const char *name) switch (pd->state) { case STATE_START: break; - case STATE_REPOMD: + case STATE_REPOMD: if (pd->timestamp > 0) repodata_set_num(pd->data, SOLVID_META, REPOSITORY_TIMESTAMP, pd->timestamp); break; @@ -412,16 +414,20 @@ endElement(void *userData, const char *name) repodata_set_str(pd->data, pd->ruhandle, REPOSITORY_PRODUCT_LABEL, pd->content); repodata_add_flexarray(pd->data, SOLVID_META, REPOSITORY_UPDATES, pd->ruhandle); break; + case STATE_REPO: + if (pd->content) + repodata_add_poolstr_array(pd->data, SOLVID_META, REPOSITORY_GLOBALID, pd->content); + break; case STATE_SUSEINFO: break; case STATE_KEYWORDS: break; - case NUMSTATES: break; + case NUMSTATES: break; default: break; } pd->state = pd->sbtab[pd->state]; pd->docontent = 0; - + return; } |