Re: [PATCH] Workaround for strange cmp bug

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

 



Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:

> The cmp(1) (cmp (GNU diffutils) 2.8.7) distributed with openSUSE 10.1 has
> a subtle "shortcoming":
>
> 	$ echo a > a
> 	$ echo b > b
> 	$ cmp a b && echo nonono
> 	a b differ: char 1, line 1
> 	$ cmp a b >/dev/null && echo nonono
> 	nonono
> 	$ cmp -s a b >/dev/null && echo nonono
>
> So, if cmp should _not_ be quiet, _and_ the output is redirected to
> /dev/null, it has a bogus exit value. Our test suite redirects to
> /dev/null, which triggers that bug. (Obviously, the tests pass when
> running with '-v', which made that a real bugger to debug.)

While I sympathize unfortunate users who are stuck with such a
broken implementation of an important basic tool, such a rewrite
unnecessarily makes debugging of both test scripts _and_ real
breakage harder.

It actually is very useful, in the chain of &&, to see that
these steps in our tests output something when they shouldn't
when the tests are run under -v; you may have noticed that the
tests written by me have seemingly useless "echo happy" (which
always returns true) and such, and they are there for a reason.

Please get the distribution fixed.


-
: 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]