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: Iaf058d18aa906068de65e800066752ba3343dda5
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
NEEDED_PACKAGES="$1"
echo -e "Checking required packages: ${NEEDED_PACKAGES}"
for PACKAGE in ${NEEDED_PACKAGES} ; do
NEEDED_PACKAGES="$1"
echo -e "Checking required packages: ${NEEDED_PACKAGES}"
for PACKAGE in ${NEEDED_PACKAGES} ; do
- dpkg -L ${PACKAGE} &>/dev/null
- echo -e "Package ${PACKAGE} is not installed. Updating apt"
+ echo -e "Package ${PACKAGE} is not installed."
+ echo -e "Updating apt-cache ..."
+ echo -e "Installing ${PACKAGE} ..."
sudo apt-get install -y ${PACKAGE} || FATAL "failed to install ${PACKAGE}"
fi
done
sudo apt-get install -y ${PACKAGE} || FATAL "failed to install ${PACKAGE}"
fi
done
# 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
# 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
# if develop, we force master
[ -z "$COMMIT_ID" ] && [ -n "$DEVELOP" ] && COMMIT_ID="master"
# 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
sudo snap install jq
if [ -z "$OSM_DEVOPS" ]; then