[MPlayer-dev-eng] [PATCH] clean up tests in configure

Corey Hickey bugfood-ml at fatooh.org
Fri Jun 10 09:28:22 CEST 2005


I recently came upon this:

[ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major"
= 3 ] && [ "$_cc_minor" -ge 4 ]))

...over which I prefer:

test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq
3 -a "$_cc_minor" -ge 4

...but I foolishly decided to make a more substantial patch than a
one-line change. I found 44 tests in configure that I could clean up
slightly.

Aside from the example above, most changes are replacing "test ... ||
test' with "test ... -o" and the same with && / -a. I also removed a few
subshells I think are unnecessary and replaced one "if not test ... ;
then" with  "... ||" .

Most of configure uses "test ..." syntax rather than "[ ... ]", so I
changed the latter to the former on lines I was altering anyway. I left
the rest alone.

I've tested this by running configure with and without the patch.
config.mak was identical between each run. Of course, that's just on my
system, so review by another pair of eyes would be prudent.

-Corey
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: configure-test-cleanup.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050610/da3b84e6/attachment.txt>


More information about the MPlayer-dev-eng mailing list