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

[fix] Postinstall error with rm /usr/bin/pulsar #228

Merged
merged 4 commits into from
Dec 25, 2022

Conversation

Spiker985
Copy link
Member

Redirect stderr to /dev/null

Since this is a shell (sh) file and not a bash file, rather than doing an if [[ -f "" ]] condition, we can just throw away the error if it doesn't exist

A whole lot safer than using -f/--force

Should fix #215

Since this is a shell (sh) file and not a bash file, rather than doing a `if [[ -f "" ]]` condition, we can just throw away the error if it doesn't exist

A whole lot safer than using `-f/--force`
Copy link
Member

@DeeDeeG DeeDeeG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems legit.

Although if /usr/bin/pulsar already exists and we get an error trying to rm it, maybe we should print the error only in that case? So the "if exists then rm" way could give that benefit.

@Spiker985
Copy link
Member Author

Yeah, I bounced back and forth. I'm not necessarily sure if the postinstall has to continue to be a sh file over a bash file, but there's definitely a way to do the same IF check within sh if we wanted

Actually, you've made me rethink this. I think I'm actually going to switch it over to the IF statement, because if the current user (for whatever reason) doesn't have access to delete that file, the redirection would chuck that error to the void

@Spiker985 Spiker985 self-assigned this Dec 16, 2022
On second thought, throwing all errors to the void would also throw permission issues to the void as well. So we'll just test for the file existence and echo a message if it isn't found
@Spiker985 Spiker985 closed this Dec 16, 2022
@Spiker985 Spiker985 deleted the update-postinstall branch December 16, 2022 17:34
@Spiker985 Spiker985 restored the update-postinstall branch December 16, 2022 17:36
@Spiker985 Spiker985 reopened this Dec 16, 2022
@Spiker985
Copy link
Member Author

Man, that is quite annoying, renaming a branch which already has a PR, doesn't simply renamed the branch the PR is targeting - nah it deletes the whole thing

We'll just remove the else statement for now, and if people report issues later, we can simply recreate it

Co-authored-by: DeeDeeG <[email protected]>
Copy link
Member

@confused-Techie confused-Techie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@DeeDeeG DeeDeeG merged commit 4390e9c into pulsar-edit:master Dec 25, 2022
@DeeDeeG
Copy link
Member

DeeDeeG commented Dec 25, 2022

Thanks for this!

@Spiker985 Spiker985 deleted the update-postinstall branch February 27, 2023 21:06
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.

Error occurs while installing from *.deb (installation does succeed).
3 participants