diff options
author | Alexander Færøy <ahf@0x90.dk> | 2015-02-17 01:10:38 +0100 |
---|---|---|
committer | Alexander Færøy <ahf@0x90.dk> | 2015-02-17 01:10:38 +0100 |
commit | 6b08cbe906bc2f13a34aca3195f8808d709c160c (patch) | |
tree | 9e1643180d1e43ebe3cf5f2a410853bf3c536f22 | |
parent | 8e64aee42a0692360ef108b11aa035fdd04b0a89 (diff) | |
parent | 1b3e74645af996a3ec46a72bfb098f1506515f8a (diff) | |
download | irssi-6b08cbe906bc2f13a34aca3195f8808d709c160c.zip |
Merge pull request #124 from dgl/git-version
Include commit and if the tree is dirty in builds of -head versions
-rw-r--r-- | Makefile.am | 3 | ||||
-rwxr-xr-x | irssi-version.sh | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index 4cebd112..6ca69fc7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/irssi-version.sh b/irssi-version.sh index 49abc55e..7588182d 100755 --- a/irssi-version.sh +++ b/irssi-version.sh @@ -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 |