source: scripts/do-release @ 6211c76

release-1.10release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since 6211c76 was 168f8a9, checked in by Nelson Elhage <nelhage@mit.edu>, 15 years ago
do-release: Support --no-tag for test builds.
  • Property mode set to 100755
File size: 1.4 KB
Line 
1#!/bin/sh -e
2
3die() {
4    echo "$@" >&2
5    exit 1
6}
7
8force=
9no_tag=
10
11for arg; do
12    case $arg in
13        -f) force=1 ;;
14        --no-tag) no_tag=1 ;;
15    esac
16done
17
18VERS=$(perl -ne 'print $1 if m{^AC_INIT\(\[[^\]]+\],\s*\[([^\]]+)\]}' configure.ac) \
19    || die "Unable to parse barnowl version"
20TAG=barnowl-$VERS
21TGZ="$TAG-src"
22
23if [ ! "$force" ] && [ "$VERS" != "$(head -1 ChangeLog)" ]; then
24    die "No ChangeLog entry for version $VERS, aborting."
25fi
26
27if ! [ "$no_tag" ]; then
28    if git cat-file -t "$TAG" > /dev/null 2>&1; then
29        die "Error: Object $TAG already exists."
30    fi
31
32    git tag -s -m "BarnOwl $VERS" "$TAG"
33else
34    TAG=HEAD
35fi
36
37exittrap() { :; }
38for sig in 1 2 13 15; do trap "exit $(($sig + 128))" $sig; done
39trap 'exittrap' EXIT
40
41TMPDIR=$(mktemp -d /tmp/barnowl.XXXXXX)
42
43exittrap() { rm -rf "$TMPDIR"; }
44
45git archive --format=tar --prefix="$TGZ/" "$TAG" | tar -x -C "$TMPDIR"
46
47CODIR=$(pwd)
48cd "$TMPDIR/$TGZ"
49autoreconf -fvi
50cd "$TMPDIR"
51tar czvf "$TGZ.tgz" "$TGZ"
52cd "$CODIR"
53
54mv "$TMPDIR/$TGZ.tgz" .
55rm -rf "$TMPDIR"
56
57exittrap() { :; }
58
59echo "Created release tarball for BarnOwl $VERS in $(pwd)"
60echo "Remember to bump OWL_VERSION_STRING for future development."
61
62COMMIT=$(git rev-parse "$TAG")
63NOW=$(date +"%B %d, %Y")
64cat <<EOF
65 * '''$NOW''': BarnOwl $VERS Released. [wiki:Download] it here. or see the [/browser/ChangeLog?rev=$COMMIT ChangeLog]
66EOF
Note: See TracBrowser for help on using the repository browser.