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

2 messages from 2007-03-06 to 2007-03-06. Participants: Nur Hussein, Josef Sipek.
Thread: https://gitlist.dev/t/7100

## Nur Hussein, 2007-03-06 03:31

Subject: [PATCH 1/1] Guilt: Added an uninstall target
Message-ID: <1173151869.4877.15.camel@gandalf.dcc.usm.my>
URL: https://gitlist.dev/e/1173151869.4877.15.camel%40gandalf.dcc.usm.my

```
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(-)

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, 2007-03-06 03:47

Subject: Re: [PATCH 1/1] Guilt: Added an uninstall target - uninstall in git?
Message-ID: <20070306034755.GA15701@filer.fsl.cs.sunysb.edu>
URL: https://gitlist.dev/e/20070306034755.GA15701%40filer.fsl.cs.sunysb.edu
In-Reply-To: <1173151869.4877.15.camel@gandalf.dcc.usm.my>

```
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

```
