scripts: apply fixes to helpers when using set -eE#3285
scripts: apply fixes to helpers when using set -eE#3285georglauterbach merged 1 commit intomasterfrom
set -eE#3285Conversation
For an upcoming PR, these changes are required, because the script that is using the helpers uses `set -eE`. This leads to situations where errors are not properly handled in our helpers (yet; I plan on changing that in the future).
475e18a to
98aac32
Compare
function _adjust_mtime_for_postfix_maincf
{
if [[ $(( $(date '+%s') - $(stat -c '%Y' '/etc/postfix/main.cf') )) -lt 2 ]]
then
touch -d '2 seconds ago' /etc/postfix/main.cf
fi
return 0
}If |
It's not the touch - it's the condition in the Looking at it again, you're right about the |
I think you are wrong, that's not the case: or |
|
You are indeed correct, there is a difference between set -eE
function x() {
if false && :; then :; fi
}
x
echo "this will show up"and set -eE
function x() {
false && :
}
x
echo "this wont show up"I will correct my error and remove unnecessary |
Description
For an upcoming PR, these changes are required, because the script that is using the helpers uses
set -eE. This leads to situations where errors are not properly handled in our helpers (yet; I plan on changing that in the future).Fixes issues of an upcoming PR that I do not want to include in the upcoming PR because I am a nice maintainer and I try my best to separate concerns with PRs :D 😆
The
return 0statements at the end of some functions seem superflous, but they are not, because the previos command (even when run inside anif-clause) set the return value to non-zero, which is not what we want.Type of change
Checklist:
docs/)