diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 11:19:16 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:07:37 +0000 |
commit | b485aab7e71c1625cfc27e0f92c9509f42378458 (patch) | |
tree | ae9abe108601079d1679194de237c9a435ae5b55 /src/fluent-bit/lib/monkey/mk_core/deps/libevent/test/rpcgen_wrapper.sh | |
parent | Adding upstream version 1.44.3. (diff) | |
download | netdata-b485aab7e71c1625cfc27e0f92c9509f42378458.tar.xz netdata-b485aab7e71c1625cfc27e0f92c9509f42378458.zip |
Adding upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/fluent-bit/lib/monkey/mk_core/deps/libevent/test/rpcgen_wrapper.sh')
-rwxr-xr-x | src/fluent-bit/lib/monkey/mk_core/deps/libevent/test/rpcgen_wrapper.sh | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/fluent-bit/lib/monkey/mk_core/deps/libevent/test/rpcgen_wrapper.sh b/src/fluent-bit/lib/monkey/mk_core/deps/libevent/test/rpcgen_wrapper.sh new file mode 100755 index 000000000..aaa03031a --- /dev/null +++ b/src/fluent-bit/lib/monkey/mk_core/deps/libevent/test/rpcgen_wrapper.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# libevent rpcgen_wrapper.sh +# Transforms event_rpcgen.py failure into success for make, only if +# regress.gen.c and regress.gen.h already exist in $srcdir. This +# is needed for "make distcheck" to pass the read-only $srcdir build, +# as with read-only sources fresh from tarball, regress.gen.[ch] will +# be correct in $srcdir but unwritable. This previously triggered +# Makefile.am to create stub regress.gen.c and regress.gen.h in the +# distcheck _build directory, which were then detected as leftover +# files in the build tree after distclean, breaking distcheck. +# Note that regress.gen.[ch] are not in fresh git clones, making +# working Python a requirement for make distcheck of a git tree. + +exit_updated() { +# echo "Updated ${srcdir}/regress.gen.c and ${srcdir}/regress.gen.h" + exit 0 +} + +exit_reuse() { + echo "event_rpcgen.py failed, ${srcdir}/regress.gen.\[ch\] will be reused." >&2 + exit 0 +} + +exit_failed() { + echo "Could not generate regress.gen.\[ch\] using event_rpcgen.sh" >&2 + exit 1 +} + +if [ -x /usr/bin/python2 ] ; then + PYTHON2=/usr/bin/python2 +elif [ "x`which python2`" != x ] ; then + PYTHON2=python2 +else + PYTHON2=python +fi + +srcdir=$1 +srcdir=${srcdir:-.} + +${PYTHON2} ${srcdir}/../event_rpcgen.py --quiet ${srcdir}/regress.rpc \ + test/regress.gen.h test/regress.gen.c + +case "$?" in + 0) + exit_updated + ;; + *) + test -r ${srcdir}/regress.gen.c -a -r ${srcdir}/regress.gen.h && \ + exit_reuse + exit_failed + ;; +esac |