Browse Source

Mark initial removed apps

Bob Mottram 8 years ago
parent
commit
b7de2bacec
1 changed files with 23 additions and 0 deletions
  1. 23
    0
      src/freedombone-addremove

+ 23
- 0
src/freedombone-addremove View File

55
   source $f
55
   source $f
56
 done
56
 done
57
 
57
 
58
+function mark_unselected_apps_as_removed {
59
+    # Initially mark the apps not selected on first install as being removed
60
+    # otherwise they may be automatically installed on the next update
61
+    select_all_apps=$1
62
+    if [[ "$select_all_apps" != "add-all" ]]; then
63
+        return
64
+    fi
65
+
66
+    if [ -f $REMOVED_APPS_FILE ]; then
67
+        rm $REMOVED_APPS_FILE
68
+    fi
69
+
70
+    app_index=0
71
+    for app_name in "${APPS_AVAILABLE[@]}"
72
+    do
73
+        if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
74
+            echo "_${app_name}_" >> $REMOVED_APPS_FILE
75
+        fi
76
+        app_index=$[app_index+1]
77
+    done
78
+}
79
+
58
 function show_apps {
80
 function show_apps {
59
     select_all_apps=$1
81
     select_all_apps=$1
60
     applist=""
82
     applist=""
199
 fi
221
 fi
200
 
222
 
201
 show_apps $1
223
 show_apps $1
224
+mark_unselected_apps_as_removed $1
202
 
225
 
203
 clear
226
 clear
204
 
227