From 99b6f9c94ee522309a40c135d26b0b9a2b1754d1 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sat, 17 Oct 2020 18:48:55 +0200 Subject: [PATCH] update_retroplayer-addons: match lastest tag with kodi branch in name If no tag with the kodi branch name can be found, fall back to the latest tag in the branch. This fixes ambiguity if both a -Leia and a -Matrix tag point to the same githash. Signed-off-by: Matthias Reichl --- tools/mkpkg/update_common_functions | 8 ++++++++ tools/mkpkg/update_retroplayer-addons | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/mkpkg/update_common_functions b/tools/mkpkg/update_common_functions index 3f59569ee2..41ac0708c7 100644 --- a/tools/mkpkg/update_common_functions +++ b/tools/mkpkg/update_common_functions @@ -61,8 +61,16 @@ resolve_hash_in_branch() { } resolve_tag_in_branch() { + local tag if [ -d "$1" ] ; then cd "$1" + if [ $# -eq 3 ] ; then + tag=$(git describe --abbrev=0 --tags --match "$3" origin/$2 2>/dev/null) + if [ -n "$tag" ] ; then + echo "$tag" + return + fi + fi git describe --abbrev=0 --tags origin/$2 2>/dev/null fi } diff --git a/tools/mkpkg/update_retroplayer-addons b/tools/mkpkg/update_retroplayer-addons index 71db0d28af..f49a6c1a03 100755 --- a/tools/mkpkg/update_retroplayer-addons +++ b/tools/mkpkg/update_retroplayer-addons @@ -115,7 +115,7 @@ for addon in ${ADDONS_DIR}/*.*/ ; do CHECK_RETRO="" git_clone "${GAME_GIT_REPO}" "${GAME_GIT_DIR}" - GAME_NEW_VERSION=$(resolve_tag_in_branch "${GAME_GIT_DIR}" "${GAME_GIT_BRANCH}") + GAME_NEW_VERSION=$(resolve_tag_in_branch "${GAME_GIT_DIR}" "${GAME_GIT_BRANCH}" "*-${KODI_BRANCH}") if [ -z "${GAME_NEW_VERSION}" ]; then NO_TAG="yes" echo "========================================================================"