From 5ca1ded228e6ed7c069a95842d1dff96f22248b7 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Mon, 28 Aug 2017 15:14:34 +0200 Subject: Error out when needed packages are missing on the host Previously, Check_package would only show an error when host packages are missing on a non-apt system. On apt system, the packages would be added to _LB_PACKAGES, which causes them to be installed in the chroot, not in the host (or not at all if Install_package is not called). This behaviour could break the build. This applies to either packages that must be present in the host (as checked with `Check_package host ...`), as well as packages that can be either in the chroot or host (as checked with `Check_package chroot`) when LB_BUILD_WITH_CHROOT=false. --- functions/packages.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/functions/packages.sh b/functions/packages.sh index c2f7cfabf..7c3592dac 100755 --- a/functions/packages.sh +++ b/functions/packages.sh @@ -16,16 +16,16 @@ Check_package () Check_installed "${CHROOT}" "${FILE}" "${PACKAGE}" - case "${INSTALL_STATUS}" in - 1) + if [ "${INSTALL_STATUS}" -ne 0 ] + then + if [ "${LB_BUILD_WITH_CHROOT}" != "false" ] + then _LB_PACKAGES="${_LB_PACKAGES} ${PACKAGE}" - ;; - - 2) + else Echo_error "You need to install %s on your host system." "${PACKAGE}" exit 1 - ;; - esac + fi + fi } Install_package () -- cgit v1.2.3