git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6/6] Always provide a fallback when hardlinks fail
@ 2008-08-17  9:00 Andreas Färber
  2008-08-17 11:03 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Färber @ 2008-08-17  9:00 UTC (permalink / raw)
  To: git, gitster

BFS does not support hardlinks, so suppress the resulting error  
messages.

Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
Acked-by: Ingo Weinhold <ingo_weinhold@gmx.de>
Acked-by: Scott McCreary <scottmc2@gmail.com>
---
In one place cp was already used as fallback, so I went that route.
Personally I would also be okay with symlinks as alternative.

  Makefile |    6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 3daf9ac..7dc4bbd 100644
--- a/Makefile
+++ b/Makefile
@@ -1106,7 +1106,7 @@ help.o: help.c common-cmds.h GIT-CFLAGS
  		'-DGIT_INFO_PATH="$(infodir_SQ)"' $<

  $(BUILT_INS): git$X
-	$(QUIET_BUILT_IN)$(RM) $@ && ln git$X $@
+	$(QUIET_BUILT_IN)$(RM) $@ && ln git$X $@ 2>/dev/null || cp git$X $@

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

@@ -1373,10 +1373,10 @@ endif
  	execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
  	if test "z$$bindir" != "z$$execdir"; \
  	then \
-		ln -f "$$bindir/git$X" "$$execdir/git$X" || \
+		ln -f "$$bindir/git$X" "$$execdir/git$X" 2>/dev/null || \
  		cp "$$bindir/git$X" "$$execdir/git$X"; \
  	fi && \
-	{ $(foreach p,$(BUILT_INS), $(RM) "$$execdir/$p" && ln "$$execdir/git 
$X" "$$execdir/$p" ;) } && \
+	{ $(foreach p,$(BUILT_INS), $(RM) "$$execdir/$p" && ln "$$execdir/git 
$X" "$$execdir/$p" 2>/dev/null || cp "$$execdir/git$X" "$$execdir/ 
$p" ;) } && \
  	if test "z$$bindir" != "z$$execdir"; \
  	then \
  		$(RM) "$$execdir/git$X"; \
-- 
1.6.0.rc3.32.g8aaa

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-08-25 21:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-17  9:00 [PATCH 6/6] Always provide a fallback when hardlinks fail Andreas Färber
2008-08-17 11:03 ` Junio C Hamano
2008-08-17 12:14   ` Andreas Färber
2008-08-17 17:51     ` Junio C Hamano
2008-08-25 15:42   ` [PATCH] Makefile: always " Andreas Färber
2008-08-25 21:36     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).