From c25e25596a50db3b77bd3b2d04fd8251177be6fb Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Wed, 26 May 2021 20:59:09 +0200 Subject: [PATCH] Examples: Adapt to system-packaged DDS Distribution policies forbid installation of environment scripts at the install prefix. So, e.g. in the Fedora DDS package the DDS_env.sh is installed to /usr/bin and available via $PATH. --- examples/dds/fairmq-start-ex-dds.sh.in | 7 ++++++- examples/n-m/fairmq-start-ex-n-m-dds.sh.in | 7 ++++++- examples/n-m/fairmq-start-ex-n-m-pair-dds.sh.in | 7 ++++++- examples/qc/fairmq-start-ex-qc.sh.in | 8 +++++++- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/examples/dds/fairmq-start-ex-dds.sh.in b/examples/dds/fairmq-start-ex-dds.sh.in index 99a4f72f..dd3b7d2f 100755 --- a/examples/dds/fairmq-start-ex-dds.sh.in +++ b/examples/dds/fairmq-start-ex-dds.sh.in @@ -18,7 +18,12 @@ cleanup() { echo "CLEANUP PERFORMED" } -source @DDS_INSTALL_PREFIX@/DDS_env.sh +if [[ -e "@DDS_INSTALL_PREFIX@/DDS_env.sh" ]]; then + source @DDS_INSTALL_PREFIX@/DDS_env.sh +elif command -v DDS_env.sh &> /dev/null; then + source DDS_env.sh +fi + export PATH=@BIN_DIR@:$PATH plugin=${1:-localhost} diff --git a/examples/n-m/fairmq-start-ex-n-m-dds.sh.in b/examples/n-m/fairmq-start-ex-n-m-dds.sh.in index f6e2998a..95a09e61 100755 --- a/examples/n-m/fairmq-start-ex-n-m-dds.sh.in +++ b/examples/n-m/fairmq-start-ex-n-m-dds.sh.in @@ -15,7 +15,12 @@ cleanup() { echo "CLEANUP PERFORMED" } -source @DDS_INSTALL_PREFIX@/DDS_env.sh +if [[ -e "@DDS_INSTALL_PREFIX@/DDS_env.sh" ]]; then + source @DDS_INSTALL_PREFIX@/DDS_env.sh +elif command -v DDS_env.sh &> /dev/null; then + source DDS_env.sh +fi + export PATH=@BIN_DIR@:$PATH exec 5>&1 diff --git a/examples/n-m/fairmq-start-ex-n-m-pair-dds.sh.in b/examples/n-m/fairmq-start-ex-n-m-pair-dds.sh.in index a65e3273..52de25e7 100755 --- a/examples/n-m/fairmq-start-ex-n-m-pair-dds.sh.in +++ b/examples/n-m/fairmq-start-ex-n-m-pair-dds.sh.in @@ -15,7 +15,12 @@ cleanup() { echo "CLEANUP PERFORMED" } -source @DDS_INSTALL_PREFIX@/DDS_env.sh +if [[ -e "@DDS_INSTALL_PREFIX@/DDS_env.sh" ]]; then + source @DDS_INSTALL_PREFIX@/DDS_env.sh +elif command -v DDS_env.sh &> /dev/null; then + source DDS_env.sh +fi + export PATH=@BIN_DIR@:$PATH exec 5>&1 diff --git a/examples/qc/fairmq-start-ex-qc.sh.in b/examples/qc/fairmq-start-ex-qc.sh.in index 9e6c7031..b253ddfe 100755 --- a/examples/qc/fairmq-start-ex-qc.sh.in +++ b/examples/qc/fairmq-start-ex-qc.sh.in @@ -17,7 +17,13 @@ cleanup() { echo "CLEANUP PERFORMED" } -source @DDS_INSTALL_PREFIX@/DDS_env.sh + +if [[ -e "@DDS_INSTALL_PREFIX@/DDS_env.sh" ]]; then + source @DDS_INSTALL_PREFIX@/DDS_env.sh +elif command -v DDS_env.sh &> /dev/null; then + source DDS_env.sh +fi + export PATH=@BIN_DIR@:$PATH exec 5>&1