Hello Agustin Martin

> Note that ''||' chains are different, will only fail if all components fail.
> However, chaining too much also affects readability.

Ok thanks for this hint.

> It indeed looks better to me, thanks. While I did not test myself I think
> you may have problems with empty $MILTERSOCKET with dash as interpreter in 
> 
> if [ $MILTERSOCKET -a "`echo $MILTERSOCKET | grep -v ^inet`" ]
> 
> as in e.g.,
> 
> ----8<---- test
> #!/bin/sh
> bs="bs"
> if [ $as -a $bs ]; then
>     echo "Hi"
> fi
> ----8<--- end test
> 
> $ dash test
> [: 5: -a: unexpected operator
> 
> Quoting variables should help.

Ok will check and fix this.

> 
> Also I am not sure of full portability of -a there (although seems to not be 
> a problem with dash).

No I specifically checked the manpage for this.

> Maintainer scripts normally use chained '&&' in the 
> if clause (note that this is different from standalone '&&' chains and is 
> not a problem under 'set -e')
> 
> I'd write above line as
> 
> if [ "$MILTERSOCKET" ] && [ "`echo $MILTERSOCKET | grep -v ^inet`" ]; then
> 
> but as Teodor points out (just read it), second check seems to be enough.

Not really as an empty $MILTERSOCKET may lead to undesired behaviour too.

> 
> Also, I'd do a more extensive variable quoting, 
> 
> if [ "$MILTERSOCKET" ]; then
> if [ "$AMAVISSOCKET" ]; then
> ...
> 
> besides those Teodor points out.

Thanks will do this.

> 
> 
> -- 
> Agustin
> 

Kind regards
Harald Jenny



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to