aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorgen Lundman <[email protected]>2019-06-07 11:01:41 +0900
committerBrian Behlendorf <[email protected]>2019-06-06 19:01:41 -0700
commit876d76be3455ba6aa8d1567203847d8c012d05c9 (patch)
tree37a36e3daead67c5fa11bd85cf8d74b8b574f7b1
parentfd7a657bffccf24a11c60ea63e5dba7aed635961 (diff)
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 <[email protected]> Reviewed-by: Chris Dunlop <[email protected]> Reviewed-by: Allan Jude <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes #8860
-rwxr-xr-xscripts/make_gitrev.sh4
1 files changed, 4 insertions, 0 deletions
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