better handling of dependency installs
This commit is contained in:
parent
109faa3741
commit
02d0c9de53
2 changed files with 22 additions and 2 deletions
2
PRbL
2
PRbL
|
|
@ -1 +1 @@
|
||||||
Subproject commit f9b664efa1bd4dfc89defbb489863b3544dbaeb9
|
Subproject commit 0bd9104a89603fdb7b5c449d530b593c792bf1cd
|
||||||
|
|
@ -47,13 +47,33 @@ export PATH=\"\$PATH:\$HOME/devl/CodeDog\"
|
||||||
# Functions
|
# Functions
|
||||||
check-deps(){
|
check-deps(){
|
||||||
# Iterate through the list of required packages and check if installed
|
# Iterate through the list of required packages and check if installed
|
||||||
for pkg in ${packages[@]} ; do
|
for pkg in ${sys_packages[@]} ; do
|
||||||
local _pkg=$(dpkg -l $pkg 2>&1 >/dev/null ; echo $?)
|
local _pkg=$(dpkg -l $pkg 2>&1 >/dev/null ; echo $?)
|
||||||
# If not installed, add it to the list of missing bins
|
# If not installed, add it to the list of missing bins
|
||||||
if [[ $_pkg != 0 ]] ; then
|
if [[ $_pkg != 0 ]] ; then
|
||||||
bins_missing+=($pkg)
|
bins_missing+=($pkg)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
if ! $(which python3) ; then
|
||||||
|
run sudo apt-get install -y python3 python3-pip
|
||||||
|
# TODO: make a universal package install function
|
||||||
|
fi
|
||||||
|
if ! $(which pip3)
|
||||||
|
run sudo apt-get install -y python3-pip
|
||||||
|
fi
|
||||||
|
for pkg in ${pip_packages[@]} ; do
|
||||||
|
pippkg_installed=$(pip list | grep -F $pkg ; echo &?)
|
||||||
|
if [[ $pippkg_installed != 0 ]] ; then
|
||||||
|
bins_missing+=("pip: $pkg")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# This installer requires golang to work
|
||||||
|
# TODO: better handling of prbl_packages as dependencies
|
||||||
|
|
||||||
|
if ! $(which go) ; then
|
||||||
|
bins_missing+=("prbl: golang.install")
|
||||||
|
fi
|
||||||
# Count the number of entries in bins_missing
|
# Count the number of entries in bins_missing
|
||||||
local _bins_missing=${#bins_missing[@]}
|
local _bins_missing=${#bins_missing[@]}
|
||||||
# If higher than 0, return a fail (1)
|
# If higher than 0, return a fail (1)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue