From owner-cvs-src@FreeBSD.ORG Tue Jun 3 03:31:33 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 A7E08106566C; Tue, 3 Jun 2008 03:31:33 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 59E878FC1C; Tue, 3 Jun 2008 03:31:33 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m533V07V061561; Mon, 2 Jun 2008 21:31:00 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 02 Jun 2008 21:32:39 -0600 (MDT) Message-Id: <20080602.213239.-861051005.imp@bsdimp.com> To: marcus@marcuscom.com From: "M. Warner Losh" In-Reply-To: <1212461214.18384.83.camel@shumai.marcuscom.com> References: <1212440845.18384.49.camel@shumai.marcuscom.com> <20080602.204014.-222576415.imp@bsdimp.com> <1212461214.18384.83.camel@shumai.marcuscom.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 03:31:33 -0000 In message: <1212461214.18384.83.camel@shumai.marcuscom.com> Joe Marcus Clarke writes: : 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 : > : > > > : > : > > > FreeBSD src repository : > : > > > : > : > > > Modified files: : > : > > > bin/sh expand.c parser.c parser.h : > : > > > Log: : > : > > > Expand $LINENO to the current line number. This is required by : > : > > SUSv3's "User : > : > > > Portability Utilities" option. : > : > > > : > : > > > Often configure scripts generated by the autotools test if $LINENO works : > : > > and : > : > > > refuse to use /bin/sh if not. : > : > > > : > : > > > Package test run by: pav : > : > > : > : > > This breaks the build of editors/openoffice-2 : > : > > : > : > > Specifically, the libxslt configure script has two statements like this: : > : > > : > : > > if test "1" == "1" : > : > > then : > : > > blah blah : > : > > endif : > : > > : > : > > Specifically note the "==" passed to test(1). POSIX says this should be "=", : > : > > and that's all our test(1) implements. The bash manpage for the builtin-test : > : > > command says: : > : > > : > : > > string1 == string2 : > : > > True if the strings are equal. = may be used in place of == for : > : > > strict POSIX compliance. : > : > > : > : > > IOW, it encourages "==". I'm not sure if we want to force the use of bash for : > : > > certain ports or if we want to just implement bash'isms in our tools as we : > : > > encounter them (or patch the port?). In this case the patch is not : > : > > complicated (just replace the two '==' with '=' in libxslt's configure : > : > > script). : > : > > : > : > : > : > This is annoying... I had to clean this behavior up once recently in : > : > someone else's script. POSIX "test" syntax has been "=" and not "==" for : > : > a long time. Bash is not C... so I don't understand why the attempt to : > : > document "==" as the "proper" operator. My thinking is the offending : > : > script should be fixed with a patch that gets forwarded upstream to the : > : > libxslt team (including a mention that /bin/sh and /bin/test are not : > : > documented to support "==" by POSIX). : > : : > : This is one of the most pervasive bashisms around. We (gnome@) : > : typically fix the script to use "=" 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. : > : > Maybe a 'grep ==' 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: " == ". For : example: : : @${FIND} ${WRKSRC} -name Makefile.in | ${XARGS} ${REINPLACE_CMD} -e \ : 's|" == "|" = "|g' : : You don't typically find '"' on either side of a == in C. heh... Another option would be to add support for it to our test, maybe with a warning... :-) Warner