All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] fix bashism for a few scripts
@ 2013-08-02  7:52 Qi.Chen
  2013-08-02  7:52 ` [PATCH 1/4] scripts/contrib/mkefidisk.sh: fix bashism Qi.Chen
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Qi.Chen @ 2013-08-02  7:52 UTC (permalink / raw)
  To: openembedded-core; +Cc: Zhangle.Yang

From: Chen Qi <Qi.Chen@windriver.com>

I used the checkbashism command to check our OE repo.
This patchset fixes the auto-detected bashism.

The following changes since commit bd1c441a210cae03fb6006c996227211cc29056b:

  bitbake: bitbake: runqueue: add warning if invalidating invalid task (2013-07-29 15:25:09 +0100)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib ChenQi/fix-bashism
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/fix-bashism

Chen Qi (4):
  scripts/contrib/mkefidisk.sh: fix bashism
  qtdemo-init: fix bashism
  xtscal: fix bashism
  initramfs-framework: fix bashism

 .../initrdscripts/initramfs-framework/finish       |    5 +++--
 .../initrdscripts/initramfs-framework/init         |   13 +++++++------
 .../xtscal/xtscal/30xTs_Calibrate.sh               |    2 +-
 meta/recipes-qt/qt-demo/qt-demo-init/qtdemo-init   |    8 ++++----
 scripts/contrib/mkefidisk.sh                       |    8 ++++----
 5 files changed, 19 insertions(+), 17 deletions(-)

-- 
1.7.9.5



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] scripts/contrib/mkefidisk.sh: fix bashism
  2013-08-02  7:52 [PATCH 0/4] fix bashism for a few scripts Qi.Chen
@ 2013-08-02  7:52 ` Qi.Chen
  2013-08-02  7:52 ` [PATCH 2/4] qtdemo-init: " Qi.Chen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Qi.Chen @ 2013-08-02  7:52 UTC (permalink / raw)
  To: openembedded-core; +Cc: Zhangle.Yang

From: Chen Qi <Qi.Chen@windriver.com>

Remove the function keyword.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 scripts/contrib/mkefidisk.sh |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
index bcc2411..af06b4b 100755
--- a/scripts/contrib/mkefidisk.sh
+++ b/scripts/contrib/mkefidisk.sh
@@ -28,14 +28,14 @@ BOOT_SIZE=20
 # 5% for swap
 SWAP_RATIO=5
 
-function usage() {
+usage() {
 	echo "Usage: $(basename $0) DEVICE HDDIMG TARGET_DEVICE"
 	echo "       DEVICE: The device to write the image to, e.g. /dev/sdh"
 	echo "       HDDIMG: The hddimg file to generate the efi disk from"
 	echo "       TARGET_DEVICE: The device the target will boot from, e.g.  /dev/mmcblk0"
 }
 
-function image_details() {
+image_details() {
 	IMG=$1
 	echo "Image details"
 	echo "============="
@@ -46,7 +46,7 @@ function image_details() {
 	echo ""
 }
 
-function device_details() {
+device_details() {
 	DEV=$1
 	BLOCK_SIZE=512
 
@@ -71,7 +71,7 @@ function device_details() {
 	echo ""
 }
 
-function unmount_device() {
+unmount_device() {
 	grep -q $DEVICE /proc/mounts
 	if [ $? -eq 0 ]; then
 		echo -n "$DEVICE listed in /proc/mounts, attempting to unmount..."
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] qtdemo-init: fix bashism
  2013-08-02  7:52 [PATCH 0/4] fix bashism for a few scripts Qi.Chen
  2013-08-02  7:52 ` [PATCH 1/4] scripts/contrib/mkefidisk.sh: fix bashism Qi.Chen
@ 2013-08-02  7:52 ` Qi.Chen
  2013-08-02  7:52 ` [PATCH 3/4] xtscal: " Qi.Chen
  2013-08-02  7:52 ` [PATCH 4/4] initramfs-framework: " Qi.Chen
  3 siblings, 0 replies; 5+ messages in thread
From: Qi.Chen @ 2013-08-02  7:52 UTC (permalink / raw)
  To: openembedded-core; +Cc: Zhangle.Yang

From: Chen Qi <Qi.Chen@windriver.com>

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-qt/qt-demo/qt-demo-init/qtdemo-init |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-qt/qt-demo/qt-demo-init/qtdemo-init b/meta/recipes-qt/qt-demo/qt-demo-init/qtdemo-init
index 0748fcd..3a1f2cb 100644
--- a/meta/recipes-qt/qt-demo/qt-demo-init/qtdemo-init
+++ b/meta/recipes-qt/qt-demo/qt-demo-init/qtdemo-init
@@ -12,13 +12,13 @@ case "$1" in
   start)
 	echo "Starting qtdemo"
 	if [ -f /etc/profile.d/tslib.sh ]; then
-		source /etc/profile.d/tslib.sh
+		. /etc/profile.d/tslib.sh
 	fi
 	if [ -e "$TSLIB_TSDEVICE" ]; then
 		if [ ! -f /etc/pointercal ]; then
 			/usr/bin/ts_calibrate
 		fi
-		if [ "$QTDEMO" == qtdemo ]; then
+		if [ "$QTDEMO" = qtdemo ]; then
 			Xorg &
 			export DISPLAY=:0
 			$QTDEMO &
@@ -26,7 +26,7 @@ case "$1" in
 			QWS_MOUSE_PROTO=tslib:$TSLIB_TSDEVICE $QTDEMO &
 		fi
 	else
-		if [ "$QTDEMO" == qtdemo ]; then
+		if [ "$QTDEMO" = qtdemo ]; then
 			Xorg &
 			export DISPLAY=:0
 		fi
@@ -35,7 +35,7 @@ case "$1" in
 	;;
   stop)
 	echo "Stopping qtdemo"
-	if [ "$QTDEMO" == qtdemo ]; then
+	if [ "$QTDEMO" = qtdemo ]; then
 		killall Xorg
 		killall qtdemo
 	else
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] xtscal: fix bashism
  2013-08-02  7:52 [PATCH 0/4] fix bashism for a few scripts Qi.Chen
  2013-08-02  7:52 ` [PATCH 1/4] scripts/contrib/mkefidisk.sh: fix bashism Qi.Chen
  2013-08-02  7:52 ` [PATCH 2/4] qtdemo-init: " Qi.Chen
@ 2013-08-02  7:52 ` Qi.Chen
  2013-08-02  7:52 ` [PATCH 4/4] initramfs-framework: " Qi.Chen
  3 siblings, 0 replies; 5+ messages in thread
From: Qi.Chen @ 2013-08-02  7:52 UTC (permalink / raw)
  To: openembedded-core; +Cc: Zhangle.Yang

From: Chen Qi <Qi.Chen@windriver.com>

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 .../xtscal/xtscal/30xTs_Calibrate.sh               |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-graphics/xtscal/xtscal/30xTs_Calibrate.sh b/meta/recipes-graphics/xtscal/xtscal/30xTs_Calibrate.sh
index b8383bf..fa43617 100644
--- a/meta/recipes-graphics/xtscal/xtscal/30xTs_Calibrate.sh
+++ b/meta/recipes-graphics/xtscal/xtscal/30xTs_Calibrate.sh
@@ -8,6 +8,6 @@ if [ "$HAVE_TOUCHSCREEN" = "1" ]; then
 	do
 	   /usr/bin/xtscal
 	   sleep 1
-	   let "n += 1"
+	   n=$(($n+1))
 	done
 fi
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] initramfs-framework: fix bashism
  2013-08-02  7:52 [PATCH 0/4] fix bashism for a few scripts Qi.Chen
                   ` (2 preceding siblings ...)
  2013-08-02  7:52 ` [PATCH 3/4] xtscal: " Qi.Chen
@ 2013-08-02  7:52 ` Qi.Chen
  3 siblings, 0 replies; 5+ messages in thread
From: Qi.Chen @ 2013-08-02  7:52 UTC (permalink / raw)
  To: openembedded-core; +Cc: Zhangle.Yang

From: Chen Qi <Qi.Chen@windriver.com>

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 .../initrdscripts/initramfs-framework/finish       |    5 +++--
 .../initrdscripts/initramfs-framework/init         |   13 +++++++------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/finish b/meta/recipes-core/initrdscripts/initramfs-framework/finish
index bedd803..325f47b 100755
--- a/meta/recipes-core/initrdscripts/initramfs-framework/finish
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/finish
@@ -16,8 +16,9 @@ finish_run() {
 		if [ -n "$bootparam_root" ]; then
 			debug "No e2fs compatible filesystem has been mounted, mounting $bootparam_root..."
 
-			if [ "${bootparam_root:0:5}" = "UUID=" ]; then
-				bootparam_root="/dev/disk/by-uuid/${bootparam_root/UUID=/}"
+			if [ "`echo ${bootparam_root} | cut -c1-5`" = "UUID=" ]; then
+				root_uuid=`echo $bootparam_root | cut -c6-`
+				bootparam_root="/dev/disk/by-uuid/$root_uuid"
 			fi
 
 			if [ -e "$bootparam_root" ]; then
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/init b/meta/recipes-core/initrdscripts/initramfs-framework/init
index 0be8f4d..20774aa 100755
--- a/meta/recipes-core/initrdscripts/initramfs-framework/init
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/init
@@ -78,12 +78,13 @@ mount -t sysfs sysfs /sys
 
 # populate bootparam environment
 for p in `cat /proc/cmdline`; do
-	opt="${p%%=*}"
-	opt=${opt/-/_}
-	if [ "${p/=/}" = "$p" ]; then
+	opt=`echo $p | cut -d'=' -f1`
+	opt=`echo $opt | sed -e 's/-/_/'`
+	if [ "`echo $p | cut -d'=' -f1`" = "$p" ]; then
 		eval "bootparam_${opt}=true"
 	else
-		eval "bootparam_${opt}=\"${p#*=}\""
+		value="`echo $p | cut -d'=' -f2-`"
+		eval "bootparam_${opt}=\"${value}\""
 	fi
 done
 
@@ -102,7 +103,7 @@ mkdir $ROOTFS_DIR
 # Load and run modules
 for m in $MODULES_DIR/*; do
 	# Skip backup files
-	if [ "${m/\~/}" != "$m" ]; then
+	if [ "`echo $m | sed -e 's/\~$//'`" = "$m" ]; then
 		continue
 	fi
 
@@ -117,7 +118,7 @@ for m in $MODULES_DIR/*; do
 	done
 
 	# process module
-	source $m
+	. $m
 
 	if ! eval "${module}_enabled"; then
 		debug "Skipping module $module"
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-02  7:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-02  7:52 [PATCH 0/4] fix bashism for a few scripts Qi.Chen
2013-08-02  7:52 ` [PATCH 1/4] scripts/contrib/mkefidisk.sh: fix bashism Qi.Chen
2013-08-02  7:52 ` [PATCH 2/4] qtdemo-init: " Qi.Chen
2013-08-02  7:52 ` [PATCH 3/4] xtscal: " Qi.Chen
2013-08-02  7:52 ` [PATCH 4/4] initramfs-framework: " Qi.Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.