fixing dependency resolution syntax
This commit is contained in:
parent
bcf74d9f05
commit
eed0ee893d
1 changed files with 12 additions and 11 deletions
21
install.sh
21
install.sh
|
|
@ -14,6 +14,7 @@ runuser=$(whoami)
|
||||||
users=($(ls /home/))
|
users=($(ls /home/))
|
||||||
userinstalldir="$HOME/.local/share/prbl"
|
userinstalldir="$HOME/.local/share/prbl"
|
||||||
globalinstalldir="/usr/share/prbl"
|
globalinstalldir="/usr/share/prbl"
|
||||||
|
bins_missing=()
|
||||||
backupFiles=()
|
backupFiles=()
|
||||||
installed_files=()
|
installed_files=()
|
||||||
|
|
||||||
|
|
@ -114,14 +115,15 @@ check-deps(){
|
||||||
for pkg in $packages ; do
|
for pkg in $packages ; do
|
||||||
local _pkg=$(dpkg -l $pkg 2>&1 >/dev/null ; echo $?)
|
local _pkg=$(dpkg -l $pkg 2>&1 >/dev/null ; echo $?)
|
||||||
if [[ $_pkg != 0 ]] ; then
|
if [[ $_pkg != 0 ]] ; then
|
||||||
bins_missing="${bins_missing} $pkg"
|
bins_missing+=($pkg)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
local _bins_missing=$(echo $bins_missing | wc -w)
|
local _bins_missing=$(echo $bins_missing | wc -w)
|
||||||
if [[ $_bins_missing == 0 ]] ; then
|
if [[ $_bins_missing == 0 ]] ; then
|
||||||
bins_missing="false"
|
bins_missing=("false")
|
||||||
|
return false
|
||||||
else
|
else
|
||||||
echo "$bins_missing"
|
return true
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -200,14 +202,13 @@ userinstall(){
|
||||||
done
|
done
|
||||||
|
|
||||||
# Check for dependent applications and warn user if any are missing
|
# Check for dependent applications and warn user if any are missing
|
||||||
check-deps
|
if ! check-deps ; then
|
||||||
if [[ "$bins_missing" != "false" ]] ; then
|
|
||||||
warn "Some of the utilities needed by this script are missing"
|
warn "Some of the utilities needed by this script are missing"
|
||||||
echo -e "Missing utilities:"
|
echo -e "Missing utilities:"
|
||||||
echo -e "$bins_missing"
|
echo -e "${bins_missing[@]}"
|
||||||
echo -e "After this installer completes, run:"
|
echo -e "After this installer completes, run:"
|
||||||
boxseparator
|
boxseparator
|
||||||
echo -en "\n${lbl}sudo apt install -y $bins_missing\n${dfl}"
|
echo -en "\n${lbl}sudo apt install -y ${bins_missing[@]}\n${dfl}"
|
||||||
boxborder "Press 'Enter' key when ready to proceed"
|
boxborder "Press 'Enter' key when ready to proceed"
|
||||||
read proceed
|
read proceed
|
||||||
fi
|
fi
|
||||||
|
|
@ -257,11 +258,10 @@ globalinstall(){
|
||||||
export prbl_functions="${globalinstalldir}/functions"
|
export prbl_functions="${globalinstalldir}/functions"
|
||||||
|
|
||||||
# Check for dependent applications and offer to install
|
# Check for dependent applications and offer to install
|
||||||
check-deps
|
if ! check-deps ; then
|
||||||
if [[ "$bins_missing" != "false" ]] ; then
|
|
||||||
warn "Some of the utilities needed by this script are missing"
|
warn "Some of the utilities needed by this script are missing"
|
||||||
echo -e "Missing utilities:"
|
echo -e "Missing utilities:"
|
||||||
echo -e "$bins_missing"
|
echo -e "${bins_missing[@]}"
|
||||||
echo -e "Would you like to install them? (this will require root password)"
|
echo -e "Would you like to install them? (this will require root password)"
|
||||||
utilsmissing_menu=(
|
utilsmissing_menu=(
|
||||||
"$(boxline "${green_check} Yes")"
|
"$(boxline "${green_check} Yes")"
|
||||||
|
|
@ -289,6 +289,7 @@ globalinstall(){
|
||||||
install-file $file /home/${selecteduser}
|
install-file $file /home/${selecteduser}
|
||||||
done
|
done
|
||||||
if [[ $(cat /home/${selecteduser}/.bashrc | grep -c prbl) == 0 ]] ; then
|
if [[ $(cat /home/${selecteduser}/.bashrc | grep -c prbl) == 0 ]] ; then
|
||||||
|
take-backup /home/${selecteduser}/.bashrc
|
||||||
echo -e "$bashrc_append" >> /home/${selecteduser}/.bashrc && boxborder "bashc.d installed..." || warn "Malformed append on ${lbl}/home/${selecteduser}/.bashrc${dfl}. Check this file for errors"
|
echo -e "$bashrc_append" >> /home/${selecteduser}/.bashrc && boxborder "bashc.d installed..." || warn "Malformed append on ${lbl}/home/${selecteduser}/.bashrc${dfl}. Check this file for errors"
|
||||||
fi
|
fi
|
||||||
chown -R ${selecteduser}:${selecteduser} /home/${selecteduser}
|
chown -R ${selecteduser}:${selecteduser} /home/${selecteduser}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue