From 78259e03a0f8e4041e76d71d192dff6eb181df19 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Fri, 1 Mar 2019 13:07:58 +0100 Subject: [PATCH] update addons: add possibility to exclude packages in updates Signed-off-by: Matthias Reichl --- tools/mkpkg/update_binary-addons | 7 +++++++ tools/mkpkg/update_common_functions | 10 ++++++++++ tools/mkpkg/update_retroplayer-addons | 5 +++++ 3 files changed, 22 insertions(+) diff --git a/tools/mkpkg/update_binary-addons b/tools/mkpkg/update_binary-addons index de4926c0d8..cbb47eb2e5 100755 --- a/tools/mkpkg/update_binary-addons +++ b/tools/mkpkg/update_binary-addons @@ -9,6 +9,9 @@ if [ -z "$1" ]; then exit 0 fi +# list of packages to exclude from update +EXCLUDED_PACKAGES="" + # 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 @@ -73,6 +76,8 @@ for addontxt in $KODI_DIR/cmake/addons/bootstrap/repositories/*-addons.txt ; do [[ ${ADDON} =~ ^game.* ]] && continue # ignore game.* addons - handled by update_retroplayer-addons + check_package_excluded "${ADDON}" "${EXCLUDED_PACKAGES}" && continue + REPO=$(cat $addon/$ADDON.txt | awk '{print $2}') GIT_HASH=$(cat $addon/$ADDON.txt | awk '{print $3}') @@ -108,6 +113,8 @@ for ADDON in $(ls -1 "${ROOT}/packages/mediacenter/kodi-binary-addons"); do # ignore already processed addons echo -e "${PROCESSED}" | grep -qE "^${ADDON}$" && continue + check_package_excluded "${ADDON}" "${EXCLUDED_PACKAGES}" && continue + # Obtain git url - ignore if not a suitable repo REPO="$(geturl "${ADDON}")" || continue diff --git a/tools/mkpkg/update_common_functions b/tools/mkpkg/update_common_functions index be6e650171..1f37736a99 100644 --- a/tools/mkpkg/update_common_functions +++ b/tools/mkpkg/update_common_functions @@ -73,6 +73,16 @@ resolve_tag() { fi } +check_package_excluded() { + local package="$1" local packages_to_exclude="$2" pkg + [ -z "${package}" -o -z "${packages_to_exclude}" ] && return 1 + if [[ ${packages_to_exclude} =~ (^|[[:space:]])${package}($|[[:space:]]) ]]; then + msg_info "SKIPPING excluded package ${package}" + return 0 + fi + return 1 +} + set_pkg_version() { local package_mk="$1/package.mk" pkg_version="$2" sed -e "s|PKG_VERSION=.*|PKG_VERSION=\"${pkg_version}\"|g" -i "${package_mk}" diff --git a/tools/mkpkg/update_retroplayer-addons b/tools/mkpkg/update_retroplayer-addons index c9ae3d1872..8a87aba073 100755 --- a/tools/mkpkg/update_retroplayer-addons +++ b/tools/mkpkg/update_retroplayer-addons @@ -14,6 +14,9 @@ fi # 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="" + MY_DIR="$(dirname "$0")" ROOT="$(cd "${MY_DIR}"/../.. && pwd)" TMPDIR="$(pwd)/.update-retroplayer-tmp" @@ -37,6 +40,8 @@ for addontxt in "game-binary-addons https://github.com/kodi-game/repo-binary-add [[ "${GAME_ADDON}" =~ ^game. ]] || continue + check_package_excluded "${GAME_ADDON}" "${EXCLUDED_PACKAGES}" && continue + if ! grep -q all $addon/platforms.txt && ! grep -q linux $addon/platforms.txt && ! grep -q ! $addon/platforms.txt; then continue fi