From: Duncan Mac-Vicar P Date: Fri, 12 Sep 2008 13:12:33 +0000 (+0000) Subject: start to parse missing urls (blocker :-( ) X-Git-Tag: BASE-SuSE-Code-12_1-Branch~512 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2215f667f3369ca66edc11819a92e61db8c5f15c;p=platform%2Fupstream%2Flibsolv.git start to parse missing urls (blocker :-( ) --- diff --git a/src/knownid.h b/src/knownid.h index afe9125..b8c6902 100644 --- a/src/knownid.h +++ b/src/knownid.h @@ -150,10 +150,12 @@ KNOWNID(PRODUCT_SHORTLABEL, "product:shortlabel"), KNOWNID(PRODUCT_DISTPRODUCT, "product:distproduct"), KNOWNID(PRODUCT_DISTVERSION, "product:distversion"), KNOWNID(PRODUCT_TYPE, "product:type"), -KNOWNID(PRODUCT_RELNOTESURL, "product:relnotesurl"), -KNOWNID(PRODUCT_UPDATEURLS, "product:updateurls"), -KNOWNID(PRODUCT_EXTRAURLS, "product:extraurls"), -KNOWNID(PRODUCT_OPTIONALURLS, "product:optionalurls"), +KNOWNID(PRODUCT_URL, "product:url"), +KNOWNID(PRODUCT_URL_TYPE, "product:url:type"), +KNOWNID(PRODUCT_URL_TYPE_SMOLT, "product:url:type:smolt"), +KNOWNID(PRODUCT_URL_TYPE_RELNOTES, "product:url:type:relnotes"), +KNOWNID(PRODUCT_URL_TYPE_EXTRA, "product:url:type:extra"), +KNOWNID(PRODUCT_URL_TYPE_OPTIONAL, "product:url:type:optional"), KNOWNID(PRODUCT_FLAGS, "product:flags"), KNOWNID(PRODUCT_FLAVOR, "product:flavor"), KNOWNID(PRODUCT_REFERENCES, "product:references"), diff --git a/tools/repo_products.c b/tools/repo_products.c index a781caa..6b58826 100644 --- a/tools/repo_products.c +++ b/tools/repo_products.c @@ -115,12 +115,12 @@ struct parsedata { struct stateswitch *swtab[NUMSTATES]; enum state sbtab[NUMSTATES]; - const char *attribute; /* only print this attribute, if currentproduct == baseproduct */ const char *tmplang; const char *tmpvers; const char *tmprel; + const char *tmpurltype; Solvable *s; Id handle; @@ -237,6 +237,9 @@ startElement(void *userData, const char *name, const char **atts) case STATE_DESCRIPTION: pd->tmplang = find_attr("lang", atts, 1); break; + case STATE_URL: + pd->tmpurltype = find_attr("name", atts, 1); + break; default: break; } @@ -300,6 +303,13 @@ endElement(void *userData, const char *name) pd->tmplang = 0; } break; + case STATE_URL: + if (pd->tmpurltype) + { + repodata_add_poolstr_array(pd->data, pd->handle, PRODUCT_URL, pd->content); + repodata_add_poolstr_array(pd->data, pd->handle, PRODUCT_URL_TYPE, pd->content); + } + break; case STATE_TARGET: if (currentproduct == baseproduct && pd->attribute