summaryrefslogtreecommitdiff
path: root/irssi-version.sh
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2008-11-13 23:35:48 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2008-11-13 23:35:48 +0000
commit52b506e13ac184f49563411ec922f3a5ecf7cbc4 (patch)
tree29461dd7fa9f510f82508c2e0ae82c1e0daca715 /irssi-version.sh
parent5497b07c8a1331e0322b614f55d458d2319ea3ea (diff)
downloadirssi-52b506e13ac184f49563411ec922f3a5ecf7cbc4.zip
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
Diffstat (limited to 'irssi-version.sh')
-rwxr-xr-xirssi-version.sh13
1 files changed, 13 insertions, 0 deletions
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"