Skip to contentSkip to conversation

Added multilib support for DEBIAN_NAME

PATCH Applied Lianhao Lu 2 participants 5 messages Sep 16, 2011

lore
Share & tools
lore
author
#1 lore raw

PATCH 1/3 debian/_ipk.bbclass: Added multilib support for package_name_hook()

In reply to Lianhao Lu

[YOCTO #1486]
1. Added multilib support for package_name_hook() so MLPREFIX is kept in the final package name.

2. clean the output of log_check_ipk.

---
 meta/classes/debian.bbclass      |    4 ++++
 meta/classes/package_ipk.bbclass |    1 +
 meta/classes/rootfs_ipk.bbclass  |    2 +-
 3 files changed, 6 insertions(+), 1 deletions(-)
meta/classes/debian.bbclass +4 -0
index 46a9d08..1880830 100644
@@ -104,6 +104,10 @@ python debian_package_name_hook () {
 						newpkg = pkgname
 					else:
 						newpkg = pkg.replace(orig_pkg, devname, 1)
+					mlpre=bb.data.getVar('MLPREFIX', d, True)
+					if mlpre:
+						if not newpkg.find(mlpre) == 0:
+							newpkg = mlpre + newpkg
 					if newpkg != pkg:
 						bb.data.setVar('PKG_' + pkg, newpkg, d)
 
meta/classes/package_ipk.bbclass +1 -0
index e83aff8..c0893a6 100644
@@ -75,6 +75,7 @@ package_tryout_install_multilib_ipk() {
 			fi
 		done
 		if [ ! -z "${selected_pkg}" ]; then
+			rm -f ${target_rootfs}
 			mkdir -p ${target_rootfs}/${opkglibdir}
 			opkg-cl ${ipkg_args} update
 			opkg-cl ${ipkg_args} install ${selected_pkg}
meta/classes/rootfs_ipk.bbclass +1 -1
index 695bee0..e02b816 100644
@@ -114,7 +114,7 @@ fakeroot rootfs_ipk_do_rootfs () {
 			rm -rf ${IMAGE_ROOTFS}${opkglibdir}
 		fi
 	fi
-
+	set +x
 	log_check rootfs 	
 }
 
Signature · 1 line
1.7.0.4
author
#2 lore raw

PATCH 2/3 Misc: Added MLPREFIX to final pkg names in case of DEBIAN_NAMES.

[YOCTO #1486]
Added MLPREFIX to the final package names of library packages in case of DEBIAN_NAMES.

---
 meta/recipes-core/libxml/libxml2.inc           |    2 +-
 meta/recipes-core/libxml/libxml2_2.7.8.bb      |    2 +-
 meta/recipes-gnome/gtk+/gtk+_2.12.7.bb         |    4 ++--
 meta/recipes-gnome/gtk+/gtk+_2.16.6.bb         |    4 ++--
 meta/recipes-gnome/gtk+/gtk+_2.22.1.bb         |    4 ++--
 meta/recipes-graphics/xorg-lib/libxft_2.2.0.bb |    4 ++--
 6 files changed, 10 insertions(+), 10 deletions(-)
meta/recipes-core/libxml/libxml2.inc +1 -1
index dfe6a9a..cf789b2 100644
@@ -34,7 +34,7 @@ export LDFLAGS += "-ldl"
 python populate_packages_prepend () {
 	# autonamer would call this libxml2-2, but we don't want that
 	if bb.data.getVar('DEBIAN_NAMES', d, 1):
-		bb.data.setVar('PKG_libxml2', 'libxml2', d)
+		bb.data.setVar('PKG_libxml2', '${MLPREFIX}libxml2', d)
 }
 
 PACKAGES = "${PN}-dbg ${PN}-dev ${PN}-utils ${PN} ${PN}-doc ${PN}-locale"
meta/recipes-core/libxml/libxml2_2.7.8.bb +1 -1
index 616fd09..3909839 100644
@@ -1,6 +1,6 @@
 require libxml2.inc
 
-PR = "r0"
+PR = "r1"
 
 SRC_URI[md5sum] = "8127a65e8c3b08856093099b52599c86"
 SRC_URI[sha256sum] = "cda23bc9ebd26474ca8f3d67e7d1c4a1f1e7106364b690d822e009fdc3c417ec"
meta/recipes-gnome/gtk+/gtk+_2.12.7.bb +2 -2
index 7de748c..00c4ee8 100644
@@ -1,6 +1,6 @@
 require gtk+.inc
 
-PR = "r11"
+PR = "r12"
 
 SRC_URI = "http://download.gnome.org/sources/gtk+/2.12/gtk+-${PV}.tar.bz2 \
            file://xsettings.patch \
@@ -47,5 +47,5 @@ python populate_packages_prepend () {
 	do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s')
 
         if (bb.data.getVar('DEBIAN_NAMES', d, 1)):
-                bb.data.setVar('PKG_${PN}', 'libgtk-2.0', d)
+                bb.data.setVar('PKG_${PN}', '${MLPREFIX}libgtk-2.0', d)
 }
meta/recipes-gnome/gtk+/gtk+_2.16.6.bb +2 -2
index 18f61e7..09b917f 100644
@@ -1,6 +1,6 @@
 require gtk+.inc
 
-PR = "r7"
+PR = "r8"
 
 SRC_URI = "http://download.gnome.org/sources/gtk+/2.16/gtk+-${PV}.tar.bz2 \
            file://xsettings.patch \
@@ -47,5 +47,5 @@ python populate_packages_prepend () {
 	do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s')
 
         if (bb.data.getVar('DEBIAN_NAMES', d, 1)):
-                bb.data.setVar('PKG_${PN}', 'libgtk-2.0', d)
+                bb.data.setVar('PKG_${PN}', '${MLPREFIX}libgtk-2.0', d)
 }
meta/recipes-gnome/gtk+/gtk+_2.22.1.bb +2 -2
index 55620d2..ba90e0e 100644
@@ -4,7 +4,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
                     file://gtk/gtk.h;endline=27;md5=c59e0b4490dd135a5726ebf851f9b17f \
                     file://gdk/gdk.h;endline=27;md5=07db285ec208fb3e0bf7d861b0614202 \
                     file://tests/testgtk.c;endline=27;md5=262db5db5f776f9863e56df31423e24c"
-PR = "r2"
+PR = "r3"
 
 SRC_URI = "http://download.gnome.org/sources/gtk+/2.22/gtk+-${PV}.tar.bz2 \
            file://xsettings.patch \
@@ -50,5 +50,5 @@ python populate_packages_prepend () {
 	do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s')
 
         if (bb.data.getVar('DEBIAN_NAMES', d, 1)):
-                bb.data.setVar('PKG_${PN}', 'libgtk-2.0', d)
+                bb.data.setVar('PKG_${PN}', '${MLPREFIX}libgtk-2.0', d)
 }
meta/recipes-graphics/xorg-lib/libxft_2.2.0.bb +2 -2
index 33c8a1e..ac7dfb1 100644
@@ -18,14 +18,14 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=90b90b60eb30f65fc9c2673d7cf59e24"
 DEPENDS += "virtual/libx11 libxrender freetype fontconfig"
 PROVIDES = "xft"
 
-PR = "r1"
+PR = "r2"
 PE = "1"
 
 XORG_PN = "libXft"
 
 python () {
         if bb.data.getVar('DEBIAN_NAMES', d, 1):
-            bb.data.setVar('PKG_${PN}', 'libxft2', d)
+            bb.data.setVar('PKG_${PN}', '${MLPREFIX}libxft2', d)
 }
 
 FILES_${PN} = "${libdir}/lib*${SOLIBS}"
Signature · 1 line
1.7.0.4

Lianhao Lu

author
#0 lore raw

cover Added multilib support for DEBIAN_NAME

This series of patches is meant to fix bug [YOCTO #1486].

It added multilib support in package_name_hook() so MLPREFIX is kept in the package name after the debian package renaming.

It changed the logic of multilib_sanity_check() that all the equal duplicated files from different multilib variants are allowed to be installed into the same rootfs.

It also fixed several recipes to support the multilib in debian package renaming.

The following changes since commit bb4dad44432b2e40ac3cf16baa45befbae3e70f5:
Darren Hart (1):
Prevent IMAGE_FEATURES from contaminating initrd

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib llu/bug1486
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=llu/bug1486

Lianhao Lu (3):
debian/_ipk.bbclass: Added multilib support for package_name_hook()
Misc: Added MLPREFIX to final pkg names in case of DEBIAN_NAMES. image/package.bbclass: Revise multilib support for DEBIAN_NAME.

 meta/classes/debian.bbclass                    |    4 ++++
 meta/classes/image.bbclass                     |   17 +++++------------
 meta/classes/package.bbclass                   |    2 +-
 meta/classes/package_ipk.bbclass               |    1 +
 meta/classes/rootfs_ipk.bbclass                |    2 +-
 meta/recipes-core/libxml/libxml2.inc           |    2 +-
 meta/recipes-core/libxml/libxml2_2.7.8.bb      |    2 +-
 meta/recipes-gnome/gtk+/gtk+_2.12.7.bb         |    4 ++--
 meta/recipes-gnome/gtk+/gtk+_2.16.6.bb         |    4 ++--
 meta/recipes-gnome/gtk+/gtk+_2.22.1.bb         |    4 ++--
 meta/recipes-graphics/xorg-lib/libxft_2.2.0.bb |    4 ++--
 11 files changed, 22 insertions(+), 24 deletions(-)
author
#3 lore raw

PATCH 3/3 image/package.bbclass: Revise multilib support for DEBIAN_NAME.

In reply to Lianhao Lu

[YOCTO #1486]
1. image.bbclass: In multilib_sanity_check, duplicated files except those matching to MULTILIBRE_ALLOW_REP are allowed if they're equal.

2. pacakge.bbclass: Allow DEBIAN_NOAUTONAMES variable to be automatically mapped in multilib case.

---
 meta/classes/image.bbclass   |   17 +++++------------
 meta/classes/package.bbclass |    2 +-
 2 files changed, 6 insertions(+), 13 deletions(-)
meta/classes/image.bbclass +5 -12
index 3cd5e7a..f17e989 100644
@@ -213,7 +213,6 @@ log_check() {
 }
 
 MULTILIBRE_ALLOW_REP =. "${base_bindir}|${base_sbindir}|${bindir}|${sbindir}|${libexecdir}|"
-MULTILIBRE_FORCE_SAME =. "${sysconfdir}|${datadir}|"
 MULTILIB_CHECK_FILE = "${WORKDIR}/multilib_check.py"
 MULTILIB_TEMP_ROOTFS = "${WORKDIR}/multilib"
 
@@ -223,7 +222,6 @@ import sys, os, os.path
 import re,filecmp
 
 allow_rep=re.compile(re.sub("\|$","","${MULTILIBRE_ALLOW_REP}"))
-force_same=re.compile(re.sub("\|$","","${MULTILIBRE_FORCE_SAME}"))
 error_promt="Multilib check error:"
 
 files={}
@@ -236,19 +234,14 @@ for dir in dirs.split():
 
       valid=True;
       if files.has_key(key):
-        #check whether files are the same
-        if force_same.match(key):
+        #check whether the file is allow to replace
+        if allow_rep.match(key):
+          valid=True
+        else:
           if not filecmp.cmp(files[key],item):
              valid=False
-             print("%s %s is not the same as %s\n" % (error_promt, item, files[key]))
+             print("%s duplicate files %s %s is not the same\n" % (error_promt, item, files[key]))
              sys.exit(1)
-        #check whether the file is allow to replace
-        elif allow_rep.match(key):
-          valid=True
-        else: 
-          valid=False
-          print("%s duplicated files %s %s not allowed\n" % (error_promt, item, files[key]))
-          sys.exit(1)
 
       #pass the check, add to list
       if valid:
meta/classes/package.bbclass +1 -1
index 73e8f63..0e08394 100644
@@ -1622,7 +1622,7 @@ python package_depchains() {
 
 # Since bitbake can't determine which variables are accessed during package 
 # iteration, we need to list them here:
-PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst pkg_postrm INITSCRIPT_NAME INITSCRIPT_PARAMS"
+PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst pkg_postrm INITSCRIPT_NAME INITSCRIPT_PARAMS DEBIAN_NOAUTONAME"
 
 def gen_packagevar(d):
     ret = []
Signature · 1 line
1.7.0.4
#4 lore raw
In reply to Lianhao Lu
Quoted 16 lines · Lianhao Lu

This series of patches is meant to fix bug [YOCTO #1486].

It added multilib support in package_name_hook() so MLPREFIX is kept in the package name after the debian package renaming.

It changed the logic of multilib_sanity_check() that all the equal duplicated files from different multilib variants are allowed to be installed into the same rootfs.

It also fixed several recipes to support the multilib in debian package renaming.

The following changes since commit bb4dad44432b2e40ac3cf16baa45befbae3e70f5:
Darren Hart (1):
Prevent IMAGE_FEATURES from contaminating initrd

are available in the git repository at:

Quoted 7 lines

git://git.yoctoproject.org/poky-contrib llu/bug1486
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=llu/bug1486

Lianhao Lu (3):
debian/_ipk.bbclass: Added multilib support for package_name_hook()
Misc: Added MLPREFIX to final pkg names in case of DEBIAN_NAMES. image/package.bbclass: Revise multilib support for DEBIAN_NAME.

Merged to master, thanks.

Richard