9os

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit a2239b4be6e56d68d4cc311ca1489cd5cd2ae7de
parent 60adb80fd49472ba9b3fc06df04aea6b61c82692
Author: Roberto E. Vargas Caballero <roberto.vargas@midokura.com>
Date:   Tue, 22 Nov 2022 20:04:19 +0100

os9: Regenerate version.h in commit changes

The file version.h was generated once and it was not regenerated
ever, generating builds with wrong version identifiers.

Diffstat:
Msrc/os9/Makefile | 2+-
Msrc/os9/mkver | 17++++++++++++-----
2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/os9/Makefile b/src/os9/Makefile @@ -18,7 +18,7 @@ OBJS =\ all: image -version.h: +version.h: FORCE ./mkver sys.o: version.h diff --git a/src/os9/mkver b/src/os9/mkver @@ -1,9 +1,16 @@ #!/bin/sh -set -e trap 'rm -f $$.tmp' EXIT HUP INT QUIT TERM -git show-ref HEAD | -awk '{printf("#define OS9VERSION \"%s\"\n", - substr($1, 1, 8)) -}' > $$.tmp && mv $$.tmp version.h +git=`git show-ref --head | awk '$2 == "HEAD" {print substr($1, 1, 8)}'` +ver=`sed -n '/OS9VERSION/ s/.*"\(.*\)"/\1/p' version.h 2>/dev/null` + +if test "$ver" = "$git" +then + exit +fi + +rm -f version.h + +echo '#define OS9VERSION "'$git'"' > $$.tmp && +mv $$.tmp version.h