[MEncoder-users] MEncoder build problem
Moritz Barsnick
barsnick at gmx.net
Tue Oct 9 00:30:59 CEST 2007
Hi Michael,
On Sat, Oct 06, 2007 at 01:36:48 +0100, Michael Rozdoba wrote:
> The problem line in configure is around 2253:
> $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
[...]
> Given this, how is the above meant to differentiate between success &
> failure? Using the return code from as?
Exactly.
> Even then I'm still confused: success returns 0 which would surely cause
> the above expression to evalute as_verc_fail=yes, in so doing flagging
> an incorrect state, which can't be intended behviour.
Well, success may return zero, but it is evaluated here by the shell as
"true". The reasoning then is sort of as such:
a) "AND"
cmd1 && cmd2
Make cmd1 _and_ cmd2 succeed. If cmd1 fails, there's no point in
executing (evaluating) cmd2, it is skipped. If cmd1 succeeds, then
cmd2 is also executed.
b) "OR"
cmd1 || cmd2
Make cmd1 _or_ cmd2 succeed. If cmd1 fails, cmd2 definitely needs
to executed (evaluated). If cmd1 succeeds, there's no point in
executing cmd2, it is skipped.
It pretends to be logic. Don't get confused by returns of 0 or 1. It's
the typical computing/C/whatever problem: Is '1' true, or is '0' true?
So, anyway, if $_as fails, as_verc_fail is set to yes, otherwise not.
> That said, the above code sets the variable to yes regardless of whether
> as returns 1 or 0, so it can't be relying on the return code.
Are you sure the script is executing the same "as" as you are on the
command line?
HTH,
Moritz
More information about the MEncoder-users
mailing list