Bug#563121: Returning a status of non-zero might not be safe

2009-12-30 Thread YOSHINO Yoshihito
Hello,

test -x "`which foo`" && foo bar baz

returns status 1, which comes to an error if a script executed this as
the last command. E.g. like #563121, prerm will exit with status 1 if
defoma not found unless explicitly writing the last line "exit 0" in
the prerm template.

So I think changing defoma templates like

if test -x "`which foo`"; then
   foo bar baz
fi

would be good, since the script should simply ignore the block when
defoma is not found.

Regards,

-- 
YOSHINO Yoshihito 



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



Bug#563121: Returning a status of non-zero might not be safe

2009-12-31 Thread Cyril Brulebois
YOSHINO Yoshihito  (31/12/2009):
> Hello,

Hi,

> test -x "`which foo`" && foo bar baz
> 
> returns status 1, which comes to an error if a script executed this
> as the last command. E.g. like #563121, prerm will exit with status
> 1 if defoma not found unless explicitly writing the last line "exit
> 0" in the prerm template.
> 
> So I think changing defoma templates like
> 
> if test -x "`which foo`"; then
>foo bar baz
> fi

that's what I stated in a later reply to this bug.

> would be good, since the script should simply ignore the block when
> defoma is not found.

That's indeed what I implemented.

Please, Cc the bug submitter in the future. I would have totally
missed your mail if I wouldn't have used “bts -m show $bug” to make
sure not to break the threading…

Mraw,
KiBi.


signature.asc
Description: Digital signature