diff options
author | Wynn Wolf Arbor | 2020-05-12 22:14:47 +0200 |
---|---|---|
committer | Wynn Wolf Arbor | 2020-05-16 10:55:38 +0200 |
commit | e25e7ad50bb82b416e2c703356867a8be7cb9d09 (patch) | |
tree | 58f72fe23e9e88ef79cb01e27d12444db8e7ff3d /kernfrag.7 | |
parent | 363ef24cbdff39adefe983ccf783e1c867819b93 (diff) | |
download | kern-e25e7ad50bb82b416e2c703356867a8be7cb9d09.tar.gz |
Simplify conditional logic in test_diff()
Previously we recorded the return value of the sed ... | diff pipeline
into a variable and later used it to test whether the command returned
successfully or not. Since we enable errexit, this meant that the diff
command failing would terminate the execution of the whole script.
We are unsure how this was not caught earlier as the script has been in
use for quite a while now - it is possible that bash 5.0 shows different
behaviour here. It is our understanding that bash's current behaviour is
correct, however.
Instead of using a variable to store the return value, put the whole
pipeline into an if clause, and react to its success or failure there.
Whilst this does remove our ability to indicate diff's actual return
value, it makes this test simpler and more straightforward.
Diffstat (limited to 'kernfrag.7')
0 files changed, 0 insertions, 0 deletions