diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/newclass | 31 | ||||
-rwxr-xr-x | tools/newtestclass | 29 | ||||
-rwxr-xr-x | tools/release | 33 | ||||
-rwxr-xr-x | tools/relicense | 15 | ||||
-rwxr-xr-x | tools/replaceinsources | 9 | ||||
-rw-r--r-- | tools/sourcefileheader.txt | 19 | ||||
-rwxr-xr-x | tools/sourceformatter | 17 |
7 files changed, 153 insertions, 0 deletions
diff --git a/tools/newclass b/tools/newclass new file mode 100755 index 0000000..8831b73 --- /dev/null +++ b/tools/newclass @@ -0,0 +1,31 @@ +#!/bin/sh + +class=$1 +lowerclass=`echo $class | tr [:upper:] [:lower:]` +upperclass=`echo $class | tr [:lower:] [:upper:]` +headerfile="${lowerclass}.h" +ccfile="$lowerclass".cc + +cp `dirname $0`/sourcefileheader.txt $headerfile + +cat >> $headerfile <<EOF +#ifndef ___${upperclass}_H +#define ___${upperclass}_H + +class $1 +{ + public: +}; + +#endif +EOF + +cp `dirname $0`/sourcefileheader.txt $ccfile + +cat >> $ccfile <<EOF +#include "$headerfile" + +??? $class::???(???) +{ +} +EOF diff --git a/tools/newtestclass b/tools/newtestclass new file mode 100755 index 0000000..652f354 --- /dev/null +++ b/tools/newtestclass @@ -0,0 +1,29 @@ +#!/bin/sh + +class=$1 +lowerclass=`echo $class | tr [:upper:] [:lower:]` +include="$lowerclass".h +testfile="$lowerclass"_test.cc + +cp `dirname $0`/sourcefileheader.txt $testfile + +cat >> $testfile <<EOF +#include <cxxtest/TestSuite.h> +#include "#INCLUDE#" + +namespace +{ + +class #CLASS#Test: public CxxTest::TestSuite +{ + public: + void TestSimple() + { + } +}; + +}; +EOF + +sed "s/#CLASS#/$class/g" $testfile >$testfile.tmp ; mv $testfile.tmp $testfile +sed "s/#INCLUDE#/$include/g" $testfile >$testfile.tmp ; mv $testfile.tmp $testfile diff --git a/tools/release b/tools/release new file mode 100755 index 0000000..179525a --- /dev/null +++ b/tools/release @@ -0,0 +1,33 @@ +#!/bin/sh + +set -e + +# clean +make clean + +if [ -n "`svn st`" ] ; then + echo "uncommited changes !!!" + exit 1 +fi + +CXXFLAGS="-O0 -fPIC -ggdb -Wall -Woverloaded-virtual" + +# compile and run test +make CXXFLAGS="$CXXFLAGS" -s runtests + +# compile production code +make CXXFLAGS="$CXXFLAGS" -s LIBDIR=. VDRDIR=/usr/include/vdr LOCALEDIR=/tmp/locales all + +# clean +make clean + +# make distribution tarball +make dist + +# read version +VERSION=`grep 'static const char VERSION\[\] =' src/Version.h | awk '{ print $6 }' | sed -e 's/[";]//g'` + +# tag version +echo "Tagging: $VERSION" +svn cp -m "Releasing Vodcatcher $VERSION" svn+e-tobi://e-tobi.net/vodcatcher/trunk \ + "svn+e-tobi://e-tobi.net/vodcatcher/tags/$VERSION" diff --git a/tools/relicense b/tools/relicense new file mode 100755 index 0000000..05d42b3 --- /dev/null +++ b/tools/relicense @@ -0,0 +1,15 @@ +#!/usr/bin/ruby + +header = IO.read(File.dirname(__FILE__) + "/sourcefileheader.txt") + +for file in Dir['./**/*.{h,cc}'] + if IO.read(file) =~ /(\/\*[\S\s]*?\*\/\n)(.*)/m + src = $2 + if $1 =~ /.*Tobias Grimm.*/m + file = File.new(file, "w") + file.write(header) + file.write(src) + file.close + end + end +end diff --git a/tools/replaceinsources b/tools/replaceinsources new file mode 100755 index 0000000..55319cf --- /dev/null +++ b/tools/replaceinsources @@ -0,0 +1,9 @@ +#!/bin/sh + +sources=`find ./ -name *.cc -o -name *.h` + +for src in $sources; do + echo $src + sed "$1" "$src" >"$src".tmp + mv "$src".tmp $src +done diff --git a/tools/sourcefileheader.txt b/tools/sourcefileheader.txt new file mode 100644 index 0000000..41c315f --- /dev/null +++ b/tools/sourcefileheader.txt @@ -0,0 +1,19 @@ +/* + * vdr-vodcatcher - A plugin for the Linux Video Disk Recorder + * Copyright (c) 2007 - 2009 Tobias Grimm <vdr@e-tobi.net> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ diff --git a/tools/sourceformatter b/tools/sourceformatter new file mode 100755 index 0000000..58ad4aa --- /dev/null +++ b/tools/sourceformatter @@ -0,0 +1,17 @@ +#!/bin/sh + +make clean + +CCFILES=`find src/ -name *.cc` +HFILES=`find src/ -name *.h` + +SRCFILES="$CCFILES $HFILES" + +# +# Remove trailing whitespace from lines +# + +for file in $SRCFILES ; do + sed "s/[[:space:]]*$//" $file >$file.tmp + mv $file.tmp $file +done |