Skip to content

Commit 998c4da

Browse files
author
Junio C Hamano
committed
Work around sed and make interactions on the backslash at the end of line.
Traditionally 'i' and 'a' commands to sed have been unfriendly with make, primarily because different make implementations did unexpected things to backslashes at the end of lines. So work it around by not using 'i' command. Signed-off-by: Junio C Hamano <[email protected]>
1 parent c7a30e5 commit 998c4da

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,13 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/Makefile
550550
$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
551551
rm -f $@ $@+
552552
INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \
553-
sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|1' \
554-
-e '2i\
555-
use lib (split(/:/, $$ENV{GITPERLLIB} || '\'"$$INSTLIBDIR"\''));' \
553+
sed -e '1{' \
554+
-e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \
555+
-e ' h' \
556+
-e ' s=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || "@@INSTLIBDIR@@"));=' \
557+
-e ' H' \
558+
-e ' x' \
559+
-e '}' \
556560
-e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
557561
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
558562
$@.perl >$@+

0 commit comments

Comments
 (0)