From owner-cvs-src@FreeBSD.ORG Tue Jun 3 02:46:46 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2EA3106564A; Tue, 3 Jun 2008 02:46:45 +0000 (UTC) (envelope-from marcus@marcuscom.com) Received: from creme-brulee.marcuscom.com (unknown [IPv6:2001:470:1f00:ffff::1279]) by mx1.freebsd.org (Postfix) with ESMTP id A65EA8FC26; Tue, 3 Jun 2008 02:46:45 +0000 (UTC) (envelope-from marcus@marcuscom.com) Received: from [IPv6:2001:470:1f00:2464::4] (shumai.marcuscom.com [IPv6:2001:470:1f00:2464::4]) by creme-brulee.marcuscom.com (8.14.2/8.14.2) with ESMTP id m532lgJG055741; Mon, 2 Jun 2008 22:47:43 -0400 (EDT) (envelope-from marcus@marcuscom.com) From: Joe Marcus Clarke To: "M. Warner Losh" In-Reply-To: <20080602.204014.-222576415.imp@bsdimp.com> References: <200806021445.15974.jhb@freebsd.org> <1212439968.3115.53.camel@localhost> <1212440845.18384.49.camel@shumai.marcuscom.com> <20080602.204014.-222576415.imp@bsdimp.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-FvKrS+58KSxenrRZgnYV" Organization: MarcusCom, Inc. Date: Mon, 02 Jun 2008 22:46:54 -0400 Message-Id: <1212461214.18384.83.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 FreeBSD GNOME Team Port X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on creme-brulee.marcuscom.com Cc: src-committers@FreeBSD.org, jhb@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org, stefanf@FreeBSD.org, cokane@FreeBSD.org Subject: Re: cvs commit: src/bin/sh expand.c parser.c parser.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2008 02:46:46 -0000 --=-FvKrS+58KSxenrRZgnYV Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2008-06-02 at 20:40 -0600, M. Warner Losh wrote: > In message: <1212440845.18384.49.camel@shumai.marcuscom.com> > Joe Marcus Clarke writes: > : On Mon, 2008-06-02 at 16:52 -0400, Coleman Kane wrote: > : > On Mon, 2008-06-02 at 14:45 -0400, John Baldwin wrote: > : > > On Thursday 15 May 2008 03:55:27 pm Stefan Farfeleder wrote: > : > > > stefanf 2008-05-15 19:55:27 UTC > : > > >=20 > : > > > FreeBSD src repository > : > > >=20 > : > > > Modified files: > : > > > bin/sh expand.c parser.c parser.h=20 > : > > > Log: > : > > > Expand $LINENO to the current line number. This is required by= =20 > : > > SUSv3's "User > : > > > Portability Utilities" option. > : > > > =20 > : > > > Often configure scripts generated by the autotools test if $LIN= ENO works=20 > : > > and > : > > > refuse to use /bin/sh if not. > : > > > =20 > : > > > Package test run by: pav > : > >=20 > : > > This breaks the build of editors/openoffice-2 > : > >=20 > : > > Specifically, the libxslt configure script has two statements like = this: > : > >=20 > : > > if test "1" =3D=3D "1" > : > > then > : > > blah blah > : > > endif > : > >=20 > : > > Specifically note the "=3D=3D" passed to test(1). POSIX says this = should be "=3D",=20 > : > > and that's all our test(1) implements. The bash manpage for the bu= iltin-test=20 > : > > command says: > : > >=20 > : > > string1 =3D=3D string2 > : > > True if the strings are equal. =3D may be used in pl= ace of =3D=3D for > : > > strict POSIX compliance. > : > >=20 > : > > IOW, it encourages "=3D=3D". I'm not sure if we want to force the = use of bash for=20 > : > > certain ports or if we want to just implement bash'isms in our tool= s as we=20 > : > > encounter them (or patch the port?). In this case the patch is not= =20 > : > > complicated (just replace the two '=3D=3D' with '=3D' in libxslt's = configure=20 > : > > script). > : > >=20 > : >=20 > : > This is annoying... I had to clean this behavior up once recently in > : > someone else's script. POSIX "test" syntax has been "=3D" and not "= =3D=3D" for > : > a long time. Bash is not C... so I don't understand why the attempt t= o > : > document "=3D=3D" as the "proper" operator. My thinking is the offend= ing > : > script should be fixed with a patch that gets forwarded upstream to t= he > : > libxslt team (including a mention that /bin/sh and /bin/test are not > : > documented to support "=3D=3D" by POSIX). > :=20 > : This is one of the most pervasive bashisms around. We (gnome@) > : typically fix the script to use "=3D" then forward the information > : upstream. Solaris is also bit by this, so it's usually not a big deal > : to get upstream vendors to fix their scripts. >=20 > Maybe a 'grep =3D=3D' on all configure scripts should be SOP, eh? This will yield false positives as many (all?) contain embedded C code. We have been using one regexp that seems to work nicely: " =3D=3D ". For example: @${FIND} ${WRKSRC} -name Makefile.in | ${XARGS} ${REINPLACE_CMD} -e \ 's|" =3D=3D "|" =3D "|g' You don't typically find '"' on either side of a =3D=3D in C. Joe --=20 PGP Key : http://www.marcuscom.com/pgp.asc --=-FvKrS+58KSxenrRZgnYV Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkhEsJ4ACgkQb2iPiv4Uz4d8jACgsD2dr9RWpyJLNYp4frrGVoMS aEUAoIQLIfCZLGKfN5vLAezHWBqhJ0r8 =6mSF -----END PGP SIGNATURE----- --=-FvKrS+58KSxenrRZgnYV--