diff options
-rwxr-xr-x | prepare-release | 65 |
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 |