From: Piotr Dymacz Date: Wed, 2 Mar 2016 14:24:03 +0000 (+0100) Subject: Include repository status (-{clean,dirty}) in version string X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5bc9d7f28ddf5029576a85385110845273b9113f;p=oweals%2Fu-boot_mod.git Include repository status (-{clean,dirty}) in version string --- diff --git a/u-boot/Makefile b/u-boot/Makefile index 62aea60..9bd2c1e 100644 --- a/u-boot/Makefile +++ b/u-boot/Makefile @@ -24,10 +24,17 @@ VERSION = 1 PATCHLEVEL = 1 SUBLEVEL = 4 -EXTRAVERSION = -$(shell git rev-parse --short=8 HEAD) -U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) +EXTRAVERSION = -$(shell git rev-parse --short=8 HEAD) +ISREPODIRTY = $(shell if git diff-files | read dummy; then echo 1; else echo 0; fi) VERSION_FILE = include/version_autogenerated.h +# Show in version string if we are not building from clean repository +ifeq ($(ISREPODIRTY), 1) +U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)"-dirty" +else +U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)"-clean" +endif + HOSTARCH := $(shell uname -m | \ sed -e s/i.86/i386/ \ -e s/sun4u/sparc64/ \ diff --git a/u-boot/lib_mips/board.c b/u-boot/lib_mips/board.c index 3fd8ac2..998123d 100644 --- a/u-boot/lib_mips/board.c +++ b/u-boot/lib_mips/board.c @@ -96,7 +96,7 @@ static int display_banner(void) #endif printf("\n***************************************" - "\n* %s *" + "\n* %s *" "\n* " __DATE__ ", " __TIME__ " *" "\n***************************************\n\n", version_string);