Always print GIT_VERSION even if empty
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 Always print GIT_VERSION even if empty
Adjustment from last proposed patch. Less crowded and more standard. This should not break any packaging.
feedback?
Signed-off-by Jonathan Rajotte Julien <[email protected]>
--- include/Makefile.am | 14 +------------- include/version.h.tmpl | 9 +-------- src/bin/lttng/commands/version.c | 2 +- src/bin/lttng/lttng.c | 4 ++-- 4 files changed, 5 insertions(+), 24 deletions(-)
include/Makefile.am +1 -13
@@ -47,19 +47,7 @@ version.h: ## 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)
include/version.h.tmpl +1 -8
@@ -20,13 +20,6 @@ #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 */
src/bin/lttng/commands/version.c +1 -1
@@ -164,7 +164,7 @@ int cmd_version(int argc, const char **argv)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);
src/bin/lttng/lttng.c +2 -2
@@ -90,7 +90,7 @@ static struct cmd_struct commands[] = {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" );
@@ -134,7 +134,7 @@ static void usage(FILE *ofp)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); }
Signature · 1 line
2.0.0