Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Fri, 7 May 2004 11:15:50 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: "Silver, David (Contractor)" cc: cygwin AT cygwin DOT com Subject: Re: Bugs in nfs-server package. Att: package maintainers. In-Reply-To: <8D98BD395C94D7119DF800306E01596601EF3D52@ednex506.dsto.defence.gov.au> Message-ID: References: <8D98BD395C94D7119DF800306E01596601EF3D52 AT ednex506 DOT dsto DOT defence DOT gov DOT au> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.39 On Fri, 7 May 2004, Silver, David (Contractor) wrote: > Hi, > > I'm writing to report two bugs in the nfs-server package. By my reading > of the Cygwin docs, posting to this list is the correct procedure, so forgive > me if that's not the case. The correct place to report bugs in each Cygwin package should be stated clearly in the announcement for the package (it's not always the Cygwin list, BTW). Googling for " announcement cygwin" usually pulls up the right message. > I have checked the mailing list archives and only seen an obtuse > reference to problem (1) and a brief mention of problem (2) as something > that fixes itself. In my experience, and by examination of the current > version of the script, I would say that is unlikely. > > The problems: > (1) The sunrpc package should be listed as a dependency of nfs-server. This is quite possibly correct. > (2) nfs-server-config incorrectly complains about my mount > configuration. A transcript of output follows. The next section should have followed the output, and been clearly marked as a WAG (as that's exactly what it is). See below. > The reason for the error is that the script is written as a Bourne > shell script (/bin/sh) but the following line: > if ! /bin/mount -m | /bin/grep -q ' -s .*"/"'; then > is Bash/Ksh syntax (the Bourne shell doesn't like "if !"). > Switching over to Bash would fix that nicely. This is a red herring. The following works just fine: sh -c "! false && echo 'hey!'" # prints "hey!" sh -c "! true || echo 'hey!'" # prints "hey!" The problem is not that '!' is not recognized by the shell (it is), but that "sh" interprets "! a | b" differently than "bash". In "sh", the pipe takes priority over the negation, whereas in bash it doesn't. Also, "sh" treats '!' as just a modifier for a spawned command, but in bash, it's treated specially. So, for this to work in "sh" (but not in "bash", incidentally), this needs to be if /bin/mount -m | ! /bin/grep -q ' -s .*"/"'; then ... For this to work in both "sh" and "bash", unambiguously, a subshell needs to be spawned, either by if ! (/bin/mount -m | /bin/grep -q ' -s .*"/"'); then ... or by if /bin/mount -m | (! /bin/grep -q ' -s .*"/"'); then ... HTH, Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "I have since come to realize that being between your mentor and his route to the bathroom is a major career booster." -- Patrick Naughton -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/