From 805dced32cbb2eef1f2b639100faef3bb0482e29 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Wed, 1 Apr 2009 16:10:55 +0200 Subject: Added indenting tool for C code and reindented *.[ch] files --- utils/c-code-indent | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 utils/c-code-indent (limited to 'utils') diff --git a/utils/c-code-indent b/utils/c-code-indent new file mode 100755 index 0000000..0d5381d --- /dev/null +++ b/utils/c-code-indent @@ -0,0 +1,3 @@ +#!/bin/sh +PARAM="-npro -kr -nut -bbb -bad -i8 -ts8 -sob -l100 -ss -ncs -cp1 -sc -nsaf -nsai -nsaw -nbbo -hnl -br -ce" +indent $PARAM "$@" -- cgit From 48725333d5cfbe44194ed34f20223cad74c6e538 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Thu, 11 Jun 2009 16:06:28 +0200 Subject: Added utility to simply change the version number This script will update all needed files at once --- utils/set_version | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 utils/set_version (limited to 'utils') diff --git a/utils/set_version b/utils/set_version new file mode 100755 index 0000000..2e23428 --- /dev/null +++ b/utils/set_version @@ -0,0 +1,53 @@ +#!/bin/sh + +if [ $# != 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +if [ ! -d ./src -a ! -f redhat.spec ]; then + echo "Cannot find the ./src directory or the ./redhat.spec file" + echo "Are you in the project root directory?" + exit 2 +fi + +NEW_VERSION=$1 +OLD_VERSION=$(cd src;python -c "from setup_common import *; print get_version();") + +cat </dev/null + + echo " ** Updating redhat.spec" + printf ",s/^Version: .*/Version: ${NEW_VERSION}/\nw\n" | ed redhat.spec 2>/dev/null + + echo + echo " ** git add src/version.h redhat.spec" + git add src/version.h redhat.spec + echo + ;; + *) + echo + echo + echo " ** Not confirmed. Aborting." + echo + ;; +esac + -- cgit From 8edf8556f59056a8043e4c1bd7af5e2ab63d161e Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Fri, 12 Jun 2009 17:11:02 +0200 Subject: Moved and renamed redhat.spec This spec file do not contain anything Red Hat specific, so I gave it a more generic name --- utils/set_version | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils') diff --git a/utils/set_version b/utils/set_version index 2e23428..41c3337 100755 --- a/utils/set_version +++ b/utils/set_version @@ -36,11 +36,11 @@ case $conf in printf ",s/^#define VERSION \".*\"/#define VERSION \"${NEW_VERSION}\"/\nw\n" | ed src/version.h 2>/dev/null echo " ** Updating redhat.spec" - printf ",s/^Version: .*/Version: ${NEW_VERSION}/\nw\n" | ed redhat.spec 2>/dev/null + printf ",s/^Version: .*/Version: ${NEW_VERSION}/\nw\n" | ed contrib/python-dmidecode.spec 2>/dev/null echo echo " ** git add src/version.h redhat.spec" - git add src/version.h redhat.spec + git add src/version.h contrib/python-dmidecode.spec echo ;; *) -- cgit From b1db52e62be1a700517308877b08dbf8c5d9e1eb Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Fri, 12 Jun 2009 17:31:39 +0200 Subject: Make use of setup_common::get_version() in python-dmidecode.spec as well Now you only need to change the src/version.h to set the correct version numbers. The utils/set_version script will still help you remember the important steps and make sure you don't do the wrong things. --- utils/set_version | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'utils') diff --git a/utils/set_version b/utils/set_version index 41c3337..fcb081f 100755 --- a/utils/set_version +++ b/utils/set_version @@ -35,12 +35,12 @@ case $conf in echo " ** Updating src/version.h" printf ",s/^#define VERSION \".*\"/#define VERSION \"${NEW_VERSION}\"/\nw\n" | ed src/version.h 2>/dev/null - echo " ** Updating redhat.spec" - printf ",s/^Version: .*/Version: ${NEW_VERSION}/\nw\n" | ed contrib/python-dmidecode.spec 2>/dev/null - echo - echo " ** git add src/version.h redhat.spec" - git add src/version.h contrib/python-dmidecode.spec + echo " ** git add src/version.h" + git add src/version.h + git diff --cached + echo + echo " REMEMBER to commit this change when you have validated the result" echo ;; *) -- cgit From e2730f6b8436eb92222246816578490834cc9015 Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 15 Jun 2009 18:58:37 +0200 Subject: Revert "Make use of setup_common::get_version() in python-dmidecode.spec as well" This reverts commit b1db52e62be1a700517308877b08dbf8c5d9e1eb. This change broke rpmbuild --rebuild. So the version number cannot be set dynamically like this. Reverting back to manually updating it. --- utils/set_version | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'utils') diff --git a/utils/set_version b/utils/set_version index fcb081f..c42f6d6 100755 --- a/utils/set_version +++ b/utils/set_version @@ -35,9 +35,12 @@ case $conf in echo " ** Updating src/version.h" printf ",s/^#define VERSION \".*\"/#define VERSION \"${NEW_VERSION}\"/\nw\n" | ed src/version.h 2>/dev/null + echo " ** Updating redhat.spec" + printf ",s/^Version: .*/Version: ${NEW_VERSION}/\nw\n" | ed contrib/python-dmidecode.spec 2>/dev/null + echo - echo " ** git add src/version.h" - git add src/version.h + echo " ** git add src/version.h redhat.spec" + git add src/version.h contrib/python-dmidecode.spec git diff --cached echo echo " REMEMBER to commit this change when you have validated the result" -- cgit