diff options
author | Mark Allen <[email protected]> | 2016-05-25 21:29:12 -0500 |
---|---|---|
committer | Mark Allen <[email protected]> | 2016-05-25 21:29:12 -0500 |
commit | ca96e227e1dc55c3a4f7b930e6d766f048efb2b8 (patch) | |
tree | 2036ec0b1d1ca674fa46ce166f7436c9c4078a9e | |
parent | 44a1f846a6370b9f40aaf64f2870b49f4ce55209 (diff) | |
download | kerl-ca96e227e1dc55c3a4f7b930e6d766f048efb2b8.tar.gz kerl-ca96e227e1dc55c3a4f7b930e6d766f048efb2b8.tar.bz2 kerl-ca96e227e1dc55c3a4f7b930e6d766f048efb2b8.zip |
Do not assume writes to list_add/remove succeed
If the otp_builds or otp_installations files in $KERL_BASE_DIR
are unwritable kerl will falsely report a successful action. Now exit
from the script with a return code of 1.
-rwxr-xr-x | kerl | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -889,16 +889,16 @@ list_add() return 1 fi done < "$KERL_BASE_DIR/otp_$1" - echo "$2" >> "$KERL_BASE_DIR/otp_$1" + echo "$2" >> "$KERL_BASE_DIR/otp_$1" || exit 1 else - echo "$2" > "$KERL_BASE_DIR/otp_$1" + echo "$2" > "$KERL_BASE_DIR/otp_$1" || exit 1 fi } list_remove() { if [ -f "$KERL_BASE_DIR/otp_$1" ]; then - sed $SED_OPT -i -e "/^.*$2$/d" "$KERL_BASE_DIR/otp_$1" + sed $SED_OPT -i -e "/^.*$2$/d" "$KERL_BASE_DIR/otp_$1" || exit 1 fi } |