-NAME=tinyos
-VERSION=2.1.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
./tests/TestSerial/TestSerial.class
./RadioCountToLeds/RadioCountMsg.class
EOF
-rm -rf $NAME-$VERSION
+popd