Patchwork [1/2] package_deb.bbclass:fix the arch (replace "_" with "-") in deb package control

login
register
mail settings
Submitter Hongxu Jia
Date March 2, 2013, 9:12 a.m.
Message ID <e2868d95026f84923a67646d706ebf2ef67c0ffa.1362215186.git.hongxu.jia@windriver.com>
Download mbox | patch
Permalink /patch/45405/
State Accepted
Commit 8e73fb597ab7c518978c44beb75464dfdcdbd768
Headers show

Comments

Hongxu Jia - March 2, 2013, 9:12 a.m.
when build deb image, such as building meta-toolchain-sdk in x86_64 host,
there is warning like that:
...
'x86_64' is not a valid architecture name: character `_' not allowed
(only letters, digits and characters `-')
...

The params in deb package control file don't allow character `_', only
letters, digits and characters `-' allowed. Change the arch's "_" to "-"
in the deb package's control file at the control file creation time. Such
as `x86_64'-->`x86-64'

[YOCTO #3721]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/classes/package_deb.bbclass |    8 ++++++++
 1 file changed, 8 insertions(+)

Patch

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index eea15e7..309c48d 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -82,6 +82,9 @@  package_install_internal_deb () {
 
 	tac ${STAGING_ETCDIR_NATIVE}/apt/sources.list.rev > ${STAGING_ETCDIR_NATIVE}/apt/sources.list
 
+	# The params in deb package control don't allow character `_', so
+	# change the arch's `_' to `-' in it.
+	dpkg_arch=`echo ${dpkg_arch} | sed 's/_/-/g'`
 	cat "${STAGING_ETCDIR_NATIVE}/apt/apt.conf.sample" \
 		| sed -e "s#Architecture \".*\";#Architecture \"${dpkg_arch}\";#" \
 		| sed -e "s:#ROOTFS#:${target_rootfs}:g" \
@@ -259,6 +262,11 @@  python do_package_deb () {
                     raise KeyError(f)
                 if i == 'DPKG_ARCH' and d.getVar('PACKAGE_ARCH', True) == 'all':
                     data = 'all'
+                elif i == 'PACKAGE_ARCH' or i == 'DPKG_ARCH':
+                   # The params in deb package control don't allow character
+                   # `_', so change the arch's `_' to `-'. Such as `x86_64'
+                   # -->`x86-64'
+                   data = data.replace('_', '-')
                 l2.append(data)
             return l2