File 1065-Use-special-environment-variable-to-change-default-R.patch of Package erlang

From 5475a9e25849adc7ab992e22dbcc93cd1667e528 Mon Sep 17 00:00:00 2001
From: Kjell Winblad <kjellwinblad@gmail.com>
Date: Wed, 2 Dec 2020 08:24:57 +0100
Subject: [PATCH] Use special environment variable to change default ROOTDIR

Using the environment variable ROOTDIR to change to a custom root dir
for the Erlang/OTP installation is not a good idea because this
variable might sometimes be set to something incorrect. This commit
changes so that the the user can change the root directory by setting
the environment variable ERL_ROOTDIR instead.
---
 erts/etc/unix/erl.src.src | 6 ++++--
 erts/etc/unix/start.src   | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/erts/etc/unix/erl.src.src b/erts/etc/unix/erl.src.src
index b7438f615b..0983132ac1 100644
--- a/erts/etc/unix/erl.src.src
+++ b/erts/etc/unix/erl.src.src
@@ -18,9 +18,11 @@
 #
 # %CopyrightEnd%
 #
-if [ -z "$ROOTDIR" ]
+if [ -z "$ERL_ROOTDIR" ]
 then
-   ROOTDIR="%FINAL_ROOTDIR%"
+    ROOTDIR="%FINAL_ROOTDIR%"
+else
+    ROOTDIR="$ERL_ROOTDIR"
 fi
 BINDIR=$ROOTDIR/erts-%VSN%/bin
 EMU=%EMULATOR%%EMULATOR_NUMBER%
diff --git a/erts/etc/unix/start.src b/erts/etc/unix/start.src
index e3d1b8676a..4cf0e899e4 100644
--- a/erts/etc/unix/start.src
+++ b/erts/etc/unix/start.src
@@ -25,9 +25,11 @@
 #
 # Usage: start [Data]
 #
-if [ -z "$ROOTDIR" ]
+if [ -z "$ERL_ROOTDIR" ]
 then
-   ROOTDIR=%FINAL_ROOTDIR%
+    ROOTDIR="%FINAL_ROOTDIR%"
+else
+    ROOTDIR="$ERL_ROOTDIR"
 fi
 
 if [ -z "$RELDIR" ]
-- 
2.26.2

openSUSE Build Service is sponsored by