~barryprice/juju-deployer/lp1893162

« back to all changes in this revision

Viewing changes to install_test_deps.sh

  • Committer: Barry Price
  • Date: 2020-11-02 12:38:03 UTC
  • Revision ID: barry.price@canonical.com-20201102123803-bu0jsz2caybflxh0
Move deps logic to separate shell scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
set -eu
 
4
 
 
5
PKG_DEPS="make tox"
 
6
 
 
7
RELEASE=$(lsb_release -r | cut -f 2)
 
8
 
 
9
if (( $(echo "$RELEASE >= 20.04" |bc -l) )); then
 
10
    PKG_DEPS="$PKG_DEPS brz"
 
11
elif [ "$RELEASE" == "18.04" ]; then
 
12
    PKG_DEPS="$PKG_DEPS brz"
 
13
else
 
14
    PKG_DEPS="$PKG_DEPS bzr"
 
15
fi
 
16
 
 
17
PKGS_TO_INSTALL=""
 
18
 
 
19
for PKG_DEP in $PKG_DEPS;
 
20
do
 
21
    dpkg -l "${PKG_DEP?}" >/dev/null || PKGS_TO_INSTALL="$TO_INSTALL $PKG_DEP"
 
22
done
 
23
 
 
24
if [ "$PKGS_TO_INSTALL" != "" ]; then
 
25
    echo "Please run: sudo apt-get install $PKGS_TO_INSTALL"
 
26
fi