Adjustment from last proposed patch. Less crowded and more standard.
This should not break any packaging.
feedback?
Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien@gmail.com>
## 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; \
+ sed -i "s'^#define GIT_VERSION.*$$'#define GIT_VERSION \"$${git_version}\"'" "$${version_h}"; \
fi; \
fi; \
fi)
#ifndef VERSION_H
#define VERSION_H
-/*
- * Define the macro containing the FULL version
- */
-#ifdef GIT_VERSION
-#define FULL_VERSION "" GIT_VERSION
-#else /* GIT_VERSION */
-#define FULL_VERSION "" VERSION
-#endif /* GIT_VERSION */
+#define GIT_VERSION ""
#endif /* VERSION_H */
if (lttng_opt_mi) {
ret = print_mi();
} else {
- MSG("lttng version " FULL_VERSION " - " VERSION_NAME);
+ MSG("lttng version " VERSION " - " VERSION_NAME " - " GIT_VERSION);
MSG("\n" VERSION_DESCRIPTION "\n");
MSG("Web site: http://lttng.org");
MSG("\n%s", lttng_license);
static void usage(FILE *ofp)
{
- fprintf(ofp, "LTTng Trace Control " FULL_VERSION" - " VERSION_NAME"\n\n");
+ fprintf(ofp, "LTTng Trace Control " VERSION " - " VERSION_NAME" - " GIT_VERSION "\n\n");
fprintf(ofp, "usage: lttng [OPTIONS] <COMMAND> [<ARGS>]\n");
fprintf(ofp, "\n");
fprintf(ofp, "Options:\n");
static void version(FILE *ofp)
{
- fprintf(ofp, "%s (LTTng Trace Control) " FULL_VERSION" - " VERSION_NAME"\n",
+ fprintf(ofp, "%s (LTTng Trace Control) " VERSION" - " VERSION_NAME" - " GIT_VERSION "\n",
progname);
}