Hi!

Ralph Glasstetter wrote:

>>I'm back in town, and I brought some changes with me as well:
> 
> Hope you had some relaxed/sunny holidays! :)

Yep, thanks!

>>- $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.

Nice.

> 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.

As long as you have (ba)sh and a few tools...

> 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));
> :-)

Yep.

> 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!).

Ugh. That's a bit too much. ;-)

> 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.

setversion should not modify a file that comes from the repository.
Otherwise, I might check in the modified version by mistake.

> 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 $^

... or something very similar ...

> should do the job (but I don't know where to put it in the Makefile,... my 
> first attempts failed... :-( ).

You probably forgot to tell make that dvbcut.cpp now depends on
version.h - if you don't, it will simply ignore any changes to the file.

Where you put the rule doesn't matter much. Just don't make it the first
explicit rule, because that's executed by default when you call "make"
without arguments.

> And for SCons... I really not even have an idea what to write into the 
> SConstruct/SConscript files...

Neither do I.

> although I have some knowledge about python 
> and had a look on the scons webside this build tool is still a miracle to 
> me... :-(

Same here.

Michael.

-------------------------------------------------------------------------
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

Reply via email to