Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Nov 2023 12:59:41 -0500
From:      "Jonathan T. Looney" <jtl@freebsd.org>
To:        Warner Losh <imp@bsdimp.com>, Jessica Clarke <jrtc27@freebsd.org>
Cc:        "src-committers@freebsd.org" <src-committers@freebsd.org>,  "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org>,  "dev-commits-src-main@freebsd.org" <dev-commits-src-main@freebsd.org>
Subject:   Re: git: accfb4cc9346 - main - genoffset.sh: stop using a temporary file
Message-ID:  <CADrOrmvTx=nK3ZSbDByBDfyD3KwidjoCUPPOn=9TkAJEXnk9Cw@mail.gmail.com>
In-Reply-To: <CANCZdfr9G_jttwu8G85%2Bvcodf6SNnmt7WPhp8-M10vDrEroP2A@mail.gmail.com>
References:  <202311161507.3AGF7kgx070201@gitrepo.freebsd.org> <39921E4A-4C15-4D8F-BA9F-D0C53AD62CD1@freebsd.org> <CANCZdfr9G_jttwu8G85%2Bvcodf6SNnmt7WPhp8-M10vDrEroP2A@mail.gmail.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Thu, Nov 16, 2023 at 11:23 AM Warner Losh <imp@bsdimp.com> wrote:

>
>
> On Thu, Nov 16, 2023 at 9:07 AM Jessica Clarke <jrtc27@freebsd.org> wrote:
>
>> On 16 Nov 2023, at 15:07, Jonathan T. Looney <jtl@FreeBSD.org> wrote:
>>
>> > -    cat "$temp/asserts"
>> > +    echo -e "${asserts}\c"
>>
>> This isn’t POSIX, and isn’t supported by macOS’s sh, so breaks the
>> build there. Please fix or revert promptly.
>>
>
> echo "${asserts}"
>
> is semantically the same for C. A stray newline doesn't matter in this
> context. It's not worth the effort to remove it.
>
> Sadly, echo -n doesn't work (it's not posix, and posix defines it
> specifically as implementation defined). `echo "fred\c"' works on macos,
> but not FreeBSD's shell echo built-in (but somehow does for /bin/echo).
> macos doesn't implement -e at all (it's also not posix). FreeBSD's shell
> echo build-in is not posix compliant. So, to be portable, just echo it, and
> cope with the extra newline.
>
> That's what I'd do :)
>

Thanks for the report and suggestions. I've committed a fix
in 884eeff20ce9. Please let me know if there are further concerns which I
should address.

Jonathan

[-- Attachment #2 --]
<div dir="ltr"><div dir="ltr">On Thu, Nov 16, 2023 at 11:23 AM Warner Losh &lt;<a href="mailto:imp@bsdimp.com">imp@bsdimp.com</a>&gt; wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 16, 2023 at 9:07 AM Jessica Clarke &lt;<a href="mailto:jrtc27@freebsd.org" target="_blank">jrtc27@freebsd.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 16 Nov 2023, at 15:07, Jonathan T. Looney &lt;jtl@FreeBSD.org&gt; wrote:<br><br>
&gt; -    cat &quot;$temp/asserts&quot;<br>
&gt; +    echo -e &quot;${asserts}\c&quot;<br>
<br>
This isn’t POSIX, and isn’t supported by macOS’s sh, so breaks the<br>
build there. Please fix or revert promptly.<br></blockquote><div><br></div><div>echo &quot;${asserts}&quot;</div><div><br></div><div>is semantically the same for C. A stray newline doesn&#39;t matter in this context. It&#39;s not worth the effort to remove it.</div><div><br></div><div>Sadly, echo -n doesn&#39;t work (it&#39;s not posix, and posix defines it specifically as implementation defined). `echo &quot;fred\c&quot;&#39; works on macos, but not FreeBSD&#39;s shell echo built-in (but somehow does for /bin/echo). macos doesn&#39;t implement -e at all (it&#39;s also not posix). FreeBSD&#39;s shell echo build-in is not posix compliant. So, to be portable, just echo it, and cope with the extra newline.</div><div><br></div><div>That&#39;s what I&#39;d do :)</div></div></div></blockquote><div><br>Thanks for the report and suggestions. I&#39;ve committed a fix in 884eeff20ce9. Please let me know if there are further concerns which I should address.</div><div><br></div><div>Jonathan </div></div></div>
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADrOrmvTx=nK3ZSbDByBDfyD3KwidjoCUPPOn=9TkAJEXnk9Cw>