tribler-mod: Added script that modifies Tribler's sources setting DEBUG to True/False.
authorAdriana Draghici <adriana008@gmail.com>
Tue, 27 Oct 2009 10:06:25 +0000 (12:06 +0200)
committerAdriana Draghici <adriana008@gmail.com>
Tue, 27 Oct 2009 10:06:25 +0000 (12:06 +0200)
Signed-off-by: Adriana Draghici <adriana008@gmail.com>
tribler-mod/scrips/set_DEBUG.sh [new file with mode: 0755]

diff --git a/tribler-mod/scrips/set_DEBUG.sh b/tribler-mod/scrips/set_DEBUG.sh
new file mode 100755 (executable)
index 0000000..b722ae4
--- /dev/null
@@ -0,0 +1,14 @@
+
+if test $# -lt 2 -o \( "-$1" != "-f" -a "-$1" != "-t" \)
+then
+       echo "Usage: ";echo "$0 t <filename> - changes DEBUG variable to True for the source files listed in <filename>"
+       echo "$0 f <filename> - changes DEBUG variable to False for the source files listed in <filename>"
+else
+#      for i in $(cat $2 | grep "/");do echo $i; done;
+       if test "-$1" == "-t"
+       then
+               for i in $(cat $2 | grep "/"); do sed -i.bak 's/DEBUG[ \t]*=[ \t]*False[ \t]*[#a-zA-Z ]*/DEBUG = True  #False/g' $i; done;
+       else
+               for i in $(cat $2 | grep "/"); do sed -i.bak 's/DEBUG[ \t]*=[ \t]*True[ \t]*[#a-zA-Z ]*/DEBUG = False #True/g' $i; done;
+       fi
+fi