Patchwork [1/1] dpkg: fix pkg_postinst_dpkg, don't supply {bindir}/update-alternatives

login
register
mail settings
Submitter Dexuan Cui
Date Sept. 13, 2011, 1:30 p.m.
Message ID <372fffc4e289f88388de55665b1c5d766b956b37.1315920580.git.dexuan.cui@intel.com>
Download mbox | patch
Permalink /patch/11327/
State New, archived
Headers show

Comments

Dexuan Cui - Sept. 13, 2011, 1:30 p.m.
[YOCTO #1070].

The pkg_postinst_dpkg seems buggy, e.g., for dpkg-native,
${IMAGE_ROOTFS}/${sysconfdir}/rcS.d doesn't exist.
I think OE's version(do_install_prepend) at
http://git.openembedded.org/cgit.cgi/openembedded/tree/recipes/dpkg/dpkg.inc
is correct, so let's change to OE's version.

And, bth dpkg and update-alternatives-cworth supply
/usr/bin/update-alternatives and this causes conflict. e.g., bug 1070.
We can resolve the issue by ask dpkg not to supply the binary.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
---
 meta/recipes-devtools/dpkg/dpkg.inc         |   19 ++++++++-----------
 meta/recipes-devtools/dpkg/dpkg_1.15.8.7.bb |    2 +-
 2 files changed, 9 insertions(+), 12 deletions(-)
Richard Purdie - Sept. 13, 2011, 4:11 p.m.
On Tue, 2011-09-13 at 21:30 +0800, Dexuan Cui wrote:
> [YOCTO #1070].
> 
> The pkg_postinst_dpkg seems buggy, e.g., for dpkg-native,
> ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d doesn't exist.
> I think OE's version(do_install_prepend) at
> http://git.openembedded.org/cgit.cgi/openembedded/tree/recipes/dpkg/dpkg.inc
> is correct, so let's change to OE's version.
> 
> And, bth dpkg and update-alternatives-cworth supply
> /usr/bin/update-alternatives and this causes conflict. e.g., bug 1070.
> We can resolve the issue by ask dpkg not to supply the binary.
> 
> Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
> ---
>  meta/recipes-devtools/dpkg/dpkg.inc         |   19 ++++++++-----------
>  meta/recipes-devtools/dpkg/dpkg_1.15.8.7.bb |    2 +-
>  2 files changed, 9 insertions(+), 12 deletions(-)

Merged to master, thanks.

Richard

Patch

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index aa5f90e..8c2511d 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -2,7 +2,7 @@  DESCRIPTION = "Package maintenance system for Debian."
 LICENSE = "GPL"
 SECTION = "base"
 
-INC_PR = "r4"
+INC_PR = "r5"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.bz2 \
            file://ignore_extra_fields.patch"
@@ -20,17 +20,14 @@  inherit autotools gettext perlnative
 
 DPKG_INIT_POSITION = "98"
 
-pkg_postinst_dpkg () {
-#!/bin/sh
-if [ "x$D" != "x" ]; then
-	install -d $D/${sysconfdir}/rcS.d
+do_install_prepend () {
+	install -d ${D}/${sysconfdir}/rcS.d
 	# this happens at S98 where our good 'ole packages script used to run
-	echo -e "#!/bin/sh
-	dpkg --configure -a
-	rm -f /${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}configure
-" > ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}configure
-	chmod 0755 $D/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}configure
-fi
+	printf "#!/bin/sh
+dpkg --configure -a
+rm -f ${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}configure
+" > ${D}/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}configure
+	chmod 0755 ${D}/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}configure
 }
 
 do_configure () {
diff --git a/meta/recipes-devtools/dpkg/dpkg_1.15.8.7.bb b/meta/recipes-devtools/dpkg/dpkg_1.15.8.7.bb
index 91535d3..99197c0 100644
--- a/meta/recipes-devtools/dpkg/dpkg_1.15.8.7.bb
+++ b/meta/recipes-devtools/dpkg/dpkg_1.15.8.7.bb
@@ -20,6 +20,6 @@  EXTRA_OECONF = "--without-static-progs \
 
 BBCLASSEXTEND = "native"
 
-do_install_append_virtclass-native () {
+do_install_append () {
 	rm ${D}${bindir}/update-alternatives
 }