aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2023-01-24 18:00:59 +0000
committerAlex Bennée <alex.bennee@linaro.org>2023-02-02 10:44:23 +0000
commitec91e923784df086bdb3bd39569203524aa75875 (patch)
tree10b0e49ad8f40e70be4b7fdb471ff8aac31e49a8
parent7195f30248c4e55ebd56cbe370547571fdf5c144 (diff)
downloadqemu-ec91e923784df086bdb3bd39569203524aa75875.zip
qemu-ec91e923784df086bdb3bd39569203524aa75875.tar.gz
qemu-ec91e923784df086bdb3bd39569203524aa75875.tar.bz2
meson: replace Perl usage with Python
Let's try to remove Perl usage during build time. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230110132700.833690-5-marcandre.lureau@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230124180127.1881110-8-alex.bennee@linaro.org>
-rw-r--r--tests/qapi-schema/meson.build7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build
index 9dfe98b..d85b14f 100644
--- a/tests/qapi-schema/meson.build
+++ b/tests/qapi-schema/meson.build
@@ -259,22 +259,23 @@ if build_docs
# Fix possible inconsistency in line endings in generated output and
# in the golden reference (which could otherwise cause test failures
# on Windows hosts). Unfortunately diff --strip-trailing-cr
- # is GNU-diff only. The odd-looking perl is because we must avoid
+ # is GNU-diff only. The odd-looking python is because we must avoid
# using an explicit '\' character in the command arguments to
# a custom_target(), as Meson will unhelpfully replace it with a '/'
# (https://github.com/mesonbuild/meson/issues/1564)
+ remove_cr = [python, '-c', 'import sys;[sys.stdout.write(line.replace(chr(13), "")) for line in sys.stdin]']
qapi_doc_out_nocr = custom_target('QAPI rST doc newline-sanitized',
output: ['doc-good.txt.nocr'],
input: qapi_doc_out[0],
build_by_default: true,
- command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
+ command: [remove_cr, '@INPUT@'],
capture: true)
qapi_doc_ref_nocr = custom_target('QAPI rST doc reference newline-sanitized',
output: ['doc-good.ref.nocr'],
input: files('doc-good.txt'),
build_by_default: true,
- command: ['perl', '-pe', '$x = chr 13; s/$x$//', '@INPUT@'],
+ command: [remove_cr, '@INPUT@'],
capture: true)
test('QAPI rST doc', diff, args: ['-u', qapi_doc_ref_nocr[0], qapi_doc_out_nocr[0]],