From: Michael Schroeder Date: Thu, 22 Mar 2012 17:34:45 +0000 (+0100) Subject: - check distepoch tag if rpm5 is used X-Git-Tag: BASE-SuSE-Code-12_2-Branch~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18f4ce311222033a9a134e8b3cf4e9cd4cad6d27;p=thirdparty%2Flibsolv.git - check distepoch tag if rpm5 is used --- diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index 3ab8d102..58786ee2 100644 --- a/ext/repo_rpmdb.c +++ b/ext/repo_rpmdb.c @@ -121,6 +121,7 @@ #ifdef RPM5 # define RPM_INDEX_SIZE 4 +# define TAG_DISTEPOCH 1218 #else # define RPM_INDEX_SIZE 8 #endif @@ -284,6 +285,9 @@ static char *headtoevr(RpmHead *h) char *version, *v; char *release; char *evr; +#ifdef TAG_DISTEPOCH + char *distepoch; +#endif version = headstring(h, TAG_VERSION); release = headstring(h, TAG_RELEASE); @@ -307,6 +311,16 @@ static char *headtoevr(RpmHead *h) evr = solv_malloc(strlen(version) + 1 + strlen(release) + 1); sprintf(evr, "%s-%s", version, release); } +#ifdef TAG_DISTEPOCH + distepoch = headstring(h, TAG_DISTEPOCH); + if (distepoch && *distepoch) + { + int l = strlen(evr); + evr = solv_realloc(evr, l + strlen(distepoch) + 2); + evr[l++] = ':'; + strcpy(evr + l, distepoch); + } +#endif return evr; }