versioning based on hg identify trunk
authornathan
Sat, 29 Dec 2007 13:19:16 +0100
branchtrunk
changeset 20bc64e11172f5
parent 19 5686936eefc5
child 21 bc68e23ad6d5
versioning based on hg identify
Makefile
po/de_DE.po
po/fr_FR.po
premiereepg.c
version.c
version.h
     1.1 --- a/Makefile	Sat Dec 29 11:30:38 2007 +0100
     1.2 +++ b/Makefile	Sat Dec 29 13:19:16 2007 +0100
     1.3 @@ -24,9 +24,10 @@
     1.4  #
     1.5  PLUGIN = premiereepg
     1.6  
     1.7 -### The version number of this plugin (taken from the main source file):
     1.8 +### The version number of this plugin:
     1.9  
    1.10 -VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
    1.11 +RELEASE := $(shell grep 'define PLUGIN_RELEASE' version.h | awk '{ print $$3 }' | sed -e 's/[";]//g')
    1.12 +VERSION := $(shell if test -d .hg; then echo -n '$(RELEASE)-'; (hg identify 2>/dev/null || echo -n Unknown) | sed -e 's/ .*//'; else echo -n '$(RELEASE)'; fi)
    1.13  
    1.14  ### The C++ compiler and options:
    1.15  
    1.16 @@ -42,11 +43,12 @@
    1.17  ### Allow user defined options to overwrite defaults:
    1.18  
    1.19  -include $(VDRDIR)/Make.config
    1.20 +-include Make.config
    1.21  
    1.22  ### The version number of VDR (taken from VDR's "config.h"):
    1.23  
    1.24 -VDRVERSION = $(shell sed -ne '/define VDRVERSION/ s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
    1.25 -APIVERSION = $(shell sed -ne '/define APIVERSION/ s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
    1.26 +VDRVERSION := $(shell sed -ne '/define VDRVERSION/ s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
    1.27 +APIVERSION := $(shell sed -ne '/define APIVERSION/ s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
    1.28  ifeq ($(strip $(APIVERSION)),)
    1.29     APIVERSION = $(VDRVERSION)
    1.30  endif
    1.31 @@ -64,7 +66,7 @@
    1.32  
    1.33  ### The object files (add further files here):
    1.34  
    1.35 -OBJS = $(PLUGIN).o
    1.36 +OBJS = $(PLUGIN).o version.o
    1.37  
    1.38  ifdef DBG
    1.39  CXXFLAGS += -g
    1.40 @@ -81,8 +83,9 @@
    1.41  
    1.42  MAKEDEP = $(CXX) -MM -MG
    1.43  DEPFILE = .dependencies
    1.44 -$(DEPFILE): Makefile
    1.45 -	@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
    1.46 +DEPFILES = $(subst version.c,,$(OBJS:%.o=%.c) $(OBJS2:%.o=%.c))
    1.47 +$(DEPFILE): Makefile $(DEPFILES) $(wildcard *.h)
    1.48 +	@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(DEPFILES) > $@
    1.49  
    1.50  -include $(DEPFILE)
    1.51  
    1.52 @@ -119,6 +122,13 @@
    1.53  
    1.54  i18n: $(I18Nmsgs)
    1.55  
    1.56 +version.c: FORCE
    1.57 +	@echo >$@.new "/* this file will be overwritten without warning */"; \
    1.58 +	 echo >>$@.new 'const char *PluginVersion =' '"'$(VERSION)'";'; \
    1.59 +	 diff $@.new $@ >$@.diff 2>&1; \
    1.60 +	 if test -s $@.diff; then mv -f $@.new $@; fi; \
    1.61 +	 rm -f $@.new $@.diff;
    1.62 +
    1.63  dist: clean
    1.64  	@-rm -rf $(TMPDIR)/$(ARCHIVE)
    1.65  	@mkdir $(TMPDIR)/$(ARCHIVE)
    1.66 @@ -129,4 +139,7 @@
    1.67  
    1.68  clean:
    1.69  	@-rm -f $(OBJS) $(DEPFILE) *.so *.tar.gz core* *~
    1.70 -	@-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
    1.71 +	@-rm -f version.c
    1.72 +	@-rm -f $(PODIR)/*.mo
    1.73 +
    1.74 +FORCE:
     2.1 --- a/po/de_DE.po	Sat Dec 29 11:30:38 2007 +0100
     2.2 +++ b/po/de_DE.po	Sat Dec 29 13:19:16 2007 +0100
     2.3 @@ -7,7 +7,7 @@
     2.4  msgstr ""
     2.5  "Project-Id-Version: VDR 1.5.9\n"
     2.6  "Report-Msgid-Bugs-To: <s.huelswitt@gmx.de>\n"
     2.7 -"POT-Creation-Date: 2007-08-27 17:31+0200\n"
     2.8 +"POT-Creation-Date: 2007-12-29 13:17+0100\n"
     2.9  "PO-Revision-Date: 2007-08-27 16:22+0200\n"
    2.10  "Last-Translator: Stefan Huelswitt <s.huelswitt@gmx.de>\n"
    2.11  "Language-Team: <vdr@linuxtv.org>\n"
    2.12 @@ -15,9 +15,6 @@
    2.13  "Content-Type: text/plain; charset=ISO-8859-15\n"
    2.14  "Content-Transfer-Encoding: 8bit\n"
    2.15  
    2.16 -msgid "Parses extended Premiere EPG data"
    2.17 -msgstr "Liest erweiterte Premiere EPG Daten ein"
    2.18 -
    2.19  msgid "PremiereEPG"
    2.20  msgstr "PremiereEPG"
    2.21  
    2.22 @@ -56,3 +53,6 @@
    2.23  
    2.24  msgid "years"
    2.25  msgstr "Jahre"
    2.26 +
    2.27 +msgid "Parses extended Premiere EPG data"
    2.28 +msgstr "Liest erweiterte Premiere EPG Daten ein"
     3.1 --- a/po/fr_FR.po	Sat Dec 29 11:30:38 2007 +0100
     3.2 +++ b/po/fr_FR.po	Sat Dec 29 13:19:16 2007 +0100
     3.3 @@ -7,7 +7,7 @@
     3.4  msgstr ""
     3.5  "Project-Id-Version: VDR 1.5.9\n"
     3.6  "Report-Msgid-Bugs-To: <s.huelswitt@gmx.de>\n"
     3.7 -"POT-Creation-Date: 2007-12-16 15:00+0200\n"
     3.8 +"POT-Creation-Date: 2007-12-29 13:17+0100\n"
     3.9  "PO-Revision-Date: 2007-12-16 15:00+0200\n"
    3.10  "Last-Translator: Patrice Staudt <patrice.staudt@laposte.net>\n"
    3.11  "Language-Team: <vdr@linuxtv.org>\n"
    3.12 @@ -15,9 +15,6 @@
    3.13  "Content-Type: text/plain; charset=ISO-8859-15\n"
    3.14  "Content-Transfer-Encoding: 8bit\n"
    3.15  
    3.16 -msgid "Parses extended Premiere EPG data"
    3.17 -msgstr "Lis les informations EPG étandue de Premiere"
    3.18 -
    3.19  msgid "PremiereEPG"
    3.20  msgstr "PremiereEPG"
    3.21  
    3.22 @@ -56,3 +53,6 @@
    3.23  
    3.24  msgid "years"
    3.25  msgstr "ans"
    3.26 +
    3.27 +msgid "Parses extended Premiere EPG data"
    3.28 +msgstr "Lis les informations EPG étandue de Premiere"
     4.1 --- a/premiereepg.c	Sat Dec 29 11:30:38 2007 +0100
     4.2 +++ b/premiereepg.c	Sat Dec 29 13:19:16 2007 +0100
     4.3 @@ -32,6 +32,7 @@
     4.4  #include <vdr/config.h>
     4.5  #include <libsi/section.h>
     4.6  #include <libsi/descriptor.h>
     4.7 +#include "version.h"
     4.8  
     4.9  #if APIVERSNUM < 10401
    4.10  #error You need at least VDR API version 1.4.1 for this plugin
    4.11 @@ -57,9 +58,6 @@
    4.12  #define PMT_SCAN_TIMEOUT  10  // seconds
    4.13  #define PMT_SCAN_IDLE     300 // seconds
    4.14  
    4.15 -static const char *VERSION        = "0.0.8";
    4.16 -static const char *DESCRIPTION    = trNOOP("Parses extended Premiere EPG data");
    4.17 -
    4.18  // --- cSetupPremiereEpg -------------------------------------------------------
    4.19  
    4.20  const char *optPats[] = {
    4.21 @@ -740,6 +738,8 @@
    4.22  
    4.23  // --- cPluginPremiereEpg ------------------------------------------------------
    4.24  
    4.25 +static const char *DESCRIPTION    = trNOOP("Parses extended Premiere EPG data");
    4.26 +
    4.27  class cPluginPremiereEpg : public cPlugin {
    4.28  private:
    4.29    struct {
    4.30 @@ -748,7 +748,7 @@
    4.31      } epg[MAXDVBDEVICES];
    4.32  public:
    4.33    cPluginPremiereEpg(void);
    4.34 -  virtual const char *Version(void) { return VERSION; }
    4.35 +  virtual const char *Version(void) { return PluginVersion; }
    4.36    virtual const char *Description(void) { return tr(DESCRIPTION); }
    4.37    virtual bool Start(void);
    4.38    virtual void Stop(void);
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/version.c	Sat Dec 29 13:19:16 2007 +0100
     5.3 @@ -0,0 +1,2 @@
     5.4 +/* this file will be overwritten without warning */
     5.5 +const char *PluginVersion = "0.0.8-5686936eefc5+";
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/version.h	Sat Dec 29 13:19:16 2007 +0100
     6.3 @@ -0,0 +1,33 @@
     6.4 +/*
     6.5 + * PremiereEpg plugin to VDR (C++)
     6.6 + *
     6.7 + * (C) 2005-2007 Stefan Huelswitt <s.huelswitt@gmx.de>
     6.8 + *
     6.9 + * This code is base on the commandline tool premiereepg2vdr
    6.10 + * (C) 2004-2005 by Axel Katzur software@katzur.de
    6.11 + * but has been rewritten from scratch
    6.12 + *
    6.13 + * This code is free software; you can redistribute it and/or
    6.14 + * modify it under the terms of the GNU General Public License
    6.15 + * as published by the Free Software Foundation; either version 2
    6.16 + * of the License, or (at your option) any later version.
    6.17 + *
    6.18 + * This code is distributed in the hope that it will be useful,
    6.19 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.20 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    6.21 + * GNU General Public License for more details.
    6.22 + *
    6.23 + * You should have received a copy of the GNU General Public License
    6.24 + * along with this program; if not, write to the Free Software
    6.25 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    6.26 + * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
    6.27 + */
    6.28 +
    6.29 +#ifndef ___VERSION_H
    6.30 +#define ___VERSION_H
    6.31 +
    6.32 +#define PLUGIN_RELEASE "0.0.8"
    6.33 +
    6.34 +extern const char *PluginVersion;
    6.35 +
    6.36 +#endif //___VERSION_H