-NAME=tinyos-tools
-VERSION=1.3.0
+NAME="$1"
+VERSION="$2"
+OUTPUT_FILE="$3"
-cd ../..
-rm -rf $NAME-$VERSION
-tools/release/extractor $NAME-$VERSION <<'EOF' | gzip >../$NAME-$VERSION.tar.gz
+pushd ../../
+./tools/release/extractor $NAME-$VERSION $OUTPUT_FILE <<'EOF'
+!^./tinyos.sh
+!^./tos.mk
+!^./debian
+!^./(patch|configure|build|install)-stamp
!^./apps
!^./doc
!^./support
!/.cvsignore
!/CVS/
!/CVS$
+!/.svn/
+!/.svn$
+!^./.git
+!^./.gitignore
+!^./.gbp.conf
!~$
!#
EOF
-rm -rf $NAME-$VERSION
+popd