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