blob: 29cad757f25c69cdf201f79f37b082811d39f5be (
plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
#!/bin/bash
set -e
if [ ! -d debian ]
then
echo "No debian/ directory found!"
echo "Run me in the packaging directory."
exit 1
fi
if [ "$1" = "-D" ]
then
dist="$2"
shift
shift
else
dist=unstable
fi
cabal_name="$(cat debian/watch | grep http | cut -d/ -f5)"
package="$(grep-dctrl -n -s Source . < debian/control)"
old_version=`dpkg-parsechangelog -ldebian/changelog -c1 | grep-dctrl -n -s Version .`
old_version=`echo $old_version | cut -d- -f1` # this could be improved
if echo $old_version | fgrep -q : ; then
old_version=`echo $old_version | cut -d: -f2-`
epoch=`echo $old_version | cut -d: -f1`:
else
epoch=''
fi
version=$(grep "^$cabal_name " ../../../package-plan/packages.txt|cut -d\ -f2)
if [ -z "$version" ]
then
echo "could not detect version to upgrade to."
exit 1
fi
if [ "$version" = "$old_version" ]
then
echo "No new version to upgrade to."
exit 1
fi
debchange --changelog debian/changelog --newversion="$epoch$version-1" 'New upstream release'
origtargz -u
if fgrep -q 'DEB_ENABLE_TESTS = yes' debian/rules
then
test=""
else
test="--no-tests"
fi
cabal-debian --official --upgrade $test
find debian/ -name '*~' -delete
dch -D $dist -r ''
git commit . -q -m "$cabal_name: Upgrading from $old_version to $version"
echo "Upgraded $cabal_name to $version"
echo "Please check git show HEAD for sanity."
echo "Please check http://hdiff.luite.com/cgit/$cabal_name/diff/?id=$version&id2=$old_version for interesting changes."
if test -d debian/patches
then
echo "Please refresh the patches"
fi
|