]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
getsounds.sh: avoid copying sound files
authorTravis Cross <tc@traviscross.com>
Wed, 25 Apr 2012 08:03:10 +0000 (08:03 +0000)
committerTravis Cross <tc@traviscross.com>
Wed, 25 Apr 2012 08:59:12 +0000 (08:59 +0000)
build/getsounds.sh.in

index f25922c7efda0bde859c9f8810f16f7842ac2c28..de6cc72947869f5199eb2a5e6220d6b77c555372 100755 (executable)
@@ -22,17 +22,17 @@ echo -n "#"
 pwd
 echo "# $0 $1 $2"
 
-if [ ! -f $tarfile ] ; then
-    if [ -f $FS_SOUNDS_DIR/$tarfile ]; then
-        cp -l $FS_SOUNDS_DIR/$tarfile . \
-            || cp $FS_SOUNDS_DIR/$tarfile .
-    else
-        $DOWNLOAD_CMD $base$tarfile
-        if [ ! -f $tarfile ] ; then
-            echo cannot find $tarfile
-           exit 1
-        fi
-    fi
+if [ -n "$FS_SOUNDS_DIR" ] ; then
+    [ -d $FS_SOUNDS_DIR ] || mkdir -p $FS_SOUNDS_DIR
+    DIR=$FS_SOUNDS_DIR
+fi
+
+if [ ! -f $DIR/$tarfile ] ; then
+  (cd $DIR && $DOWNLOAD_CMD $base$tarfile)
+  if [ ! -f $DIR/$tarfile ] ; then
+    echo cannot find $tarfile
+    exit 1
+  fi
 fi
 
 if [ ! -z $install ] ; then