done | grep -v '^[[:space:]]*$' > $tmp_fetch.main || :
[ -e "$tmp_fetch.pre" ] && sort -u "$tmp_fetch.pre"
cat "$tmp_fetch.main"
-}
+}
# ============= Execute a command by recording the standard output and error output into a file in case of error =============
reinstall_execcmd_tee_errlog ()
func=$1
tmp_err=${TMPDIR}/reinstall_execcmd_tee_errlog::error
rm -f "$tmp_err"
- { eval "$func"; } 2>&1 || touch "$tmp_err"; } | tee "$REINSTALL_DBNODE_DIR/error.log"
+ {
+ $func
+ } 2>&1 || touch "$tmp_err"; } | tee "$REINSTALL_DBNODE_DIR/error.log"
[ -e "$tmp_err" ] && return 1
rm -f "$REINSTALL_DBNODE_DIR/error.log"
return
message_echo "INFO: Retrying the build process after cleaning for $REINSTALL_ORIGPKGTAG."
_reinstall_exec__tmpcmd () { reinstall_make clean; }
if ! reinstall_execcmd_tee_errlog _reinstall_exec__tmpcmd
- {
+ then
if pkgsys_is_necessary_pkgtool "$REINSTALL_ORIGIN"
then
pkg_is_tool_available || pkg_rescue_tools
reinstall_errproc 'build and clean after build failure'
temp_set_msg_current_stage "${_MSG_CURRENT_STAGE_general}"
return
- }
+ fi
reinstall_register_stage_complete CLEAN_BEFORE_BUILD
_reinstall_exec__tmpcmd () { reinstall_make build MAKE_JOBS_UNSAFE=yes; }
if ! reinstall_execcmd_tee_errlog _reinstall_exec__tmpcmd
- {
+ then
if pkgsys_is_necessary_pkgtool "$REINSTALL_ORIGIN"
then
pkg_is_tool_available || pkg_rescue_tools
reinstall_errproc 'retrial of build after failure'
temp_set_msg_current_stage "${_MSG_CURRENT_STAGE_general}"
return
- }
+ fi
reinstall_deregister_stage in_retrial_build
fi
if pkgsys_is_necessary_pkgtool "$REINSTALL_ORIGIN"
! reinstall_chk_stage_complete FAILED_INSTALL.AFTERINSTALL
then
message_echo "-- AFTERINSTALL operations (start)"
- sh -e "$REINSTALL_DBNODE_DIR/AFTERINSTALL.conf" || \
- {
+ if ! sh -e "$REINSTALL_DBNODE_DIR/AFTERINSTALL.conf"
+ then
message_echo "WARNING: Failed in AFTERINSTALL operations." >&2
message_echo "---- (The process is continued anyway)"
- }
+ fi
message_echo "-- AFTERINSTALL operations (end)"
reinstall_register_stage_complete FAILED_INSTALL.AFTERINSTALL
fi
reinstall_restore_conflicts "$REINSTALL_ORIGIN"
if ! reinstall_chk_stage_complete CLEAN_AFTER_INSTALL
then
- reinstall_make clean || \
- {
+ if ! reinstall_make clean
+ then
message_echo "WARNING: Failed to clean $REINSTALL_ORIGPKGTAG." >&2
- }
+ fi
reinstall_register_stage_complete CLEAN_AFTER_INSTALL
fi
reinstall_tell_update_to_depandents