Skip to contentSkip to conversation

scripts/extract-ikconfig: remove bashisms

PATCH Applied [email protected] 2 participants 2 messages Dec 1, 2008 – Dec 3, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 8/8 scripts/extract-ikconfig: remove bashisms

From: Werner Almesberger <[email protected]>

scripts/extract-ikconfig contains a lot of gratuituous bashisms, which make it fail if /bin/sh isn't bash. This patch replaces them with regular Bourne shell constructs.

---

 scripts/extract-ikconfig |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
scripts/extract-ikconfig renamed from scripts/extract-ikconfig~scripts-extract-ikconfig-remove-bashisms +4 -4
diff -puN scripts/extract-ikconfig~scripts-extract-ikconfig-remove-bashisms scripts/extract-ikconfig
@@ -8,8 +8,8 @@ test -e $binoffset || cc -o $binoffset .
 
 IKCFG_ST="0x49 0x4b 0x43 0x46 0x47 0x5f 0x53 0x54"
 IKCFG_ED="0x49 0x4b 0x43 0x46 0x47 0x5f 0x45 0x44"
-function dump_config {
-    typeset file="$1"
+dump_config() {
+    file="$1"
 
     start=`$binoffset $file $IKCFG_ST 2>/dev/null`
     [ "$?" != "0" ] && start="-1"
@@ -18,8 +18,8 @@ function dump_config {
     fi
     end=`$binoffset $file $IKCFG_ED 2>/dev/null`
 
-    let start="$start + 8"
-    let size="$end - $start"
+    start=`expr $start + 8`
+    size=`expr $end - $start`
 
     dd if="$file" ibs=1 skip="$start" count="$size" 2>/dev/null | zcat
 

_

#1 lore raw
Quoted 10 lines · On Mon, Dec 01, 2008 at 02:21:08PM -0800, [email protected] wrote:

From: Werner Almesberger <[email protected]>

scripts/extract-ikconfig contains a lot of gratuituous bashisms, which make it fail if /bin/sh isn't bash. This patch replaces them with regular Bourne shell constructs.

Already applied - soon to appear in -next.

Sam