From 8a6383884bb3ff25edffe1853deedec6094a8811 Mon Sep 17 00:00:00 2001 From: Jonas Häggqvist Date: Mon, 13 Aug 2007 12:31:18 +0000 Subject: More elegant (and robust) check for program availability. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14311 a1c6a512-1295-4272-9138-f99709370657 --- tools/voicecommon.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tools/voicecommon.sh') diff --git a/tools/voicecommon.sh b/tools/voicecommon.sh index 61e0d07bdd..052e73b67a 100644 --- a/tools/voicecommon.sh +++ b/tools/voicecommon.sh @@ -53,7 +53,7 @@ TOOLSDIR=`dirname $0` WAVTRIM=$TOOLSDIR/wavtrim # The SAPI5 script directory -if [ "`which cygpath`" != "" ]; then +if [ -f "`which cygpath`" ]; then SAPI5DIR=`cygpath $TOOLSDIR -a -w` fi @@ -128,14 +128,14 @@ init_tts() { case $TTS_ENGINE in festival) # Check for festival_client - if [ "`which $FESTIVAL_CLIENT`" = "" ]; then + if [ -f "`which $FESTIVAL_CLIENT`" ]; then echo "Error: $FESTIVAL_CLIENT not found" exit 4 fi # Check for, and start festival server if specified if [ X$FESTIVAL_START = XY ]; then - if [ "`which $FESTIVAL_BIN`" = "" ]; then + if [ -f "`which $FESTIVAL_BIN`" ]; then echo "Error: $FESTIVAL_BIN not found" exit 3 fi @@ -160,14 +160,14 @@ init_tts() { ;; flite) # Check for flite - if [ "`which $FLITE_BIN`" = "" ]; then + if [ -f "`which $FLITE_BIN`" ]; then echo "Error: $FLITE_BIN not found" exit 5 fi ;; espeak) # Check for espeak - if [ "`which $ESPEAK_BIN`" = "" ]; then + if [ -f "`which $ESPEAK_BIN`" ]; then echo "Error: $ESPEAK_BIN not found" exit 5 fi @@ -208,21 +208,21 @@ init_encoder() { case $ENCODER in lame) # Check for lame binary - if [ "" = "`which $LAME_BIN`" ]; then + if [ -f "`which $LAME_BIN`" ]; then echo "Error: $LAME_BIN not found" exit 6 fi ;; speex) # Check for speexenc binary - if [ "" = "`which $SPEEX_BIN`" ]; then + if [ -f "`which $SPEEX_BIN`" ]; then echo "Error: $SPEEX_BIN not found" exit 7 fi ;; vorbis) # Check for vorbis encoder binary - if [ "" = "`which $VORBIS_BIN`" ]; then + if [ -f "`which $VORBIS_BIN`" ]; then echo "Error: $VORBIS_BIN not found" exit 10 fi -- cgit v1.2.3