#!/bin/sh function usage { echo "" echo "Usage: source dest" echo "" echo "source must point to a branch directory to use" echo "dest must be the name of the tarball" echo "" echo "Example: make_release 1.2_RC deluge-1.2.0" echo "" } if [ ! $# == 2 ]; then usage exit fi src="$1" dst="$2" if [ ! -d $src ]; then echo "$src is not a directory!" usage exit fi echo "Attemping svn export of $src to $dst.." svn export $src $dst if [ ! $? == 0 ]; then echo "There was an error with the svn export.. Aborting." exit fi REMOVALS=( "$dst/libtorrent" "$dst/win32" "$dst/docs/build" "$dst/docs/source" "$dst/tests" "$dst/deluge/scripts" ) echo "Removing unwanted directories/files.." for remove in ${REMOVALS[@]} do echo "rm -r $remove" rm -r $remove done echo "Creating tarballs.." tar -czf $dst".tar.gz" $dst tar -cjf $dst".tar.bz2" $dst tar --lzma -cf $dst".tar.lzma" $dst echo "Calculating hashes.." echo "" HASHES=( "sha1sum" "md5sum" ) TARBALLS=( "$dst.tar.gz" "$dst.tar.bz2" "$dst.tar.lzma" ) for h in ${HASHES[@]} do echo "$h:" for tb in ${TARBALLS[@]} do $h $tb done echo "" done