summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2017-08-28 15:14:34 +0200
committerRaphaƫl Hertzog <hertzog@debian.org>2017-09-01 10:22:02 +0200
commit5ca1ded228e6ed7c069a95842d1dff96f22248b7 (patch)
treef69abb91ccd75ffa5697d6d35744c94d3e4372ac
parent4c229d9449ab5605940bdee28e89166132b1d7e1 (diff)
downloadvyos-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-xfunctions/packages.sh14
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 ()