This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bugs in nfs-server package. Att: package maintainers.


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 "<package-name> 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@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]