From: Michael Andres Date: Mon, 17 Nov 2008 13:52:45 +0000 (+0000) Subject: - Parse RELEASE tag from contentfile (bnc #444978) X-Git-Tag: BASE-SuSE-Code-12_1-Branch~308^2~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4549a011b7644de6ab6abaeac561eabe213968d;p=thirdparty%2Flibsolv.git - Parse RELEASE tag from contentfile (bnc #444978) --- diff --git a/VERSION.cmake b/VERSION.cmake index 23dee8ac..39d1ae63 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -46,6 +46,6 @@ SET(LIBSATSOLVER_MAJOR "0") SET(LIBSATSOLVER_MINOR "12") -SET(LIBSATSOLVER_PATCH "2") +SET(LIBSATSOLVER_PATCH "3") # last released 0.12.2 diff --git a/package/libsatsolver.changes b/package/libsatsolver.changes index 12d1848f..35698185 100644 --- a/package/libsatsolver.changes +++ b/package/libsatsolver.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Nov 17 14:30:08 CET 2008 - ma@suse.de + +- Parse RELEASE tag from contentfile (bnc #444978) +- 0.12.3 + ------------------------------------------------------------------- Fri Nov 14 18:00:19 CET 2008 - mls@suse.de diff --git a/tools/repo_content.c b/tools/repo_content.c index bc016e55..be0b5bbf 100644 --- a/tools/repo_content.c +++ b/tools/repo_content.c @@ -24,7 +24,8 @@ #include "repo.h" #include "util.h" #include "repo_content.h" - +#define DISABLE_SPLIT +#include "tools_util.h" /* split off a word, return null terminated pointer to it. * return NULL if there is no word left. */ @@ -50,16 +51,10 @@ struct parsedata { Repo *repo; char *tmp; int tmpl; -}; - -static Id -makeevr(Pool *pool, char *s) -{ - if (!strncmp(s, "0:", 2) && s[2]) - s += 2; - return str2id(pool, s, 1); -} + const char *tmpvers; + const char *tmprel; +}; /* * dependency relations @@ -322,7 +317,9 @@ repo_add_content(Repo *repo, FILE *fp, int flags) } if (istag ("VERSION")) - s->evr = makeevr(pool, value); + pd.tmpvers = strdup(value); + else if (istag ("RELEASE")) + pd.tmprel = strdup(value); else if (code11 && istag ("DISTRIBUTION")) repo_set_str(repo, s - pool->solvables, SOLVABLE_DISTRIBUTION, value); else if (istag ("DATADIR")) @@ -416,6 +413,20 @@ repo_add_content(Repo *repo, FILE *fp, int flags) exit(1); } + if (pd.tmpvers) + { + if (pd.tmprel) + s->evr = makeevr(pool, join2(pd.tmpvers, "-", pd.tmprel)); + else + s->evr = makeevr(pool, pd.tmpvers); + } + else if (pd.tmprel) + { + s->evr = makeevr(pool, join2("", "-", pd.tmprel)); + } + pd.tmpvers = sat_free((void *)pd.tmpvers); + pd.tmprel = sat_free((void *)pd.tmprel); + if (!s->arch) s->arch = ARCH_NOARCH; if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)