From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Unbreak `make install' in leim/ when leim's ${INSTALLDIR} doesn't exist Date: Thu, 12 Oct 2006 14:52:26 +0200 Message-ID: <85odshn1bp.fsf@lola.goethe.zz> References: <549c434ebfb50d1a4ca2.1160608974@gothmog.pc> <20061012123556.GA89997@gothmog.pc> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1160657685 3345 80.91.229.2 (12 Oct 2006 12:54:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 12 Oct 2006 12:54:45 +0000 (UTC) Cc: emacs-devel@gnu.org, Kenichi Handa Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 12 14:54:42 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GY04l-00065R-3D for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2006 14:54:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GY04j-0001d4-AK for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2006 08:54:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GY03k-00014r-Nd for emacs-devel@gnu.org; Thu, 12 Oct 2006 08:53:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GY03j-00014E-VR for emacs-devel@gnu.org; Thu, 12 Oct 2006 08:53:12 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GY03j-000141-Ku for emacs-devel@gnu.org; Thu, 12 Oct 2006 08:53:11 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GY0Bx-0007ug-Ku for emacs-devel@gnu.org; Thu, 12 Oct 2006 09:01:41 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1GY03i-0007ZZ-Lp; Thu, 12 Oct 2006 08:53:10 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id F34AC1CE169B; Thu, 12 Oct 2006 14:52:26 +0200 (CEST) Original-To: Giorgos Keramidas In-Reply-To: <20061012123556.GA89997@gothmog.pc> (Giorgos Keramidas's message of "Thu\, 12 Oct 2006 15\:35\:56 +0300") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:60658 Archived-At: Giorgos Keramidas writes: > I just pulled the changes from CVS. > > It seems to include this part: > > + if [ ! -d ${INSTALLDIR} ] ; then \ > + ${srcdir}/${dot}${dot}/mkinstalldirs ${INSTALLDIR}; \ > + else true; fi > > We don't really *need* to have an else branch in all statements. We can > write this as: > > + if [ ! -d ${INSTALLDIR} ] ; then \ > + ${srcdir}/${dot}${dot}/mkinstalldirs ${INSTALLDIR}; \ > + fi This disagrees with (info "(autoconf) Limitations of Builtins") `if' [...] There are shells that do not reset the exit status from an `if': $ if (exit 42); then true; fi; echo $? 42 whereas a proper shell should have printed `0'. This is especially bad in Makefiles since it produces false failures. This is why properly written Makefiles, such as Automake's, have such hairy constructs: if test -f "$file"; then install "$file" "$dest" else : fi Note that you can often use `||' instead of `if', then this is not as ugly. Also note that `:' may actually more portable than `true' according to the same source: `true' Don't worry: as far as we know `true' is portable. Nevertheless, it's not always a builtin (e.g., Bash 1.x), and the portable shell community tends to prefer using `:'. This has a funny side effect: when asked whether `false' is more portable than `true' Alexandre Oliva answered: In a sense, yes, because if it doesn't exist, the shell will produce an exit status of failure, which is correct for `false', but not for `true'. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum