~midori/midori/tabSafe

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /bin/sh

# Copyright (C) 2013-2014 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=$(grep -r --color=no '^set(VERSION' CMakeLists.txt | sed -r "s@.+ ([0-9.]+)\)@\1@")
NEWVER=$(python -c "print('0.'+str(float('$OLDVER'[2:])+.1))")
if [ "x$1" = "xbefore" ]; then
    echo Bumping from $OLDVER to $NEWVER
    sed -i "s@$OLDVER@$NEWVER@g" CMakeLists.txt win32/makedist/midori.nsi
    mv ChangeLog ChangeLog.old || exit 1
    echo This file is licensed under the terms of the expat license, see the file EXPAT. > ChangeLog
    echo >> ChangeLog
    echo v$NEWVER >> ChangeLog
    bzr log --line -rtag:$OLDVER.. \
        | sed -r 's@.+20[0-9][0-9]-[0-9]+-[0-9]+ @ @' \
        | sed 's@\[merge\] @@' \
        | grep -v -E 'l10n|Revert |makedist|tools(/release)?: |nsi|translation|Bump version to|Merge lp:midori|POTFILES.in' \
        >> ChangeLog
    tail -n+2 ChangeLog.old >> ChangeLog
    rm ChangeLog.old
    curl http://wiki.xfce.org/_export/raw/midori/contribute | \
        sed -r 's@\[\[([^|]+)\|([^]]+)\]\]@\1 \2@g' | \
        sed -r 's@<code( bash|)>|</code>@@g' > HACKING
    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 -n bzr commit -p -m "'Bump version to $NEWVER'"
    case $SHELL in
    *fish*)
        echo -n '; and ' ;;
    *)
        echo -n ' && ' ;;
    esac
    echo bzr tag $NEWVER
elif [ "x$1" = "xafter" ]; then
    echo Press RETURN to download tarball now; read yes
    wget http://bazaar.launchpad.net/~midori/midori/trunk/tarball
    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
else
    echo 'Usage: ['$(basename $0)']' 'before|after'
    exit 1
fi