From 52b506e13ac184f49563411ec922f3a5ecf7cbc4 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Thu, 13 Nov 2008 23:35:48 +0000 Subject: Move irssi-version.h generation out of configure and add suport for getting the date of the last change with svn info/git log. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4906 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- irssi-version.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 irssi-version.sh (limited to 'irssi-version.sh') diff --git a/irssi-version.sh b/irssi-version.sh new file mode 100755 index 00000000..c808e8a6 --- /dev/null +++ b/irssi-version.sh @@ -0,0 +1,13 @@ +#! /bin/sh + +if test -d "$1"/.svn ; then + DATE=`LC_ALL=C svn info "$1" | sed -n 's/^Last Changed Date: \(.*\)/\1/p'` +elif test -d "$1"/.git ; then + DATE=`GIT_DIR=$1/.git git log -1 --pretty=format:%ai HEAD` +else + DATE=`awk -F '|' 'NR == 2{print substr($3, 2)}' "$1"/ChangeLog` +fi +VERSION_DATE=`echo $DATE | cut -f 1 -d ' ' | tr -d -` +VERSION_TIME=`echo $DATE | cut -f 2 -d ' ' | awk -F : '{print $1 $2}'` +echo "#define IRSSI_VERSION_DATE $VERSION_DATE" +echo "#define IRSSI_VERSION_TIME $VERSION_TIME" -- cgit v1.2.3