summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm/rpm/rpm-respect-arch.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/rpm/rpm/rpm-respect-arch.patch')
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-respect-arch.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-respect-arch.patch b/meta/recipes-devtools/rpm/rpm/rpm-respect-arch.patch
new file mode 100644
index 0000000000..9b63b37fea
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-respect-arch.patch
@@ -0,0 +1,67 @@
1rpmts.c: respect to the arch priorities
2
3Let rpm respect to the priorities when choose alternatives rpm, the arch
4which comes first is preferred.
5
6Upstream-Status: Pending
7
8Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
9---
10 lib/rpmts.c | 14 ++++++++++++++
11 1 files changed, 14 insertions(+), 0 deletions(-)
12
13diff --git a/lib/rpmts.c b/lib/rpmts.c
14index 3fbbc9e..40ec08e 100644
15--- a/lib/rpmts.c
16+++ b/lib/rpmts.c
17@@ -353,6 +353,7 @@ int rpmtsSolve(rpmts ts, rpmds ds, /*@unused@*/ const void * data)
18 Header h = NULL;
19 size_t bhnamelen = 0;
20 time_t bhtime = 0;
21+ const char *bharch = NULL;
22 rpmTag rpmtag;
23 const char * keyp;
24 size_t keylen = 0;
25@@ -409,6 +410,7 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, ds, data);
26 while ((h = rpmmiNext(mi)) != NULL) {
27 size_t hnamelen;
28 time_t htime;
29+ const char *harch = NULL;
30
31 if (rpmtag == RPMTAG_PROVIDENAME && !rpmdsAnyMatchesDep(h, ds, 1))
32 continue;
33@@ -431,12 +433,23 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, ds, data);
34 if (htime <= bhtime)
35 continue;
36
37+ /* XXX Respect to the arch priorities */
38+ he->tag = RPMTAG_ARCH;
39+ xx = headerGet(h, he, 0);
40+ harch = ((xx && he->p.str) ? xstrdup(he->p.str) : NULL);
41+ he->p.ptr = _free(he->p.ptr);
42+ if (bharch && (strcmp(bharch, harch) != 0))
43+ continue;
44+
45 /* Save new "best" candidate. */
46 (void)headerFree(bh);
47 bh = NULL;
48 bh = headerLink(h);
49 bhtime = htime;
50 bhnamelen = hnamelen;
51+ bharch = _free(bharch);
52+ bharch = xstrdup(harch);
53+ harch = _free(harch);
54 }
55 mi = rpmmiFree(mi);
56
57@@ -449,6 +462,7 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, ds, data);
58 } while (1);
59
60 }
61+ bharch = _free(bharch);
62
63 /* Is there a suggested resolution? */
64 if (bh == NULL)
65--
661.7.1
67