From 9170ead86561b0d494df5ac464a04d703a61e036 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 27 Jan 2019 18:08:53 +0100 Subject: build-submodules: source OPAM environemnt if not present --- scripts/build-submodules | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts/build-submodules') diff --git a/scripts/build-submodules b/scripts/build-submodules index 79abf59f..6423a14a 100755 --- a/scripts/build-submodules +++ b/scripts/build-submodules @@ -88,6 +88,15 @@ ROOTDIR="$(pwd)" PKGDIR="$ROOTDIR/packages" SCRIPTDIR="$ROOTDIR/scripts" +# Source OPAM environment if not already set +if [ -z "$OPAMROOT" ]; then + if [ -x "$(command -v opam)" ]; then + eval $(opam env --root=/opt/opam --set-root) + else + echo "WARNING: 'opam' not installed, can't build VyConf and libvyosconfig" + fi +fi + package_in_buildlist() { # Return true if buildlist is not set if [ -z "$BUILDLIST" ]; then -- cgit v1.2.3