[pkg-bacula-devel] autopkgtest: A choice to be made

Sven Hartge sven at svenhartge.de
Sat Nov 24 18:34:34 GMT 2018


On 24.11.18 19:25, Carsten Leonhardt wrote:
> Hi,
> 
>> After the failure to edit bash yesterday, I looked into changing the
>> autopkgtests to fail in such a case.
>>
>> One way would be to remove "allow-stderr" from the test definition, but
>> for this to work we need to remove "set -v" from the test script.
>>
>> This will reduce the visibility of programs executed (unless we add more
>> echos about what is going to be done or you know a way to just get the
>> output from "-v" to STDOUT but leave the STDERR of every other programm
>> intact) but will catch errors like the one I had.
>>
>> I am currently torn on how to proceed here.
> 
> there may be a way to redirect messages correctly, but straightforward
> and easy to understand would be to use echo (maybe a function
> "exec_verbose" that first prints the command line and then executes
> it?).

I asked in de.comp.os.unix.shell and got the following suggestion from
<news:87zhty8jbo.fsf at passepartout.tim-landscheidt.de>

Ist „das Shell-Script“ unter Deiner Kontrolle? Falls ja:

| exec 3>&2
| exec 2>&1
| set -v
| ls does-not-exist 2>&3

Das sichert das alte STDERR in Descriptor 3 und biegt dann
bashs STDERR nach STDOUT, so dass die Ausgaben von „set -v“
nach STDOUT gehen, und dann ls’ STDERR zu dem alten STDERR
um. Offensichtlicher Nachteil: Jeder Befehl braucht den
„2>&3“-Anhang.

Grüße,
Sven.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-bacula-devel/attachments/20181124/3cf0107a/attachment.sig>


More information about the pkg-bacula-devel mailing list