]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
getsounds.sh: look for a locally-cached copy first
authorTravis Cross <tc@traviscross.com>
Tue, 24 Apr 2012 04:00:43 +0000 (04:00 +0000)
committerTravis Cross <tc@traviscross.com>
Tue, 24 Apr 2012 05:09:41 +0000 (05:09 +0000)
This lets you specify a FS_SOUNDS_DIR in which to look for the sound
tarballs.  This makes it easier to use git clean -fdx without
downloading the sounds every time.

build/getsounds.sh.in

index 09105fd280e81a9a64cf7e5f4d4abb5657fc93a7..c4a434ad2811132e944b17ab51a2a028845b7a8e 100755 (executable)
@@ -23,10 +23,15 @@ pwd
 echo "# $0 $1 $2"
 
 if [ ! -f $tarfile ] ; then
-    $DOWNLOAD_CMD $base$tarfile
-    if [ ! -f $tarfile ] ; then
-        echo cannot find $tarfile
-       exit 1
+    if [ -f $FS_SOUNDS_DIR/$tarfile ]; then
+        test ! 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
 fi