Skip to content

Commit

Permalink
Improvements to version detect for get-generic-sys-util
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Nov 1, 2024
1 parent 90a0875 commit 4ea5341
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion script/get-generic-sys-util/_cm.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@
"CM_SYS_UTIL_NAME": "md5sha1sum",
"CM_SYS_UTIL_VERSION_CMD": "md5sum --version",
"CM_SYS_UTIL_VERSION_RE": "\\b(\\d+\\.\\d+(?:\\.\\d+)?)\\b",
"CM_TMP_VERSION_DETECT_GROUP_NUMBER": 0
"CM_TMP_VERSION_DETECT_GROUP_NUMBER": 0,
"CM_SYS_UTIL_VERSION_CMD_USE_ERROR_STREAM": "yes"
},
"new_env_keys": ["CM_MD5SHA1SUM_VERSION"],
"state": {
Expand Down
11 changes: 9 additions & 2 deletions script/get-generic-sys-util/detect.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/bin/bash

if [[ -n "${CM_SYS_UTIL_VERSION_CMD}" ]]; then
${CM_SYS_UTIL_VERSION_CMD} > tmp-ver.out
if [[ "${CM_SYS_UTIL_VERSION_CMD_USE_ERROR_STREAM}" == "yes" ]]; then
# Redirect both stdout and stderr to tmp-ver.out
cmd="${CM_SYS_UTIL_VERSION_CMD} > tmp-ver.out 2>&1"
else
cmd="${CM_SYS_UTIL_VERSION_CMD} > tmp-ver.out"
fi
echo $cmd
eval $cmd
test $? -eq 0 || exit $?
fi

test $? -eq 0 || exit $?

0 comments on commit 4ea5341

Please sign in to comment.