From 0c28379c6d8ab33f3c902b6617503ca634b8c90e Mon Sep 17 00:00:00 2001 From: Ronan Le Martret Date: Tue, 4 Jul 2017 10:08:40 +0200 Subject: Handle error during run-agl-postinsts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * do not remove post install script if failed Bug-AGL: SPEC-700 Change-Id: I1b45670ecbe3915a69cfa659031ac877eb794571 Signed-off-by: Ronan Le Martret Reviewed-on: https://gerrit.automotivelinux.org/gerrit/10025 Reviewed-by: José Bollo Tested-by: Jenkins Job builder account ci-image-build: Jenkins Job builder account Reviewed-by: Jan-Simon Moeller --- .../run-agl-postinsts/run-agl-postinsts/run-agl-postinsts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'meta-agl') diff --git a/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts b/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts index 7c2effa70..87ec0e13b 100755 --- a/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts +++ b/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts @@ -23,10 +23,16 @@ exec_postinst_scriptlets() { [ "$POSTINST_LOGGING" = "1" ] && eval echo "Running postinst $i..." $append_log if [ -x $i ]; then eval sh -c $i $append_log - rm $i + if [ $? -eq 0 ]; then + rm $i + else + echo "ERROR: postinst $i failed." + [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log + remove_agl_pi_dir=0 + fi else - echo "ERROR: postinst $i failed." - [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log + echo "ERROR: postinst $i do not exists or do not have execute permission." + [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i do not exists or do not have execute permission." $append_log remove_agl_pi_dir=0 fi done -- cgit 1.2.3-korg