Subject: [PATCH] Fix cygwin install issues

From: Jonas Fonseca <[email-masked]>
Date: Mon, 10 Oct 2005 10:52:59 +0200

Support installing to paths including spaces.
Remove any old .exe files so ln will succeed.

Signed-off-by: Jonas Fonseca <[email-masked]>

---

diff --git a/Makefile b/Makefile
index ac384c7..9ae0dfd 100644
--- a/Makefile
+++ b/Makefile
@@ -397,13 +397,13 @@ check:
 ### Installation rules
 
 install: $(PROGRAMS) $(SCRIPTS)
-	$(INSTALL) -d -m755 $(DESTDIR)$(bindir)
-	$(INSTALL) $(PROGRAMS) $(SCRIPTS) $(DESTDIR)$(bindir)
-	$(INSTALL) git-revert $(DESTDIR)$(bindir)/git-cherry-pick
-	sh ./cmd-rename.sh $(DESTDIR)$(bindir)
+	$(INSTALL) -d -m755 "$(DESTDIR)$(bindir)"
+	$(INSTALL) $(PROGRAMS) $(SCRIPTS) "$(DESTDIR)$(bindir)"
+	$(INSTALL) git-revert "$(DESTDIR)$(bindir)/git-cherry-pick"
+	sh ./cmd-rename.sh "$(DESTDIR)$(bindir)" "$X"
 	$(MAKE) -C templates install
-	$(INSTALL) -d -m755 $(DESTDIR)$(GIT_PYTHON_DIR)
-	$(INSTALL) $(PYMODULES) $(DESTDIR)$(GIT_PYTHON_DIR)
+	$(INSTALL) -d -m755 "$(DESTDIR)$(GIT_PYTHON_DIR)"
+	$(INSTALL) $(PYMODULES) "$(DESTDIR)$(GIT_PYTHON_DIR)"
 
 install-doc:
 	$(MAKE) -C Documentation install
diff --git a/cmd-rename.sh b/cmd-rename.sh
index 34e7f49..c9d3171 100755
--- a/cmd-rename.sh
+++ b/cmd-rename.sh
@@ -1,9 +1,10 @@
 #!/bin/sh
 d="$1"
+X="$2"
 test -d "$d" || exit
 while read old new
 do
-	rm -f "$d/$old"
+	rm -f "$d/$old" "$d/$old$X"
 	if test -f "$d/$new"
 	then
 		ln -s "$new" "$d/$old" || exit
-- 
Jonas Fonseca