Hi, Am Donnerstag, 5. Juli 2007 08:30 schrieb Michael Riepe: > Hi! > > Ralph Glasstetter wrote: > > Different issue... I looked for a way to have the dvbcut revision number > > in the code rsp. binary (without editing it by hand). > > > > Could you please add '$Id$' somewhere in the header comment of each > > source file? > > > > subversion expands this to a string containing revision,date&author and > > we could use it for versioning the binary with for instance svnrev (a > > small c-program: http://www.compuphase.com/svnrev.htm), which writes a > > header file with the most recent revision number and date among all > > secified files. > > I know that feature from RCS/CVS. There you can define a set of static C > strings: > > static const char rcsid[] = "$Id$"; That wouldn't help since with subversion every source file get's a different revision number...
> > and retrieve them later (from both source and binaries) with a command > called "ident". Similarly in SCCS, except that the command is called > "what" there. ...ok, you could also parse the source files for that string during the build process to get the largest one,... for svnrev it does not matter where the string is located (but it works only with ASCII). The real problem is that the mechanism should be portable... and subversion does not have a "GlobalRevison" key... > > > For instance in dvbcut.cpp we could then use SVN_REV in your new > > setCaption call to identify the binary. > > That would require that svnrev is available when you build the binary. Of course,... the small tool svnrev.c should be distributed with subversion, build prior to dvbcut and run before building that to create a svnref.h (by reading the expanded IDs and estimating the largest). But probabely this could also be achived by executing a bash script with a combination of 'grep | tr | cut' in a loop... which is also acceptable as long as the windows version is build with mingw... ;-) > > Keywords are substituted when a revision is checked out or updated (or, > in my case, checked in). That is, you can not check in the result from > svnrev at the same time because you must run the program afterwards. And > I don't want to run "svn ci" twice. Not because I'm lazy but because the > revision will change again when you do so - therefore, the stored > results from svnrev would always be slightly out of date. No,... It's not meant that you should run svnrev as the repository maintainer and check in svnrev.h regularly (maybe only once as template with variables set to 0). It don't has to (or should) be unter version contol... > > I've always been using keywords with my own (CVS based) projects, and > found them very convenient. It's little bit different there, since (from what I've read) all files get the same revision/version, right? ciao Ralph ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ DVBCUT-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dvbcut-user
