~apport-hackers/apport/trunk

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
#!/bin/sh -e

# This script does all the steps necessary for doing a new upstream release. It
# should solely be used by upstream developers, distributors do not need to
# worry about it.

[ -z "`bzr status`" ] || {
    echo "Uncommitted changes, aborting" >&2
    exit 1
}

# filter out unused identifiers, too many false positives
if pyflakes .|grep -v unused; then
    echo "pyflakes errors, aborting" >&2
    exit 1
fi

bzr clean-tree --ignored

version=$(grep '(UNRELEASED)' NEWS | cut -f1 -d' ')
[ -n "$version" ] || {
    echo "no UNRELEASED in NEWS" >&2
    exit 1
}

sed -i -r "s/__version__ = '[0-9.]*'/__version__ = '${version}'/" apport/ui.py
sed -i "s/(UNRELEASED)/$(date '+(%Y-%m-%d)')/" NEWS
bzr commit -m "release $version"
bzr tag "$version"

bzr log -v --log-format 'gnu' > ChangeLog

# temporarily add ChangeLog for export
bzr add ChangeLog
bzr commit -m 'temporarily add changelog'
bzr export ../apport-${version}.tar.gz
bzr uncommit --force
bzr revert --no-backup
rm ChangeLog