ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Brian Hunt <brianmhunt@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Build for Alpine Linux
Date: Wed, 11 Apr 2018 12:30:28 +0000	[thread overview]
Message-ID: <CA+Zb4MztJCvGSXE1tKRujZhmrLEiW4PjSvC0Tc2ej6H1Zux2Mw@mail.gmail.com> (raw)
In-Reply-To: <20180410205530.GD3878032@phare.normalesup.org>


[-- Attachment #1.1: Type: text/plain, Size: 3668 bytes --]

> That’s what I was saying.  But you seemed to imply that grep -F 'musl'
> was preferable to grep -E '^musl' from a portability and robustness
> point of view.

Sorry if I was unclear; `grep -F` is preferable to `fgrep` since the latter
is less portable, and `grep -F` may be preferable to `-E` because it avoids
the undesirable zsh expansion.

> > The -q is superfluous with the >/dev/null, and should be removed;
> > incidentally though, is it not harmless in this case?
>  It is not.  In Thomas’ case, using grep >/dev/null would have avoided
> a 0 exit status and thus prevented his system from being erroneously
> detected as supporting musl.

I may have misunderstood Thomas' case, where zsh expands ^musl to all
filenames not containing `musl`. For convenience, here's the sample we were
discussing, which would be a different case:

if command -v ldd >/dev/null && ldd --version 2>&1 | grep -Fq 'musl' >
/dev/null

In this case there ought to be no expansion because there is no carat and
we use `grep -F`.

Generally speaking `grep -q` can have undesirable side-effects, but I
cannot see how such would occur in this case since all the input to grep is
from the pipe, which barring a radically improbable interrupt should never
error.  I would be interested to know if I have misunderstood, though.

On Tue, 10 Apr 2018 at 16:56 Arthur Reutenauer <
arthur.reutenauer@normalesup.org> wrote:

> On Tue, Apr 10, 2018 at 11:05:12AM +0000, Brian Hunt wrote:
> >>  The caret in itself was not the problem, only that it was not escaped
> >> for the shell.  Testing a regexp, with -E of course, is just as robust,
> >> and allows us to be more specific about what we test.
> >
> > Either is fine I am sure
>
>   That’s what I was saying.  But you seemed to imply that grep -F 'musl'
> was preferable to grep -E '^musl' from a portability and robustness
> point of view.
>
> >>  grep -E '^musl' works just as well; and as I explained, -q may return 0
> >> even if there are errors, so should be avoided.
> >
> > The -q is superfluous with the >/dev/null, and should be removed;
> > incidentally though, is it not harmless in this case?
>
>   It is not.  In Thomas’ case, using grep >/dev/null would have avoided
> a 0 exit status and thus prevented his system from being erroneously
> detected as supporting musl.
>
>         Best,
>
>                 Arthur
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________

-- 

*from the personal account of:*

*Brian M Hunt *<brianmhunt@gmail.com>
Direct: +1-289-684-4677
LinkedIn: https://linkedin.com/in/brianmhunt

*This e-mail may contain information that is private, privileged,
confidential and/or exempt from disclosure. Except as per this notice no
waiver of any kind is intended by sending this e-mail, and this email is
intended only for the named recipient(s) or the subscribers of a forwarding
service the email is sent directly to and to which service you are an
authorized recipient. Use, dissemination or copying without authorization
is prohibited. Please notify the sender and destroy all copies of this
e-mail if you have received this email in error.*

[-- Attachment #1.2: Type: text/html, Size: 6201 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2018-04-11 12:30 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-07 21:04 double followtokens? Pablo Rodriguez
2018-04-07 21:25 ` Hans Hagen
2018-04-07 22:11   ` Pablo Rodriguez
2018-04-08 14:41     ` Hans Hagen
2018-04-08 14:56       ` Build for Alpine Linux Brian Hunt
2018-04-08 20:50         ` Mojca Miklavec
2018-04-08 21:09           ` Arthur Reutenauer
2018-04-08 21:26           ` Henri Menke
2018-04-08 21:45             ` Arthur Reutenauer
2018-04-09  0:50           ` Henri Menke
2018-04-09 18:59             ` Brian Hunt
2018-04-09 19:35               ` Arthur Reutenauer
2018-04-10 11:05                 ` Brian Hunt
2018-04-10 12:26                   ` Brian Hunt
2018-04-10 16:27                   ` Alan Braslau
2018-04-10 20:55                   ` Arthur Reutenauer
2018-04-11 12:30                     ` Brian Hunt [this message]
2018-04-11 20:08                       ` Brian Hunt
2018-04-11 20:24                         ` Aditya Mahajan
2018-04-11 20:37                         ` Hans Hagen
2018-04-11 21:08                           ` Brian Hunt
2018-04-13 11:14                           ` Mojca Miklavec
2018-04-13 11:42                             ` Henri Menke
2018-04-13 19:54                               ` Henning Hraban Ramm
2018-04-13 20:02                                 ` Aditya Mahajan
2018-04-13 12:49                             ` Hans Hagen
2018-04-11 23:13                         ` Henri Menke
2018-04-13 10:37                           ` Brian Hunt
     [not found]                             ` <CALBOmsaXyTXhR=j6Ht1LwKGcfxMD4sHjQnEOxtjH-4gc3b5R8g@mail.gmail.com>
     [not found]                               ` <20180417152547.GA1755070@phare.normalesup.org>
2018-04-17 15:54                                 ` Thomas A. Schmitz
2018-04-08 18:10       ` double followtokens? Pablo Rodriguez
2018-04-08 21:17         ` Hans Hagen
2018-04-09 18:25           ` Pablo Rodriguez
2019-01-01 18:17       ` Hans van der Meer
2019-01-01 20:17         ` Hans Hagen

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+Zb4MztJCvGSXE1tKRujZhmrLEiW4PjSvC0Tc2ej6H1Zux2Mw@mail.gmail.com \
    --to=brianmhunt@gmail.com \
    --cc=ntg-context@ntg.nl \
    /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.
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 NNTP newsgroup(s).