upgrade scripts: Improve check exectuion 86/275786/3
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Wed, 1 Jun 2022 13:45:10 +0000 (15:45 +0200)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Thu, 2 Jun 2022 12:09:07 +0000 (14:09 +0200)
commitaa93cd90acae16f720dc8ba60925bdc43447db82
treef89ab8ca780aa268c82f510432701a296ca1e9c0
parentbc853bf4fb07ca6404255231f4c6c3ccc7bfd984
upgrade scripts: Improve check exectuion

This change is to prevent bash from exiting a script with an error when
a command returns a code other than 0, which is expected.

E.g.:

    SOME_VAR=$(grep some_value /some/file)

as the "errexit" flag is set, if "some_value" is not found grep will
return exit code 1 and the script will abort. This behavior also varies
with different versions of bash, so it is better in such cases to avoid
invoking commands that may return non-zero code.

Change-Id: I3f9eefc51a37d9762a9b47cc716805957461891f
scripts/upgrade-common.inc
scripts/upgrade-trigger.sh