Applied patch for bug #653449.
[mirror-ossqm-expat.git] / make-release.sh
blobb38757fe25662bb7b788c7e8d466ca2e8c5708da
1 #! /bin/bash
3 # make-release.sh: make an Expat release
5 # USAGE: make-release.sh tagname
7 # Note: tagname may be HEAD to just grab the head revision (e.g. for testing)
10 if test $# != 1; then
11 echo "USAGE: $0 tagname"
12 exit 1
15 tmpdir=expat-release.$$
16 if test -e $tmpdir; then
17 echo "ERROR: oops. chose the $tmpdir subdir, but it exists."
18 exit 1
21 echo "Checking out into temporary area: $tmpdir"
22 cvs -d :pserver:anonymous@cvs.libexpat.org:/cvsroot/expat export -r "$1" -d $tmpdir expat || exit 1
24 echo ""
25 echo "----------------------------------------------------------------------"
26 echo "Preparing $tmpdir for release (running buildconf.sh)"
27 (cd $tmpdir && ./buildconf.sh) || exit 1
29 # figure out the release version
30 vsn="`$tmpdir/conftools/get-version.sh $tmpdir/lib/expat.h`"
32 echo ""
33 echo "Release version: $vsn"
35 if test "$1" = HEAD ; then
36 distdir=expat-`date '+%Y-%m-%d'`
37 else
38 distdir=expat-$vsn
40 if test -e $distdir; then
41 echo "ERROR: for safety, you must manually remove $distdir."
42 rm -rf $tmpdir
43 exit 1
45 mkdir $distdir || exit 1
47 echo ""
48 echo "----------------------------------------------------------------------"
49 echo "Building $distdir based on the MANIFEST:"
50 files="`sed -e 's/[ ]:.*$//' $tmpdir/MANIFEST`"
51 for file in $files; do
52 echo "Copying $file..."
53 (cd $tmpdir && cp -Pp $file ../$distdir) || exit 1
54 done
56 echo ""
57 echo "----------------------------------------------------------------------"
58 echo "Removing (temporary) checkout directory..."
59 rm -rf $tmpdir
61 tarball=$distdir.tar.gz
62 echo "Constructing $tarball..."
63 tar cf - $distdir | gzip -9 > $tarball
65 echo "Done."