From: Michael Schroeder Date: Thu, 4 Oct 2012 13:42:27 +0000 (+0200) Subject: do not force rpm5 rpms to binary, the type info in the lead is always zero X-Git-Tag: upstream/0.2.0~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=775dc2622cdeb364a3ac24e1e556ac64974442d7;p=platform%2Fupstream%2Flibsolv.git do not force rpm5 rpms to binary, the type info in the lead is always zero --- diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index 2057d08..86b5471 100644 --- a/ext/repo_rpmdb.c +++ b/ext/repo_rpmdb.c @@ -83,6 +83,7 @@ #define TAG_CONFLICTFLAGS 1053 #define TAG_CONFLICTNAME 1054 #define TAG_CONFLICTVERSION 1055 +#define TAG_RPMVERSION 1064 #define TAG_TRIGGERNAME 1066 #define TAG_TRIGGERVERSION 1067 #define TAG_TRIGGERFLAGS 1068 @@ -878,6 +879,7 @@ rpm2solv(Pool *pool, Repo *repo, Repodata *data, Solvable *s, RpmHead *rpmhead, char *name; char *evr; char *sourcerpm; + int forcebinary = rpmhead->forcebinary; name = headstring(rpmhead, TAG_NAME); if (!strcmp(name, "gpg-pubkey")) @@ -889,7 +891,13 @@ rpm2solv(Pool *pool, Repo *repo, Repodata *data, Solvable *s, RpmHead *rpmhead, return 0; } sourcerpm = headstring(rpmhead, TAG_SOURCERPM); - if (sourcerpm || rpmhead->forcebinary) + if (!sourcerpm && forcebinary) + { + char *rpmversion = headstring(rpmhead, TAG_RPMVERSION); + if (rpmversion && *rpmversion == '5') + forcebinary = 0; + } + if (sourcerpm || forcebinary) s->arch = pool_str2id(pool, headstring(rpmhead, TAG_ARCH), 1); else { @@ -2252,6 +2260,7 @@ rpm_query(void *rpmhandle, Id what) const char *name, *arch, *sourcerpm; char *evr, *r; int l; + int forcebinary; RpmHead *rpmhead = rpmhandle; r = 0; @@ -2262,7 +2271,14 @@ rpm_query(void *rpmhandle, Id what) if (!name) name = ""; sourcerpm = headstring(rpmhead, TAG_SOURCERPM); - if (sourcerpm || rpmhead->forcebinary) + forcebinary = rpmhead->forcebinary; + if (!sourcerpm && forcebinary) + { + char *rpmversion = headstring(rpmhead, TAG_RPMVERSION); + if (rpmversion && *rpmversion == '5') + forcebinary = 0; + } + if (sourcerpm || forcebinary) arch = headstring(rpmhead, TAG_ARCH); else {