mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
addon update scripts: set modes via command line options
Use command line options to select PKG_REV bump and deleting cloned git dis after update. git dirs are now kept by default, deleting them has to be explicitly enabled via "-d". Signed-off-by: Matthias Reichl <hias@horus.com>
This commit is contained in:
parent
e25aee7b70
commit
212c181de6
@ -4,18 +4,50 @@
|
|||||||
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
|
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
|
||||||
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
|
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
BUMP_PKG_REV=""
|
||||||
echo "Usage: $0 <branch-name>"
|
KEEP_GIT_DIRS="yes"
|
||||||
exit 0
|
|
||||||
|
usage() {
|
||||||
|
echo "Usage: $0 [options] <branch-name>"
|
||||||
|
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
|
fi
|
||||||
|
|
||||||
# list of packages to exclude from update
|
# list of packages to exclude from update
|
||||||
EXCLUDED_PACKAGES="vfs.nfs vfs.sacd"
|
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")"
|
MY_DIR="$(dirname "$0")"
|
||||||
ROOT="$(cd "${MY_DIR}"/../.. && pwd)"
|
ROOT="$(cd "${MY_DIR}"/../.. && pwd)"
|
||||||
TMPDIR="$(pwd)/.update-binary-addons-tmp"
|
TMPDIR="$(pwd)/.update-binary-addons-tmp"
|
||||||
|
@ -3,16 +3,59 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
|
||||||
|
|
||||||
|
BUMP_PKG_REV=""
|
||||||
FORCE_LIBRETRO_BUMP=""
|
FORCE_LIBRETRO_BUMP=""
|
||||||
|
KEEP_GIT_DIRS="yes"
|
||||||
|
|
||||||
if [ "$1" == "-f" ]; then
|
usage() {
|
||||||
|
echo "Usage: $0 [options] [<branch>]"
|
||||||
|
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"
|
FORCE_LIBRETRO_BUMP="yes"
|
||||||
shift
|
shift
|
||||||
fi
|
;;
|
||||||
|
-h|--help)
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
echo "illegal option $1"
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
# 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
|
if [ $# -gt 1 ]; then
|
||||||
# BUMP_PKG_REV: bump PKG_REV if PKG_VERSION has changed
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
KODI_BRANCH="retroplayer"
|
||||||
|
echo "using default branch ${KODI_BRANCH}"
|
||||||
|
else
|
||||||
|
KODI_BRANCH="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
# list of packages to exclude from update
|
# list of packages to exclude from update
|
||||||
EXCLUDED_PACKAGES="game.libretro.chailove
|
EXCLUDED_PACKAGES="game.libretro.chailove
|
||||||
@ -36,7 +79,7 @@ mkdir -p "${TMPDIR}"
|
|||||||
. "${MY_DIR}/update_common_functions"
|
. "${MY_DIR}/update_common_functions"
|
||||||
|
|
||||||
# addons
|
# 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}')
|
ADDONS=$(echo $addontxt | awk '{print $1}')
|
||||||
ADDONREPO=$(echo $addontxt | awk '{print $2}')
|
ADDONREPO=$(echo $addontxt | awk '{print $2}')
|
||||||
GIT_HASH=$(echo $addontxt | awk '{print $3}')
|
GIT_HASH=$(echo $addontxt | awk '{print $3}')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user