Browse Source

Prevent apps from being installed or removed during upgrades

Bob Mottram 6 years ago
parent
commit
ab4b78778b
2 changed files with 20 additions and 0 deletions
  1. 12
    0
      src/freedombone-addremove
  2. 8
    0
      src/freedombone-utils-selector

+ 12
- 0
src/freedombone-addremove View File

165
         return
165
         return
166
     fi
166
     fi
167
 
167
 
168
+    if [ -f /tmp/.upgrading ]; then
169
+        dialog --title $"Cannot remove apps" \
170
+               --msgbox $"A system upgrade is happening, so apps cannot be removed at this time" 6 60
171
+        return
172
+    fi
173
+
168
     # ask for confirmation
174
     # ask for confirmation
169
     dialog --title $"Remove applications" \
175
     dialog --title $"Remove applications" \
170
            --backtitle $"Freedombone" \
176
            --backtitle $"Freedombone" \
212
     fi
218
     fi
213
 
219
 
214
     if [[ "$select_all_apps" != "add-all" ]]; then
220
     if [[ "$select_all_apps" != "add-all" ]]; then
221
+        if [ -f /tmp/.upgrading ]; then
222
+            dialog --title $"Cannot install apps" \
223
+                   --msgbox $"A system upgrade is happening, so apps cannot be installed at this time" 6 60
224
+            return
225
+        fi
226
+
215
         # ask for confirmation
227
         # ask for confirmation
216
         if [ $n -eq 1 ]; then
228
         if [ $n -eq 1 ]; then
217
             dialog --title $"$installs" \
229
             dialog --title $"$installs" \

+ 8
- 0
src/freedombone-utils-selector View File

496
 }
496
 }
497
 
497
 
498
 function remove_apps {
498
 function remove_apps {
499
+    if [ -f /tmp/.upgrading ]; then
500
+        return
501
+    fi
502
+
499
     app_index=0
503
     app_index=0
500
     # shellcheck disable=SC2068
504
     # shellcheck disable=SC2068
501
     for a in ${APPS_AVAILABLE[@]}
505
     for a in ${APPS_AVAILABLE[@]}
617
 function install_apps {
621
 function install_apps {
618
     is_interactive=$1
622
     is_interactive=$1
619
 
623
 
624
+    if [ -f /tmp/.upgrading ]; then
625
+        return
626
+    fi
627
+
620
     APP_INSTALLED_SUCCESS=1
628
     APP_INSTALLED_SUCCESS=1
621
 
629
 
622
     # interactive install configuration for each app
630
     # interactive install configuration for each app