-
Notifications
You must be signed in to change notification settings - Fork 3
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
Better way of symlinking up
to update
(rpm)
#19
Conversation
So wait, this makes a symlink after installation?? This is exactly what I have been looking for (you can tell from all the failed |
So I've run into a problem. This works, except when you already have a Thoughts? |
No, there is always a possibility that the user has a program/script that invokes I think you could do something like below, but with the correct variables in the spec file. Althought I'm not 100% sure it will work. [[ $(ls -l $(command -v up)) =~ "/usr/bin/update" ]] || ln -v -s /usr/bin/update "/usr/bin/up" This will execute What do you think is best? |
Oh that's smart! I'll test that. |
Keep in mind that this is probably not the most performant way of doing it. |
Another way would be to add an alias to the |
I don't really recommend this as some users may already have an alias I would do something like I showed above (#19 (comment)), and then let the user make the choice if they want an alias or a symlink. |
I wasn't really going to do the alias thing, but I was just putting it out there. |
Oh okay, my bad 😅! |
Thanks for the code! |
You're welcome! |
BTW you've updated the version inside the spec file by accident (86731f0). |
Oh, thanks... I didn't realize I did that 😆 |
Rpm-packages have a
%preun
stage this stage contains the commands that are run after uninstalling the package. This is something similar thepostrm
file for deb-packages.This allows you to let the package manager remove the symlink, this makes it so you don't have to write extra code to remove it inside the
install
script.You can find more information about it here https://www.golinuxhub.com/2018/05/how-to-execute-script-at-pre-post-preun-postun-spec-file-rpm/.