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

Disable symbolic link removal on update #836

Open
jneko33 opened this issue Jul 6, 2016 · 2 comments
Open

Disable symbolic link removal on update #836

jneko33 opened this issue Jul 6, 2016 · 2 comments

Comments

@jneko33
Copy link

jneko33 commented Jul 6, 2016

I wish to retain symbolic links made during install, on update.

During a package upgrade process, because the new package gets installed before the old package gets uninstalled, I've found that symlinks made by the post script of the new package are then deleted by the postuninstall script of the old package (as the symlinks are the same in both packages).
This behaviour could not be overwritten because in com.typesafe.sbt.packager.rpm.RpmMetadata.writeSpec(rpmRoot: File, tmpRoot: File) [line 261], teardown of symlinks is always appended to the end of the postuninstall script as long as the linuxPackageSymlinks key is populated.

It would be useful if tearing down of symlinks to somehow be conditional on update, preferably to have update behaviour configurable.

@dpennell
Copy link
Contributor

dpennell commented Jul 7, 2016

I have the same issue. While it looks like it is fairly common to use %post to add symbolic links, there seems to be pretty consistent advice to create them in the %install section. Here are some references:

I assume that if you list the links in %files, then upgrade can "do the right thing".

Another option that I considered is to use the argument that RPM passes to %postun as described in http://www.rpm.org/max-rpm/s1-rpm-inside-scripts.html. This would avoid removing all symbolic links, so links that are not present in newer versions would not get deleted.

@muuki88
Copy link
Contributor

muuki88 commented Jul 10, 2016

Thanks @jneko33 for the detailed bug report and thanks @dpennell for the research. I tried a naive approach and putting the symlinks into the install section. I haven't tested this yet, just want to get something out quick to get feedback.

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

No branches or pull requests

3 participants