-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebian-new-release
executable file
·43 lines (34 loc) · 1.04 KB
/
debian-new-release
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
#!/bin/sh -e
if [ -z "$1" ]; then
echo "usage: $0 <new version> [base]"
exit 1
fi
if [ ! -f debian/changelog -o ! -f debian/control ]; then
echo "Not in the right directory, cant find debian files"
exit 1
fi
darwin=""
if uname | grep -q -i darwin; then
darwin="yes"
fi
new_vers="$1"
base="$2"
if [ -z "$base" ]; then
base="unstable"
fi
cur_vers=`head -n 1 debian/changelog | sed 's%.*(\([^)]*\)).*%\1%'`
name=`head -n 1 debian/changelog | awk '{ print $1 }'`
date=`date -R`
mv debian/changelog debian/changelog.new-upstream-release
echo "$name ($new_vers-1~$base+1) unstable; urgency=low
* New release v$new_vers.
-- Jerry Lundström <[email protected]> $date
" >> debian/changelog
cat debian/changelog.new-upstream-release >> debian/changelog
rm debian/changelog.new-upstream-release
if [ -n "$darwin" ]; then
sed -i "" "s%\\(liblim[^ ]*\\) (= $cur_vers)%\\1 (= $new_vers-1~$base+1)%g" debian/control
else
sed -i "s%\\(liblim[^ ]*\\) (= $cur_vers)%\\1 (= $new_vers-1~$base+1)%g" debian/control
fi
echo "ok"