[PATCH] Install built-ins as symlinks

From: Alp Toker <alp@atoker.com>
Date: 2006-07-11 20:19:38
Doing this now will save headache in the long run, avoiding mismatched
versions of installed utilities and dangling copies of removed or
renamed git commands that still appear to work. It also makes screwups
when packaging git or making system backups less likely.

BusyBox has been doing it this way for years.

Signed-off-by: Alp Toker <alp@atoker.com>
---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 5b7bac8..cb5a5cc 100644
--- a/Makefile
+++ b/Makefile
@@ -538,7 +538,7 @@ git$X: git.c common-cmds.h $(BUILTIN_OBJ
 builtin-help.o: common-cmds.h
 
 $(BUILT_INS): git$X
-	rm -f $@ && ln git$X $@
+	ln -sf git$X $@
 
 common-cmds.h: Documentation/git-*.txt
 	./generate-cmdlist.sh > $@+
@@ -748,7 +748,7 @@ install: all
 		cp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \
 			'$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \
 	fi
-	$(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
+	$(foreach p,$(BUILT_INS), ln -sf 'git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
 
 install-doc:
 	$(MAKE) -C Documentation install
-- 
1.4.1.g97c7-dirty

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Tue Jul 11 20:20:22 2006

This archive was generated by hypermail 2.1.8 : 2006-07-11 20:28:19 EST