Patch:xpm:Fix bashism downloaded from http://navit.latouche.info/tmp/navit_svg2png...
authorwoglinde <woglinde@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 26 Jan 2010 11:12:11 +0000 (11:12 +0000)
committerHenning Heinold <heinold@inf.fu-berlin.de>
Thu, 4 Feb 2010 23:46:35 +0000 (00:46 +0100)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit@2927 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/xpm/navit_svg2png

index f40ec2d..50cd5f2 100755 (executable)
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/bin/sh
 
-function svgtopng
+svgtopng()
 {
        case $svgtopng in
        *ksvgtopng|*ksvgtopng4)
@@ -18,22 +18,24 @@ function svgtopng
        esac
 }
 
-if test "$OSTYPE" != "cygwin" -a "$OSTYPE" != "msys"; then
+if [ "$OSTYPE" != "cygwin" -a "$OSTYPE" != "msys" ]; then
        ulimit -t 5
 fi
 
 svgtopng=$1
 png=$2
-if [[ "$png" = *_[1-9]*_[1-9]*.png ]];
-then
-        svg=${png%_*_*.png};
-       h=${png##*_}
-       w=${png%_$h}
-       h=${h%.png}
-       w=${w##*_}
-else
-       svg=${png%.png}
-fi
+case "$png" in
+       *_[1-9]*_[1-9]*.png)
+               svg=${png%_*_*.png};
+               h=${png##*_}
+               w=${png%_$h}
+               h=${h%.png}
+               w=${w##*_}
+               ;;
+       *)
+               svg=${png%.png}
+               ;;
+esac
 if [ ! -f $svg.svg -a ! -f $svg.svgz ]
 then
        svg="$SRCDIR/$svg"
@@ -42,7 +44,7 @@ if [ -f $png -a ! -f $svg.svg ]; then
        # width and height seems to be defined as part of the file name
        touch $png
 else
-       # use width and hight from the svg image
+       # use width and height from the svg image
        if [ -f $svg.svg ]
        then
                if [ -z "$w" ]