buildsystem: "set -e" error handling not working for addon builds

This commit is contained in:
MilhouseVH 2019-12-18 08:27:48 +00:00
parent 3bfc4fb706
commit ff7194584f
2 changed files with 17 additions and 29 deletions

View File

@ -66,33 +66,7 @@ package_worker() {
if [ "${isaddon}" = "yes" -a "${istarget}" = "yes" ]; then
if [ ${result} -eq 0 ]; then
(
pkg_lock "${pkgname}" "packadd"
pkg_lock_status "ACTIVE" "${pkgname}" "packadd"
# cleanup old install path
rm -rf "${ADDON_BUILD}"
# install addon parts
if pkg_call_exists addon; then
pkg_call addon
else
install_binary_addon "${PKG_ADDON_ID}"
fi
# HACK for packages that provide multiple addons like screensavers.rsxs
# addon's addon() in package.mk should take care for exporting
# MULTI_ADDONS="addon.boo1 addon.boo2 addon.boo3"
if [ -n "${MULTI_ADDONS}" ] ; then
for addon in ${MULTI_ADDONS}; do
${SCRIPTS}/install_addon "${PKG_NAME}" "${addon}"
done
else
${SCRIPTS}/install_addon "${PKG_NAME}" "${PKG_ADDON_ID}"
fi
pkg_lock_status "UNLOCK" "${pkgname}" "packadd" "packed"
) 2>&1 || result=1
${SCRIPTS}/install_addon ${pkgname} 2>&1 && result=0 || result=1
fi
if [ ${result} -ne 0 ]; then

View File

@ -5,11 +5,22 @@
. config/options "${1}"
pkg_lock "${PKG_NAME}" "packadd"
pkg_lock_status "ACTIVE" "${PKG_NAME}" "packadd"
# cleanup old install path
rm -rf "${ADDON_BUILD}"
# install addon parts
if pkg_call_exists addon; then
pkg_call addon
else
install_binary_addon "${PKG_ADDON_ID}"
fi
# Make sure we have a value for STRIP
setup_toolchain target
[ -n "${2}" ] && PKG_ADDON_ID=${2}
ADDON_DIRECTORY="${ADDON_BUILD}/${PKG_ADDON_ID}"
install_addon_files "${ADDON_DIRECTORY}"
@ -25,6 +36,7 @@ if [ -f ${ADDON_INSTALL_DIR}/${PKG_ADDON_ID}-${ADDONVER}.zip ]; then
rm ${ADDON_INSTALL_DIR}/${PKG_ADDON_ID}-${ADDONVER}.zip
else
build_msg "CLR_WARNING" "*** WARNING: ${PKG_ADDON_ID}-${ADDONVER}.zip already exists. Not overwriting it. ***"
pkg_lock_status "UNLOCK" "${PKG_NAME}" "packadd" "already packed"
exit 0
fi
fi
@ -74,3 +86,5 @@ if [ "${ADDON_JENKINS}" = "yes" ]; then
else
build_msg "CLR_INFO" "*** creating ${PKG_ADDON_ID} complete ***"
fi
pkg_lock_status "UNLOCK" "${PKG_NAME}" "packadd" "packed"