From 286569c1a2359a97ad33f77b3b6b63b04d520b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= Date: Sat, 19 Jan 2019 22:18:37 +0100 Subject: [PATCH] Revert "Tests: cts-cli: Use extended regular expressions." This reverts commit 48f59e65223e018f4a639c4c9c155cb62e7806a9, because while it's true that GNU sed supports -E switch _now_, it wasn't the case until about v4.1.5+ (silently, see 3a8e165, and explicitly since v4.3, see 8b65e07), meaning that, for instance, RHEL 7 doesn't officially supports it (as sad as it is): https://bugzilla.redhat.com/show_bug.cgi?id=1564789 Also note that while there was an effort to standardize -E switch in POSIX (http://austingroupbugs.net/view.php?id=528) it may have passed without any affect so far (speaking of "2018 edition"): https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html Definitely, it wasn't in IEEE Std 1003.1-2008 that, moreover, we don't take for granted even 10+ years later (cf. ongoing parallel discussion whether and how to check for %m specifier to scanf(3)), the change at hand is not anything else but invalid. Also, -E implementation may have been faulty until sed v4.5: https://lists.gnu.org/archive/html/info-gnu/2018-04/msg00000.html Note that one can make do without extended regular expressions, and in turn, without '+' (or '\+' that is just a GNU-specific extension into basic regular expressions syntax), since the respective substitute can be used: "a+" ~ "aa*" (can be hefty for long patterns, but that's what we reliably have). --- cts/cts-cli.in | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cts/cts-cli.in b/cts/cts-cli.in index e48d644574..34c094e76c 100755 --- a/cts/cts-cli.in +++ b/cts/cts-cli.in @@ -924,22 +924,21 @@ for t in $tests; do eval TMPFILE_$t="$TMPFILE" test_$t > "$TMPFILE" - sed -E \ - -e 's/cib-last-written.*>/>/'\ + sed -e 's/cib-last-written.*>/>/'\ -e 's/ last-run=\"[0-9]*\"//'\ -e 's/crm_feature_set="[^"]*" //'\ -e 's/validate-with="[^"]*" //'\ -e 's/Created new pacemaker-.* configuration/Created new pacemaker configuration/'\ - -e 's/.*(pcmk__.*)@.*.c:[0-9][0-9]*\)/\1/g' \ - -e 's/.*(unpack_.*)@.*.c:[0-9][0-9]*\)/\1/g' \ - -e 's/.*(update_validation)@.*\.c:[0-9][0-9]*\)/\1/g' \ - -e 's/.*(apply_upgrade)@.*\.c:[0-9][0-9]*\)/\1/g' \ + -e 's/.*\(pcmk__.*\)@.*\.c:[0-9][0-9]*)/\1/g' \ + -e 's/.*\(unpack_.*\)@.*\.c:[0-9][0-9]*)/\1/g' \ + -e 's/.*\(update_validation\)@.*\.c:[0-9][0-9]*)/\1/g' \ + -e 's/.*\(apply_upgrade\)@.*\.c:[0-9][0-9]*)/\1/g' \ -e 's/ last-rc-change=\"[0-9]*\"//'\ -e 's|^/tmp/cts-cli\.validity\.bad.xml\.[^:]*:|validity.bad.xml:|'\ -e 's/^Entity: line [0-9][0-9]*: //'\ - -e 's/(validation \([0-9][0-9]* of )[0-9][0-9]*(\).*)/\1X\2/' \ + -e 's/\(validation ([0-9][0-9]* of \)[0-9][0-9]*\().*\)/\1X\2/' \ -e 's/^Migration will take effect until: .*/Migration will take effect until:/' \ - -e 's/ end=\"[-: 0123456789]+Z?\"/ end=\"\"/' \ + -e 's/ end=\"[-: 0123456789]*Z\?\"/ end=\"\"/' \ "$TMPFILE" > "${TMPFILE}.$$" mv -- "${TMPFILE}.$$" "$TMPFILE"