| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #!/bin/sh
- # Get date (two formats)
- if [ -n "$2" ]; then
- LONGDATE=`date -d "$2" "+%B %d, %Y"`
- SHORTDATE=`date -d "$2" "+%m-%d-%Y"`
- else
- LONGDATE=`date "+%B %d, %Y"`
- SHORTDATE=`date "+%m-%d-%Y"`
- fi
- # Current version number
- CURRENTVERSION=2.12
- # Last date
- LASTDATE=03-10-2008
- if [ "x$1" = "x" ]
- then
- echo "Usage: $0 <version number | \"newdate\"> [revision date]"
- echo ""
- echo "Run this script with the name of the new version (i.e \"2.6\") to"
- echo "update version number and modification date in files."
- echo "Use the \"newdate\" argument if you want to keep the current version"
- echo "number and just update the modification date."
- echo ""
- echo "Current version=$CURRENTVERSION"
- echo "Current Modification date=$LASTDATE"
- echo ""
- exit 1
- fi
- newversion=$1
- if [ "x$newversion" = "xnewdate" ]
- then
- newversion=$CURRENTVERSION
- fi
- # Update version number and release date in common code
- perl -i -p -e "s/VERSION \".*\"/VERSION \"$1\"/;" include/common.h
- perl -i -p -e "s/MODIFICATION_DATE \".*\"/MODIFICATION_DATE \"$SHORTDATE\"/;" include/common.h
- perl -i -p -e "s/Last Modified: [0-9].*/Last Modified: $SHORTDATE/;" include/common.h
- # Update version number and release date in main code
- perl -i -p -e "s/Last Modified: [0-9].*/Last Modified: $SHORTDATE/;" src/nrpe.c
- perl -i -p -e "s/Last Modified: [0-9].*/Last Modified: $SHORTDATE/;" src/check_nrpe.c
- # Update version number and release date in configure script and configure.in
- perl -i -p -e "s/PKG_VERSION=.*/PKG_VERSION=\"$1\"/;" configure
- perl -i -p -e "s/PKG_REL_DATE=.*\"/PKG_REL_DATE=\"$SHORTDATE\"/;" configure
- perl -i -p -e "s/PKG_VERSION=.*/PKG_VERSION=\"$1\"/;" configure.in
- perl -i -p -e "s/PKG_REL_DATE=.*\"/PKG_REL_DATE=\"$SHORTDATE\"/;" configure.in
- # Update RPM spec file with version number
- perl -i -p -e "s/%define version .*/%define version $1/;" nrpe.spec
- # Update this file with version number and last date
- perl -i -p -e "s/^CURRENTVERSION=.*/CURRENTVERSION=$newversion/;" update-version
- perl -i -p -e "s/^LASTDATE=.*/LASTDATE=$SHORTDATE/;" update-version
|