Permalink
Browse files

do not force rpm5 rpms to binary, the type info in the lead is always…

… zero
  • Loading branch information...
mlschroe committed Oct 4, 2012
1 parent d1b3a51 commit 775dc2622cdeb364a3ac24e1e556ac64974442d7
Showing with 18 additions and 2 deletions.
  1. +18 −2 ext/repo_rpmdb.c
View
@@ -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
{

0 comments on commit 775dc26

Please sign in to comment.