diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2012-05-23 13:55:39 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-24 08:51:37 +0100 |
commit | bb4f829965682f7879883dbf788ea03954b13bb5 (patch) | |
tree | a04fc3a188f3f3d34dc087205a6d55c30a2a2993 /meta/recipes-devtools | |
parent | 73538f548c796a31f8e2404a5f006fcae7e56df0 (diff) | |
download | poky-bb4f829965682f7879883dbf788ea03954b13bb5.tar.gz |
rpm 5.4.0: respect to the arch when choose the alternatives
There is a bug if we:
1) bitbake diffutils with MACHINE=crownbay
2) bitbake diffutils with MACHINE=qemux86
3) bitbake core-image-sato with MACHINE=crownbay
Then the diffutils.i586 would be installed to the crownbay's image, this
is because diffutils.i586 is newer than diffutils.core2, and rpm doesn't
respect to the arch priorities:
We have put the archs in order in _solve_dbpath:
crownbay/solvedb:core2/solvedb:i586/solvedb:all/solvedb
Fix rpm to respect to the order, for example, if it finds a pkg in both
core2/ and i586/, and the core2/ comes first, it should not use the one
in i586/ even if it's build time is newer.
Note: Don't worry about the _free(*ptr), it can check whether ptr is
NULL or not.
This is for the denzil branch, and the master branch also needs it.
[YOCTO #2360]
(From OE-Core rev: d76067ae100623dd6dd4858568b98522d1daf474)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/rpm/rpm/rpm-respect-arch.patch | 67 | ||||
-rw-r--r-- | meta/recipes-devtools/rpm/rpm_5.4.0.bb | 3 |
2 files changed, 69 insertions, 1 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 @@ | |||
1 | rpmts.c: respect to the arch priorities | ||
2 | |||
3 | Let rpm respect to the priorities when choose alternatives rpm, the arch | ||
4 | which comes first is preferred. | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
9 | --- | ||
10 | lib/rpmts.c | 14 ++++++++++++++ | ||
11 | 1 files changed, 14 insertions(+), 0 deletions(-) | ||
12 | |||
13 | diff --git a/lib/rpmts.c b/lib/rpmts.c | ||
14 | index 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 | -- | ||
66 | 1.7.1 | ||
67 | |||
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.0.bb b/meta/recipes-devtools/rpm/rpm_5.4.0.bb index 5ee6b47e34..d79d199970 100644 --- a/meta/recipes-devtools/rpm/rpm_5.4.0.bb +++ b/meta/recipes-devtools/rpm/rpm_5.4.0.bb | |||
@@ -45,7 +45,7 @@ LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1" | |||
45 | DEPENDS = "bzip2 zlib db openssl elfutils expat libpcre attr acl popt ${extrarpmdeps}" | 45 | DEPENDS = "bzip2 zlib db openssl elfutils expat libpcre attr acl popt ${extrarpmdeps}" |
46 | extrarpmdeps = "python perl file" | 46 | extrarpmdeps = "python perl file" |
47 | extrarpmdeps_virtclass-native = "python-native file-native" | 47 | extrarpmdeps_virtclass-native = "python-native file-native" |
48 | PR = "r36" | 48 | PR = "r37" |
49 | 49 | ||
50 | # rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed | 50 | # rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed |
51 | # in order to extract the distribution SRPM into a format we can extract... | 51 | # in order to extract the distribution SRPM into a format we can extract... |
@@ -70,6 +70,7 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.0-0.20101229.src.rpm;ex | |||
70 | file://pythondeps.sh \ | 70 | file://pythondeps.sh \ |
71 | file://rpmdeps-oecore.patch \ | 71 | file://rpmdeps-oecore.patch \ |
72 | file://rpm-resolvedep.patch \ | 72 | file://rpm-resolvedep.patch \ |
73 | file://rpm-respect-arch.patch \ | ||
73 | " | 74 | " |
74 | 75 | ||
75 | # file://rpm-autoconf.patch \ | 76 | # file://rpm-autoconf.patch \ |