From a50dd5ecbbe51ed795c278b378611babfdd4beb7 Mon Sep 17 00:00:00 2001 From: pancake Date: Sun, 29 Jan 2017 15:25:14 +0100 Subject: [PATCH] Show 'release' instead of '9999999' in r2 -v --- Makefile | 3 ++- libr/core/cmd_help.c | 4 ++++ libr/util/lib.c | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c0600c40e0..5161b359e5 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,8 @@ ZIP=zip R2VC=$(shell git rev-list --all --count 2>/dev/null) ifeq ($(R2VC),) -R2VC=9999999 +# release +R2VC=0 endif STRIP?=strip diff --git a/libr/core/cmd_help.c b/libr/core/cmd_help.c index 794ad944e8..d561dc0fe5 100644 --- a/libr/core/cmd_help.c +++ b/libr/core/cmd_help.c @@ -524,11 +524,15 @@ static int cmd_help(void *data, const char *input) { } break; case 0: +#if R2_VERSION_COMMIT == 0 + r_cons_printf ("%s release\n", R2_VERSION); +#else if (!strcmp (R2_VERSION, R2_GITTAP)) { r_cons_printf ("%s %d\n", R2_VERSION, R2_VERSION_COMMIT); } else { r_cons_printf ("%s aka %s commit %d\n", R2_VERSION, R2_GITTAP, R2_VERSION_COMMIT); } +#endif break; case 'j': r_cons_printf ("{\"system\":\"%s-%s\"", R_SYS_OS, R_SYS_ARCH); diff --git a/libr/util/lib.c b/libr/util/lib.c index 4c17f041e6..5fbc3d72c0 100644 --- a/libr/util/lib.c +++ b/libr/util/lib.c @@ -269,7 +269,8 @@ R_API int r_lib_open_ptr (RLib *lib, const char *file, void *handler, RLibStruct if (stru->version) { if (strcmp (stru->version, R2_VERSION)) { - eprintf ("Module version mismatch %s\n", file); + eprintf ("Module version mismatch %s (%s) vs (%s)\n", + file, stru->version, R2_VERSION); return R_FAIL; } }