diff options
-rw-r--r-- | Makefile | 3 | ||||
-rwxr-xr-x | buildutil/version-util | 43 | ||||
-rw-r--r-- | pages/pageelems.ecpp | 2 |
3 files changed, 46 insertions, 2 deletions
@@ -14,6 +14,7 @@ PLUGIN = live ### The version number of this plugin (taken from the main source file): VERSION = $(shell grep '\#define LIVEVERSION ' setup.h | awk '{ print $$3 }' | sed -e 's/[";]//g') +VERSINFO= $(shell ./buildutil/version-util) ### The C++ compiler and options: @@ -57,7 +58,7 @@ ifneq ($(TNTVERS7),yes) LIBS += httpd/libhttpd.a endif -DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' +DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -DVERSION_SUFFIX='"$(VERSINFO)"' ifeq ($(TNTVERS7),yes) DEFINES += -DTNTVERS7 endif diff --git a/buildutil/version-util b/buildutil/version-util new file mode 100755 index 0000000..7e377ab --- /dev/null +++ b/buildutil/version-util @@ -0,0 +1,43 @@ +#!/bin/sh +# ----------------------------------------------------------------------------- +# Small shell script to determine the last commit version of the project +# It checks for CVS and .git repositories. +# The output is a string that can be used in a define at compile time to +# automatically mark repository versions. +# For CVS repositories the string contains the date and time of the commit +# that lead to the current version of files. +# For git repositories the output contains the git-id of the current tree. +# An indication if localy modified files exist is added. +# ----------------------------------------------------------------------------- + +function cvsVers () +{ + d=`cvs log -r -N 2> /dev/null \ + | grep '^date:' \ + | cut -d ' ' -f 2-4 \ + | sort -u \ + | tail -1 \ + | tr -d ' \-:'` + m=`cvs status 2> /dev/null \ + | grep 'Status: Locally Modified' > /dev/null && echo "_MOD"` + echo "_cvs_${d}${m}" +} + +function gitVers () +{ + b=`git branch \ + | grep '^*' \ + | sed -e's/^* //'` + h=`git show --pretty=format:"%h_%ci" HEAD \ + | head -1 \ + | tr -d ' \-:'` + echo "_git_${b}_${h}" +} + +if [ -d CVS ]; then + cvsVers +fi + +if [ -d .git ]; then + gitVers +fi diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp index b61e663..cd527cd 100644 --- a/pages/pageelems.ecpp +++ b/pages/pageelems.ecpp @@ -334,7 +334,7 @@ int update_status(1); <div class="about_right">Michael Brückner (skiller2k1)</div> <div class="about_head"><div><div><$ tr("Information") $></div></div></div> <div class="about_left"><$ tr("LIVE version") $>:</div> - <div class="about_right"><$ LIVEVERSION $></div> + <div class="about_right"><$ LIVEVERSION $><$ VERSION_SUFFIX $></div> <div class="about_left"><$ tr("VDR version") $>:</div> <div class="about_right"><$ VDRVERSION $></div> <div class="about_head"><div><div><$ tr("Features") $></div></div></div> |