vigna / ne

ne, the nice editor
http://ne.di.unimi.it/
GNU General Public License v3.0
473 stars 33 forks source link

makefile uninstall target #69

Closed uvtc closed 2 years ago

uvtc commented 4 years ago

Not sure how customary this is to supply an uninstall target for programs installed via makefile, but it would be handy for cases where users want to upgrade to a much newer version and don't want to risk leaving remnants of the old version around.

Also for folks who want to completely remove ne for whatever reason.

Personally, it's always a good sign to me when software provides an easy uninstall.

vigna commented 4 years ago

Good point.

vigna commented 3 years ago

One of the problems I see with this is that the install script has parameters. Unless you invoke make uninstall with the same parameters, it won't work. This is better handled by means of a package manager. The install target is very simple and installs the binary, a shared directory, a doc directory and a man/info page. It is very easy to remove them.

utoddl commented 3 years ago

OTOH, if a make uninstall checked for a $(DESTDIR)$(PREFIX)/bin/ne and found none, it could say it needs the same parameters the install target had, otherwise it attempts the removal. If they already aren't there, then no harm done.

It could be as simple as giving the user the commands and saying "You'll have to do these manually, assuming this is where previously you installed ne." A note mentioning that "Personal ~/.ne directories may remain after uninstall but it's safe to remove them" would be a nice touch too.

The point being, it's better to have an uninstall target, even if just to assure that there's not some non-obvious hidden junk lying around.

vigna commented 3 years ago

OK, I found some magick on StackOverflow that will do it without using shell commands. Please have a look: d954f8cfa2c4c44d4df76f34eefc8f4c437600bf

utoddl commented 3 years ago

That nearly broke my brain! I like it in that it seems to do exactly the right thing with minimal text added. But it is subtle. (Also, check for trailing space, or view it with sy tabs to see inadvertent trailing space.)

vigna commented 3 years ago

git diff will red out traliling spaces, too. There's none.

utoddl commented 3 years ago

??? Lines 84 and 85.

vigna commented 3 years ago

OK, you're right, and that's really weird. Usually it does. Or maybe not on all files... fixed!

uvtc commented 3 years ago

Thank you. I don't yet understand the makefile magic you've conjured, but if it nearly broke Todd's brain I should probably look closely. :)

I wonder if, as part of the make install process, if anyone ever writes out a small text file to the cwd that includes those parameters that were used, in order to help inform a possible later manual uninstall.

vigna commented 3 years ago

Well, I think that if someone is fiddling with install/uninstall, they better know what they're doing 😂.

uvtc commented 2 years ago

Since the uninstall target has been added, closing this issue. Thanks again.