Skip to contentSkip to conversation

Add the formal version before the git version for a commit outside the master branch

PATCH Mathieu Desnoyers 2 participants 2 messages Jul 31, 2014 – Aug 4, 2014 2 messages not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Is this change still needed after the recent changes I did ?

----- Original Message -----

Quoted 65 lines

From: "Raphaël Beamonte" <[email protected]>
To: [email protected]
Cc: "Raphaël Beamonte" <[email protected]>
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

---
 include/Makefile.am | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
include/Makefile.am +4 -3
index d40cb4a..67a7063 100644
@@ -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}"; \

include/Makefile.am +1 -0
+					sed -i "s'^\(#define VERSION_H.*\)$$'\1\n\n#define GIT_VERSION

\"$${addversion}$${git_version}\"'" "$${version_h}"; \

include/Makefile.am +0 -1
 				fi; \
 			fi; \
 		fi; \
--

2.0.0.rc0

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Signature · 8 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#3 lore raw
In reply to a message not in the archive

2014-07-31 17:17 GMT-04:00 Mathieu Desnoyers <[email protected]>:

Quoted 1 line

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.

Quoted 71 lines

----- Original Message -----

Quoted 56 lines

From: "Raphaël Beamonte" <[email protected]>
To: [email protected]
Cc: "Raphaël Beamonte" <[email protected]>
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

---
 include/Makefile.am | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
include/Makefile.am +4 -3
index d40cb4a..67a7063 100644
@@ -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; \
Quoted 9 lines

--
2.0.0.rc0

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com