From 246e1e8a654788359b1489c65d8b52c19b587f42 Mon Sep 17 00:00:00 2001 From: Olivier Boudeville Date: Tue, 11 Aug 2020 22:36:33 +0200 Subject: [PATCH] Added, until https://github.com/erlware/relx/pull/809 is accepted. --- conf/us_web.patch | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 conf/us_web.patch diff --git a/conf/us_web.patch b/conf/us_web.patch new file mode 100644 index 0000000..a44e7ff --- /dev/null +++ b/conf/us_web.patch @@ -0,0 +1,31 @@ +--- us_web-source 2020-08-11 21:51:04.724167964 +0200 ++++ us_web.target 2020-08-11 21:56:14.507137897 +0200 +@@ -647,17 +647,19 @@ + + # Extract the target cookie + # Do this before relx_get_nodename so we can use it and not create a ~/.erlang.cookie +-COOKIE_ARG="$(grep '^-setcookie' "$VMARGS_PATH" || true)" +-DEFAULT_COOKIE_FILE="$HOME/.erlang.cookie" +-if [ -z "$COOKIE_ARG" ]; then +- if [ -f "$DEFAULT_COOKIE_FILE" ]; then +- COOKIE="$(cat "$DEFAULT_COOKIE_FILE")" ++if [ -z "$COOKIE" ]; then ++ COOKIE_ARG="$(grep '^-setcookie' "$VMARGS_PATH" || true)" ++ DEFAULT_COOKIE_FILE="$HOME/.erlang.cookie" ++ if [ -z "$COOKIE_ARG" ]; then ++ if [ -f "$DEFAULT_COOKIE_FILE" ]; then ++ COOKIE="$(cat "$DEFAULT_COOKIE_FILE")" ++ else ++ echo "No cookie is set or found. This limits the scripts functionality, installing, upgrading, rpc and getting a list of versions will not work." ++ fi + else +- echo "No cookie is set or found. This limits the scripts functionality, installing, upgrading, rpc and getting a list of versions will not work." ++ # Extract cookie name from COOKIE_ARG ++ COOKIE="$(echo "$COOKIE_ARG" | awk '{print $2}')" + fi +-else +- # Extract cookie name from COOKIE_ARG +- COOKIE="$(echo "$COOKIE_ARG" | awk '{print $2}')" + fi + + # User can specify an sname without @hostname