Show 'release' instead of '9999999' in r2 -v

This commit is contained in:
pancake 2017-01-29 15:25:14 +01:00
parent 5fa9601abe
commit a50dd5ecbb
3 changed files with 8 additions and 2 deletions

View File

@ -12,7 +12,8 @@ ZIP=zip
R2VC=$(shell git rev-list --all --count 2>/dev/null) R2VC=$(shell git rev-list --all --count 2>/dev/null)
ifeq ($(R2VC),) ifeq ($(R2VC),)
R2VC=9999999 # release
R2VC=0
endif endif
STRIP?=strip STRIP?=strip

View File

@ -524,11 +524,15 @@ static int cmd_help(void *data, const char *input) {
} }
break; break;
case 0: case 0:
#if R2_VERSION_COMMIT == 0
r_cons_printf ("%s release\n", R2_VERSION);
#else
if (!strcmp (R2_VERSION, R2_GITTAP)) { if (!strcmp (R2_VERSION, R2_GITTAP)) {
r_cons_printf ("%s %d\n", R2_VERSION, R2_VERSION_COMMIT); r_cons_printf ("%s %d\n", R2_VERSION, R2_VERSION_COMMIT);
} else { } else {
r_cons_printf ("%s aka %s commit %d\n", R2_VERSION, R2_GITTAP, R2_VERSION_COMMIT); r_cons_printf ("%s aka %s commit %d\n", R2_VERSION, R2_GITTAP, R2_VERSION_COMMIT);
} }
#endif
break; break;
case 'j': case 'j':
r_cons_printf ("{\"system\":\"%s-%s\"", R_SYS_OS, R_SYS_ARCH); r_cons_printf ("{\"system\":\"%s-%s\"", R_SYS_OS, R_SYS_ARCH);

View File

@ -269,7 +269,8 @@ R_API int r_lib_open_ptr (RLib *lib, const char *file, void *handler, RLibStruct
if (stru->version) { if (stru->version) {
if (strcmp (stru->version, R2_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; return R_FAIL;
} }
} }