Make sure we always return the latest tag in the branch and
only apply tag-suffix filtering if more than one tag exists.
This ensures we won't pick up an older (eg -Nexus) tag if newer
(eg -Matrix) tags are present - like it's currently the case with
game addons which only get "-Matrix" tags.
Signed-off-by: Matthias Reichl <hias@horus.com>
When environment variable GITHUB_API_TOKEN like in ${HOME}/.${DISTRO,,}/options
is assigned the script will fetch all data direct from Github instead
clone every single package.
If no tag with the kodi branch name can be found, fall back to the
latest tag in the branch.
This fixes ambiguity if both a -Leia and a -Matrix tag point to the
same githash.
Signed-off-by: Matthias Reichl <hias@horus.com>
Kodi binary and game addons always reference branches in the addon
repo. The only exception is the kodi-platform package which references
a githash.
This allows us to simplify remote repo fetch and tag / branch HEAD
resolving: we don't need named branches in the working copy but can
simply query remote branches or use a detached branch if we need the
actual contents.
With this change the same (out-of-tree) directory containing cloned
repos can be used to update both kodi Leia and master addon versions,
without needing another clone.
Also refactor the package update code, drop update_to_latest_tag from
common functions (it was only used by update_binary-addons,
update_retroplayer-addons needs slightly different logic) and use
update_pkg function. update_retroplayer-addons now also uses update_pkg
instead of duplicating nearly identical code.
Several variable names have been cleaned up to follow a common naming
pattern.
Signed-off-by: Matthias Reichl <hias@horus.com>
When updating versioned / tagged addons reset PKG_REV to 1.
When updating unversioned / untagged addons always bump PKG_REV
as we don't know if the version has been changed or not.
If the "-b/--bump-pkg-rev" option is used PKG_REV will be bumped
on all addons that weren't updated. Use this to ensure all addons
will have a newer version than before.
Signed-off-by: Matthias Reichl <hias@horus.com>