[lttng-dev] [PATCH] Add a git version information in LTTng versions compiled from git sources

Raphaël Beamonte raphael.beamonte at gmail.com
Wed Mar 13 23:16:17 EDT 2013


On 2013-03-13 23:03, Raphaël Beamonte wrote:
> Signed-off-by: Raphaël Beamonte <raphael.beamonte at gmail.com>
> ---
>  include/Makefile.am              |   20 +++++++++++++++++++-
>  include/lttng/version.h          |   25 +++++++++++++++++++++++++
>  src/bin/lttng-sessiond/main.c    |    5 +++++
>  src/bin/lttng/commands/version.c |    4 ++++
>  src/bin/lttng/lttng.c            |    7 ++++++-
>  5 files changed, 59 insertions(+), 2 deletions(-)
>  create mode 100644 include/lttng/version.h

Ok, this is a new try. This one uses shell script in the Makefile of the
include directory to verify and change (only if necessary) the value of
the GIT_VERSION define. It allows the sessiond/main.c,
commands/version.c and lttng.c files to be the only one to need
re-compilation for versioning when the git version changes.

I thought at first to put the content of the shell script in a
version.sh file that would be called, but I wasn't sure the idea of
calling an external shell script at make would be better that directly
put the operations in the makefile.

One thing I'm not sure about is that currently, the version.h needs to
be versioned but perhaps should be in the .gitignore file to only save
the "original" version file in the repository. There could be another
solution if you think it's better : generating the version.h file with
the bash script at first run. In this case, I think the version.sh shell
script should perhaps be a better solution.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20130313/8d41399d/attachment.pgp>


More information about the lttng-dev mailing list