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 <hias@horus.com>
This commit is contained in:
Matthias Reichl 2019-12-29 19:10:54 +01:00
parent 49ebd0f9ab
commit f9f53151b5

View File

@ -8,7 +8,7 @@ BUMP_PKG_REV=""
KEEP_GIT_DIRS="yes" KEEP_GIT_DIRS="yes"
usage() { usage() {
echo "Usage: $0 [options] <branch-name>" echo "Usage: $0 [options] <kodi-branch> [<unofficial-addon-branch>]"
echo " -b, --bump-pkg-rev: bump PKG_REV if package was not updated" 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 " -d, --delete-git-dirs: delete cloned git dirs after update"
echo " -h, --help: display help and exit" echo " -h, --help: display help and exit"
@ -40,7 +40,7 @@ while [ $# -ne 0 ]; do
esac esac
done done
if [ $# -ne 1 ]; then if [ $# -eq 0 -o $# -gt 2 ]; then
usage usage
exit 1 exit 1
fi fi
@ -60,6 +60,12 @@ mkdir -p "${TMPDIR}"
KODI_BRANCH="$1" KODI_BRANCH="$1"
KODI_DIR="kodi.git" KODI_DIR="kodi.git"
if [ $# -eq 1 ]; then
UNOFFICIAL_ADDON_BRANCH="${KODI_BRANCH}"
else
UNOFFICIAL_ADDON_BRANCH="$2"
fi
. "${MY_DIR}/update_common_functions" . "${MY_DIR}/update_common_functions"
git_clone https://github.com/xbmc/xbmc ${KODI_DIR} ${KODI_BRANCH} 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} git_clone ${GIT_REPO} ${GIT_DIR}
if RESOLVED_HASH=$(resolve_hash_in_branch ${ADDON}.git ${KODI_BRANCH}); then if RESOLVED_HASH=$(resolve_hash_in_branch ${ADDON}.git ${UNOFFICIAL_ADDON_BRANCH}); then
echo "Resolved hash for ${ADDON}: ${KODI_BRANCH} => ${RESOLVED_HASH}" echo "Resolved hash for ${ADDON}: ${UNOFFICIAL_ADDON_BRANCH} => ${RESOLVED_HASH}"
elif RESOLVED_HASH=$(resolve_hash_in_branch ${ADDON}.git HEAD); then elif RESOLVED_HASH=$(resolve_hash_in_branch ${ADDON}.git HEAD); then
echo "Resolved hash for ${ADDON}: HEAD => ${RESOLVED_HASH}" echo "Resolved hash for ${ADDON}: HEAD => ${RESOLVED_HASH}"
else else