aboutsummaryrefslogtreecommitdiff
path: root/prepare-release
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-03-27 00:35:32 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-03-27 00:35:32 +0100
commit58f548a687329e9fb45320701f7d2ddaf8e5f90b (patch)
tree6b6ffaca0c0fc6c7a344a063e9d2d7f70548ec96 /prepare-release
parentc72e3ad5824eb9385b62a51633cff817b825f06d (diff)
downloadqtmips-58f548a687329e9fb45320701f7d2ddaf8e5f90b.tar.gz
qtmips-58f548a687329e9fb45320701f7d2ddaf8e5f90b.tar.bz2
qtmips-58f548a687329e9fb45320701f7d2ddaf8e5f90b.zip
Initial version of script to help with release preparation.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'prepare-release')
-rwxr-xr-xprepare-release65
1 files changed, 65 insertions, 0 deletions
diff --git a/prepare-release b/prepare-release
new file mode 100755
index 0000000..ae49f02
--- /dev/null
+++ b/prepare-release
@@ -0,0 +1,65 @@
+#!/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
+
+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.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
+
+cd ../debian-test-build/qtmips-$V_TXT || exit 1
+
+dpkg-buildpackage