wincent / masochist

β›“ Website infrastructure for over-engineers
MIT License
78 stars 26 forks source link

Update Uninstalling packages (.pkg files) on Mac OS X.md #141

Closed MikeDX closed 5 years ago

MikeDX commented 5 years ago

Removed the line for removing directories, since this would be an absolute disaster if the pkg had installed to anything in /usr

MikeDX commented 5 years ago

it is, but it really shouldn't even be an option to suggest sudo rm on could-be system dirs!

i made the pull request to prevent other making the same mistake i almost did, and I consider myself semi literate 😊

On Sun, 25 Aug 2019, 13:17 Greg Hurrell, notifications@github.com wrote:

@wincent commented on this pull request.

Thanks. Seems this is already covered though by the lines that immediately follow the one you removed:

Needless to say, extreme care should always be taken when removing files with root privileges. Particularly, be aware that some packages may update shared system components, so uninstalling them can actually break your system by removing a necessary component.

For smaller packages it is probably safer to just manually remove the files after visually inspecting the package file listing.

β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wincent/masochist/pull/141?email_source=notifications&email_token=AAGQPKZKFRZNNODVNKLORS3QGJZ4HA5CNFSM4IPI2RK2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCCTETPQ#pullrequestreview-279333310, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGQPK67LJ6ZLZJAVUFCXPTQGJZ4HANCNFSM4IPI2RKQ .

wincent commented 5 years ago

But there's an -i switch there, and even if you miss that, SIP (which didn't exist when this article was written) would stop even root from writing to (deleting) the really important stuff, I'd think.

Was it -i that saved you in your case?

MikeDX commented 5 years ago

well, this is the thing. the -i on my version of osx at least just skipped every rm anyway.

there was no interactive. pasting the line as-is did nothing to it

On Sun, 25 Aug 2019, 17:20 Greg Hurrell, notifications@github.com wrote:

But there's an -i switch there, and even if you miss that, SIP (which didn't exist when this article was written) would stop even root from writing to (deleting) the really important stuff, I'd think.

Was it -i that saved you in your case?

β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wincent/masochist/pull/141?email_source=notifications&email_token=AAGQPK53KMGOBJH6TIKE4GDQGKWMFA5CNFSM4IPI2RK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5CWVHI#issuecomment-524642973, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGQPK6AFGH3FJT7AV7GIHTQGKWMFANCNFSM4IPI2RKQ .

wincent commented 5 years ago

I think that something has changed in the version of rm or xargs that ships with macOS in the 8 years since that article was written; either that, or it never worked exactly as written (possible).

It seems that if you pass -i to rm invoked via xargs the prompt fails (as though you had typed "n"); you see it print the prompt but not wait to read the answer β€”Β it just treats it as "no".

But if you add the -o flag to xargs then the interactive prompts work.

wincent commented 5 years ago

I merged your commit with some changes on top (see 5aaa92831c3f for the total diff) which hopefully strike the right balance of providing complete information and scaring the crap out of anybody foolhardy enough to try running these commands on their system. Thanks @MikeDX.

MikeDX commented 5 years ago

Thanks. glad i could be of some help :)