Skip to content

Commit d0c2ca5

Browse files
authored
fix: fix ustreamer binary path for v5.52 changes (mainsail-crew#245)
Signed-off-by: Patrick Gehrsitz <[email protected]>
1 parent 4caedfe commit d0c2ca5

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

libs/core.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,16 @@ function check_dep {
8282

8383
function check_apps {
8484
local cstreamer ustreamer
85-
ustreamer="bin/ustreamer/ustreamer"
85+
ustreamer_base="bin/ustreamer"
86+
ustreamer="$(find "${BASE_CN_PATH}"/"${ustreamer_base}" \
87+
-iname 'ustreamer.bin' 2> /dev/null | sed '1q')"
8688
cstreamer="bin/camera-streamer/camera-streamer"
8789

88-
if [[ -x "${BASE_CN_PATH}/${ustreamer}" ]]; then
89-
log_msg "Dependency: '${ustreamer##*/}' found in ${ustreamer}."
90+
if [[ -x "${ustreamer}" ]]; then
91+
log_msg "Dependency: '${ustreamer##*/}' found in ${ustreamer_base}/${ustreamer##*/}."
92+
UST_BIN="${ustreamer}"
93+
# shellcheck disable=SC2034
94+
declare -r UST_BIN
9095
else
9196
log_msg "Dependency: '${ustreamer##*/}' not found. Exiting!"
9297
exit 1

libs/ustreamer.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ run_mjpg() {
3131
run_ustreamer() {
3232
local cam_sec ust_bin dev pt res fps cstm start_param
3333
cam_sec="${1}"
34-
ust_bin="${BASE_CN_PATH}/bin/ustreamer/ustreamer"
34+
# shellcheck disable=SC2153
35+
ust_bin="${UST_BIN}"
3536
dev="$(get_param "cam ${cam_sec}" device)"
3637
pt="$(get_param "cam ${cam_sec}" port)"
3738
res="$(get_param "cam ${cam_sec}" resolution)"

libs/versioncontrol.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ versioncontrol() {
2828
local cur_ver avail_ver
2929
pushd "${BASE_CN_PATH}"/bin/ustreamer &> /dev/null || exit 1
3030
avail_ver="$(git describe --tags --always)"
31-
cur_ver="v$("${PWD}"/ustreamer -v)"
31+
cur_ver="v$(${UST_BIN} -v)"
3232
if [[ "${cur_ver}" == "${avail_ver}" ]]; then
3333
vc_log_msg "ustreamer is up to date. (${cur_ver})"
3434
fi

0 commit comments

Comments
 (0)