Skip to content

Commit dba9583

Browse files
andyclaude
andcommitted
Let ecce-<app> wrappers honour an existing ECCE_HOME
The generated wrappers did "export ECCE_HOME=<builtin>" unconditionally, overriding whatever the caller had set -- unlike the way the same wrappers already treat ECCE_REALUSERHOME, DISPLAY and ECCE_HELP. So an ECCE tree anywhere other than its configured location could not be run at all, even with ECCE_HOME pointed at it. Now "${ECCE_HOME:-<builtin>}", so the built-in path is still the default and nothing changes for a normal install. Found while trying to test a .deb without installing it: extracting the package and running its wrappers silently ran the INSTALLED binaries instead, so the test proved nothing about the package. It now works -- verified via /proc/<pid>/exe that the packaged binary is the one running: dpkg-deb -x ecce_8.11.0_amd64.deb /tmp/debcheck ECCE_HOME=/tmp/debcheck/opt/ecce \ ECCE_TEST_HOME=/tmp/debcheck/opt/ecce \ ECCE_TEST_WRAPPERS=/tmp/debcheck/usr/bin \ tests/apps/run_tests.py which means a package can be smoke-tested before anyone installs it, and without root. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFMUNbw2UpRPmgsqviAowb
1 parent 29f4d9e commit dba9583

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ foreach(_gw start stop status)
645645
set(_gw_wrapper ${CMAKE_BINARY_DIR}/wrappers/ecce-gateway-${_gw})
646646
file(WRITE ${_gw_wrapper}
647647
"#!/bin/bash
648-
export ECCE_HOME=${ECCE_HOME_DIR}
648+
export ECCE_HOME=\${ECCE_HOME:-${ECCE_HOME_DIR}}
649649
export ECCE_REALUSERHOME=\${ECCE_REALUSERHOME:-$HOME}
650650
exec \"$ECCE_HOME/bin/ecce-gateway-${_gw}\" \"$@\"
651651
")
@@ -675,7 +675,7 @@ foreach(_ds start stop status adduser)
675675
set(_ds_wrapper ${CMAKE_BINARY_DIR}/wrappers/ecce-dataserver-${_ds})
676676
file(WRITE ${_ds_wrapper}
677677
"#!/bin/bash
678-
export ECCE_HOME=${ECCE_HOME_DIR}
678+
export ECCE_HOME=\${ECCE_HOME:-${ECCE_HOME_DIR}}
679679
export ECCE_REALUSERHOME=\${ECCE_REALUSERHOME:-$HOME}
680680
export ECCE_REALUSER=\${ECCE_REALUSER:-\$(id -un)}
681681
exec \"$ECCE_HOME/bin/ecce-dataserver-${_ds}\" \"$@\"
@@ -863,7 +863,7 @@ foreach(_app ${ECCE_GUI_APPS} ${ECCE_CLI_APPS})
863863
endif()
864864
file(WRITE ${_wrapper}
865865
"#!/bin/bash
866-
export ECCE_HOME=${ECCE_HOME_DIR}
866+
export ECCE_HOME=\${ECCE_HOME:-${ECCE_HOME_DIR}}
867867
export ECCE_REALUSER=\${ECCE_REALUSER:-$(id -un)}
868868
export ECCE_REALUSERHOME=\${ECCE_REALUSERHOME:-$HOME}
869869
export HOST=\${HOST:-$(hostname)}
@@ -917,7 +917,7 @@ install(PROGRAMS ${_ecce_wrapper} DESTINATION ${ECCE_WRAPPER_DESTINATION})
917917
set(_viewer_wrapper ${CMAKE_BINARY_DIR}/wrappers/ecce-viewer)
918918
file(WRITE ${_viewer_wrapper}
919919
"#!/bin/bash
920-
export ECCE_HOME=${ECCE_HOME_DIR}
920+
export ECCE_HOME=\${ECCE_HOME:-${ECCE_HOME_DIR}}
921921
export ECCE_REALUSER=\${ECCE_REALUSER:-$(id -un)}
922922
export ECCE_REALUSERHOME=\${ECCE_REALUSERHOME:-$HOME}
923923
export HOST=\${HOST:-$(hostname)}

0 commit comments

Comments
 (0)