threads / patch / 7100

patchGuilt: Added an uninstall target

Subject: [PATCH 1/1] Guilt: Added an uninstall target

## tl;dr

2 messages between Mar 6, 2007 and Mar 6, 2007. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Nur Hussein· Mar 6, 2007, 03:31 UTC · lore
Invoking make uninstall will remove guilt files from installed directory.
Signed-off-by: Nur Hussein <hussein@cs.usm.my>
---
 Makefile  |    4 ++++
 uninstall |   18 ++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)
Show changes to 2 files +22 −0

Makefile, uninstall

diff --git a/Makefile b/Makefile
index 828e73f..eb5fc2e 100644
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,10 @@ install:
 	install -d $(PREFIX)/bin/
 	install -m 755 $(SCRIPTS) $(PREFIX)/bin/
 
+.PHONY: uninstall
+uninstall:
+       ./uninstall $(PREFIX)/bin/ $(SCRIPTS)
+
 .PHONY: doc
 doc:
 	$(MAKE) -C Documentation all
diff --git a/uninstall b/uninstall
new file mode 100755
index 0000000..aa2e127
--- /dev/null
+++ b/uninstall
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+# Copyright (c) 2007 Nur Hussein <hussein@cs.usm.my>
+#
+
+if [ $# -lt 2 ]; then
+	echo "Usage: $0 <prefix> <file1> <file2> ..." >&2
+	exit 1
+fi
+
+PRE=$1
+
+shift
+
+for x in "$@"
+do
+	rm "$PRE/$x"
+done
-- 
1.4.4.4


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Josef Sipek· Mar 6, 2007, 03:47 UTC · re: Nur Hussein · lore

Re: [PATCH 1/1] Guilt: Added an uninstall target - uninstall in git?

On Tue, Mar 06, 2007 at 11:31:09AM +0800, Nur Hussein wrote:
> Invoking make uninstall will remove guilt files from installed directory.
 
I glanced at git to see what it does with respect to uninstall, and unless I
completely missed it, it just doesn't support it. Is there any reason for
that? Maybe a similar patch to git would be in order?

And yes, I do understand that once you install git, there's no way you'd want to uninstall it :)

Josef "Jeff" Sipek.
-- 
The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all progress
depends on the unreasonable man.
		- George Bernard Shaw

← back to recent threads