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