threads / discuss / 48904

sed: command garbled: rGIT-PERL-HEADER

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

## tl;dr

4 messages between Jul 18, 2018 and Jul 18, 2018.

replies: 3people: 2as markdown or json

Jeffrey Walton· Jul 18, 2018, 11:53 UTC · lore
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?
Thanks in advance.
Junio C Hamano· Jul 18, 2018, 17:49 UTC · re: Jeffrey Walton · lore

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

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
Jeffrey Walton· Jul 18, 2018, 18:47 UTC · re: Junio C Hamano · lore

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

On Wed, Jul 18, 2018 at 1:49 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
> Jeffrey Walton <noloader@gmail.com> writes:
> ...
> 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' \
Thanks, that tested good.
Here's another one for FreeBSD 11 x86_64. LDLIBS includes -pthread.
$ cat ~/git-freebsd.txt
    LINK git-credential-store
/usr/local/bin/ld: libgit.a(name-hash.o): undefined reference to
symbol 'pthread_create@@FBSD_1.0'
//lib/libthr.so.3: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
gmake: *** [Makefile:2329: git-credential-store] Error 1
Jeff
Jeffrey Walton· Jul 18, 2018, 19:12 UTC · re: Jeffrey Walton · lore

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

On Wed, Jul 18, 2018 at 2:47 PM, Jeffrey Walton <noloader@gmail.com> wrote:
Show 28 quoted lines
> On Wed, Jul 18, 2018 at 1:49 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Jeffrey Walton <noloader@gmail.com> writes:
>> ...
>> 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' \
>
> Thanks, that tested good.
>
> Here's another one for FreeBSD 11 x86_64. LDLIBS includes -pthread.
>
> $ cat ~/git-freebsd.txt
>     LINK git-credential-store
> /usr/local/bin/ld: libgit.a(name-hash.o): undefined reference to
> symbol 'pthread_create@@FBSD_1.0'
> //lib/libthr.so.3: error adding symbols: DSO missing from command line
> collect2: error: ld returned 1 exit status
> gmake: *** [Makefile:2329: git-credential-store] Error 1
I was able to clear this one with sed (trailing space is important):
    sed -e 's|$(LIB_FILE) |$(LIB_FILE) -lpthread |g' "$file.orig"
But I don't know how to fix the missing recipe:
    $ gmake
    gmake: *** No rule to make target 'git-daemon', needed by 'all'.  Stop.
Jeff

← back to recent threads