Prevent apps from being installed or removed during upgrades

This commit is contained in:
Bob Mottram 2018-06-09 10:40:44 +01:00
parent 83ea67971e
commit ab4b78778b
2 changed files with 20 additions and 0 deletions

View File

@ -165,6 +165,12 @@ function remove_apps_selected {
return
fi
if [ -f /tmp/.upgrading ]; then
dialog --title $"Cannot remove apps" \
--msgbox $"A system upgrade is happening, so apps cannot be removed at this time" 6 60
return
fi
# ask for confirmation
dialog --title $"Remove applications" \
--backtitle $"Freedombone" \
@ -212,6 +218,12 @@ function install_apps_selected {
fi
if [[ "$select_all_apps" != "add-all" ]]; then
if [ -f /tmp/.upgrading ]; then
dialog --title $"Cannot install apps" \
--msgbox $"A system upgrade is happening, so apps cannot be installed at this time" 6 60
return
fi
# ask for confirmation
if [ $n -eq 1 ]; then
dialog --title $"$installs" \

View File

@ -496,6 +496,10 @@ function list_chosen_apps {
}
function remove_apps {
if [ -f /tmp/.upgrading ]; then
return
fi
app_index=0
# shellcheck disable=SC2068
for a in ${APPS_AVAILABLE[@]}
@ -617,6 +621,10 @@ function remove_users_for_app {
function install_apps {
is_interactive=$1
if [ -f /tmp/.upgrading ]; then
return
fi
APP_INSTALLED_SUCCESS=1
# interactive install configuration for each app