Skip to content
Snippets Groups Projects
Commit 40939070 authored by Bob Mottram's avatar Bob Mottram
Browse files

Checking whether another app is required during install

parent 443f8137
No related branches found
No related tags found
No related merge requests found
......@@ -241,6 +241,33 @@ function app_is_installed {
fi
}
function other_app_required {
# is another app required before the install of this one?
app_name="$1"
app_filename="/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}"
if [ ! -f "$app_filename" ]; then
echo ''
return
fi
if ! grep -q 'REQUIRES_APP=' "$app_filename"; then
echo ''
return
fi
grep 'REQUIRES_APP=' "$app_filename" | head -n 1 | awk -F '=' '{print $2}'
}
function check_other_app_required {
app_name="$1"
apprequired=$(other_app_required "${app_name}")
if [ "$apprequired" ]; then
if [[ $(app_is_installed "${apprequired}") != "1" ]]; then
echo $"${apprequired} needs to be installed before you can install ${app_name}"
exit 61
fi
fi
}
function install_completed_remove_progress_screen {
local_hostname=$(grep 'host-name' /etc/avahi/avahi-daemon.conf | awk -F '=' '{print $2}').local
webadmin_install_dir="/var/www/${local_hostname}/htdocs/admin"
......@@ -696,6 +723,7 @@ function install_apps {
"upgrade_${a}"
echo $"${a} was upgraded from interactive"
else
check_other_app_required "${a}"
echo $"Installing application from interactive: ${a}"
APP_INSTALLED=
function_check app_being_added_indicator
......@@ -730,6 +758,7 @@ function install_apps {
"upgrade_${a}"
echo $"${a} was upgraded"
else
check_other_app_required "${a}"
echo $"Installing application: ${a}"
APP_INSTALLED=
function_check app_being_added_indicator
......@@ -753,6 +782,7 @@ function install_apps {
APP_INSTALLED_SUCCESS=
echo $"${a} was not installed"
fi
fi
else
echo $"${a} has been removed and so will not be reinstalled"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment