Skip to content

Commit 014aff7

Browse files
committed
Merge branch 'af/maint-install-no-handlink' into maint
* af/maint-install-no-handlink: Fix use of hardlinks in "make install" Makefile: always provide a fallback when hardlinks fail
2 parents 6ffaecc + 4e3ae59 commit 014aff7

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,10 @@ help.o: help.c common-cmds.h GIT-CFLAGS
10981098
'-DGIT_INFO_PATH="$(infodir_SQ)"' $<
10991099

11001100
$(BUILT_INS): git$X
1101-
$(QUIET_BUILT_IN)$(RM) $@ && ln git$X $@
1101+
$(QUIET_BUILT_IN)$(RM) $@ && \
1102+
ln git$X $@ 2>/dev/null || \
1103+
ln -s git$X $@ 2>/dev/null || \
1104+
cp git$X $@
11021105

11031106
common-cmds.h: ./generate-cmdlist.sh command-list.txt
11041107

@@ -1357,16 +1360,13 @@ ifneq (,$X)
13571360
endif
13581361
bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
13591362
execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
1360-
if test "z$$bindir" != "z$$execdir"; \
1361-
then \
1362-
ln -f "$$bindir/git$X" "$$execdir/git$X" || \
1363-
cp "$$bindir/git$X" "$$execdir/git$X"; \
1364-
fi && \
1365-
{ $(foreach p,$(BUILT_INS), $(RM) "$$execdir/$p" && ln "$$execdir/git$X" "$$execdir/$p" ;) } && \
1366-
if test "z$$bindir" != "z$$execdir"; \
1367-
then \
1368-
$(RM) "$$execdir/git$X"; \
1369-
fi && \
1363+
{ $(RM) "$$execdir/git-add$X" && \
1364+
ln git-add$X "$$execdir/git-add$X" 2>/dev/null || \
1365+
cp git-add$X "$$execdir/git-add$X"; } && \
1366+
{ $(foreach p,$(filter-out git-add$X,$(BUILT_INS)), $(RM) "$$execdir/$p" && \
1367+
ln "$$execdir/git-add$X" "$$execdir/$p" 2>/dev/null || \
1368+
ln -s "git-add$X" "$$execdir/$p" 2>/dev/null || \
1369+
cp "$$execdir/git-add$X" "$$execdir/$p" || exit;) } && \
13701370
./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X"
13711371

13721372
install-doc:

0 commit comments

Comments
 (0)