git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: sed: command garbled: rGIT-PERL-HEADER

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 18, 2018, 17:49 UTC
Message-ID
<xmqqtvowjuxp.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAH8yC8nef0iPVLqnkcJ2fh=N8jCM=tK1DXJJe+nx8cOL8K9D6A@mail.gmail.com>
Jeffrey Walton <noloader@gmail.com> writes:
Show 24 quoted lines
> I'm trying to build Git 2.18 on Solaris 11.3 x86_64.
>
> $ gmake V=1
> rm -f git-add--interactive git-add--interactive+ && \
> sed -e '1{' \
>     -e '        s|#!.*perl|#!/usr/bin/perl|' \
>     -e '        rGIT-PERL-HEADER' \
>     -e '        G' \
>     -e '}' \
>     -e 's/@@GIT_VERSION@@/2.18.0/g' \
>     git-add--interactive.perl >git-add--interactive+ && \
> chmod +x git-add--interactive+ && \
> mv git-add--interactive+ git-add--interactive
> sed: command garbled:   rGIT-PERL-HEADER
> gmake: *** [git-add--interactive] Error 2
>
> And:
>
> $ perl --version
>
> This is perl 5, version 12, subversion 5 (v5.12.5) built for i86pc-solaris-64int
> (with 7 registered patches, see perl -V for more detail)
>
> Any ideas how to fix it?

The fix is prepared to become part of the next feature release (and also some maintenance release before that happens). Please try the attached patch.

Thanks.
-- >8 --
From: Alejandro R. Sedeño <asedeno@mit.edu>
Date: Mon, 25 Jun 2018 15:13:25 -0400
Subject: [PATCH] Makefile: tweak sed invocation

With GNU sed, the r command doesn't care if a space separates it and the filename it reads from.

With SunOS sed, the space is required.
Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 2ba24035f5..50138e85eb 100644
--- a/Makefile
+++ b/Makefile
@@ -2086,7 +2086,7 @@ $(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE
 	$(QUIET_GEN)$(RM) $@ $@+ && \
 	sed -e '1{' \
 	    -e '	s|#!.*perl|#!$(PERL_PATH_SQ)|' \
-	    -e '	rGIT-PERL-HEADER' \
+	    -e '	r GIT-PERL-HEADER' \
 	    -e '	G' \
 	    -e '}' \
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-- 
2.18.0-129-ge3331758f1
Previous: Jeffrey WaltonNext: Jeffrey Walton
Message 2 of 4 in “sed: command garbled: rGIT-PERL-HEADER”
  1. Jeffrey WaltonJul 18, 2018
  2. Junio C HamanoJul 18, 2018
  3. Jeffrey WaltonJul 18, 2018
  4. Jeffrey WaltonJul 18, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.