From 876d76be3455ba6aa8d1567203847d8c012d05c9 Mon Sep 17 00:00:00 2001 From: Jorgen Lundman Date: Fri, 7 Jun 2019 11:01:41 +0900 Subject: [PATCH] Avoid updating zfs_gitrev.h when rev is unchanged 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 Reviewed-by: Chris Dunlop Reviewed-by: Allan Jude Signed-off-by: Jorgen Lundman Closes #8860 --- scripts/make_gitrev.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/make_gitrev.sh b/scripts/make_gitrev.sh index bab9be88d..1cf143794 100755 --- a/scripts/make_gitrev.sh +++ b/scripts/make_gitrev.sh @@ -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