#! /bin/sh

# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# See the file COPYING for the full license text.

OLDVER=$(git describe --abbrev=0)
NEWVER=$(python -c "print('0.'+str(float('$OLDVER'[2:])+.1))")
echo Bumping from $OLDVER to $NEWVER
echo https://releases.xfce.org/
echo http://git.xfce.org/apps/midori/snapshot/midori-$NEWVER.tar.bz2
echo git tag -a $NEWVER -m "Bump version to $NEWVER"';' git commit -m "Bump version to $NEWVER"
sed -i "s@$OLDVER@$NEWVER@g" wscript win32/makedist/midori-0.3.3.nsi
echo; git log --pretty=format:%s $OLDVER..HEAD | grep -v l10n; echo
curl http://wiki.xfce.org/_export/xhtml/midori/faq | \
    sed 's@This is a list of frequently asked questions@This is <a href="http://wiki.xfce.org/midori/faq">a snapshot of the online FAQ</a>@g' | \
    sed 's@<link rel="style.*>@<link rel="stylesheet" href="faq.css" />@g' > data/faq.html
echo Press RETURN to update Launchpad bugs now; read yes
if [ -n $(which bugreleaser 1>/dev/null) ]; then
    bugreleaser midori
else
    echo bzr branch lp:~mgiuca/+junk/launchpad-tools
fi
