2014-12-31 21:57:53 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2015-06-06 22:02:16 +00:00
|
|
|
set -e
|
|
|
|
|
2014-12-31 21:57:53 +00:00
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo "Usage: $0 VERSION" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
VERSION=$1
|
|
|
|
|
2016-01-17 19:04:34 +00:00
|
|
|
if ! echo $VERSION | grep -Eq "^[0-9.]*(-.+)?$"; then
|
2014-12-31 21:57:53 +00:00
|
|
|
echo "invalid version";
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
|
2016-01-04 19:36:19 +00:00
|
|
|
git checkout release-$VERSION
|
|
|
|
|
2014-12-31 21:57:53 +00:00
|
|
|
sed -i 's/(defconst ghc-version ".*")/(defconst ghc-version "'"$VERSION"'")/' \
|
|
|
|
elisp/ghc.el
|
|
|
|
|
|
|
|
sed -r -i 's/^(Version:[[:space:]]*)[0-9.]+/\1'"$VERSION"'/' ghc-mod.cabal
|
|
|
|
|
2015-06-06 22:02:16 +00:00
|
|
|
git add elisp/ghc.el ghc-mod.cabal
|
2016-01-17 19:04:34 +00:00
|
|
|
|
|
|
|
git update-index -q --ignore-submodules --refresh
|
|
|
|
# If there are uncommitted changes do the bump commit
|
|
|
|
if ! git diff-index --cached --quiet HEAD --ignore-submodules --
|
|
|
|
then
|
|
|
|
git commit -m "Bump version to $VERSION" --allow-empty
|
|
|
|
fi
|
2015-06-06 22:02:16 +00:00
|
|
|
|
|
|
|
git checkout release
|
2016-07-11 04:54:52 +00:00
|
|
|
#git merge release-VER branch into 'release'
|
2016-01-04 19:36:19 +00:00
|
|
|
git merge -s recursive -X theirs release-$VERSION
|
2015-06-06 22:02:16 +00:00
|
|
|
|
2014-12-31 21:57:53 +00:00
|
|
|
( tac ChangeLog; echo "\n$(date '+%Y-%m-%d') v$VERSION" ) | tac \
|
|
|
|
> ChangeLog.tmp
|
|
|
|
|
|
|
|
mv ChangeLog.tmp ChangeLog
|
|
|
|
|
|
|
|
emacs -q -nw ChangeLog
|
|
|
|
|
2015-06-06 22:02:16 +00:00
|
|
|
git add ChangeLog
|
|
|
|
git commit -m "ChangeLog"
|
|
|
|
|
2014-12-31 21:57:53 +00:00
|
|
|
git tag "v$VERSION"
|