[thrift] highly concurrent Erlang goodness

Summary:
 * shim to use object-oriented code as gen_servers
 * high(er) performance Erlang-style server and transport
 * sane packaging based on otp-base, i.e. Makefiles and real structure

Test Plan: tutorial server offers the same (subset of) functionality as previous version

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665164 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/erl/tools/.appgen/substitute.sh b/lib/erl/tools/.appgen/substitute.sh
new file mode 100755
index 0000000..5305b75
--- /dev/null
+++ b/lib/erl/tools/.appgen/substitute.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+
+if [ $# -lt 2 ]; then
+	echo "usage: substitute.sh <variable to replace> <value to replace with> <filename | STDIN>"
+	exit 1
+fi
+
+if [ $# -eq 3 ]; then
+	VARIABLE=$1
+	VALUE=$2
+	FILENAME=$3
+	
+	echo "replacing $VARIABLE with $VALUE in $FILENAME"
+	sed -e "s/$VARIABLE/$VALUE/" $FILENAME > "$FILENAME"_tmp 
+	mv "$FILENAME"_tmp $FILENAME
+	exit 0
+fi
+
+if [ $# -eq 2 ]; then
+    while read line; 
+    do
+		VARIABLE=$1
+		VALUE=$2
+		FILENAME=${line}
+	
+		echo "replacing $VARIABLE with $VALUE in $FILENAME"
+		sed -e "s/$VARIABLE/$VALUE/" $FILENAME > "$FILENAME"_tmp 
+		mv "$FILENAME"_tmp $FILENAME
+    done
+    exit 0
+fi
+