Split GetStatus JVM command.
[barry/progweb.git] / maintainer / git-tagged-release.sh
blob26a3af60a93f407d421052112f66c799d583f5ac
1 #!/bin/sh
3 if [ -z "$1" -o -z "$2" ] ; then
4 echo
5 echo "Usage: ./git-tagged-tar.sh MAJOR MINOR"
6 echo
7 echo "MAJOR is the desired major version number"
8 echo "MINOR is the desired minor version number"
9 echo
10 echo "This script is an alternative to git-release-tar.sh, and"
11 echo "produces the same output, with the additional side effect of"
12 echo "having 2 pristine tar deltas available to generate the"
13 echo "debian and the tar.bz2 tarballs directly from the repository."
14 echo
15 echo "This script assumes that a tag called 'barry-MAJOR.MINOR' already"
16 echo "exists. This script will create two more tags:"
17 echo
18 echo " barry-MAJOR.MINOR.tar.bz2"
19 echo " barry_MAJOR.MINOR.orig.tar.gz"
20 echo
21 echo "Both tags will contain trees with the same contents as the"
22 echo "tarballs of the same name."
23 echo
24 echo "In addition, pristine-tar will be run against the above generated"
25 echo "tarballs, and will produce deltas in the usual pristine-tar branch."
26 echo
27 echo "The main difference between git-release-tar.sh and this script"
28 echo "is that this script must be run from inside the root of the"
29 echo "git repository you wish to use."
30 echo
31 echo "Example: cd barry-repo"
32 echo " git tag barry-0.14"
33 echo " maintainer/git-tagged-tar.sh 0 14"
34 echo
35 exit 1
38 DIRNAME="barry-$1.$2"
39 MAJOR="$1"
40 MINOR="$2"
41 COMMIT="barry-$1.$2"
43 # make sure that git has its tar.umask set to 0022
44 GITUMASK=$(git config tar.umask)
45 if [ "$GITUMASK" != "0022" ] ; then
46 echo "Please set:"
47 echo
48 echo " git config tar.umask 0022"
49 echo
50 exit 1
53 set -e
55 # Are we in a Barry root tree?
56 if ! [ -f AUTHORS -a -f ChangeLog -a -f COPYING -a -f buildgen.sh ] ; then
57 echo "Can't find Barry files. Please run from root of Barry tree."
58 exit 1
61 # start fresh
62 git checkout -f master
63 git clean -xdf
65 mkdir maintainer/build
67 # generate tarball trees
68 git checkout -b git-tagged-tar "$COMMIT"
69 maintainer/tar-prepare.sh
70 git add .
71 git commit -m "Tarball tree for barry-$MAJOR.$MINOR.tar.bz2"
72 git tag -s "barry-$MAJOR.$MINOR.tar.bz2"
73 git rm -r debian
74 git commit -m "Tarball tree for barry_$MAJOR.$MINOR.orig.tar.gz"
75 git tag -s "barry_$MAJOR.$MINOR.orig.tar.gz"
77 # generate bzip2 tarball
78 git archive --prefix="$DIRNAME/" "barry-$MAJOR.$MINOR.tar.bz2" | \
79 bzip2 -9c > "maintainer/build/barry-$MAJOR.$MINOR.tar.bz2"
81 # generate debian source package... create tar.gz without debian/, and
82 # a tree with debian, and then run dpkg-source to bundle it up
83 git archive --prefix="$DIRNAME/" "barry_$MAJOR.$MINOR.orig.tar.gz" | \
84 gzip -9c > "maintainer/build/barry_$MAJOR.$MINOR.orig.tar.gz"
85 git archive --prefix="$DIRNAME/" "barry-$MAJOR.$MINOR.tar.bz2" | \
86 (cd maintainer/build && tar xf -)
87 (cd maintainer/build && dpkg-source -b $DIRNAME barry_$MAJOR.$MINOR.orig.tar.gz)
89 # finally, generate pristine-tar deltas
90 pristine-tar -m "Release tarball barry-$MAJOR.$MINOR.tar.bz2" commit \
91 maintainer/build/barry-$MAJOR.$MINOR.tar.bz2 \
92 barry-$MAJOR.$MINOR.tar.bz2
93 pristine-tar -m "Release tarball barry_$MAJOR.$MINOR.orig.tar.gz" commit \
94 maintainer/build/barry_$MAJOR.$MINOR.orig.tar.gz \
95 barry_$MAJOR.$MINOR.orig.tar.gz
97 # cleanup
98 git checkout master
99 git branch -D git-tagged-tar