[pkg-bacula-devel] autopkgtest: A choice to be made
sven at svenhartge.de
Mon Nov 26 14:43:46 GMT 2018
On 25.11.18 17:06, Sven Hartge wrote:
> On 25.11.18 16:26, Sven Hartge wrote:
>> On 25.11.18 15:38, Sven Hartge wrote:
>>> On 24.11.18 19:25, Carsten Leonhardt wrote:
>>>> 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
>>> The solution is this here:
>>> trap 'echo "$BASH_COMMAND"' DEBUG
>>> I am testing a variant of this in my personal git space and will
>>> implement it in the autopkgtest branch once it proves to be working.
>> Yes, this works very nice and gives us the best of both worlds: a bit
>> more verbosity while running the tests and also the ability to fail on
>> output to STDERR, which would have caught my error before releasing a
>> new package.
>> I've updated the autopkgtest branch accordingly.
> I found an even better solution, using BASH_XTRACEFD to redirect the
> xtrace output to STDOUT. But it only works on "set -x" and not "set -v".
> Plus: This will properly expand all variables.
> Con: The output is a bit more noisy.
> But I think the benefits outweigh the negatives here.
Well, nope, this is not better, because of this:
+ echo -e 'label volume=testvol pool=File storage=File1 drive=0 slot=0'
+: is an invalid command.
label volume=testvol pool=File storage=File1 drive=0 slot=0
See how the XTRACE output gets mixed in with the normal pipe output?
Would have been nice to fix this this easily, but we need to revert back
to the "trap DEBUG" variant, as far as I can see.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: OpenPGP digital signature
More information about the pkg-bacula-devel