6 # With no arguments, this creates a source tarball from git master with a
7 # filename based on today's date.
9 # With a <tag> argument, this creates a tarball of the tag.
14 # ./maketarball v0.0.2
16 NOWDATE
=`date "+%Y-%m-%d"`
21 PREFIX
="$NOWDATE-$REVISH"
27 # convert PREFIX to all lowercase.
28 # nix the v from tag names.
29 PREFIX
=`echo "$PREFIX" | tr '[A-Z]' '[a-z]' | sed s/v//`
31 echo "== REVISH $REVISH"
32 echo "== PREFIX $PREFIX"
36 echo "generating archive...."
39 --prefix=mediagoblin-
$PREFIX/ \
40 $REVISH > mediagoblin-
$PREFIX.
tar
44 echo "git archive command failed. See above text for reason."
45 if [[ -e mediagoblin-
$PREFIX.
tar ]]
47 rm mediagoblin-
$PREFIX.
tar
52 echo "compressing...."
53 gzip mediagoblin-
$PREFIX.
tar
55 echo "archive at mediagoblin-$PREFIX.tar.gz"