Author: kkaempf Date: Tue Feb 19 13:08:12 2008 New Revision: 8801 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8801&view=rev Log: save patch timestamp as attribute Modified: trunk/sat-solver/tools/repo_patchxml.c Modified: trunk/sat-solver/tools/repo_patchxml.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_patchxml.c?... ============================================================================== --- trunk/sat-solver/tools/repo_patchxml.c (original) +++ trunk/sat-solver/tools/repo_patchxml.c Tue Feb 19 13:08:12 2008 @@ -134,9 +134,11 @@ int docontent; Pool *pool; Repo *repo; + Repodata *data; Solvable *solvable; char *kind; - + unsigned int timestamp; + struct stateswitch *swtab[NUMSTATES]; enum state sbtab[NUMSTATES]; char *tempstr; @@ -145,6 +147,8 @@ struct deltarpm delta; }; +static Id id_timestamp; + #if 0 static void append_str(struct parsedata *pd, const char *s) @@ -369,6 +373,15 @@ } break; case STATE_PATCH: + if (sw->from == STATE_START) + { + if ((str = find_attr("timestamp", atts))) + { + pd->timestamp = strtoul(str, NULL, 10); + fprintf(stderr, "timestamp %s [%d]\n", str, pd->timestamp); + } + } + /*FALLTHRU*/ case STATE_ATOM: if (pd->state == STATE_ATOM) { @@ -386,6 +399,14 @@ pd->kind = "patch"; pd->solvable = pool_id2solvable(pool, repo_add_solvable(pd->repo)); + + if (!strcmp(pd->kind, "patch")) + { + int solvnum = (pd->solvable - pool->solvables) - pd->repo->start; + if (pd->data) + repodata_extend(pd->data, pd->solvable - pool->solvables); + repodata_set_num(pd->data, solvnum, id_timestamp, pd->timestamp); + } #if 0 fprintf(stderr, "package #%d\n", pd->solvable - pool->solvables); #endif @@ -683,6 +704,9 @@ } pd.pool = pool; pd.repo = repo; + pd.data = repo_add_repodata(pd.repo); + id_timestamp = str2id(pool, "patch:timestamp", 1); + pd.content = malloc(256); pd.acontent = 256; pd.lcontent = 0; @@ -706,5 +730,8 @@ } XML_ParserFree(parser); + if (pd.data) + repodata_internalize(pd.data); + free(pd.content); } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org