about summary refs log tree commit diff
path: root/tools/check-compare-generated.sh
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2021-02-25 11:36:45 +0100
committerSebastien Bacher <seb128@ubuntu.com>2021-02-25 11:36:45 +0100
commitd92aa7f298fe84d4cf686c5ad64b73438e00d377 (patch)
tree2f1f4c7b48cff9e63b0d0e3669bada3d9aeda72e /tools/check-compare-generated.sh
parenta82e048a943092315a32d745c99e0f5635e29134 (diff)
parent3a56bce6c0ea7ba0fe269520547740783b342e0d (diff)
Merge branch 'upstream/latest' of https://salsa.debian.org/utopia-team/network-manager into upstream/latest
Diffstat (limited to 'tools/check-compare-generated.sh')
-rwxr-xr-xtools/check-compare-generated.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/check-compare-generated.sh b/tools/check-compare-generated.sh
new file mode 100755
index 00000000..44b70f95
--- /dev/null
+++ b/tools/check-compare-generated.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+srcdir="$1"
+builddir="$2"
+doc_h="$3"
+
+[ -n "$NMTST_NO_CHECK_SETTINGS_DOCS" ] && exit 0
+
+cmp -s "${srcdir}/${doc_h}.in" "${builddir}/${doc_h}" && exit 0
+
+if [ "$NM_TEST_REGENERATE" = 1 ] ; then
+   cp -f "${builddir}/${doc_h}" "${srcdir}/${doc_h}.in"
+else
+   echo "*** Error: the generated file '${builddir}/${doc_h}' differs from the source file '${srcdir}/${doc_h}.in'. You probably should copy the generated file over to the source file. You can skip this test by setting NMTST_NO_CHECK_SETTINGS_DOCS=yes. You can also automatically copy the file by rerunning the test with NM_TEST_REGENERATE=1"
+   exit 1
+fi