summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2022-10-21 11:11:11 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-10-21 09:25:56 +0000
commit954791b9639a62e09488a21d152aaa7ee59f877d (patch)
tree96fd836353e3b647923aed836668fa4603ce0fa4
parent99014191b6c2e7abd0614e885a338ab1d6f34432 (diff)
Fix Makefile rule for patch to succeed on diff status 1
The exit status for diff is "0 if inputs are the same, 1 if different, 2 if trouble." So say out loud that the patch is empty if diff "succeeds", otherwise succeed precisely if its status was 1. Change-Id: Ia2497a0c9673e0c663d01d6e34815e663b83ba09 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 7d87b45..2cf32cb 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,8 @@ clean:
# For use during an update:
.PHONY: patch
patch: template.html planetqt/template.qt
- $Q cp $< scripts/$< && diff -bu planetqt/template.qt scripts/$< >scripts/template.diff
+ $Q if cp $< scripts/$< && diff -bu planetqt/template.qt scripts/$< >scripts/template.diff; \
+ then echo Empty patch; else [ $$? -eq 1 ]; fi
# Does not declare dependency of template.diff on prerequisites, to avoid circular dependency.
planetqt/template.qt planetqt/website: