summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-09-11 14:20:54 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-09-11 14:20:54 -0400
commit4ad34c64825c9edc1cebbb434b914b0312891545 (patch)
tree4395faf39b84b61e81e6925f7c3663bc37da1e5c
parentd967331db9699b77fabdf01b47d6e6eec60c7c62 (diff)
tools/notsd-fixup--includes: avoid touching a file for no changes
-rwxr-xr-xtools/notsd-fixup--includes6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/notsd-fixup--includes b/tools/notsd-fixup--includes
index cd7638afd4..46deaa8e8e 100755
--- a/tools/notsd-fixup--includes
+++ b/tools/notsd-fixup--includes
@@ -228,7 +228,11 @@ main() {
done
"$hook"
} < "$current_file" > "$current_file.tmp"
- mv -Tf "$current_file.tmp" "$current_file"
+ if cmp -s "$current_file.tmp" "$current_file"; then
+ rm -f "$current_file.tmp" || :
+ else
+ mv -Tf "$current_file.tmp" "$current_file"
+ fi
}
main "$@"