Skip to content
Snippets Groups Projects
Commit 3fa9fda0 authored by Sertonix's avatar Sertonix Committed by Natanael Copa
Browse files

avoid masking exit code of shell commands

When a variables is declared (with 'local' or 'export') a failing
command is ignored[0]. Changing that so abuild should now error out
properly in more cases.

Also remove 1 pipe that could have prevented an issue recently[1] where
the 'du' command core dumped but abuild didn't error.

The other pipes were not changed for now since it may be better to use
'set -o pipefail' instead. That may require some changes with commands
like grep which use a non-zero exit code to indicate if a match was
found or similar[2].

[0]: https://www.shellcheck.net/wiki/SC2155
[1]: aports#16005 (comment 395899)
[2]: https://github.com/koalaman/shellcheck/issues/665
parent b3b659a9
1 merge request!283avoid masking exit code of shell commands
Checking pipeline status
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment