Re: [PATCH v2] allow TTY tests to run under recent Mac OS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Right, I missed that there was more going on above, thanks =)

On Fri, Nov 14, 2014 at 12:02 PM, Jeff King <peff@xxxxxxxx> wrote:
> On Fri, Nov 14, 2014 at 11:48:36AM -0800, Michael Blume wrote:
>
>> My understanding is that && and || have equal precedence, and this
>> seems to be borne out in testing at my shell. If the if/then method is
>> clearer I'm happy to go with that.
>
> I think the problem is that there are earlier parts of the chain. It
> currently looks like:
>
>   foo &&
>   bar &&
>   do_something
>
> but you are making it:
>
>   foo &&
>   bar || baz &&
>   do_something
>
> which will do_something whether or not "foo" is true. You need to put
> your "||" at a lower precedence than the rest of the chain. The "if"
> that Johannes mentioned works, though I think
>
>   test_have_prereq PERL &&
>   {
>     test "$(uname -s)" != Darwin ||
>     test "$(uname -r | cut -d. -f1)" -ge 13
>   } &&
>   ...
>
> is more obvious to read (but that's subjective, of course).
>
> -Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]