summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 16bda3a)
raw | patch | inline | side by side (parent: 16bda3a)
author | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 4 Feb 2009 17:41:12 +0000 (18:41 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 5 Feb 2009 09:11:19 +0000 (10:11 +0100) |
Makefile | patch | blob | history | |
contrib/release.sh | [new file with mode: 0755] | patch | blob |
diff --git a/Makefile b/Makefile
index 252d1b74a98aaf1c5e610f80f05140f793758683..d764644ba99bde58ec46ad0acc682088e69b1d8a 100644 (file)
--- a/Makefile
+++ b/Makefile
configure: configure.ac acinclude.m4
$(AUTORECONF) -v
-# Maintainer stuff
-release-doc:
- git checkout release && \
- git merge master && \
- $(MAKE) distclean doc-man doc-html sysconfdir=++SYSCONFDIR++ && \
- git add -f $(MANDOC) $(HTMLDOC) && \
- git commit -m "Sync docs" && \
- git checkout master
-
-release-dist: release-doc
- git checkout release && \
- $(MAKE) dist && \
- git checkout master
-
.PHONY: all all-debug doc doc-man doc-html install install-doc \
install-doc-man install-doc-html clean spell-check dist rpm
diff --git a/contrib/release.sh b/contrib/release.sh
--- /dev/null
+++ b/contrib/release.sh
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# Script for preparing a release or updating the release branch.
+# Usage: $0 version
+#
+# Copyright (c) 2009 Jonas Fonseca <fonseca@diku.dk>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+set -e
+set -x
+
+VERSION="$1"
+
+TAG="tig-$VERSION"
+TITLE="$TAG\n$(echo "$TAG" | sed 's/./-/g')"
+
+# Require a clean repository.
+git update-index --refresh
+git diff-index --quiet HEAD
+
+if test -n "$VERSION"; then
+ # Get a sane starting point.
+ test "$(git symbolic-ref HEAD)" = "refs/heads/master" ||
+ git checkout master
+
+ # Update files which should reference the version.
+ echo "$VERSION" > VERSION
+ perl -pi -e 's/^tig master.*/@@TITLE@@/ms' NEWS
+ perl -pi -e "s/^@@TITLE@@.*/$TITLE/" NEWS
+
+ # Check for typos.
+ make spell-check
+
+ # Last review.
+ $EDITOR NEWS
+
+ # Create release commit and tag.
+ git commit -a -m "$TAG"
+ git tag -s -m "tig version $VERSION" "$TAG"
+
+ # Prepare release announcement file.
+ ./contrib/announcement.sh "$TAG" > "$TAG.txt"
+
+ # Set version for the Makefile
+ export DIST_VERSION="$VERSION"
+else
+ # Get meaningful version for the update message.
+ TAG="$(git describe)"
+fi
+
+# Update the release branch.
+git checkout release
+HEAD="$(git rev-parse release)"
+git merge master
+if test -n "$(git rev-list -1 release ^$HEAD)"; then
+ make distclean doc-man doc-html sysconfdir=++SYSCONFDIR++
+ git commit -a -m "Update for version $TAG"
+fi
+
+if test -n "$VERSION"; then
+ # Create the tarball.
+ make dist
+fi
+
+# Done.
+git checkout master