Hi, Am Montag, 23. Juli 2007 18:00 schrieb Michael Riepe: > Hi *, > > I'm back in town, and I brought some changes with me as well: Hope you had some relaxed/sunny holidays! :)
> ...
> - $Id$ keywords in src/* (except generated files)
I did a little bash scripting (see the appended "setversion") for getting the
revision number and writing a appropriate header file (example attached) with
this info.
Seemed to me a little bit more transparent/easier than this svnrev.c tool
we talked about a few weeks ago... and which always needs to be compiled
before usage.
My script is scanning all the source files supplied as arguments for the $Id$
keywords to find the last changed file and the current revision number, i.e.
setversion src/*.cpp src/*.h
will produce a header file "version.h", which can be included for instance in
dvbcut.cpp to have in line 1105 something like:
setCaption(QString("dvbcut " VERSION "/" REVISION " - " + filename));
:-)
If already present, also this header file (containing an "artifical"
$Id:-line) will be scanned to ensure that always the max. revision number is
found, even if called with just a subset of changed/updated files.
Additionally in that header file a version string containing the last official
release is set, which is got from the envirionment variable $VERSION, some
text file "version.txt", a pre-build header file or some default set in the
script (in that order!).
At the moment I'm not sure which method to use... I would prefer setting it
via a template "version.h" to minimize the need for additionally "hidden"
resources, but don't know if this causes any conflicts, since it has to be in
the repository that way.
Another problem is how to call "setversion"!
At the moment I'm doing this manually after each checkout since my
knowledge about make/scons is limited. But that shouldn't be too difficult for
an expert... ;-)
For the Windows Makefile something like:
version.h: *.cpp *.h
$(TOP)/setversion $^
should do the job (but I don't know where to put it in the Makefile,... my
first attempts failed... :-( ).
And for SCons... I really not even have an idea what to write into the
SConstruct/SConscript files... although I have some knowledge about python
and had a look on the scons webside this build tool is still a miracle to
me... :-(
Any ideas/opinions...
ciao
Ralph
setversion
Description: application/shellscript
/*
This file was automatically generated by the 'setversion' script!
You should not modify it manually (except for the version string),
as it may be re-generated.
Last changed source file (read on input!):
$Id: dvbcut.cpp 59 2007-07-23 15:54:21Z too-tired $
*/
#ifndef VERSION_H
#define VERSION_H
#define VERSION "0.5.4"
#define REVISION "59"
#define CHANGED 20070723155421
#define BUILT 20070725132252
#endif /* VERSION_H */
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________ DVBCUT-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dvbcut-user
