]>
Commit | Line | Data |
---|---|---|
11a3e7b6 VZ |
1 | #! /bin/bash |
2 | # | |
3 | # make-release.sh: make an Expat release | |
4 | # | |
5 | # USAGE: make-release.sh tagname | |
6 | # | |
7 | # Note: tagname may be HEAD to just grab the head revision (e.g. for testing) | |
8 | # | |
9 | ||
10 | #CVSROOT=':ext:cvs.libexpat.org:/cvsroot/expat' | |
11 | CVSROOT=':pserver:anonymous@expat.cvs.sourceforge.net:/cvsroot/expat' | |
12 | ||
13 | if test $# != 1; then | |
14 | echo "USAGE: $0 tagname" | |
15 | exit 1 | |
16 | fi | |
17 | ||
18 | tmpdir=expat-release.$$ | |
19 | if test -e $tmpdir; then | |
20 | echo "ERROR: oops. chose the $tmpdir subdir, but it exists." | |
21 | exit 1 | |
22 | fi | |
23 | ||
24 | echo "Checking out into temporary area: $tmpdir" | |
25 | cvs -fq -d "$CVSROOT" export -r "$1" -d $tmpdir expat || exit 1 | |
26 | ||
27 | echo "" | |
28 | echo "----------------------------------------------------------------------" | |
29 | echo "Preparing $tmpdir for release (running buildconf.sh)" | |
30 | (cd $tmpdir && ./buildconf.sh) || exit 1 | |
31 | ||
32 | # figure out the release version | |
33 | vsn="`$tmpdir/conftools/get-version.sh $tmpdir/lib/expat.h`" | |
34 | ||
35 | echo "" | |
36 | echo "Release version: $vsn" | |
37 | ||
38 | if test "$1" = HEAD ; then | |
39 | distdir=expat-`date '+%Y-%m-%d'` | |
40 | else | |
41 | distdir=expat-$vsn | |
42 | fi | |
43 | if test -e $distdir; then | |
44 | echo "ERROR: for safety, you must manually remove $distdir." | |
45 | rm -rf $tmpdir | |
46 | exit 1 | |
47 | fi | |
48 | mkdir $distdir || exit 1 | |
49 | ||
50 | CPOPTS=-Pp | |
51 | if (cp --version 2>/dev/null | grep -q 'Free Software Foundation') ; then | |
52 | # If we're using GNU cp, we can avoid the warnings about forward | |
53 | # compatibility of the options. | |
54 | CPOPTS='--parents --preserve' | |
55 | fi | |
56 | ||
57 | echo "" | |
58 | echo "----------------------------------------------------------------------" | |
59 | echo "Building $distdir based on the MANIFEST:" | |
60 | files="`sed -e 's/[ ]:.*$//' $tmpdir/MANIFEST`" | |
61 | for file in $files; do | |
62 | echo "Copying $file..." | |
63 | (cd $tmpdir && cp $CPOPTS $file ../$distdir) || exit 1 | |
64 | done | |
65 | ||
66 | echo "" | |
67 | echo "----------------------------------------------------------------------" | |
68 | echo "Removing (temporary) checkout directory..." | |
69 | rm -rf $tmpdir | |
70 | ||
71 | tarball=$distdir.tar.gz | |
72 | echo "Constructing $tarball..." | |
73 | tar cf - $distdir | gzip -9 > $tarball || exit $? | |
74 | rm -r $distdir | |
75 | ||
76 | echo "Done." |