Skip to content

Commit 66fc0a0

Browse files
practicalswiftrustyrussell
authored andcommitted
Make version output simpler/more user-friendly
1 parent b4db228 commit 66fc0a0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#! /usr/bin/make
2-
NAME=Bitcoin Savings & Trust Daily Interest II
32

4-
# TODO: Decide: c-lightning, lightningd, lightning?
53
PKGNAME = c-lightning
64

75
# We use our own internal ccan copy.
@@ -291,7 +289,7 @@ ccan/config.h: ccan/tools/configurator/configurator Makefile
291289
if $< --configurator-cc="$(CONFIGURATOR_CC)" $(CC) $(CFLAGS) > $@.new; then mv $@.new $@; else rm $@.new; exit 1; fi
292290

293291
gen_version.h: FORCE
294-
@(echo "#define VERSION \"`git describe --always --dirty`\"" && echo "#define VERSION_NAME \"$(NAME)\"" && echo "#define BUILD_FEATURES \"$(FEATURES)\"") > $@.new
292+
@(echo "#define VERSION \"`git describe --always --dirty=-with-local-modifications`\"" && echo "#define BUILD_FEATURES \"$(FEATURES)\"") > $@.new
295293
@if cmp $@.new $@ >/dev/null 2>&2; then rm -f $@.new; else mv $@.new $@; echo Version updated; fi
296294

297295
# All binaries require the external libs, ccan

common/version.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ const char *version(void)
99

1010
char *version_and_exit(const void *unused UNUSED)
1111
{
12-
printf("%s\n"
13-
"aka. %s\n"
14-
"Built with: %s\n", VERSION, VERSION_NAME, BUILD_FEATURES);
12+
printf("%s\n", VERSION);
13+
if (BUILD_FEATURES[0]) {
14+
printf("Built with features: %s\n", BUILD_FEATURES);
15+
}
1516
exit(0);
1617
}

0 commit comments

Comments
 (0)