nelhage / reptyr

Reparent a running program to a new terminal
MIT License
5.71k stars 216 forks source link

Add target uninstall #105

Closed RaghavRao closed 4 years ago

RaghavRao commented 4 years ago

Here's what I added to my Makefile to add the uninstall target:

@@ -57,4 +58,14 @@ install: reptyr
        install -d -m 755 $(DESTDIR)$$bashcompdir ; \
        install -m 644 reptyr.bash $(DESTDIR)$$bashcompdir/reptyr

+BASHCOMPDIR ?= $(shell $(PKG_CONFIG) --variable=completionsdir bash-completion 2>/dev/null)
+
+uninstall: reptyr
+       rm $(DESTDIR)$(BINDIR)/reptyr
+       rm $(DESTDIR)$(MANDIR)/man1/reptyr.1
+       rm $(DESTDIR)$(MANDIR)/fr/man1/reptyr.1
+       bashcompdir=$(BASHCOMPDIR) ; \
+       test -z "$$bashcompdir" && bashcompdir=/etc/bash_completion.d ; \
+       rm $(DESTDIR)$$bashcompdir/reptyr
+

I didn't know if it was worth a PR. Is it?

nelhage commented 4 years ago

I'm a bit skeptical of uninstall targets since I feel like the use case is almost always better met by some out-of-band tool like GNU stow which is capable of properly sandboxing installations and doesn't require manually keeping the lists in sync, but I'd accept the PR if it's helpful to you for some reason.

RaghavRao commented 4 years ago

Stow seems a lot nicer. I added the uninstall after several failed attempts with checkinstall on Fedora 31 but stow seems perfect. I suppose an uninstall target would be redundant. Could a mention of stow be made in the Readme or wiki? Thanks!