Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] image-mklibs/package_ipk: Remove bashisms
Date: Thu, 05 Jan 2012 12:50:11 +0000	[thread overview]
Message-ID: <1325767811.20759.69.camel@ted> (raw)

We now support using dash but these bashisms triggered build failures for me
when using it. This replaces the code with something which works on dash.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/classes/image-mklibs.bbclass b/meta/classes/image-mklibs.bbclass
index 69dac2f..7623815 100644
--- a/meta/classes/image-mklibs.bbclass
+++ b/meta/classes/image-mklibs.bbclass
@@ -60,7 +60,7 @@ mklibs_optimize_image_doit() {
 mklibs_optimize_image() {
 	for img in ${MKLIBS_OPTIMIZED_IMAGES}
 	do
-		if [ "${img}" == "${PN}" ] || [ "${img}" == "all" ]
+		if [ "${img}" = "${PN}" ] || [ "${img}" = "all" ]
 		then
 			mklibs_optimize_image_doit
 			break
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index aeabc11..36dedb9 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -72,8 +72,10 @@ package_tryout_install_multilib_ipk() {
 		local ipkg_args="-f ${INSTALL_CONF_IPK} -o ${target_rootfs} --force_overwrite"
 		local selected_pkg=""
 		local pkgname_prefix="${item}-"
+		local pkgname_len=${#pkgname_prefix}
 		for pkg in ${INSTALL_PACKAGES_MULTILIB_IPK}; do
-			if [ ${pkg:0:${#pkgname_prefix}} == ${pkgname_prefix} ]; then
+			local pkgname=$(echo $pkg | awk -v var=$pkgname_len '{ pkgname=substr($1, 1, var - 1); print pkgname; }' )
+			if [ ${pkgname} = ${pkgname_prefix} ]; then
 			    selected_pkg="${selected_pkg} ${pkg}"
 			fi
 		done
@@ -94,7 +96,9 @@ split_multilib_packages() {
 		is_multilib=0
 		for item in ${MULTILIB_VARIANTS}; do
 			local pkgname_prefix="${item}-"
-			if [ ${pkg:0:${#pkgname_prefix}} == ${pkgname_prefix} ]; then
+			local pkgname_len=${#pkgname_prefix}
+			local pkgname=$(echo $pkg | awk -v var=$pkgname_len '{ pkgname=substr($1, 1, var - 1); print pkgname; }' )
+			if [ ${pkgname} = ${pkgname_prefix} ]; then
 				is_multilib=1
 				break
 			fi





                 reply	other threads:[~2012-01-05 12:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1325767811.20759.69.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox