[oe-commits] Khem Raj : package_rpm.bbclass: Accomodate dash when using arrays

git at git.openembedded.org git at git.openembedded.org
Tue Jul 31 11:25:46 UTC 2012


Module: openembedded-core.git
Branch: master
Commit: 4029ce1a15e1dbd374444ee77ccf2a915e463b7b
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=4029ce1a15e1dbd374444ee77ccf2a915e463b7b

Author: Khem Raj <raj.khem at gmail.com>
Date:   Sun Jul 29 14:27:05 2012 -0700

package_rpm.bbclass: Accomodate dash when using arrays

we were assigning local variable to an array coming through
positional arguments. local is a non posix contruct thats
also supported by dash luckily but operates differently in this
case it exapnds the array before assignment. so

local pkgs="$@"

turns into pkgs=locale-base-en-us locale-base-en-gb

ant we see errors

run.do_rootfs.25593: 932: local: locale-base-en-gb: bad variable name

So lets not use defining and assigning local in one go
first define a local and then the assignment

Signed-off-by: Khem Raj <raj.khem at gmail.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/package_rpm.bbclass |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index b4bc52e..50e9b31 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -200,7 +200,12 @@ rpm_update_pkg () {
 process_pkg_list_rpm() {
 	local insttype=$1
 	shift
-	local pkgs="$@"
+	# $@ is special POSIX linear array can not be assigned
+	# to a local variable directly in dash since its separated by
+	# space and dash expands it before assignment
+	# and local x=1 2 3 and not x="1 2 3"
+	local pkgs
+	pkgs="$@"
 	local confbase=${INSTALL_CONFBASE_RPM}
 
 	echo -n > ${target_rootfs}/install/base_archs.pkglist





More information about the Openembedded-commits mailing list