From 745343c7baad2d1ddc178fae0d3d66036404e310 Mon Sep 17 00:00:00 2001 From: hackacad Date: Tue, 27 Jul 2021 15:20:27 +0200 Subject: [PATCH 1/7] FreeBSD Node support Signed-off-by: hackacad --- .../tasks/bin/scripts/opensearch-dashboards | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/dev/build/tasks/bin/scripts/opensearch-dashboards b/src/dev/build/tasks/bin/scripts/opensearch-dashboards index 56c22eb268c..475913f4958 100755 --- a/src/dev/build/tasks/bin/scripts/opensearch-dashboards +++ b/src/dev/build/tasks/bin/scripts/opensearch-dashboards @@ -1,6 +1,17 @@ #!/bin/sh SCRIPT=$0 + +UNAME=$(uname -s) +if [ $UNAME = "FreeBSD" ]; then + OS="freebsd" +elif [ $UNAME = "Darwin" ]; then + OS="darwin" +else + OS="other" +fi + + # SCRIPT may be an arbitrarily deep series of symlinks. Loop until we have the concrete path. while [ -h "$SCRIPT" ] ; do ls=$(ls -ld "$SCRIPT") @@ -15,8 +26,15 @@ done DIR="$(dirname "${SCRIPT}")/.." CONFIG_DIR=${OSD_PATH_CONF:-"$DIR/config"} -NODE="${DIR}/node/bin/node" + +if [ $OS = "freebsd" ]; then + NODE="/usr/local/bin/node" +else + NODE="${DIR}/node/bin/node" +fi + test -x "$NODE" + if [ ! -x "$NODE" ]; then echo "unable to find usable node.js executable." exit 1 From c80da207ca6c970c4cf17c3758cb97c6f5bf7b09 Mon Sep 17 00:00:00 2001 From: Sven R Date: Tue, 21 Sep 2021 18:27:40 +0200 Subject: [PATCH 2/7] more liberal node selection Signed-off-by: Sven R --- .../build/tasks/bin/scripts/opensearch-dashboards | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/dev/build/tasks/bin/scripts/opensearch-dashboards b/src/dev/build/tasks/bin/scripts/opensearch-dashboards index 475913f4958..302168ca67f 100755 --- a/src/dev/build/tasks/bin/scripts/opensearch-dashboards +++ b/src/dev/build/tasks/bin/scripts/opensearch-dashboards @@ -2,15 +2,6 @@ SCRIPT=$0 -UNAME=$(uname -s) -if [ $UNAME = "FreeBSD" ]; then - OS="freebsd" -elif [ $UNAME = "Darwin" ]; then - OS="darwin" -else - OS="other" -fi - # SCRIPT may be an arbitrarily deep series of symlinks. Loop until we have the concrete path. while [ -h "$SCRIPT" ] ; do @@ -27,10 +18,10 @@ done DIR="$(dirname "${SCRIPT}")/.." CONFIG_DIR=${OSD_PATH_CONF:-"$DIR/config"} -if [ $OS = "freebsd" ]; then +if [ -x "${DIR}/node/bin/node" ]; then NODE="/usr/local/bin/node" -else - NODE="${DIR}/node/bin/node" +elif [ -x "$(which node)" ]; then + NODE="$(which node)" fi test -x "$NODE" From eddeb2d065df6a0c97f61aa846c194e80ada28e8 Mon Sep 17 00:00:00 2001 From: Sven R Date: Wed, 22 Sep 2021 08:04:24 +0200 Subject: [PATCH 3/7] consume less space Signed-off-by: Sven R --- src/dev/build/tasks/bin/scripts/opensearch-dashboards | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/dev/build/tasks/bin/scripts/opensearch-dashboards b/src/dev/build/tasks/bin/scripts/opensearch-dashboards index 302168ca67f..73edcb40b2f 100755 --- a/src/dev/build/tasks/bin/scripts/opensearch-dashboards +++ b/src/dev/build/tasks/bin/scripts/opensearch-dashboards @@ -1,8 +1,6 @@ #!/bin/sh SCRIPT=$0 - - # SCRIPT may be an arbitrarily deep series of symlinks. Loop until we have the concrete path. while [ -h "$SCRIPT" ] ; do ls=$(ls -ld "$SCRIPT") From 23865dd34f756735d668e5eadab6e943fa017b4a Mon Sep 17 00:00:00 2001 From: Sven R Date: Wed, 22 Sep 2021 08:29:11 +0200 Subject: [PATCH 4/7] improved and simplified node test Signed-off-by: Sven R --- src/dev/build/tasks/bin/scripts/opensearch-dashboards | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/dev/build/tasks/bin/scripts/opensearch-dashboards b/src/dev/build/tasks/bin/scripts/opensearch-dashboards index 73edcb40b2f..d354a9778d3 100755 --- a/src/dev/build/tasks/bin/scripts/opensearch-dashboards +++ b/src/dev/build/tasks/bin/scripts/opensearch-dashboards @@ -18,12 +18,10 @@ CONFIG_DIR=${OSD_PATH_CONF:-"$DIR/config"} if [ -x "${DIR}/node/bin/node" ]; then NODE="/usr/local/bin/node" -elif [ -x "$(which node)" ]; then +else NODE="$(which node)" fi -test -x "$NODE" - if [ ! -x "$NODE" ]; then echo "unable to find usable node.js executable." exit 1 From 5122a22ddff4f24461b31d3f28df3e21739532fe Mon Sep 17 00:00:00 2001 From: Sven R Date: Fri, 5 Nov 2021 15:42:13 +0100 Subject: [PATCH 5/7] fixed node selection Signed-off-by: Sven R --- src/dev/build/tasks/bin/scripts/opensearch-dashboards | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dev/build/tasks/bin/scripts/opensearch-dashboards b/src/dev/build/tasks/bin/scripts/opensearch-dashboards index d354a9778d3..a528d406bbd 100755 --- a/src/dev/build/tasks/bin/scripts/opensearch-dashboards +++ b/src/dev/build/tasks/bin/scripts/opensearch-dashboards @@ -17,7 +17,7 @@ DIR="$(dirname "${SCRIPT}")/.." CONFIG_DIR=${OSD_PATH_CONF:-"$DIR/config"} if [ -x "${DIR}/node/bin/node" ]; then - NODE="/usr/local/bin/node" + NODE="/${DIR}/local/bin/node" else NODE="$(which node)" fi From 4ca2abfd697d1ea453e15e6e4913257452ea70b6 Mon Sep 17 00:00:00 2001 From: Sven R Date: Fri, 5 Nov 2021 15:47:29 +0100 Subject: [PATCH 6/7] fixed node selection Signed-off-by: Sven R --- src/dev/build/tasks/bin/scripts/opensearch-dashboards | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dev/build/tasks/bin/scripts/opensearch-dashboards b/src/dev/build/tasks/bin/scripts/opensearch-dashboards index a528d406bbd..ea3ecd73953 100755 --- a/src/dev/build/tasks/bin/scripts/opensearch-dashboards +++ b/src/dev/build/tasks/bin/scripts/opensearch-dashboards @@ -17,7 +17,7 @@ DIR="$(dirname "${SCRIPT}")/.." CONFIG_DIR=${OSD_PATH_CONF:-"$DIR/config"} if [ -x "${DIR}/node/bin/node" ]; then - NODE="/${DIR}/local/bin/node" + NODE="${DIR}/local/bin/node" else NODE="$(which node)" fi From fdb16501fbb5b11589c64d03bb6282ab7d739fd1 Mon Sep 17 00:00:00 2001 From: Sven R Date: Fri, 5 Nov 2021 15:49:04 +0100 Subject: [PATCH 7/7] fixed node selection Signed-off-by: Sven R --- src/dev/build/tasks/bin/scripts/opensearch-dashboards | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dev/build/tasks/bin/scripts/opensearch-dashboards b/src/dev/build/tasks/bin/scripts/opensearch-dashboards index ea3ecd73953..d81555a18c3 100755 --- a/src/dev/build/tasks/bin/scripts/opensearch-dashboards +++ b/src/dev/build/tasks/bin/scripts/opensearch-dashboards @@ -17,7 +17,7 @@ DIR="$(dirname "${SCRIPT}")/.." CONFIG_DIR=${OSD_PATH_CONF:-"$DIR/config"} if [ -x "${DIR}/node/bin/node" ]; then - NODE="${DIR}/local/bin/node" + NODE="${DIR}/node/bin/node" else NODE="$(which node)" fi