From: Eric Sunshine <sunshine@sunshineco.com>
To: Jeffrey Walton <noloader@gmail.com>
Cc: "Git List" <git@vger.kernel.org>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: Re: Solaris and sed: Too many commands, last: s/\n//
Date: Mon, 11 Mar 2019 22:45:42 -0400 [thread overview]
Message-ID: <20190312024542.GA7411@flurp.local> (raw)
In-Reply-To: <CAH8yC8kD3XkYP2o6k3ioCcNB_+wwQ=H2=V03z7Han1K8t2aUsg@mail.gmail.com>
On Mon, Mar 11, 2019 at 10:11:41PM -0400, Jeffrey Walton wrote:
> On Mon, Mar 11, 2019 at 9:55 PM Jeffrey Walton <noloader@gmail.com> wrote:
> > Oh man, you're using GNU make. I thought Git was using that anemic
> > Posix Make. See attached.
> >
> > I think Solaris provides an older gawk. Is this an easier problem:
> >
> > awk: chainlint.sed:88: :squash
> > awk: chainlint.sed:88: ^ syntax error
> > awk: chainlint.sed:91: s/\\\n//
> > awk: chainlint.sed:91: ^ backslash not last character on line
> > Usage: awk [POSIX or GNU style options] -f progfile [--] file ...
> > Usage: awk [POSIX or GNU style options] [--] 'program' file ...
>
> My bad , there was a typo... 'awk' got assigned to SED variable.
>
> This patch works as expected.
>
> diff --git a/t/Makefile b/t/Makefile
> @@ -11,11 +11,25 @@ SHELL_PATH ?= $(SHELL)
> TAR ?= $(TAR)
> +AWK ?= $(AWK)
> +SED ?= $(SED)
> +GREP ?= $(GREP)
>
> +# Fix Solaris tools. These are Posix. GNU tools located at /usr/gnu/bin.
> +ifneq ($(wildcard /usr/gnu/bin/grep),)
> + GREP := /usr/gnu/bin/grep
> +endif
> +ifneq ($(wildcard /usr/gnu/bin/sed),)
> + SED := /usr/gnu/bin/sed
> +endif
> +ifneq ($(wildcard /usr/gnu/bin/awk),)
> + SED := /usr/gnu/bin/awk
> +endif
I think the last assignment ought to be "AWK := ...".
Anyhow, this sort of platform-specific tool customization is typically done by config.mak.uname in the top-level Git directory. In fact, there's already a section for SunOS:
ifeq ($(uname_S),SunOS)
...
SANE_TOOL_PATH = /usr/xpg6/bin:/usr/xpg4/bin
...
Prepending /usr/gnu/bin to SANE_TOOL_PATH might be a good idea as a first step toward fixing the problem you're seeing on Solaris, however, as Ævar mentioned in [1], SANE_TOOL_PATH isn't presently consulted when running tests. But, as he suggested, fixing the tests to respect SANE_TOOL_PATH might be a good solution overall.
So, rather than making platform-specific customizations to t/Makefile, an arguably better solution would be to update config.mak.uname to add /usr/gnu/bin to SANE_TOOL_PATH and then update the test system to respect that value (thus, these GREP, SED, AWK specializations can be avoided).
[1]: http://public-inbox.org/git/877ek0rymz.fsf@evledraar.gmail.com/
next prev parent reply other threads:[~2019-03-12 2:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-11 20:31 Solaris and sed: Too many commands, last: s/\n// Jeffrey Walton
2019-03-11 21:15 ` Eric Sunshine
2019-03-11 21:43 ` Jeffrey Walton
2019-03-11 22:28 ` Eric Sunshine
2019-03-12 1:07 ` Jeffrey Walton
2019-03-12 1:55 ` Jeffrey Walton
2019-03-12 2:11 ` Jeffrey Walton
2019-03-12 2:19 ` Jeffrey Walton
2019-03-12 2:45 ` Eric Sunshine [this message]
2019-03-12 3:57 ` Jeffrey Walton
2019-03-11 23:52 ` Jeffrey Walton
2019-03-12 0:18 ` Jeffrey Walton
2019-03-12 9:08 ` Ævar Arnfjörð Bjarmason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190312024542.GA7411@flurp.local \
--to=sunshine@sunshineco.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=noloader@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).