release-1.10release-1.6release-1.7release-1.8release-1.9
Last change
on this file since 0572abcf was
d771d1b,
checked in by Nelson Elhage <nelhage@mit.edu>, 15 years ago
|
do-release: Refuse to build an update tarball if we haven't pulled.
|
-
Property mode set to
100755
|
File size:
1.9 KB
|
Rev | Line | |
---|
[5319565] | 1 | #!/bin/sh -e |
---|
| 2 | |
---|
| 3 | die() { |
---|
| 4 | echo "$@" >&2 |
---|
| 5 | exit 1 |
---|
| 6 | } |
---|
| 7 | |
---|
[b9df757] | 8 | force= |
---|
[168f8a9] | 9 | no_tag= |
---|
[01846ce] | 10 | git= |
---|
[b9df757] | 11 | |
---|
[168f8a9] | 12 | for arg; do |
---|
| 13 | case $arg in |
---|
| 14 | -f) force=1 ;; |
---|
| 15 | --no-tag) no_tag=1 ;; |
---|
[01846ce] | 16 | --git) git=1 ;; |
---|
[168f8a9] | 17 | esac |
---|
| 18 | done |
---|
[b9df757] | 19 | |
---|
[01846ce] | 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 |
---|
[5319565] | 28 | TAG=barnowl-$VERS |
---|
| 29 | TGZ="$TAG-src" |
---|
| 30 | |
---|
[b9df757] | 31 | if [ ! "$force" ] && [ "$VERS" != "$(head -1 ChangeLog)" ]; then |
---|
[bff8f9f] | 32 | die "No ChangeLog entry for version $VERS, aborting." |
---|
| 33 | fi |
---|
| 34 | |
---|
[d771d1b] | 35 | head=$(git symbolic-ref HEAD) |
---|
| 36 | head=${head#refs/heads/} |
---|
| 37 | |
---|
| 38 | git rev-parse --verify -q $head >/dev/null 2>&1 |
---|
| 39 | git rev-parse --verify -q origin/$head >/dev/null 2>&1 |
---|
| 40 | if [ -n "$(git rev-list $head..origin/$head)" ]; then |
---|
| 41 | die "$head is not up to date. Aborting." |
---|
| 42 | fi |
---|
| 43 | |
---|
[168f8a9] | 44 | if ! [ "$no_tag" ]; then |
---|
| 45 | if git cat-file -t "$TAG" > /dev/null 2>&1; then |
---|
| 46 | die "Error: Object $TAG already exists." |
---|
| 47 | fi |
---|
| 48 | |
---|
| 49 | git tag -s -m "BarnOwl $VERS" "$TAG" |
---|
| 50 | else |
---|
| 51 | TAG=HEAD |
---|
[5319565] | 52 | fi |
---|
| 53 | |
---|
| 54 | exittrap() { :; } |
---|
| 55 | for sig in 1 2 13 15; do trap "exit $(($sig + 128))" $sig; done |
---|
| 56 | trap 'exittrap' EXIT |
---|
| 57 | |
---|
| 58 | TMPDIR=$(mktemp -d /tmp/barnowl.XXXXXX) |
---|
| 59 | |
---|
| 60 | exittrap() { rm -rf "$TMPDIR"; } |
---|
| 61 | |
---|
| 62 | git archive --format=tar --prefix="$TGZ/" "$TAG" | tar -x -C "$TMPDIR" |
---|
| 63 | |
---|
| 64 | CODIR=$(pwd) |
---|
| 65 | cd "$TMPDIR/$TGZ" |
---|
[01846ce] | 66 | [ "$git" ] && perl -i -pe 's{^(AC_INIT\(\[[^\]]+\],\s*)\[([^\]]+)\]}{${1}['$VERS']}' configure.ac |
---|
[db98968] | 67 | autoreconf -fvi |
---|
[5319565] | 68 | cd "$TMPDIR" |
---|
| 69 | tar czvf "$TGZ.tgz" "$TGZ" |
---|
| 70 | cd "$CODIR" |
---|
| 71 | |
---|
| 72 | mv "$TMPDIR/$TGZ.tgz" . |
---|
| 73 | rm -rf "$TMPDIR" |
---|
| 74 | |
---|
| 75 | exittrap() { :; } |
---|
| 76 | |
---|
| 77 | echo "Created release tarball for BarnOwl $VERS in $(pwd)" |
---|
| 78 | echo "Remember to bump OWL_VERSION_STRING for future development." |
---|
[11b9017] | 79 | |
---|
| 80 | COMMIT=$(git rev-parse "$TAG") |
---|
| 81 | NOW=$(date +"%B %d, %Y") |
---|
| 82 | cat <<EOF |
---|
| 83 | * '''$NOW''': BarnOwl $VERS Released. [wiki:Download] it here. or see the [/browser/ChangeLog?rev=$COMMIT ChangeLog] |
---|
| 84 | EOF |
---|
Note: See
TracBrowser
for help on using the repository browser.