diff options
author | Thomas Haller <thaller@redhat.com> | 2020-11-01 18:22:32 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-11-03 15:41:39 +0100 |
commit | 82ebd73bec83210a36a4c7cd77d027511650887a (patch) | |
tree | 4acfa79b670757c42e4fece13720f59a3a82b9f3 /tools | |
parent | ab8fdb73e6be76dc812574e040ac907d6eaad4b8 (diff) |
build: cleanup "tools/check-settings-docs.sh" script
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/check-settings-docs.sh | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/tools/check-settings-docs.sh b/tools/check-settings-docs.sh index 8695ccc030..44b70f95c6 100755 --- a/tools/check-settings-docs.sh +++ b/tools/check-settings-docs.sh @@ -1,19 +1,18 @@ #!/bin/sh -srcdir=$1 -builddir=$2 -doc_h=$3 +set -e -if [ -z "$NMTST_NO_CHECK_SETTINGS_DOCS" ] ; then - if ! cmp -s "${srcdir}/${doc_h}.in" "${builddir}/${doc_h}"; then - 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 - fi -fi +srcdir="$1" +builddir="$2" +doc_h="$3" + +[ -n "$NMTST_NO_CHECK_SETTINGS_DOCS" ] && exit 0 -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 |