source: scripts/do-release @ 56e4869

debianrelease-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since 56e4869 was 5319565, checked in by Nelson Elhage <nelhage@mit.edu>, 13 years ago
Add a script to create a release tag and tarball.
  • Property mode set to 100755
File size: 891 bytes
Line 
1#!/bin/sh -e
2
3die() {
4    echo "$@" >&2
5    exit 1
6}
7
8VERS=$(perl -lne 'print $1 if m{^#define\s+OWL_VERSION_STRING\s+"([^"]+)"\s*$}' owl.h) \
9    || die "Unable to parse barnowl version"
10TAG=barnowl-$VERS
11TGZ="$TAG-src"
12
13if git cat-file -t "$TAG" > /dev/null 2>&1; then
14    die "Error: Object $TAG already exists."
15fi
16
17exittrap() { :; }
18for sig in 1 2 13 15; do trap "exit $(($sig + 128))" $sig; done
19trap 'exittrap' EXIT
20
21git tag -s -m "BarnOwl $VERS" "$TAG"
22
23TMPDIR=$(mktemp -d /tmp/barnowl.XXXXXX)
24
25exittrap() { rm -rf "$TMPDIR"; }
26
27git archive --format=tar --prefix="$TGZ/" "$TAG" | tar -x -C "$TMPDIR"
28
29CODIR=$(pwd)
30cd "$TMPDIR/$TGZ"
31autoreconf
32cd "$TMPDIR"
33tar czvf "$TGZ.tgz" "$TGZ"
34cd "$CODIR"
35
36mv "$TMPDIR/$TGZ.tgz" .
37rm -rf "$TMPDIR"
38
39exittrap() { :; }
40
41echo "Created release tarball for BarnOwl $VERS in $(pwd)"
42echo "Remember to bump OWL_VERSION_STRING for future development."
Note: See TracBrowser for help on using the repository browser.