3 if [ -z "$1" -o -z "$2" ] ; then
5 echo "Usage: ./git-tagged-tar.sh MAJOR MINOR"
7 echo "MAJOR is the desired major version number"
8 echo "MINOR is the desired minor version number"
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."
15 echo "This script assumes that a tag called 'barry-MAJOR.MINOR' already"
16 echo "exists. This script will create two more tags:"
18 echo " barry-MAJOR.MINOR.tar.bz2"
19 echo " barry_MAJOR.MINOR.orig.tar.gz"
21 echo "Both tags will contain trees with the same contents as the"
22 echo "tarballs of the same name."
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."
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."
31 echo "Example: cd barry-repo"
32 echo " git tag barry-0.14"
33 echo " maintainer/git-tagged-tar.sh 0 14"
43 # make sure that git has its tar.umask set to 0022
44 GITUMASK
=$
(git config
tar.
umask)
45 if [ "$GITUMASK" != "0022" ] ; then
48 echo " git config tar.umask 0022"
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."
62 git checkout
-f master
65 mkdir maintainer
/build
67 # generate tarball trees
68 git checkout
-b git-tagged-tar
"$COMMIT"
69 maintainer
/tar-prepare.sh
71 git commit
-m "Tarball tree for barry-$MAJOR.$MINOR.tar.bz2"
72 git tag
-s "barry-$MAJOR.$MINOR.tar.bz2"
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
99 git branch
-D git-tagged-tar