From a75d0dfa184587fe66eb4e1f8bbaaad3461c5e95 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Tue, 19 Jan 2021 23:05:39 +0000 Subject: [PATCH] conf.sh: avoid pointless reruns (re: 33b6718b) Same idea as in the referenced commit. src/lib/libast/comp/conf.sh: - If an output header file has not changed after rerunning conf.sh, still update the output file's timestamp using touch(1) to signal that the test has already been run. --- src/lib/libast/comp/conf.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/libast/comp/conf.sh b/src/lib/libast/comp/conf.sh index 72b1bfff4..4b1ceb540 100644 --- a/src/lib/libast/comp/conf.sh +++ b/src/lib/libast/comp/conf.sh @@ -1567,7 +1567,7 @@ extern const int prefix_elements; } > $tmp.2 case $debug in -d7) echo $command: $tmp.2 ${base}.h ;; -*) cmp -s $tmp.2 ${base}.h 2>/dev/null || mv $tmp.2 ${base}.h ;; +*) cmp -s "$tmp.2" "${base}.h" 2>/dev/null && touch "${base}.h" || mv "$tmp.2" "${base}.h" ;; esac case $verbose in @@ -1624,7 +1624,7 @@ const int conf_elements = (int)sizeof(conf) / (int)sizeof(conf[0]); } > $tmp.4 case $debug in -d7) echo $command: $tmp.4 ${base}.c ;; -*) cmp -s $tmp.4 ${base}.c 2>/dev/null || mv $tmp.4 ${base}.c ;; +*) cmp -s "$tmp.4" "${base}.c" 2>/dev/null && touch "${base.c}" || mv "$tmp.4" "${base}.c" ;; esac # limits.h generation code @@ -1646,6 +1646,6 @@ test -f $tmp.l && cat $tmp.l } > $tmp.5 case $debug in -d7) echo $command: $tmp.5 ${base}.h ;; -*) cmp -s $tmp.5 ${base}.h 2>/dev/null || mv $tmp.5 ${base}.h ;; +*) cmp -s "$tmp.5" "${base}.h" 2>/dev/null && touch "${base}.h" || mv "$tmp.5" "${base}.h" ;; esac exit 0