From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/100522 Path: news.gmane.org!.POSTED!not-for-mail From: Brian Hunt Newsgroups: gmane.comp.tex.context Subject: Re: Build for Alpine Linux Date: Tue, 10 Apr 2018 11:05:12 +0000 Message-ID: References: <026e5b07-3364-2011-50bf-29a249fb41b7@xs4all.nl> <6a1d4148-1bb5-2633-d9e1-9859c05bb665@gmx.es> <1523235042.18581.29.camel@gmail.com> <20180409193518.GA2842220@phare.normalesup.org> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6517678669301871365==" X-Trace: blaine.gmane.org 1523358235 28617 195.159.176.226 (10 Apr 2018 11:03:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 10 Apr 2018 11:03:55 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Apr 10 13:03:51 2018 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f5r42-0007LB-QX for gctc-ntg-context-518@m.gmane.org; Tue, 10 Apr 2018 13:03:50 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 9C1C1625B55; Tue, 10 Apr 2018 13:05:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tKs7rjISVpv7; Tue, 10 Apr 2018 13:05:36 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id B50D8625B56; Tue, 10 Apr 2018 13:05:36 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id F1C7A625B56 for ; Tue, 10 Apr 2018 13:05:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TW_cfyyjgPRz for ; Tue, 10 Apr 2018 13:05:34 +0200 (CEST) Original-Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 77643625B55 for ; Tue, 10 Apr 2018 13:05:24 +0200 (CEST) Original-Received: by mail-wm0-f51.google.com with SMTP id u189so25228285wmd.1 for ; Tue, 10 Apr 2018 04:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=22fEu7oRx6MxO+mZpsDtlGWVEWmyO3O0wYuIgIhSG/I=; b=C6nSjk5mmhkooxZgMPFY0lHfvuETVD3qTgL7RFBT0441FqFeJLk8mX0hcXklJXvtaz EleZ79zb2qmEA8HRDEllB+iOWP4wJalQtEq//JbfpH0klBpSx0YGzaQtYFx5nZbMEZz0 03cQTxZHwNyY390Kio/Bwv1hVWSOvTiZ5RWeoXSQVDtNbs7JzBNG3C+8XQ+E48apEfTd WMm9LDRVrNpeW4Amx9QWbL+pqF1YAYjypa3A75Ez+adSb9JtYJK8JQPnor2mh8ZOIz65 sbtP4FSGiKzdXbr6wPPb2TYqRJN+jFqdgIz2Tzr69lFpni12focBtszTUHViVBbhmYHX xo4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=22fEu7oRx6MxO+mZpsDtlGWVEWmyO3O0wYuIgIhSG/I=; b=lPMLbZ4cLTkTgLctbsGbNomAJREVe8fX6zL/p/irP7/9molByS2VR6NIwWYwXkxSWA jKa5RXRuo+fjvsCPi8xlRppe5h9i+c5+46pvHf9McTkel2A0QbsTUvI/jjKcz0/rLheM vJoZf29BY5IS9Rcitsd+bskebeMotEcVxLhuhcd7BUL2ieRF7+Z8hqzUlbU8FyHBFpps v6mzAj7qx9GrLrp2Qe1R1Z/W5Si0AAs9lxWdpViJu9kC4FZ8Q4mezIhSQgHjAAOS7BRX fMretEro5QsMQ7zu/ICKJXj+zhbb+IozbqWGg+JAGqks7WVqIcziBe1qdHvMuyLgN/py gadg== X-Gm-Message-State: ALQs6tA36pQpe3juoKTPTbvl0sfwEIpnr0Ra8xcxJ43NgLy8YIMPTUqV bPCxvRz3rYMgHkr02JjzSi9XT8A8OEF5CEM14/8V7w== X-Google-Smtp-Source: AIpwx4/ZTvfFtvn/mE9AYSmIk6K8FTXW4Vz4wWQ19E4qqEccoiprH/kPHcPK6Cl2pLhX63cBf1zo9lB9YFqofs+Ocqo= X-Received: by 10.80.244.133 with SMTP id s5mr2578946edm.23.1523358323658; Tue, 10 Apr 2018 04:05:23 -0700 (PDT) In-Reply-To: <20180409193518.GA2842220@phare.normalesup.org> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:100522 Archived-At: --===============6517678669301871365== Content-Type: multipart/alternative; boundary="001a11484dc6bf64d005697c7f5c" --001a11484dc6bf64d005697c7f5c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > 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, but from a code maintenance and testing perspective I'd be more concerned about a regression or misinterpretation to an unescaped carat that breaks the detection on zsh (and perhaps elsewhere), as opposed to anticipating a hypothetical new or different standard C library that needs detection for an alternative build. > 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? Avoiding it is probably good measure for the reason mentioned (i.e. error on directories), but I'm not sure that such an error in grep is possible when piped from ldd, is it? I'm curious when such could occur. Cheers, Brian On Mon, 9 Apr 2018 at 15:35 Arthur Reutenauer < arthur.reutenauer@normalesup.org> wrote: > > A few notes: > > a.) On some platforms fgrep has been deprecated (in favour of `grep -F`= ) > so > > it's not future-proof > > I don=E2=80=99t think the aliases fgrep and egrep have ever been suppos= ed to > be portable. POSIX has grep -F and grep -E, and that=E2=80=99s what we s= hould > use. > > > b.) The caret (^) passed to `grep -F` will not be interpreted as a rege= x, > > since -F forces non-regexp, meaning the '^' will be interpreted literal= ly > > (and the string "^musl" is not in the ldd output). > > 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. > > > if command -v ldd >/dev/null && ldd --version 2>&1 | grep -Fq 'musl' > > /dev/null > > grep -E '^musl' works just as well; and as I explained, -q may return > 0 even if there are errors, so should be avoided. > > 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 > > _________________________________________________________________________= __________ --=20 *from the personal account of:* *Brian M Hunt * 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.* --001a11484dc6bf64d005697c7f5c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

>=C2=A0 The caret in itself was not the pr= oblem, only that it was not escaped
> for the shell.=C2=A0 Testing a re= gexp, with -E of course, is just as robust,
> and allows us to be more = specific about what we test.

Either is=C2=A0fine I am= sure, but from a code maintenance and testing perspective I'd be more = concerned about a regression or misinterpretation to an unescaped carat tha= t breaks the detection on zsh (and perhaps elsewhere), as opposed to antici= pating a hypothetical new or different standard C library that needs detect= ion for an alternative build.

=
>=C2=A0 grep -E '^musl' works just as well; and as I e= xplained, -q may return=C2=A00 e= ven 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?=C2=A0 Avoiding it i= s probably good measure for the reason mentioned (i.e. error on directories= ), but=C2=A0I'm not sure that such an error in grep is possible when pi= ped from ldd, is it?=C2=A0 I'm curious when such could occur.

Cheers,
Brian


On Mon, 9 Apr 2018 = at 15:35 Arthur Reutenauer <arthur.reutenauer@normalesup.org> wrote:
> A few notes:
> a.) On some platforms fgrep has been deprecated (in favour of `grep -F= `) so
> it's not future-proof

=C2=A0 I don=E2=80=99t think the aliases fgrep and egrep have ever been sup= posed to
be portable.=C2=A0 POSIX has grep -F and grep -E, and that=E2=80=99s what w= e should
use.

> b.) The caret (^) passed to `grep -F` will not be interpreted as a reg= ex,
> since -F forces non-regexp, meaning the '^' will be interprete= d literally
> (and the string "^musl" is not in the ldd output).

=C2=A0 The caret in itself was not the problem, only that it was not escape= d
for the shell.=C2=A0 Testing a regexp, with -E of course, is just as robust= ,
and allows us to be more specific about what we test.

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

=C2=A0 grep -E '^musl' works just as well; and as I explained, -q m= ay return
0 even if there are errors, so should be avoided.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 Best,

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Arthur
___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________
--

from the personal account of:

Brian M Hunt <brianmhunt@gmail.com>
Direct: += 1-289-684-4677
LinkedIn:=C2=A0https://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 subscri= bers of a forwarding service the email is sent directly to and to which ser= vice you are an authorized recipient. Use, dissemination or copying without= authorization is prohibited. Please notify the sender and destroy all copi= es of this e-mail if you have received this email in error.
<= /p>

--001a11484dc6bf64d005697c7f5c-- --===============6517678669301871365== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============6517678669301871365==--