Mailing List Archive

[0.4.4] reason for failing test
OK, I found reason why my machin fails at "make check" stage.

For example, "make check" executes checks/mds.test and it calls
'have_hash_algo "TIGER"' which is in defs.inc.
In defs.inc, have_hash_algo() function is defined like this:

> have_hash_algo () {
> ../g10/gpgm --homedir . --version | grep "Hash:.*$1" >/dev/null
> }

But this function may called at "set -e" situation. This causes
/bin/sh exitting with return code 1 and cannot return to "if" condition
at mds.test.

I've changed have_hash_algo() function as:

> have_hash_algo () {
> set +e
> ../g10/gpgm --homedir . --version | grep "Hash:.*$1" >/dev/null
> }

I'm not Bourn shell expert and don't know whether this is the right
way or not.

If someone helps me until 11/25, I'll commit this port into FreeBSD
2.2.8.


--
Jun Kuriyama // kuriyama@sky.rim.or.jp
// kuriyama@FreeBSD.ORG
Re: [0.4.4] reason for failing test [ In reply to ]
Jun Kuriyama <kuriyama@sky.rim.or.jp> writes:

> > set +e
> > ../g10/gpgm --homedir . --version | grep "Hash:.*$1" >/dev/null
> > }
>
> I'm not Bourn shell expert and don't know whether this is the right
> way or not.


-e Exit immediately if a simple command (see
SHELL GRAMMAR above) exits with a non-zero
status. The shell does not exit if the
command that fails is part of an until or
while loop, part of an if statement, part
of a && or || list, or if the command's
return value is being inverted via !.

Hmmm, is a pipeline a simple command?

if foo | bar; then true; else false; fi

should work but isn't very elegant.


Any Bourne shell gurus here?


Werner