format_mp3: Made the get script conditionally apply patch if not already there.
authorRichard Mudgett <rmudgett@digium.com>
Fri, 26 Sep 2014 15:51:22 +0000 (15:51 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Fri, 26 Sep 2014 15:51:22 +0000 (15:51 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424039 65c4cc65-6c06-0410-ace0-fbb531ad65f3

contrib/scripts/get_mp3_source.sh

index e1ee13b..860e2bc 100755 (executable)
@@ -17,8 +17,10 @@ fi
 
 svn export http://svn.digium.com/svn/thirdparty/mp3/trunk addons/mp3 $@
 
-# Manually patch interface.c.
-sed -i -e '/#include "asterisk.h"/i#define WRAP_LIBC_MALLOC' \
-    addons/mp3/interface.c
+# Manually patch interface.c if not done yet.
+if ! grep -q WRAP_LIBC_MALLOC addons/mp3/interface.c; then
+    sed -i -e '/#include "asterisk.h"/i#define WRAP_LIBC_MALLOC' \
+        addons/mp3/interface.c
+fi
 
 exit 0