@matheusbsbs / matheus-bagliano / commits / 6edd14968b
Fork 0

Makefile: keep "git" when bindir is execdir

For some reason there still are people who use the old style layout to put everything in $(bindir). The previous commit breaks the install for them, because it tries to unconditionally remove git from execdir and cp/ln from bindir --- oops. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jul 10, 2009 at 20:17 UTC 6edd14968bf969a651d057ea7fb7757393d282bf
1 file changed +3 -2
Makefile
+3 -2
@@ -1641,10 +1641,11 @@ ifneq (,$X)
1641 endif
1642 bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
1643 execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
1644 - { $(RM) "$$execdir/git$X" && \
1644 + { test "$$bindir/" = "$$execdir/" || \
1645 + { $(RM) "$$execdir/git$X" && \
1646 test -z "$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
1647 ln "$$bindir/git$X" "$$execdir/git$X" 2>/dev/null || \
1647 - cp "$$bindir/git$X" "$$execdir/git$X"; } && \
1648 + cp "$$bindir/git$X" "$$execdir/git$X"; } ; } && \
1649 { for p in $(BUILT_INS); do \
1650 $(RM) "$$execdir/$$p" && \
1651 ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \