From aef5e1af14eb019f28b80841824d5e8ca67cf842 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 9 Jan 2022 11:50:15 +0100 Subject: [PATCH] update_retroplayer-addons: allow overriding the tag suffix The game addons are currently being tagged with "-Matrix" as suffix which doesn't match the "Nexus" branch of the binary addons repo. Allow overriding the tag suffix so we don't fall back to earlier -Nexus tags of the addon. usage eg: ./update_retroplayer-addons Nexus Matrix Signed-off-by: Matthias Reichl --- tools/mkpkg/update_retroplayer-addons | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tools/mkpkg/update_retroplayer-addons b/tools/mkpkg/update_retroplayer-addons index 2b874222e7..a425f1ab0a 100755 --- a/tools/mkpkg/update_retroplayer-addons +++ b/tools/mkpkg/update_retroplayer-addons @@ -8,7 +8,7 @@ FORCE_LIBRETRO_BUMP="" KEEP_GIT_DIRS="yes" usage() { - echo "Usage: $0 [options] " + echo "Usage: $0 [options] []" echo " -b, --bump-pkg-rev: bump PKG_REV if package was not updated" echo " -d, --delete-git-dirs: delete cloned git dirs after update" echo " -f, --force-libretro-bump: check for new libretro package" @@ -46,12 +46,19 @@ while [ $# -ne 0 ]; do done -if [ $# -ne 1 ]; then +if [ $# -eq 0 -o $# -gt 2 ]; then usage exit 1 fi + KODI_BRANCH="$1" +if [ $# -eq 2 ]; then + TAG_SUFFIX="$2" +else + TAG_SUFFIX="${KODI_BRANCH}" +fi + # list of packages to exclude from update EXCLUDED_PACKAGES="game.libretro.chailove game.libretro.fbalpha2012 @@ -124,11 +131,19 @@ for addon in ${ADDONS_DIR}/*.*/ ; do if [ -z "$GITHUB_API_TOKEN" ]; then git_clone "${GAME_GIT_REPO}" "${GAME_GIT_DIR}" - GAME_NEW_VERSION=$(resolve_tag_in_branch "${GAME_GIT_DIR}" "${GAME_GIT_BRANCH}" "*-${KODI_BRANCH}") + if [ -n "${TAG_SUFFIX}" ]; then + GAME_NEW_VERSION=$(resolve_tag_in_branch "${GAME_GIT_DIR}" "${GAME_GIT_BRANCH}" "*-${TAG_SUFFIX}") + else + GAME_NEW_VERSION=$(resolve_tag_in_branch "${GAME_GIT_DIR}" "${GAME_GIT_BRANCH}") + fi else REPO=$(basename "${GAME_GIT_REPO}") OWNER=$(basename "${GAME_GIT_REPO%/${REPO}*}") - GAME_NEW_VERSION=$(resolve_tag_on_gh "${OWNER}" "${REPO}" "-${KODI_BRANCH}") + if [ -n "${TAG_SUFFIX}" ]; then + GAME_NEW_VERSION=$(resolve_tag_on_gh "${OWNER}" "${REPO}" "-${TAG_SUFFIX}") + else + GAME_NEW_VERSION=$(resolve_tag_on_gh "${OWNER}" "${REPO}") + fi fi if [ -z "${GAME_NEW_VERSION}" ]; then