Offer to link the launchers where sudo can see them - #5
Merged
Conversation
sudo replaces PATH with secure_path, which excludes ~/.local/bin and includes /usr/local/bin. Linking the launcher there is what makes 'sudo suplemon' work by name rather than by full path. install.sh prints the command instead of running it: nothing else in the installer needs a password, and asking for one to do something optional would be worse than showing the line. It skips the offer when something that is not ours already holds either name, since a stream editor called 'se' exists and replacing it silently would be rude. Links rather than copies, so re-running the installer keeps them current. uninstall.sh reports them and gives the removal command without ever touching them, for the same no-password reason. Also corrects the README on when upstream stopped. The last change of substance was 11 December 2019; January 2021 was two edits to a README image URL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three things.
1.
install.shoffers the/usr/local/binlinksudo replaces
PATHwithsecure_path, which excludes~/.local/binand includes/usr/local/bin. Linking there is what makessudo suplemonwork by name.The installer prints the command rather than running it — nothing else in it needs a password, and prompting for one to do something optional would be worse than showing the line:
Links, not copies, so re-running the installer keeps them current. A copy silently goes stale — which had already happened on my own machine.
It refuses to offer when something that is not ours holds either name. A stream editor called
seexists on PyPI; replacing it without asking would be rude./usr/local/binsepresent! …/se exists and is not ours; leaving it alone, no offer+ Linked into /usr/local/bin, so sudo can find it2.
uninstall.shdetects but never removesSame no-password reasoning. It reports the links under Left in place on purpose and prints
sudo rm -f …. Verified that a dry run leaves both in place. It only names links that are actually ours.Both scripts honour
SYS_BIN_DIRfor non-standard prefixes, which is also how the three cases above were tested.3. README corrections
The
sudosection now covers full path, the/usr/local/binlink, andsudoedit, in that order.Separately, About this fork claimed upstream's last commit was January 2021. Both commits that day were
Update gif url. The last change of substance was 11 December 2019, and the text now says so.test.shpasses, both scripts parse, andtwine checkpasses on both distributions since the README is the PyPI long description.