From 58f548a687329e9fb45320701f7d2ddaf8e5f90b Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Wed, 27 Mar 2019 00:35:32 +0100 Subject: Initial version of script to help with release preparation. Signed-off-by: Pavel Pisa --- prepare-release | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 prepare-release 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 < $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 -- cgit v1.2.3