Include repository status (-{clean,dirty}) in version string
authorPiotr Dymacz <pepe2k@gmail.com>
Wed, 2 Mar 2016 14:24:03 +0000 (15:24 +0100)
committerPiotr Dymacz <pepe2k@gmail.com>
Wed, 2 Mar 2016 14:24:03 +0000 (15:24 +0100)
u-boot/Makefile
u-boot/lib_mips/board.c

index 62aea606439b05a572b7b3f5bd8dc637b8f8f1dd..9bd2c1e17ba71bd9f532b686eab6a1428399a509 100644 (file)
 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/ \
index 3fd8ac287b7bdb0c28ca35eb8ab4d11d02b436b7..998123d2604a6aafc0a19f238a24eedc39f3f227 100644 (file)
@@ -96,7 +96,7 @@ static int display_banner(void)
 #endif
 
        printf("\n***************************************"
-                  "\n*        %s        *"
+                  "\n*     %s     *"
                   "\n*        " __DATE__ ", " __TIME__ "        *"
                   "\n***************************************\n\n",
                        version_string);