Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework manual update for new infrastructure #279

Merged
merged 10 commits into from
Sep 3, 2022

Conversation

antonlacon
Copy link
Contributor

@antonlacon antonlacon commented Sep 1, 2022

This updates the addon to allow manual updates to work with nightly images off test.libreelec.tv.

The first five commits are cleanups, mostly around logging and if tests.

The sixth commit is an enhancement to add "https://" to a Custom URL if the string doesn't start with http:// or https://. Ex: I can put test.libreelec.tv as the Custom URL, as it'll correct it to https://test.libreelec.tv/releases.json.

The seventh commit updates the list of available builds in the releases.json displayed to users to account for it having images in addition to tarballs.

The eighth commit changes what get_available_builds() returns when given an argument from the build's name to the build's subpath+name. This is only used when combining with the URL from the releases.json in do_manual_update().

The ninth commit is documentation.

Caveats: get_available_builds() has a matches variable. I don't know what situation takes this path / LE provided releases.json don't trigger this path. It was put in recently, so I've kept it and only done enough to keep it from causing the addon to error from not having a 'file' entry. Matches is the result of the releases.json's prettyname_regex being applied to the filename.

Uboot devices allow selecting any of the images from their project. Ex: an A64.arm device will show 40 images (4 devices * 10 images each), any of which may be chosen.

Tested RPi2 & A64 by spoofing and seeing what it downloads.

Signed-off-by: Ian Leonard <antonlacon@gmail.com>
@antonlacon antonlacon changed the title Manual update Rework manual update for new infrastructure Sep 1, 2022
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
@flubshi
Copy link
Contributor

flubshi commented Sep 2, 2022

Tested on raspberry pi4: For manual update (channel: LibreELEC-11.0 @ test.libreelec.tv) the list of avilable versions seems to contain entries, but with an empty label.

@antonlacon
Copy link
Contributor Author

I believes labels are from the prettyname_regex in the releases.json. It's set up for release images, and I'm not sure what a prettyname for a nightly would reduce it to. I can see taking the distroname off the front if length is an issue. What were you expecting for a label on them?

@flubshi
Copy link
Contributor

flubshi commented Sep 2, 2022

For the label I would expect the pretty name and, if not matching, the filename as fallback. I think that's the way it was before.

Signed-off-by: Ian Leonard <antonlacon@gmail.com>
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
@flubshi
Copy link
Contributor

flubshi commented Sep 3, 2022

Works on raspberry pi4 👍

@CvH CvH merged commit ac8018b into LibreELEC:master Sep 3, 2022
@antonlacon
Copy link
Contributor Author

The pretty name in the releases.json is set up for release builds. Nightlies are named differently, so they fallback to the filename. The addon already stripped '.tar' off filenames; I extended it to take '.img.gz' off too. I've also added a commit to remove the distro + project.arch off the front.

Before: LibreELEC-RPi2.arm-11.0-nightly-20220901-a1a77bf.img.gz
After: 11.0-nightly-20220901-a1a77bf

I believe that's equivalent enough to what the prettyname regex was creating: the version of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants