forked from bit-team/backintime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateversion.sh
executable file
·59 lines (45 loc) · 1.45 KB
/
updateversion.sh
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
#!/bin/bash
VERSION=`cat VERSION`
echo VERSION: $VERSION
if [ "x$USER" = "xgermar" ]; then
MAINTAINER="Germar Reitze <germar.reitze@gmail.com>"
else
MAINTAINER="BIT Team <dan@le-web.org>"
fi
update_config () {
echo "Update '$1'"
sed -e "s/^\(\s*\)VERSION = '.*'$/\1VERSION = '$VERSION'/" \
-i $1
}
update_man_page () {
echo "Update '$1'"
sed -e "s/\.TH\(.*\)\"version\([^\"]*\)\"\(.*\)$/.TH\1\"version $VERSION\"\3/" \
-i $1
}
update_omf () {
echo "Update '$1'"
sed -e "s/^\([ \]*\)<version\([^0-9]*\)\([^\"]*\)\(.*\)$/\1<version\2$VERSION\4/" \
-i $1
}
update_xml () {
echo "Update '$1'"
sed -e "s/^<!ENTITY appversion .*>$/<!ENTITY appversion \"$VERSION\">/" \
-e "s/^<!ENTITY manrevision .*>$/<!ENTITY manrevision \"$VERSION\">/" \
-i $1
}
update_changelog () {
echo "Update '$1'"
echo "backintime ($VERSION) unstable; urgency=low" > $1
cat CHANGES | awk 'BEGIN {ins=0} /^Version '$VERSION'/ {ins=1; next} /^Version [0-9.]+/ && (ins == 1) {exit 0} /^\*/ && (ins == 1) {print " "$0}' >> $1
if [ $(cat $1 | wc -l) -eq 1 ]; then
echo " * prepair next version" >> $1
fi
echo " -- ${MAINTAINER} $(date -R)" >> $1
}
update_config common/config.py
update_man_page common/man/C/backintime.1
update_man_page common/man/C/backintime-config.1
update_man_page common/man/C/backintime-askpass.1
update_man_page qt/man/C/backintime-qt.1
update_xml qt/docbook/en/index.docbook
update_changelog debian/changelog