Solved Issue - repo structure for multiple Kodi versions of the same addon?

  Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
primaeval Offline
Posting Freak
Posts: 1,732
Joined: Apr 2014
Reputation: 182
Post: #1
How do you structure a repo when you have to deal with versions for different versions of Kodi, preferably zips?

I need to host versions of an addon for Jarvis and Krypton+.
(This post was last modified: 2017-03-24 13:36 by primaeval.)
find quote
Rechi Online
Team-Kodi Member
Posts: 336
Joined: Feb 2015
Reputation: 4
Location: Austria
Post: #2
If you need to provide different versions of an add-on depending on Kodi version, you need to create multiple repositories.
find quote
primaeval Offline
Posting Freak
Posts: 1,732
Joined: Apr 2014
Reputation: 182
Exclamation  RE: repo structure for multiple Kodi versions of the same addon?
Post: #3
(2017-03-23 21:41)Rechi Wrote:  If you need to provide different versions of an add-on depending on Kodi version, you need to create multiple repositories.

Thanks. I think that's how Kodi likes to do it now but I found an answer here:
http://forum.kodi.tv/showthread.php?tid=273588&
The trick is to use different dir tags with the minversion attribute selecting the Kodi version.
(This post was last modified: 2017-03-26 08:42 by primaeval.)
find quote
Lunatixz Offline
Skilled Python Coder
Posts: 4,891
Joined: May 2011
Reputation: 142
Location: NYC
Post: #4
I'd create different branches under the same repository keeping master for latest development... remember to change addon.xml to match new url.


Sent from my SM-G935T (typie typie)
(This post was last modified: 2017-03-24 16:34 by Lunatixz.)
find quote
Gade Offline
Skilled Skinner
Posts: 1,883
Joined: Jan 2013
Reputation: 63
Location: Copenhagen, Denmark
Post: #5
I use this approach in my repo:

https://github.com/gade01/repository.gad.../addon.xml

That's very useful for skins, where there is a different version for each Kodi version.
(This post was last modified: 2017-03-25 20:41 by Gade.)
find quote
primaeval Offline
Posting Freak
Posts: 1,732
Joined: Apr 2014
Reputation: 182
Post: #6
(2017-03-25 20:40)Gade Wrote:  I use this approach in my repo:

https://github.com/gade01/repository.gad.../addon.xml

That's very useful for skins, where there is a different version for each Kodi version.

Thanks. Do you know if Kodi is planning to prevent the multiple separate directory method in the future?

Later versions of the official repo addon.xml only have one release in them
https://github.com/xbmc/xbmc/blob/master.../addon.xml
whereas before they allowed multiple versions
https://github.com/xbmc/xbmc/blob/1bddaf.../addon.xml
find quote
Gade Offline
Skilled Skinner
Posts: 1,883
Joined: Jan 2013
Reputation: 63
Location: Copenhagen, Denmark
Post: #7
(2017-03-25 20:50)primaeval Wrote:  Do you know if Kodi is planning to prevent the multiple separate directory method in the future?

Later versions of the official repo addon.xml only have one release in them
https://github.com/xbmc/xbmc/blob/master.../addon.xml
whereas before they allowed multiple versions
https://github.com/xbmc/xbmc/blob/1bddaf.../addon.xml

I hope not. Wink

There were a PR for Kodi Krypton to remove this approach and cleanup repos, but it was partially reverted as too many repos used it.

https://github.com/xbmc/xbmc/pull/10059

https://github.com/xbmc/xbmc/pull/10135
find quote
primaeval Offline
Posting Freak
Posts: 1,732
Joined: Apr 2014
Reputation: 182
Post: #8
(2017-03-25 23:52)Gade Wrote:  
(2017-03-25 20:50)primaeval Wrote:  Do you know if Kodi is planning to prevent the multiple separate directory method in the future?

Later versions of the official repo addon.xml only have one release in them
https://github.com/xbmc/xbmc/blob/master.../addon.xml
whereas before they allowed multiple versions
https://github.com/xbmc/xbmc/blob/1bddaf.../addon.xml

I hope not. Wink

There were a PR for Kodi Krypton to remove this approach and cleanup repos, but it was partially reverted as too many repos used it.

https://github.com/xbmc/xbmc/pull/10059

https://github.com/xbmc/xbmc/pull/10135

Wow. That was controversial. Wink I'm glad the saner devs won. Smile

It would be good if this was documented in the repo wiki though.
find quote
Gade Offline
Skilled Skinner
Posts: 1,883
Joined: Jan 2013
Reputation: 63
Location: Copenhagen, Denmark
Post: #9
Well, the wiki is open for everyone to edit. Wink
find quote
primaeval Offline
Posting Freak
Posts: 1,732
Joined: Apr 2014
Reputation: 182
Post: #10
(2017-03-26 09:25)Gade Wrote:  Well, the wiki is open for everyone to edit. Wink

I've requested a wiki account. Here is my proposed change. What do you think?
Add-on_repositories (wiki)

4.4 Multiple Kodi Versions

To support multiple Kodi versions from the same repository add seperate directories for each version of addon you need to support, specifying a minversion for that folder.
For example:
Code:
    <extension point="xbmc.addon.repository"
        name="Official XBMC.org Add-on Repository">
        <dir minversion="16.0.0">
            <info compressed="true">http://mirrors.kodi.tv/addons/jarvis/addons.xml</info>
            <checksum>http://mirrors.kodi.tv/addons/jarvis/addons.xml.md5</checksum>
            <datadir zip="true">http://mirrors.kodi.tv/addons/jarvis</datadir>
            <hashes>true</hashes>
        </dir>
        <dir minversion="17.0.0">
            <info compressed="true">http://mirrors.kodi.tv/addons/krypton/addons.xml</info>
            <checksum>http://mirrors.kodi.tv/addons/krypton/addons.xml.md5</checksum>
            <datadir zip="true">http://mirrors.kodi.tv/addons/krypton</datadir>
            <hashes>true</hashes>
        </dir>
</extension>

Add your addon to the directory of the lowest version that it will be compatible with. Use a higher version number for later Kodi versions.
Each directory needs it's own addons.xml and addons.xml.md5 folder for the addons in that directory.
find quote
Gade Offline
Skilled Skinner
Posts: 1,883
Joined: Jan 2013
Reputation: 63
Location: Copenhagen, Denmark
Post: #11
That's a great idea.

Remember:
Code:
<requires>
    <import addon="xbmc.addon" version="12.0.0"/>
</requires>

Maybe write the complete addon.xml file?

And would it be helpful with a directory example? Something like:

/jarvis/addons.xml
/jarvis/addons.xml.md5
/jarvis/my.cool.addon/addon.xml
/jarvis/my.cool.addon/my.cool.addon-1.0.0.zip
/krypton/addons.xml
/krypton/addons.xml.md5
/krypton/my.cool.addon/addon.xml
/krypton/my.cool.addon/my.cool.addon-2.0.0.zip
find quote