Closed BClark09 closed 4 years ago
Maybe it's possible to refactor the Linux update script in openhab-distro so the logic can be more easily reused?
I.e. there could be one file providing reusable update functions and another one could use these functions to update a manual installation. Then we can more easily reuse these update functions in other repos (linuxpkg, synology, snap, docker).
Hi @wborn, absolutely. If we make a parameter check for something like changesonly *
in the update script we can call on those functions, this way we could use our own update functions and call e.g.
${OPENHAB_RUNTIME}/bin/update changeonly PRE
[instalation update specifics]
${OPENHAB_RUNTIME}/bin/update changesonly POST
Is that what you had in mind?
Yes something like that would help.
I tried using the update script from openhab-distro in the Docker container and got it working. But I found out it's only for manual installations because it always downloads a new distro and always replaces the runtime dir which are already part of the container. So that's a lot of unnecessary downloading and copying when using containers. :wink:
So I thought let's have a look at how the Linux packages do this and found out it uses the postinst
script instead of the update script.
It's probably best to use a similar approach in the Docker containers so it uses a modified version of the update script using the update.lst, userdata_sysfiles.lst as input.
Tested the above change and will merge so that Linuxpkg is ready for a new milestone build.
I will try to get round to modifying the update script in the distro when I next have time :)
Signed-off-by: Ben Clark ben@benjyc.uk