From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109561 invoked by alias); 29 Jan 2016 14:22:38 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 109545 invoked by uid 89); 29 Jan 2016 14:22:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=Hx-languages-length:1956, H*MI:sk:56AA787, H*i:sk:56AA787, H*f:sk:56AA787 X-HELO: out3-smtp.messagingengine.com Received: from out3-smtp.messagingengine.com (HELO out3-smtp.messagingengine.com) (66.111.4.27) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 29 Jan 2016 14:22:36 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 3696420A28 for ; Fri, 29 Jan 2016 09:22:34 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Fri, 29 Jan 2016 09:22:34 -0500 Received: from [192.168.1.102] (host86-179-113-236.range86-179.btcentralplus.com [86.179.113.236]) by mail.messagingengine.com (Postfix) with ESMTPA id DE4DBC0001B for ; Fri, 29 Jan 2016 09:22:33 -0500 (EST) Subject: Re: [PATCH setup 0/3] Setup replacement for incver_ifdep To: cygwin-apps@cygwin.com References: <87lhb8htrh.fsf@Rainer.invalid> <561FA783.900@dronecode.org.uk> <87oag0qad3.fsf@Rainer.invalid> <20151019154100.GB18989@calimero.vinschen.de> <87io62hiz6.fsf@Rainer.invalid> <20151020102150.GF5319@calimero.vinschen.de> <56532D34.4090102@dronecode.org.uk> <87bnakmtqc.fsf@Rainer.invalid> <56549774.2090008@dronecode.org.uk> <87ziy3utip.fsf@Rainer.invalid> <20151126101120.GA6674@calimero.vinschen.de> <56AA50E4.2040105@dronecode.org.uk> <56AA6128.8030700@cornell.edu> <56AA74BE.4010208@redhat.com> <56AA7755.8060801@cornell.edu> <56AA787A.9080503@redhat.com> From: Jon Turney Message-ID: <56AB75A4.6060101@dronecode.org.uk> Date: Fri, 29 Jan 2016 14:22:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56AA787A.9080503@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-01/txt/msg00052.txt.bz2 On 28/01/2016 20:22, Eric Blake wrote: > On 01/28/2016 01:17 PM, Ken Brown wrote: >>>> install-info $f /usr/share/info/dir || >>>> install-info --entry="* $$f ($f): $$f" $$f /usr/share/info/dir >>>> >>>> First, what do those double dollar signs mean? >>> >>> If this is from a Makefile snippet, it says that $f is a make variable, >>> while $$ turns into a literal $f for the shell that make invokes >> >> It's not a Makefile snippet; it's a snippet from a bash shell script. Here's more context: >> >> for f in /usr/share/info/*; do >> case "$f" in >> *\**) >> ;; >> */dir|*/dir.info*) >> ;; >> *-[0123456789]*) >> ;; >> *) >> install-info $f /usr/share/info/dir || >> install-info --entry="* $$f ($f): $$f" $$f /usr/share/info/dir >> ;; >> esac >> done >> >> It looks to me like all those double dollar signs will just get expanded to the PID of the bash process, so that the second install-info command is nonsense. But maybe I'm missing something. > > Oooh, scary. Yeah, it looks like utter nonsense, as that would indeed > give the PID of bash followed by a literal f, but who wants to look up > info of '1234f'? I wonder if someone writing the script copied > incorrectly from a Makefile? Crazy. I didn't add this part, so I guess it's been there for a long time. >> Second, why is the second line needed, i.e., under what circumstances >> would it be expected to succeed after the first install-info command >> failed? > > Sadly, I don't know install-info enough to answer that one. I think the first install-info command would fail if the .info file is missing a START-INFO-DIR-ENTRY/END-INFO-DIR-ENTRY block, in which case install-info should fail with a 'install-info: warning: no info dir entry in `xxx.info'' Since such a .info file is apparently valid (although I don't think we have any instances of such), I guess the nonsense after the || should be fixed to use '$f' correctly.