3 if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then
5 echo "Usage: ./git-tagged-tar.sh LOGICAL MAJOR MINOR"
7 echo "LOGICAL is the desired logical version number"
8 echo "MAJOR is the desired libmajor version number"
9 echo "MINOR is the desired libminor version number"
11 echo "This script is an alternative to git-release-tar.sh, and"
12 echo "produces the same output, with the additional side effect of"
13 echo "having 2 pristine tar deltas available to generate the"
14 echo "debian and the tar.bz2 tarballs directly from the repository."
16 echo "This script assumes that a tag called 'barry-LOGICAL.MAJOR.MINOR' already"
17 echo "exists. This script will create two more tags:"
19 echo " barry-LOGICAL.MAJOR.MINOR.tar.bz2"
20 echo " barry_LOGICAL.MAJOR.MINOR.orig.tar.gz"
22 echo "Both tags will contain trees with the same contents as the"
23 echo "tarballs of the same name."
25 echo "In addition, pristine-tar will be run against the above generated"
26 echo "tarballs, and will produce deltas in the usual pristine-tar branch."
28 echo "The main difference between git-release-tar.sh and this script"
29 echo "is that this script must be run from inside the root of the"
30 echo "git repository you wish to use."
32 echo "Example: cd barry-repo"
33 echo " git tag barry-0.17.0"
34 echo " maintainer/git-tagged-tar.sh 0 17 0"
39 DIRNAME
="barry-$1.$2.$3"
43 COMMIT
="barry-$1.$2.$3"
45 # make sure that git has its tar.umask set to 0022
46 GITUMASK
=$
(git config
tar.
umask)
47 if [ "$GITUMASK" != "0022" ] ; then
50 echo " git config tar.umask 0022"
57 # Are we in a Barry root tree?
58 if ! [ -f AUTHORS
-a -f ChangeLog
-a -f COPYING
-a -f buildgen.sh
] ; then
59 echo "Can't find Barry files. Please run from root of Barry tree."
64 git checkout
-f master
67 mkdir maintainer
/build
69 # generate tarball trees
70 git checkout
-b git-tagged-tar
"$COMMIT"
71 maintainer
/tar-prepare.sh
73 git commit
-m "Tarball tree for barry-$LOGICAL.$MAJOR.$MINOR.tar.bz2"
74 git tag
-s "barry-$LOGICAL.$MAJOR.$MINOR.tar.bz2"
76 git commit
-m "Tarball tree for barry_$LOGICAL.$MAJOR.$MINOR.orig.tar.gz"
77 git tag
-s "barry_$LOGICAL.$MAJOR.$MINOR.orig.tar.gz"
79 # generate bzip2 tarball
80 git archive
--prefix="$DIRNAME/" "barry-$LOGICAL.$MAJOR.$MINOR.tar.bz2" | \
81 bzip2 -9c > "maintainer/build/barry-$LOGICAL.$MAJOR.$MINOR.tar.bz2"
83 # generate debian source package... create tar.gz without debian/, and
84 # a tree with debian, and then run dpkg-source to bundle it up
85 git archive
--prefix="$DIRNAME/" "barry_$LOGICAL.$MAJOR.$MINOR.orig.tar.gz" | \
86 gzip -9c > "maintainer/build/barry_$LOGICAL.$MAJOR.$MINOR.orig.tar.gz"
87 git archive
--prefix="$DIRNAME/" "barry-$LOGICAL.$MAJOR.$MINOR.tar.bz2" | \
88 (cd maintainer
/build
&& tar xf
-)
89 (cd maintainer
/build
&& dpkg-source
-b $DIRNAME barry_
$LOGICAL.
$MAJOR.
$MINOR.orig.
tar.gz
)
91 # finally, generate pristine-tar deltas
92 pristine-tar
-m "Release tarball barry-$LOGICAL.$MAJOR.$MINOR.tar.bz2" commit \
93 maintainer
/build
/barry-
$LOGICAL.
$MAJOR.
$MINOR.
tar.bz2 \
94 barry-
$LOGICAL.
$MAJOR.
$MINOR.
tar.bz2
95 pristine-tar
-m "Release tarball barry_$LOGICAL.$MAJOR.$MINOR.orig.tar.gz" commit \
96 maintainer
/build
/barry_
$LOGICAL.
$MAJOR.
$MINOR.orig.
tar.gz \
97 barry_
$LOGICAL.
$MAJOR.
$MINOR.orig.
tar.gz
101 git branch
-D git-tagged-tar