From 616b584fce9116d34ce7aa3fe0b41ea0033581dc Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 14 Dec 2009 20:00:11 +0100 Subject: Updated utils/set_version to be more intelligent with the .spec file - Reset the Release variable in the .spec file to 1 - Add a changelog entry with the new version --- utils/set_version | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) (limited to 'utils') diff --git a/utils/set_version b/utils/set_version index c42f6d6..97c18c9 100755 --- a/utils/set_version +++ b/utils/set_version @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash if [ $# != 1 ]; then echo "Usage: $0 " @@ -14,6 +14,26 @@ fi NEW_VERSION=$1 OLD_VERSION=$(cd src;python -c "from setup_common import *; print get_version();") +# Prepare ChangeLog entry for the python-dmidecode.spec file +TSTAMP="$(date +%a\ %b\ %d\ %Y)" +FNAME="$(git config user.name)" +EMAIL="$(git config user.email)" +CHLOG="$TSTAMP $FNAME <$EMAIL> - ${NEW_VERSION}-1" + +# Prepare regexp script to modify python-dmidecode.spec +{ +cat < .chversion + +# Get confirmation of version change cat </dev/null - echo " ** Updating redhat.spec" - printf ",s/^Version: .*/Version: ${NEW_VERSION}/\nw\n" | ed contrib/python-dmidecode.spec 2>/dev/null - + echo " ** Updating contrib/python-dmidecode.spec" + cat .chversion | ed contrib/python-dmidecode.spec 2> /dev/null + if [ $? = 0 ]; then + rm -f .chversion + fi echo - echo " ** git add src/version.h redhat.spec" + echo " ** git add src/version.h contrib/python-dmidecode.spec" git add src/version.h contrib/python-dmidecode.spec + echo "-----------------------------------------------------------------------------------" git diff --cached + echo "-----------------------------------------------------------------------------------" echo - echo " REMEMBER to commit this change when you have validated the result" + echo " ** **" + echo " ** REMEMBER to COMMIT this change when you have validated the result **" + echo " ** **" echo ;; *) -- cgit