2014-05-30 19:13:46 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-08-15 16:42:48 -04:00
|
|
|
DATE=`GIT_DIR=$1/.git git log -1 --pretty=format:%ci HEAD 2>/dev/null`
|
2008-11-13 18:35:48 -05:00
|
|
|
|
|
|
|
VERSION_DATE=`echo $DATE | cut -f 1 -d ' ' | tr -d -`
|
2009-05-13 17:01:55 -04:00
|
|
|
VERSION_TIME=`echo $DATE | cut -f 2 -d ' ' | awk -F: '{printf "%d", $1$2}'`
|
2014-05-30 19:13:46 -04:00
|
|
|
|
2015-07-09 08:20:30 -04:00
|
|
|
if test -z "$VERSION_DATE"; then
|
2019-07-07 18:02:53 -04:00
|
|
|
DATE=`grep '^v' $1/NEWS | head -1`
|
|
|
|
VERSION_DATE=`echo "$DATE" | cut -f 2 -d ' ' | tr -d -`
|
|
|
|
case $VERSION_DATE in
|
|
|
|
*xx)
|
|
|
|
VERSION_DATE=`date +%Y%m%d`
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
VERSION_TIME=`echo "$DATE" | cut -f 1 -d ' ' | tr -d v | tr .- ' '`
|
|
|
|
VERSION_TIME=`printf %d%d%02d $VERSION_TIME 2>/dev/null`
|
2015-07-09 08:20:30 -04:00
|
|
|
fi
|
|
|
|
|
2008-11-13 18:35:48 -05:00
|
|
|
echo "#define IRSSI_VERSION_DATE $VERSION_DATE"
|
|
|
|
echo "#define IRSSI_VERSION_TIME $VERSION_TIME"
|
2014-08-09 07:05:28 -04:00
|
|
|
|
|
|
|
if echo "${VERSION}" | grep -q -- -head; then
|
|
|
|
# -head version, get extra details from git if we can
|
2019-07-07 18:02:53 -04:00
|
|
|
git_version=$(GIT_DIR=$1/.git git describe --dirty --long --always --tags 2>/dev/null)
|
2014-08-09 07:05:28 -04:00
|
|
|
if [ $? = 0 ]; then
|
2015-09-20 17:02:51 -04:00
|
|
|
echo "#undef PACKAGE_VERSION"
|
2019-01-09 15:11:01 -05:00
|
|
|
echo "#define PACKAGE_VERSION \"${git_version}\""
|
2014-08-09 07:05:28 -04:00
|
|
|
fi
|
|
|
|
fi
|