[lttng-dev] [PATCH lttng-tools] Add the formal version before the git version for a commit outside the master branch

Raphaël Beamonte raphael.beamonte at gmail.com
Mon Aug 4 14:12:48 EDT 2014


2014-07-31 17:17 GMT-04:00 Mathieu Desnoyers <mathieu.desnoyers at efficios.com>:
> Is this change still needed after the recent changes I did ?

No, I guess it is not. It was only to add the version number in the
version string as asked, but I guess it's not necessary anymore.

> ----- Original Message -----
>> From: "Raphaël Beamonte" <raphael.beamonte at gmail.com>
>> To: lttng-dev at lists.lttng.org
>> Cc: "Raphaël Beamonte" <raphael.beamonte at gmail.com>
>> Sent: Monday, July 28, 2014 4:00:04 PM
>> Subject: [lttng-dev] [PATCH lttng-tools] Add the formal version before the    git version for a commit outside the
>> master branch
>>
>> Signed-off-by: Raphaël Beamonte <raphael.beamonte at gmail.com>
>> ---
>>  include/Makefile.am | 8 +++++---
>>  1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/include/Makefile.am b/include/Makefile.am
>> index d40cb4a..67a7063 100644
>> --- a/include/Makefile.am
>> +++ b/include/Makefile.am
>> @@ -24,8 +24,10 @@ version.h:
>>                       if [ "$${git_branch}" == "$${git_describe}" ] || \
>>                               [ "$${git_branch}" == "heads/master" ]; then \
>>                               git_version="$${git_describe}"; \
>> +                             addversion=""; \
>>                       else \
>>                               git_version="$$(git describe --long --all)"; \
>> +                             addversion="\" VERSION \"-"; \
>>                       fi; \
>>               fi; \
>>               ##
>> @@ -46,19 +48,19 @@ version.h:
>>                       ## as the one currently in the file (if there is one), as we
>>                       ## don't want to update the file if it is already up to date
>>                       ##
>> -                     if [ $$(grep -cE "^#define GIT_VERSION \"?$${git_version}\"?$$"
>> "$${version_h}") -eq 0 ]; then \
>> +                     if [ $$(grep -cE "^#define GIT_VERSION
>> \"?$${addversion}$${git_version}\"?$$" "$${version_h}") -eq 0 ]; then \
>>                               if [ $$(grep -c "^#define GIT_VERSION" "$${version_h}") -gt 0 ]; then \
>>                                       ##
>>                                       ## If there is already a GIT_VERSION defined,
>>                                       ## we just replace it by the new version
>>                                       ##
>> -                                     sed -i "s'^#define GIT_VERSION.*$$'#define GIT_VERSION
>> \"$${git_version}\"'" "$${version_h}"; \
>> +                                     sed -i "s'^#define GIT_VERSION.*$$'#define GIT_VERSION
>> \"$${addversion}$${git_version}\"'" "$${version_h}"; \
>>                               else \
>>                                       ##
>>                                       ## Else, we add a GIT_VERSION define
>>                                       ## containing our new version.
>>                                       ##
>> -                                     sed -i "s'^\(#define VERSION_H.*\)$$'\1\n\n#define GIT_VERSION
>> \"$${git_version}\"'" "$${version_h}"; \
>> +                                     sed -i "s'^\(#define VERSION_H.*\)$$'\1\n\n#define GIT_VERSION
>> \"$${addversion}$${git_version}\"'" "$${version_h}"; \
>>                               fi; \
>>                       fi; \
>>               fi; \
>> --
>> 2.0.0.rc0
>>
>>
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev at lists.lttng.org
>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>>
>
> --
> Mathieu Desnoyers
> EfficiOS Inc.
> http://www.efficios.com



More information about the lttng-dev mailing list