]> granicus.if.org Git - zfs/commitdiff
Avoid updating zfs_gitrev.h when rev is unchanged
authorJorgen Lundman <lundman@lundman.net>
Fri, 7 Jun 2019 02:01:41 +0000 (11:01 +0900)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 7 Jun 2019 02:01:41 +0000 (19:01 -0700)
Build process would always re-compile spa_history.c due to touching
zfs_gitrev.h - avoid if no change in gitrev.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Chris Dunlop <chris@onthe.net.au>
Reviewed-by: Allan Jude <allanjude@freebsd.org>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes #8860

scripts/make_gitrev.sh

index bab9be88d7342be0fc3b310ec3a7f00a330fb050..1cf143794b26be600432398ba5aa8c66dc96769e 100755 (executable)
@@ -39,3 +39,7 @@ trap cleanup EXIT
 git rev-parse --git-dir > /dev/null 2>&1
 # Get the git current git revision
 ZFS_GIT_REV=$(git describe --always --long --dirty 2>/dev/null)
+# Check if header file already contain the exact string
+grep -sq "\"${ZFS_GIT_REV}\"" "$(dirname "$0")"/../include/zfs_gitrev.h &&
+       trap - EXIT
+exit 0