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

Copy over REPLACE function from update script #148

Merged
merged 2 commits into from
Aug 6, 2019
Merged

Conversation

BClark09
Copy link
Member

@BClark09 BClark09 commented Aug 2, 2019

Signed-off-by: Ben Clark ben@benjyc.uk

Signed-off-by: Ben Clark <ben@benjyc.uk>
@wborn
Copy link
Member

wborn commented Aug 3, 2019

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).

@BClark09
Copy link
Member Author

BClark09 commented Aug 3, 2019

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?

@wborn
Copy link
Member

wborn commented Aug 3, 2019

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. 😉

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.

 - Also, make sure snapshot to snapshot updates load the update.lst too

Signed-off-by: Ben Clark <ben@benjyc.uk>
@BClark09
Copy link
Member Author

BClark09 commented Aug 6, 2019

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 :)

@BClark09 BClark09 merged commit ba55243 into master Aug 6, 2019
@BClark09 BClark09 deleted the post-update-replace branch August 6, 2019 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants