peno64 / test

0 stars 0 forks source link

Unable to create a repo following your repository.example example #1

Open peno64 opened 2 years ago

peno64 commented 2 years ago

@drinfernoo

I am trying to create a repository as described in https://github.com/drinfernoo/repository.example

There it says that _repo_xml_generator.py must be used to build the zip files and that this file is in included in the example. But there is no _repo_xml_generator.py file There is however a _repo_generator.py file but when I run it, does nothing at all. I am doing this on a windows system with python 3.9.5 It is also refering to repository.jurialmunkey and I cloned it locally and I also ran _repo_generator.py onit but again nothing happens. What am I doing wrong?

Thank you

drinfernoo commented 2 years ago

Thanks for noticing my typo :wink: It actually did used to be named _repo_xml_generator.xml, but I rewrote pretty much the whole script about a month ago, and ended up renaming it. I just forgot to update the guide.

It's pretty tough to say immediately what isn't working, but I know that at least on my system (also Windows, with Python 3.9.4), I have to open a shell window and run the file in there... Just double-clicking it doesn't work properly for me.

peno64 commented 2 years ago

Thank you for the response. Found out what I was doing wrong. I didn't put my addons in a folder called repo (I had put them in the folder of the addon id). Works now. And for the jurialmunkey example I first had to remove the existing zip folders before the script did something. Thank you.

peno64 commented 2 years ago

@drinfernoo Thank you for the response. Found out what I was doing wrong. I didn't put my addons in a folder called repo (I had put them in the folder of the addon id). The script now indeed generates a zip folder with files of my addons.

However there is still something I don't understand.

The repository.example starts with editing addon.xml in the repository.example folder and then rename that folder to the needed add-on ID (btw, don't you mean with this the needed repository ID). Then run the python script and copy the zip file of your repository, located at REPO_FOLDER/zips/ADDON_ID_HERE/ADDON_ID_HERE-VERSION_NUMBER_HERE.zip (again don't you mean instead of ADDON_ID the REPOSITORY_ID), and paste it into the root folder. And here I have a problem. If I understand well, this is the zip of the original folder repository.example which was renamed to the needed add-on ID. But that zip is not created... Since that folder is still part of the root folder, how does the python script see that it also needs to create a zip of this folder? It doesn't do that when I do it as such). The only way I can make this work is move this folder from the root folder to the repo folder and as such the python script also create a zip of it (next to the zips of the addons that will be hosted by the repo) and then I can move that zip to the root and then that work. But it is not as such described in your description so I am a bit lost here...

Can you please clarify this.

Thank you

drinfernoo commented 2 years ago

Ah yep, you've got it right. I need to amend my tutorial a bit more. You figured it out though 😉

peno64 commented 2 years ago

@drinfernoo I had one extra issue. Because I had to add the (renamed) repository.example in the repo folder such that its zip file is also created and afterwards can be put in the root folder, addons.xml in folder repo/zips also had an entry for the repository addon also and then in kodi, when choosing install from (this) repository, it also has an "Add-on repository" entry which is not that nice. To solve this I made a small modification to your _repo_generator.py script. Next to folders repo,leia and matrix I also added folder - and I moved repository.example to a new folder - This results in creating the repo zip in that - folder instead of in repo or leia or matrix and as such the addon.xml in the latter folders do not contain the repo addon itself. I also updated the readme file with some corrections and clarifications. See https://github.com/peno64/repository.example What do you think?

Regards,

Peter

drinfernoo commented 2 years ago

This is actually by design, for the purposes of delivering updates to the repository itself from itself.

This isn't necessary very often in most cases, but is convenient when the repository's addon.xml needs to change, like if paths change or a new section is added (like may become necessary when Nexus comes about), because it precludes the need to reinstall the repo from zip each time an update is put out.

For a little bit more insight on how this particular repo scheme is designed to work, I typically use the /repo folder for add-ons which are compatible with and can be installed in multiple versions of Kodi, like the repository add-on or cross-version dependencies and add-ons (like those in https://github.com/jurialmunkey/repository.jurialmunkey/tree/master/repo), while the version-specific folders (like /leia and /matrix) should be used for versions that are only compatible with that specific version (like Aura in https://github.com/jurialmunkey/repository.jurialmunkey/tree/master/leia does not exist in https://github.com/jurialmunkey/repository.jurialmunkey/tree/master/matrix).

This is certainly not the only way to handle Kodi repos, but only my interpretation of the "easiest" way to separate them in a logical manner.

To my knowledge, the first repo to actually use a structure similar to this (besides the official Kodi repository, which is even a little bit more different) was https://github.com/OpenELEQ/repository.q/tree/master... but I simply attempted to streamline the process of maintaining delivery to multiple versions of Kodi from a single GitHub repo. You're free to do it however you like, and it should work as long as all the paths you point to are valid and the structure is correct 😉

peno64 commented 2 years ago

@drinfernoo

Well with my tests this is not really needed. I just incremented the version number in addon.xml from the repo addon and kodi does see that the repo needs an update. The repo addon doesn't have to be contained in the repo itself to be able to do this.

But as you say everybody has its way of working with it. It is quite hard to find good documentation about it how things must be done. Yours was in fact the best I could find.

drinfernoo commented 2 years ago

@peno64 Interesting 🤔 I do know that it used to be that way, so maybe they've changed that in Matrix.

Where did you change it? Repositories shouldn't be able to see anything that isn't listed in their addons.xml, unless there were some pretty radical changes.

drinfernoo commented 2 years ago

@drinfernoo Thank you for the response. Found out what I was doing wrong. I didn't put my addons in a folder called repo (I had put them in the folder of the addon id). The script now indeed generates a zip folder with files of my addons.

However there is still something I don't understand.

The repository.example starts with editing addon.xml in the repository.example folder and then rename that folder to the needed add-on ID (btw, don't you mean with this the needed repository ID). Then run the python script and copy the zip file of your repository, located at REPO_FOLDER/zips/ADDON_ID_HERE/ADDON_ID_HERE-VERSION_NUMBER_HERE.zip (again don't you mean instead of ADDON_ID the REPOSITORY_ID), and paste it into the root folder.

Actually, either is correct... Repositories are add-ons too 😉

And here I have a problem. If I understand well, this is the zip of the original folder repository.example which was renamed to the needed add-on ID. But that zip is not created... Since that folder is still part of the root folder, how does the python script see that it also needs to create a zip of this folder? It doesn't do that when I do it as such). The only way I can make this work is move this folder from the root folder to the repo folder and as such the python script also create a zip of it (next to the zips of the addons that will be hosted by the repo) and then I can move that zip to the root and then that work. But it is not as such described in your description so I am a bit lost here...

Can you please clarify this.

Thank you

I went ahead and moved /repository.example to /repo/repository.example, and updated the guide accordingly.