diff options
Diffstat (limited to 'maketarball.sh')
-rwxr-xr-x | maketarball.sh | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/maketarball.sh b/maketarball.sh index 2ee78016..5ded9671 100755 --- a/maketarball.sh +++ b/maketarball.sh @@ -1,29 +1,48 @@ #!/bin/bash -# usage: maketarball -# maketarball <tag> +# GNU MediaGoblin -- federated, autonomous media hosting +# Copyright (C) 2011 Free Software Foundation, Inc # -# With no arguments, this creates a source tarball from git master with a -# filename based on today's date. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# With a <tag> argument, this creates a tarball of the tag. +# 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +# usage: maketarball [-d] <rev-ish> +# +# Creates a tarball from a rev-ish. If -d is passed in, then it adds +# the date to the directory name. # # Examples: # -# ./maketarball +# ./maketarball -d master # ./maketarball v0.0.2 +if [[ -z "$1" ]]; then + echo "Usage: $0 [-d] <rev-ish>"; + exit 1; +fi + NOWDATE=`date "+%Y-%m-%d"` -if [ -z "$1" ] -then - REVISH=master +if [[ $@ == *-d* ]]; then + REVISH=$2 PREFIX="$NOWDATE-$REVISH" else REVISH=$1 PREFIX="$REVISH" fi + # convert PREFIX to all lowercase. # nix the v from tag names. PREFIX=`echo "$PREFIX" | tr '[A-Z]' '[a-z]' | sed s/v//` @@ -54,4 +73,4 @@ gzip mediagoblin-$PREFIX.tar echo "archive at mediagoblin-$PREFIX.tar.gz" -echo "done."
\ No newline at end of file +echo "done." |