diff --git a/tools/mkpkg/update_binary-addons b/tools/mkpkg/update_binary-addons index 27b1244ebe..fadf909c0e 100755 --- a/tools/mkpkg/update_binary-addons +++ b/tools/mkpkg/update_binary-addons @@ -4,18 +4,50 @@ # Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv) # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) -if [ -z "$1" ]; then - echo "Usage: $0 " - exit 0 +BUMP_PKG_REV="" +KEEP_GIT_DIRS="yes" + +usage() { + 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 " -h, --help: display help and exit" + exit 1 +} + +while [ $# -ne 0 ]; do + case "$1" in + -b|--bump-pkg-rev) + BUMP_PKG_REV="yes" + shift + ;; + -d|--delete-git-dirs) + KEEP_GIT_DIRS="" + shift + ;; + -h|--help) + usage + exit 1 + ;; + -*) + echo "illegal option $1" + usage + exit 1 + ;; + *) + break + ;; + esac +done + +if [ $# -ne 1 ]; then + usage + exit 1 fi # list of packages to exclude from update EXCLUDED_PACKAGES="vfs.nfs vfs.sacd" -# the following environment variables can be set to "yes" to enable optional features: -# KEEP_GIT_DIRS: don't delete cloned git directories after update check -# BUMP_PKG_REV: bump PKG_REV if PKG_VERSION has changed - MY_DIR="$(dirname "$0")" ROOT="$(cd "${MY_DIR}"/../.. && pwd)" TMPDIR="$(pwd)/.update-binary-addons-tmp" diff --git a/tools/mkpkg/update_retroplayer-addons b/tools/mkpkg/update_retroplayer-addons index 80f01b10d3..d29a4d039c 100755 --- a/tools/mkpkg/update_retroplayer-addons +++ b/tools/mkpkg/update_retroplayer-addons @@ -3,16 +3,59 @@ # SPDX-License-Identifier: GPL-2.0 # Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv) +BUMP_PKG_REV="" FORCE_LIBRETRO_BUMP="" +KEEP_GIT_DIRS="yes" -if [ "$1" == "-f" ]; then - FORCE_LIBRETRO_BUMP="yes" - shift +usage() { + 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" + echo " even if kodi game package version has not changed" + echo " -h, --help: display help" +} + +while [ $# -ne 0 ]; do + case "$1" in + -b|--bump-pkg-rev) + BUMP_PKG_REV="yes" + shift + ;; + -d|--delete-git-dirs) + KEEP_GIT_DIRS="" + shift + ;; + -f|--force-libretro-bump) + FORCE_LIBRETRO_BUMP="yes" + shift + ;; + -h|--help) + usage + exit 1 + ;; + -*) + echo "illegal option $1" + usage + exit 1 + ;; + *) + break + ;; + esac +done + + +if [ $# -gt 1 ]; then + usage + exit 1 +fi +if [ $# -eq 0 ]; then + KODI_BRANCH="retroplayer" + echo "using default branch ${KODI_BRANCH}" +else + KODI_BRANCH="$1" fi - -# the following environment variables can be set to "yes" to enable optional features: -# KEEP_GIT_DIRS: don't delete cloned git directories after update check -# BUMP_PKG_REV: bump PKG_REV if PKG_VERSION has changed # list of packages to exclude from update EXCLUDED_PACKAGES="game.libretro.chailove @@ -36,7 +79,7 @@ mkdir -p "${TMPDIR}" . "${MY_DIR}/update_common_functions" # addons -for addontxt in "game-binary-addons https://github.com/kodi-game/repo-binary-addons.git retroplayer" ; do +for addontxt in "game-binary-addons https://github.com/kodi-game/repo-binary-addons.git ${KODI_BRANCH}" ; do ADDONS=$(echo $addontxt | awk '{print $1}') ADDONREPO=$(echo $addontxt | awk '{print $2}') GIT_HASH=$(echo $addontxt | awk '{print $3}')