From ff7c352f30a8726c5b042b6c145ec170ec8bdc6d Mon Sep 17 00:00:00 2001 From: woglinde Date: Tue, 26 Jan 2010 11:12:11 +0000 Subject: [PATCH] Patch:xpm:Fix bashism downloaded from http://navit.latouche.info/tmp/navit_svg2png-bashism.diff and set shell back to /bin/sh|Thanks latouch for the patch! git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit@2927 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/xpm/navit_svg2png | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/navit/xpm/navit_svg2png b/navit/xpm/navit_svg2png index f40ec2d..50cd5f2 100755 --- a/navit/xpm/navit_svg2png +++ b/navit/xpm/navit_svg2png @@ -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" ] -- 1.7.9.5