From 74b0a348e2413db2eb1a4ef85b5ea34311fb8ad9 Mon Sep 17 00:00:00 2001 From: zoff99 Date: Sat, 23 Nov 2024 09:42:51 +0100 Subject: [PATCH] script to check for miniaudio update --- tools/check_miniaudio.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 tools/check_miniaudio.sh diff --git a/tools/check_miniaudio.sh b/tools/check_miniaudio.sh new file mode 100755 index 000000000..66892a654 --- /dev/null +++ b/tools/check_miniaudio.sh @@ -0,0 +1,38 @@ +#! /bin/bash + +_HOME2_=$(dirname $0) +export _HOME2_ +_HOME_=$(cd $_HOME2_;pwd) +export _HOME_ + +basedir="$_HOME_""/../android-refimpl-app/" +cd "$basedir" + +r1='https://github.com/mackron/miniaudio' +f1='native-audio-jni/src/main/cpp/miniaudio.h' + +tagspec='' +ver=$(git ls-remote --refs --sort='v:refname' --tags "$r1" 2>/dev/null \ + | cut --delimiter='/' --fields=3 2>/dev/null \ + | tail -1 2>/dev/null \ + ) + + +#define MA_VERSION_MAJOR 0 +#define MA_VERSION_MINOR 11 +#define MA_VERSION_REVISION 21 + +major=$(cat "$f1"|grep 'define MA_VERSION_MAJOR'|awk '{print $3}'|tr -d ' ') +minor=$(cat "$f1"|grep 'define MA_VERSION_MINOR'|awk '{print $3}'|tr -d ' ') +revis=$(cat "$f1"|grep 'define MA_VERSION_REVISION'|awk '{print $3}'|tr -d ' ') + +current_ver="$major"'.'"$minor"'.'"$revis" + +# echo "current version=$current_ver" + +if [ "$current_ver""x" != "$ver""x" ]; then + echo "__VERSIONUPDATE__:""$ver" +else + : + # no new version available +fi