diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2017-08-28 15:14:34 +0200 |
---|---|---|
committer | Raphaƫl Hertzog <hertzog@debian.org> | 2017-09-01 10:22:02 +0200 |
commit | 5ca1ded228e6ed7c069a95842d1dff96f22248b7 (patch) | |
tree | f69abb91ccd75ffa5697d6d35744c94d3e4372ac | |
parent | 4c229d9449ab5605940bdee28e89166132b1d7e1 (diff) | |
download | vyos-live-build-5ca1ded228e6ed7c069a95842d1dff96f22248b7.tar.gz vyos-live-build-5ca1ded228e6ed7c069a95842d1dff96f22248b7.zip |
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.
-rwxr-xr-x | functions/packages.sh | 14 |
1 files 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 () |