Fix: always use git describe --all --long for the git version
[lttng-tools.git] / include / Makefile.am
index d40cb4a4fea2fbb7327dd95bcb56cdbeb2145be1..767b05b5d99ff38128713925a7dbd71e12579bd7 100644 (file)
@@ -21,8 +21,7 @@ version.h:
                        git_version=""; \
                else \
                        git_describe="$$(git describe)"; \
-                       if [ "$${git_branch}" == "$${git_describe}" ] || \
-                               [ "$${git_branch}" == "heads/master" ]; then \
+                       if [ "$${git_branch}" == "$${git_describe}" ]; then \
                                git_version="$${git_describe}"; \
                        else \
                                git_version="$$(git describe --long --all)"; \
@@ -46,20 +45,8 @@ 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 -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}"; \
-                               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}"; \
-                               fi; \
+                       if [ $$(grep -cE "^#define GIT_VERSION_SED \"?$${git_version}\"?$$" "$${version_h}") -eq 0 ]; then \
+                               sed -i "s'^#define GIT_VERSION_SED.*$$'#define GIT_VERSION \"$${git_version}\"'" "$${version_h}"; \
                        fi; \
                fi; \
        fi)
This page took 0.022948 seconds and 4 git commands to generate.