From owner-svn-src-head@FreeBSD.ORG Fri Sep 14 22:36:36 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FA7A1065672; Fri, 14 Sep 2012 22:36:36 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id 976968FC12; Fri, 14 Sep 2012 22:36:35 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id F33FF12013D; Sat, 15 Sep 2012 00:36:31 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id DB7E22847B; Sat, 15 Sep 2012 00:36:31 +0200 (CEST) Date: Sat, 15 Sep 2012 00:36:31 +0200 From: Jilles Tjoelker To: "Simon J. Gerraty" Message-ID: <20120914223631.GD13027@stack.nl> References: <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> <20120821053519.BD5A158085@chaos.jnpr.net> <20120821222943.GA27203@stack.nl> <20120821232553.35D4F58085@chaos.jnpr.net> <20120822223002.GA41104@stack.nl> <20120823003603.9B58458088@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120823003603.9B58458088@chaos.jnpr.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ruslan Ermilov , "David E. O'Brien" Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2012 22:36:36 -0000 On Wed, Aug 22, 2012 at 05:36:03PM -0700, Simon J. Gerraty wrote: > > On Thu, 23 Aug 2012 00:30:02 +0200, Jilles Tjoelker writes: > >I think the most important reason is to reduce special cases. The POSIX > >developers did not want to create a second subset of utilities that are > >not available via execve() (the first subset is the special builtins). > >The burden on implementations is very low (see src/usr.bin/alias), and > >there are some possible use cases: > The burden may be low, but so is the functionality ;-) > 'cd' makes little sense in a child process. > >'cd' will fail if the directory does not exist. > so will 'test -d', and without giving the false impression that > something useful will result if the directory does exist. > >If it avoids the need to add semicolons for mysterious reasons, that may > >be enough reason. > I think everyone agrees that re-writing the target to remove the > spurious 'cd' would have been better. > That aside, I would disagree, at least for the case of 'cd'. > It is only the fact that there is probably no way to construct a harmful > example that did not involve a shell meta char (hence rendering the > existance of /usr/bin/cd irrelevant). 'cd /tmp/dir && rm -rf *' > would be rather dangerous if the && (or ;) didn't trigger use of a > shell, and since as previously noted just 'cd /tmp/dir' is pretty > pointless, the functionality is very low. > In over 25 years of writing makefiles, I don't recall seeing this before. OK, but then you should document the conditions when shell builtins are or are not allowed. POSIX make command lines are executed as if by the shell, and if the make implementation wants to optimize by not executing sh for every command line, the burden is on it to make it behave the same. The bmake (NetBSD make) man page gives the same impression. It does not mention the optimization of bypassing the shell at all. The FreeBSD make man page mentions the optimization implicitly when it describes the meta and builtins keys of the .SHELL special target but still gives the impression that these are correct (which they mostly are, but not entirely). -- Jilles Tjoelker