From 4a136c7651aa14b324961eb2d9aea737ce6ef34c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Thu, 21 Mar 2019 10:29:03 +0000 Subject: [PATCH] ITS#8731 Improve sample processing script --- doc/devel/variadic_debug/script.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/devel/variadic_debug/script.sh b/doc/devel/variadic_debug/script.sh index 72a49773fb..b9fd9f0dd6 100755 --- a/doc/devel/variadic_debug/script.sh +++ b/doc/devel/variadic_debug/script.sh @@ -10,16 +10,16 @@ SPATCH_OPTS=( --macro-file-builtins "$PATCH_DIR/macros.h" ) SED_TRANSFORMATIONS=() -# strip trailing whitespace copied from source on affected lines -SED_TRANSFORMATIONS+=( -e 's/^\(+.*\)\s\+$/\1/' ) - # split out multipart strings back to original form (one per line) SED_TRANSFORMATIONS+=( -e 's/^\(+\s*\)\(.*"\) \(".*\)"$/\1\2\n+\1\3/' ) # re-add whitespace around parentheses -SED_TRANSFORMATIONS+=( -e 's/^\(+.*Debug[0-3]\?(\)\s*$/\1 /' ) +SED_TRANSFORMATIONS+=( -e 's/^\(+.*Debug[0-3]\?(\)\s*/\1 /' ) SED_TRANSFORMATIONS+=( -e 's/^\(+.*[^ ]\));$/\1 );/' ) +# strip trailing whitespace copied from source on affected lines +SED_TRANSFORMATIONS+=( -e 's/^\(+.*\)\s\+$/\1/' ) + # fix whitespace errors in source we touch SED_TRANSFORMATIONS+=( -e 's/^\(+.*\) \t/\1\t\t/' ) SED_TRANSFORMATIONS+=( -e 's/^\(+\t*\) \{1,3\}\t/\1\t/' ) @@ -29,7 +29,7 @@ normalise() { shift # iterate until we've reached fixpoint - while ! cmp "$patch" "${patch}.new"; do + while ! cmp "$patch" "${patch}.new" 2>/dev/null; do if [ -e "${patch}.new" ]; then mv -- "${patch}.new" "$patch" fi