1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-09 06:20:45 +00:00

Include commit and if the tree is dirty in builds of -head versions

This commit is contained in:
David Leadbeater 2014-08-09 12:05:28 +01:00
parent d40c0704f0
commit 1b3e74645a
2 changed files with 14 additions and 1 deletions

View File

@ -12,7 +12,8 @@ default-theme.h: $(srcdir)/default.theme
$(srcdir)/file2header.sh $(srcdir)/default.theme default_theme > default-theme.h
irssi-version.h:
$(srcdir)/irssi-version.sh $(srcdir) | cmp -s - $@ || $(srcdir)/irssi-version.sh $(srcdir) >$@
VERSION="$(VERSION)" $(srcdir)/irssi-version.sh $(srcdir) | \
cmp -s - $@ || VERSION="$(VERSION)" $(srcdir)/irssi-version.sh $(srcdir) >$@
SUBDIRS = src docs scripts

View File

@ -7,3 +7,15 @@ VERSION_TIME=`echo $DATE | cut -f 2 -d ' ' | awk -F: '{printf "%d", $1$2}'`
echo "#define IRSSI_VERSION_DATE $VERSION_DATE"
echo "#define IRSSI_VERSION_TIME $VERSION_TIME"
if echo "${VERSION}" | grep -q -- -head; then
# -head version, get extra details from git if we can
git_version=$(GIT_DIR=$1/.git git describe --dirty --long --always --tags)
if [ $? = 0 ]; then
new_version="$(echo "${VERSION}" | sed 's/-head//')"
# Because the git tag won't yet include the next release we modify the git
# describe output using the version defined from configure.ac.
version="${new_version}-$(echo "${git_version}" | sed 's/^.*-[0-9]\+-//')"
echo "#define PACKAGE_VERSION \"${version}\""
fi
fi