kodi-addon-submitter icon indicating copy to clipboard operation
kodi-addon-submitter copied to clipboard

Generated zips for matrix don't have a modified addon.xml

Open michaelarnauts opened this issue 3 years ago • 2 comments

It seems the zip that is generated when using -z doesn't have the modified addon.xml. I guess the issue might be in the util.create_zip method, since the uploaded PR is modified fine.

Example: https://github.com/enen92/screensaver.kaster/releases/tag/1.3.5 If you take a look at the matrix-zip, you'll notice that it doesn't contain the xbmc.python = 3.0.0 line.

michaelarnauts avatar Jan 13 '21 19:01 michaelarnauts

The issue lies with the HEAD in this line: https://github.com/xbmc/kodi-addon-submitter/blob/master/addon_submitter/utils.py#L61. HEAD doesn't contain the changes that have been made to the addon.xml.

shell('git', 'archive', '-o', '{}.zip'.format(zip_name), 'HEAD', '--', addon_id)

We've worked around this by doing something like this in our Makefile. A git stash create gives a hash that can also be used with git archive and does contain the changes made to the addon.xml. When there are no changes in the current directory, a git stash create won't work, so HEAD is used as fallback there.

git archive --format zip --worktree-attributes -v -o ../$(zip_name) --prefix $(zip_dir) $(or $(shell git stash create), HEAD)

michaelarnauts avatar Feb 27 '21 09:02 michaelarnauts

This had to be reverted.

This seems to have an issue when submitting the actual addon. I think that the git stash create causes the actual commit to fail. I'll probably have to git stash pop or find a better solution.

michaelarnauts avatar Mar 22 '21 13:03 michaelarnauts