From 6c9acd96ec91ee972b8e630f890732e2927a8c4b Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Fri, 28 Jan 2022 11:25:18 +0100 Subject: [PATCH] Moved snapd installation sooner in the installer This changes moves the check of snapd package sooner in the installer, and installs it if missing. It also modifies check_packages function so that the output is not redirected to /dev/null. Finally, some echos were added to know the progress of the check. Change-Id: I3f09af72542ae7e58d923155d092abb44f292c44 Signed-off-by: garciadeblas --- installers/full_install_osm.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 6ddf4aa4..6e50ce5c 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -143,10 +143,12 @@ function check_packages() { NEEDED_PACKAGES="$1" echo -e "Checking required packages: ${NEEDED_PACKAGES}" for PACKAGE in ${NEEDED_PACKAGES} ; do - dpkg -L ${PACKAGE} &>/dev/null + dpkg -L ${PACKAGE} if [ $? -ne 0 ]; then - echo -e "Package ${PACKAGE} is not installed. Updating apt" + echo -e "Package ${PACKAGE} is not installed." + echo -e "Updating apt-cache ..." sudo apt-get update + echo -e "Installing ${PACKAGE} ..." sudo apt-get install -y ${PACKAGE} || FATAL "failed to install ${PACKAGE}" fi done @@ -659,7 +661,6 @@ function install_osm() { # if no host is passed in, we need to install lxd/juju, unless explicilty asked not to if [ -z "$OSM_VCA_HOST" ] && [ -z "$INSTALL_NOLXD" ] && [ -z "$LXD_CLOUD_FILE" ]; then - check_packages "snapd" install_lxd fi @@ -1154,7 +1155,7 @@ fi # if develop, we force master [ -z "$COMMIT_ID" ] && [ -n "$DEVELOP" ] && COMMIT_ID="master" -check_packages "git wget curl tar" +check_packages "git wget curl tar snapd" sudo snap install jq if [ -z "$OSM_DEVOPS" ]; then -- 2.25.1