Skip to content
Permalink
Browse files

Merge pull request #4083 from HiassofT/le92-unofficial-bump-fix

[le92] update_binary-addons: fix unofficial addon bumping
  • Loading branch information
MilhouseVH
MilhouseVH committed Jan 8, 2020
2 parents 01e975b + f9f5315 commit fdcd179f815254b572a29a816c12b1192510ebaf
Showing with 17 additions and 5 deletions.
  1. +17 −5 tools/mkpkg/update_binary-addons
@@ -8,7 +8,7 @@ BUMP_PKG_REV=""
KEEP_GIT_DIRS="yes"

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 " -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,9 +171,15 @@ for ADDON in $(ls -1 "${ROOT}/packages/mediacenter/kodi-binary-addons"); do

git_clone ${GIT_REPO} ${GIT_DIR}

# update package.mk for stale github.com packages
RESOLVED_HASH=$(resolve_hash_in_branch ${ADDON}.git HEAD) || continue
echo "Resolving hash for ${ADDON}: HEAD => ${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
msg_warn "WARNING: Could not resolve hash for ${ADDON}"
continue
fi

if update_pkg "${ADDON_PATH}" "${ADDON}" "${RESOLVED_HASH}"; then
# always bump PKG_REV when updating untagged addons
bump_pkg_rev "${ADDON_PATH}" "${ADDON}"

0 comments on commit fdcd179

Please sign in to comment.
You can’t perform that action at this time.