UrJTAG already states that it is "0.6" when started. At least at the moment many people use the code from the subversion repository. We'll run into problems later when all just claim to run "version 0.6"...
I agree that we should set up such an identification.
At another project (http://sdcc.sf.net/) I've seen the following mechanism:
* ChangeLog contains the $Revision$ tag
* during make, some awk scripting copies ChangeLog's SVN revision number to version.h
* version.h is included e.g. in the code that prints the tool's version
This however requires that ChangeLog (or any other file) is updated with each check-in to keep revision numbers consistent. Not a bad thing, IMO :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The revision info could be extracted e.g. from the .svn/entries file(s). Tiny tools exist which can create .h from .svn info, e.g. http://www.compuphase.com/svnrev.htm - at work we're using subwcrev.exe (comes with TortoiseSVN for Windows...) which even notes whether the working copy has local modifications.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
However, the $Revision$ from ChangeLog would be easier to gather. The format of files in .svn might change with Subversion releases (as did the "entries" format).
Currently, the version comes from configure.ac, which also carries a $Revision$, but not as often as a ChangeLog would [should].
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Added scripting to copy the Revision tag from ChangeLog to src/version.h. I had to move the tag to the end of ChangeLog since emacs inserts new entries automatically at the top of this file (C-x 4 a). However, the revision number is used in src/jtag.c main() as the "Build" number.
Please check how this matches your initial idea.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In #829: The revision is gathered by ./configure and written to config.h. It first tries "svn info" (which works only if a. svn is installed and b. it runs in an actual working copy, not just in an unpacked distribution.tar.gz) followed by the awk on ChangeLog followed by defining SVN_REVISION to 0.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Works fine on a fresh checkout. But if config.h is already present then make doesn't update config.h although the revision number changed.
Observed after commit of r835 and r836:
SVN revision number incremented in ChangeLog but config.h still shows '#define SVN_REVISION "831"'.
Running ./configure yields "831" again - guess because 'svn info' still is at 831. How should I address this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've added the "-R" option to "svn info" and some more awk code (just learning awk that way...) After committing #837, "svn info" still shows 836, but config.h knows better: 837. More checks could be added to determine if any files aren't up-to-date or modified, but that's less important. It should go into the code for "make dist" which already checks NEWS
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=156321
Originator: NO
I agree that we should set up such an identification.
At another project (http://sdcc.sf.net/) I've seen the following mechanism:
* ChangeLog contains the $Revision$ tag
* during make, some awk scripting copies ChangeLog's SVN revision number to version.h
* version.h is included e.g. in the code that prints the tool's version
This however requires that ChangeLog (or any other file) is updated with each check-in to keep revision numbers consistent. Not a bad thing, IMO :-)
Logged In: YES
user_id=478715
Originator: YES
The revision info could be extracted e.g. from the .svn/entries file(s). Tiny tools exist which can create .h from .svn info, e.g. http://www.compuphase.com/svnrev.htm - at work we're using subwcrev.exe (comes with TortoiseSVN for Windows...) which even notes whether the working copy has local modifications.
Logged In: YES
user_id=478715
Originator: YES
However, the $Revision$ from ChangeLog would be easier to gather. The format of files in .svn might change with Subversion releases (as did the "entries" format).
Currently, the version comes from configure.ac, which also carries a $Revision$, but not as often as a ChangeLog would [should].
Logged In: YES
user_id=156321
Originator: NO
Added scripting to copy the Revision tag from ChangeLog to src/version.h. I had to move the tag to the end of ChangeLog since emacs inserts new entries automatically at the top of this file (C-x 4 a). However, the revision number is used in src/jtag.c main() as the "Build" number.
Please check how this matches your initial idea.
Logged In: YES
user_id=478715
Originator: YES
In #829: The revision is gathered by ./configure and written to config.h. It first tries "svn info" (which works only if a. svn is installed and b. it runs in an actual working copy, not just in an unpacked distribution.tar.gz) followed by the awk on ChangeLog followed by defining SVN_REVISION to 0.
Logged In: YES
user_id=156321
Originator: NO
Works fine on a fresh checkout. But if config.h is already present then make doesn't update config.h although the revision number changed.
Observed after commit of r835 and r836:
SVN revision number incremented in ChangeLog but config.h still shows '#define SVN_REVISION "831"'.
Running ./configure yields "831" again - guess because 'svn info' still is at 831. How should I address this?
Logged In: YES
user_id=478715
Originator: YES
I've added the "-R" option to "svn info" and some more awk code (just learning awk that way...) After committing #837, "svn info" still shows 836, but config.h knows better: 837. More checks could be added to determine if any files aren't up-to-date or modified, but that's less important. It should go into the code for "make dist" which already checks NEWS