File 0184-cerl-Support-RR-5.4.patch of Package erlang
From 846bbfb55a5412fea99e4afbd6957359077b1478 Mon Sep 17 00:00:00 2001
From: Frej Drejhammar <frej.drejhammar@gmail.com>
Date: Tue, 3 Nov 2020 09:00:42 +0100
Subject: [PATCH] cerl: Support RR >= 5.4
RR version >= 5.4 has replaced the `--ignore-nested` flag with
`--nested=ignore`. Make cerl autodetect the new flag and fall back on
the old `--ignore-nested` flag if it is not supported.
---
erts/etc/unix/cerl.src | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src
index 03667b9e0c..3e5087c0d8 100644
--- a/erts/etc/unix/cerl.src
+++ b/erts/etc/unix/cerl.src
@@ -377,7 +377,14 @@ if [ "x$GDB" = "x" ]; then
done
exit 0
else
- exec rr record --ignore-nested $BINDIR/$EMU_NAME $emu_xargs "$@"
+ # RR version >= 5.4 has replaced the `--ignore-nested`
+ # flag with `--nested=ignore`, so try to auto detect this.
+ if rr help record | grep -q -- '--nested=ignore'; then
+ RR_IGNORE_NESTED="--nested=ignore"
+ else
+ RR_IGNORE_NESTED="--ignore-nested"
+ fi
+ exec rr record $RR_IGNORE_NESTED $BINDIR/$EMU_NAME $emu_xargs "$@"
fi
else
exec $EXEC $xargs ${1+"$@"}
--
2.26.2