From f9f53151b5277f699e957bccfdc6954d78c59b62 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 29 Dec 2019 19:10:54 +0100 Subject: [PATCH] update_binary-addons: allow specifying branch for unofficial addons Since Kodi Matrix hasn't branched yet and is still developed in master the kodi branch name (master) and the branch name used in addons (Matrix) doesn't match. Allow to optionally specify the addon branch name on the command line, eg "./update_binary-addons master Matrix". This fixes visualization.pictureit bumps for master which picked up the master branch of the addon instead of the Matrix branch. Signed-off-by: Matthias Reichl --- tools/mkpkg/update_binary-addons | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/mkpkg/update_binary-addons b/tools/mkpkg/update_binary-addons index 32cb6b67cc..f390ae4e38 100755 --- a/tools/mkpkg/update_binary-addons +++ b/tools/mkpkg/update_binary-addons @@ -8,7 +8,7 @@ BUMP_PKG_REV="" 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 " -h, --help: display help and exit" @@ -40,7 +40,7 @@ while [ $# -ne 0 ]; do esac done -if [ $# -ne 1 ]; then +if [ $# -eq 0 -o $# -gt 2 ]; then usage exit 1 fi @@ -60,6 +60,12 @@ mkdir -p "${TMPDIR}" KODI_BRANCH="$1" KODI_DIR="kodi.git" +if [ $# -eq 1 ]; then + UNOFFICIAL_ADDON_BRANCH="${KODI_BRANCH}" +else + UNOFFICIAL_ADDON_BRANCH="$2" +fi + . "${MY_DIR}/update_common_functions" git_clone https://github.com/xbmc/xbmc ${KODI_DIR} ${KODI_BRANCH} @@ -165,8 +171,8 @@ for ADDON in $(ls -1 "${ROOT}/packages/mediacenter/kodi-binary-addons"); do git_clone ${GIT_REPO} ${GIT_DIR} - if RESOLVED_HASH=$(resolve_hash_in_branch ${ADDON}.git ${KODI_BRANCH}); then - echo "Resolved hash for ${ADDON}: ${KODI_BRANCH} => ${RESOLVED_HASH}" + if RESOLVED_HASH=$(resolve_hash_in_branch ${ADDON}.git ${UNOFFICIAL_ADDON_BRANCH}); then + echo "Resolved hash for ${ADDON}: ${UNOFFICIAL_ADDON_BRANCH} => ${RESOLVED_HASH}" elif RESOLVED_HASH=$(resolve_hash_in_branch ${ADDON}.git HEAD); then echo "Resolved hash for ${ADDON}: HEAD => ${RESOLVED_HASH}" else