From: Duncan Mac-Vicar P Date: Wed, 22 Oct 2008 11:05:45 +0000 (+0000) Subject: add support for new tags X-Git-Tag: BASE-SuSE-Code-12_1-Branch~425 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=463b0e14da770020e3241e06850cac4bb1ad9630;p=platform%2Fupstream%2Flibsolv.git add support for new tags --- diff --git a/package/libsatsolver.changes b/package/libsatsolver.changes index 81cc1d8..0f0229d 100644 --- a/package/libsatsolver.changes +++ b/package/libsatsolver.changes @@ -6,6 +6,13 @@ Wed Oct 22 13:00:56 CEST 2008 - mls@suse.de - 0.12.0 ------------------------------------------------------------------- +Wed Oct 22 13:00:25 CEST 2008 - dmacvicar@suse.de + +- support the new standarized tags available in + createrepo > 0.9.6 + saving of the distro tag still missing. + +------------------------------------------------------------------- Thu Oct 16 00:50:47 CEST 2008 - mls@suse.de - make iterator work with completely empty repos [bnc#435838] diff --git a/src/knownid.h b/src/knownid.h index d74eb3e..8032387 100644 --- a/src/knownid.h +++ b/src/knownid.h @@ -183,6 +183,8 @@ KNOWNID(REPOSITORY_UPDATES, "repository:updates"), KNOWNID(REPOSITORY_PRODUCTS, "repository:products"), /* keyword (tags) for this repository */ KNOWNID(REPOSITORY_KEYWORDS, "repository:keywords"), +/* revision of the repository. arbitrary string */ +KNOWNID(REPOSITORY_REVISION, "repository:revision"), KNOWNID(DELTA_PACKAGE_NAME, "delta:pkgname"), KNOWNID(DELTA_PACKAGE_EVR, "delta:pkgevr"), diff --git a/tools/repo_repomdxml.c b/tools/repo_repomdxml.c index 05c10a6..2bb4fb0 100644 --- a/tools/repo_repomdxml.c +++ b/tools/repo_repomdxml.c @@ -24,42 +24,53 @@ /* - - -e9162516fa25fec8d60caaf4682d2e49967786cc -1215708444 -c796c48184cd5abc260e4ba929bdf01be14778a7 - - - -1c638295c49e9707c22810004ebb0799791fcf45 -1215708445 -54a40d5db3df0813b8acbe58cea616987eb9dc16 - - - -a81ef39eaa70e56048f8351055119d8c82af2491 -1215708447 -4d1ee867c8864025575a2fb8fde3b85371d51978 - - - -5880cfa5187026a24a552d3c0650904a44908c28 -1215708447 -7c964a2c3b17df5bfdd962c3be952c9ca6978d8b - - - -4097f7e25c7bb0770ae31b2471a9c8c077ee904b -1215708447 -24f8252f3dd041e37e7c3feb2d57e02b4422d316 - - - -4097f7e25c7bb0770ae31b2471a9c8c077ee904b -1215708447 -24f8252f3dd041e37e7c3feb2d57e02b4422d316 - + + + timestamp_or_arbitrary_user_supplied_string + + opensuse + i386 + other string + openSUSE 11.0 + + + + + + e9162516fa25fec8d60caaf4682d2e49967786cc + 1215708444 + c796c48184cd5abc260e4ba929bdf01be14778a7 + + + + 1c638295c49e9707c22810004ebb0799791fcf45 + 1215708445 + 54a40d5db3df0813b8acbe58cea616987eb9dc16 + + + + a81ef39eaa70e56048f8351055119d8c82af2491 + 1215708447 + 4d1ee867c8864025575a2fb8fde3b85371d51978 + + + + 5880cfa5187026a24a552d3c0650904a44908c28 + 1215708447 + 7c964a2c3b17df5bfdd962c3be952c9ca6978d8b + + + + 4097f7e25c7bb0770ae31b2471a9c8c077ee904b + 1215708447 + 24f8252f3dd041e37e7c3feb2d57e02b4422d316 + + + + 4097f7e25c7bb0770ae31b2471a9c8c077ee904b + 1215708447 + 24f8252f3dd041e37e7c3feb2d57e02b4422d316 + support also extension suseinfo format @@ -86,6 +97,10 @@ enum state { STATE_KEYWORD, /* normal repomd.xml */ STATE_REPOMD, + STATE_REVISION, + STATE_TAGS, + STATE_CONTENT, + STATE_DISTRO, STATE_DATA, STATE_LOCATION, STATE_CHECKSUM, @@ -109,10 +124,19 @@ static struct stateswitch stateswitches[] = { { STATE_SUSEINFO, "expire", STATE_EXPIRE, 1 }, { STATE_SUSEINFO, "products", STATE_PRODUCTS, 0 }, { STATE_SUSEINFO, "keywords", STATE_KEYWORDS, 0 }, - { STATE_PRODUCTS, "id", STATE_PRODUCT, 1 }, + { STATE_PRODUCTS, "id", STATE_PRODUCT, 1 }, + /* 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 }, /* 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, "distro", STATE_DISTRO, 1 }, + { STATE_DATA, "location", STATE_LOCATION, 0 }, { STATE_DATA, "checksum", STATE_CHECKSUM, 1 }, { STATE_DATA, "timestamp", STATE_TIMESTAMP, 1 }, @@ -223,6 +247,9 @@ startElement(void *userData, const char *name, const char **atts) case STATE_PRODUCT: break; case STATE_KEYWORDS: break; case STATE_KEYWORD: break; + case STATE_CONTENT: break; + case STATE_REVISION: break; + case STATE_DISTRO: break; case STATE_DATA: break; case STATE_LOCATION: break; case STATE_CHECKSUM: break; @@ -288,10 +315,17 @@ endElement(void *userData, const char *name) if (pd->content) repodata_add_poolstr_array(pd->data, SOLVID_META, REPOSITORY_PRODUCTS, pd->content); break; + /* repomd.xml content and suseinfo.xml keywords are equivalent */ + case STATE_CONTENT: case STATE_KEYWORD: if (pd->content) repodata_add_poolstr_array(pd->data, SOLVID_META, REPOSITORY_KEYWORDS, pd->content); break; + case STATE_REVISION: + if (pd->content) + repodata_add_poolstr_array(pd->data, SOLVID_META, REPOSITORY_REVISION, pd->content); + break; + case STATE_DISTRO: break; case STATE_SUSEINFO: break; case STATE_PRODUCTS: break; case STATE_KEYWORDS: break;