All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] V2 rpm 5.4.0: respect to the arch when choose the alternatives
@ 2012-05-23 14:06 Robert Yang
  2012-05-23 14:06 ` [PATCH 1/1] " Robert Yang
  2012-05-24 18:47 ` [PATCH 0/1] V2 " Saul Wold
  0 siblings, 2 replies; 3+ messages in thread
From: Robert Yang @ 2012-05-23 14:06 UTC (permalink / raw)
  To: openembedded-core; +Cc: Zhenfeng.Zhao

Changes of V2:

Fix the rpm rather than the PACKAGE_EXTRA_ARCHS

// Robert

The following changes since commit 3bf8069100e54153d13319dc32ca089327b6a139:

  documentation/yocto-project-qs/yocto-project-qs.xml: added quotes (2012-05-01 21:00:36 +0100)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib robert/121_rpm_arch
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/121_rpm_arch

Robert Yang (1):
  rpm 5.4.0: respect to the arch when choose the alternatives

 .../rpm/rpm/rpm-respect-arch.patch                 |   67 ++++++++++++++++++++
 meta/recipes-devtools/rpm/rpm_5.4.0.bb             |    3 +-
 2 files changed, 69 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-respect-arch.patch




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] rpm 5.4.0: respect to the arch when choose the alternatives
  2012-05-23 14:06 [PATCH 0/1] V2 rpm 5.4.0: respect to the arch when choose the alternatives Robert Yang
@ 2012-05-23 14:06 ` Robert Yang
  2012-05-24 18:47 ` [PATCH 0/1] V2 " Saul Wold
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Yang @ 2012-05-23 14:06 UTC (permalink / raw)
  To: openembedded-core; +Cc: Zhenfeng.Zhao

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]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 .../rpm/rpm/rpm-respect-arch.patch                 |   67 ++++++++++++++++++++
 meta/recipes-devtools/rpm/rpm_5.4.0.bb             |    3 +-
 2 files changed, 69 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-respect-arch.patch

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 0000000..9b63b37
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-respect-arch.patch
@@ -0,0 +1,67 @@
+rpmts.c: respect to the arch priorities
+
+Let rpm respect to the priorities when choose alternatives rpm, the arch
+which comes first is preferred.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ lib/rpmts.c |   14 ++++++++++++++
+ 1 files changed, 14 insertions(+), 0 deletions(-)
+
+diff --git a/lib/rpmts.c b/lib/rpmts.c
+index 3fbbc9e..40ec08e 100644
+--- a/lib/rpmts.c
++++ b/lib/rpmts.c
+@@ -353,6 +353,7 @@ int rpmtsSolve(rpmts ts, rpmds ds, /*@unused@*/ const void * data)
+     Header h = NULL;
+     size_t bhnamelen = 0;
+     time_t bhtime = 0;
++    const char *bharch = NULL;
+     rpmTag rpmtag;
+     const char * keyp;
+     size_t keylen = 0;
+@@ -409,6 +410,7 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, ds, data);
+ 	while ((h = rpmmiNext(mi)) != NULL) {
+ 	    size_t hnamelen;
+ 	    time_t htime;
++	    const char *harch = NULL;
+ 
+ 	    if (rpmtag == RPMTAG_PROVIDENAME && !rpmdsAnyMatchesDep(h, ds, 1))
+ 		continue;
+@@ -431,12 +433,23 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, ds, data);
+ 	    if (htime <= bhtime)
+ 		continue;
+ 
++	    /* XXX Respect to the arch priorities */
++	    he->tag = RPMTAG_ARCH;
++	    xx = headerGet(h, he, 0);
++	    harch = ((xx && he->p.str) ? xstrdup(he->p.str) : NULL);
++	    he->p.ptr = _free(he->p.ptr);
++	    if (bharch && (strcmp(bharch, harch) != 0))
++		continue;
++
+ 	    /* Save new "best" candidate. */
+ 	    (void)headerFree(bh);
+ 	    bh = NULL;
+ 	    bh = headerLink(h);
+ 	    bhtime = htime;
+ 	    bhnamelen = hnamelen;
++	    bharch = _free(bharch);
++	    bharch = xstrdup(harch);
++	    harch = _free(harch);
+ 	}
+ 	mi = rpmmiFree(mi);
+ 
+@@ -449,6 +462,7 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __FUNCTION__, ts, ds, data);
+       } while (1);
+ 
+     }
++    bharch = _free(bharch);
+ 
+     /* Is there a suggested resolution? */
+     if (bh == NULL)
+-- 
+1.7.1
+
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.0.bb b/meta/recipes-devtools/rpm/rpm_5.4.0.bb
index 5ee6b47..d79d199 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"
 DEPENDS = "bzip2 zlib db openssl elfutils expat libpcre attr acl popt ${extrarpmdeps}"
 extrarpmdeps = "python perl file"
 extrarpmdeps_virtclass-native = "python-native file-native"
-PR = "r36"
+PR = "r37"
 
 # rpm2cpio is a shell script, which is part of the rpm src.rpm.  It is needed
 # 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
 	   file://pythondeps.sh \
 	   file://rpmdeps-oecore.patch \
 	   file://rpm-resolvedep.patch \
+	   file://rpm-respect-arch.patch \
 	  "
 
 #	   file://rpm-autoconf.patch \
-- 
1.7.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/1] V2 rpm 5.4.0: respect to the arch when choose the alternatives
  2012-05-23 14:06 [PATCH 0/1] V2 rpm 5.4.0: respect to the arch when choose the alternatives Robert Yang
  2012-05-23 14:06 ` [PATCH 1/1] " Robert Yang
@ 2012-05-24 18:47 ` Saul Wold
  1 sibling, 0 replies; 3+ messages in thread
From: Saul Wold @ 2012-05-24 18:47 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Zhenfeng.Zhao

On 05/23/2012 07:06 AM, Robert Yang wrote:
> Changes of V2:
>
> Fix the rpm rather than the PACKAGE_EXTRA_ARCHS
>
> // Robert
>
> The following changes since commit 3bf8069100e54153d13319dc32ca089327b6a139:
>
>    documentation/yocto-project-qs/yocto-project-qs.xml: added quotes (2012-05-01 21:00:36 +0100)
>
> are available in the git repository at:
>    git://git.pokylinux.org/poky-contrib robert/121_rpm_arch
>    http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/121_rpm_arch
>
> Robert Yang (1):
>    rpm 5.4.0: respect to the arch when choose the alternatives
>
>   .../rpm/rpm/rpm-respect-arch.patch                 |   67 ++++++++++++++++++++
>   meta/recipes-devtools/rpm/rpm_5.4.0.bb             |    3 +-
>   2 files changed, 69 insertions(+), 1 deletions(-)
>   create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-respect-arch.patch
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>

Merged into OE-Core

Thanks
	Sau!



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-24 18:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-23 14:06 [PATCH 0/1] V2 rpm 5.4.0: respect to the arch when choose the alternatives Robert Yang
2012-05-23 14:06 ` [PATCH 1/1] " Robert Yang
2012-05-24 18:47 ` [PATCH 0/1] V2 " Saul Wold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.