aboutsummaryrefslogtreecommitdiff
path: root/prepare-release
blob: 1fba021f3f58a55e7330185b966701311784f533 (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
#!/bin/bash

if [ $# -lt 1 ] ; then
  echo "Version has to be specified"
  exit 1
fi

V_TXT="$1"

cd "$(dirname "$0")"

V_DATE_MDY="$( date '+%m/%d/%Y' )"
V_DATE_YMD="$( date '+%Y-%m-%d' )"
V_DATE_RFC="$( date -R )"

V_USER_NAME="$(git config user.name)"
V_USER_EMAIL="$(git config user.email)"

sed --in-place \
  -e 's#^\([\t ]*\)versionText = "Version [^"]*\\n";.*$#\1versionText = "Version '"$V_TXT"'\\n";#' \
  qtmips_gui/aboutdialog.cpp

sed --in-place \
  -e 's#^\([\t ]*\)app.setApplicationVersion("[^"]*");.*$#\1app.setApplicationVersion("'"$V_TXT"'");#' \
  qtmips_gui/main.cpp

if grep -q "qtmips ($V_TXT)" debian/changelog ; then
sed --in-place \
  -e '1,/^ -- .*$/s/^ -- .*$/'" -- $V_USER_NAME <$V_USER_EMAIL> $V_DATE_RFC/" \
  debian/changelog
else
cat >debian/changelog.tmp <<EOF
qtmips ($V_TXT) unstable; urgency=medium

  * Debian package updated to version $V_TXT.

 -- $V_USER_NAME <$V_USER_EMAIL>  $V_DATE_RFC

EOF
cat debian/changelog >>debian/changelog.tmp
mv debian/changelog.tmp debian/changelog
fi

sed --in-place \
  -e 's#^\(Version:[\t ]*\)[^ ]\+ *$#\1'"$V_TXT"'#' \
  qtmips.spec

nedit-nc debian/changelog

echo Press enter to continue
read x

git add debian/changelog qtmips_gui/aboutdialog.cpp \
        qtmips_gui/main.cpp qtmips.spec

echo >.git/GITGUI_MSG "Version updated to $V_TXT"

git gui

git tag -d v$V_TXT

git tag -s v$V_TXT

rm -rf ../debian-test-build

mkdir -p ../debian-test-build/qtmips-$V_TXT

cp -xa . ../debian-test-build/qtmips-$V_TXT

cd ../debian-test-build/qtmips-$V_TXT || exit 1

dpkg-buildpackage