Browse Source

Fix app removal lists

Bob Mottram 8 years ago
parent
commit
63ce7511ad
1 changed files with 12 additions and 1 deletions
  1. 12
    1
      src/freedombone-utils-selector

+ 12
- 1
src/freedombone-utils-selector View File

43
 # file containing a list of removed apps
43
 # file containing a list of removed apps
44
 REMOVED_APPS_FILE=/root/removed
44
 REMOVED_APPS_FILE=/root/removed
45
 
45
 
46
+INSTALLED_APPS_LIST=/usr/share/${PROJECT_NAME}/installed.txt
47
+
48
+if [ ! $COMPLETION_FILE ]; then
49
+    COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
50
+fi
51
+
46
 # Loads variables defined at the beginning of an app script
52
 # Loads variables defined at the beginning of an app script
47
 function app_load_variables {
53
 function app_load_variables {
48
     app_name=$1
54
     app_name=$1
148
     if ! grep -Fxq "_${app_name}_" $REMOVED_APPS_FILE; then
154
     if ! grep -Fxq "_${app_name}_" $REMOVED_APPS_FILE; then
149
         echo "_${app_name}_" >> $REMOVED_APPS_FILE
155
         echo "_${app_name}_" >> $REMOVED_APPS_FILE
150
     fi
156
     fi
157
+    if grep -Fxq "install_${app_name}" $COMPLETION_FILE; then
158
+        sed -i "/install_${app_name}/d" $COMPLETION_FILE
159
+    fi
160
+    if grep -Fxq "install_${app_name}" $INSTALLED_APPS_LIST; then
161
+        sed -i "/install_${app_name}/d" $INSTALLED_APPS_LIST
162
+    fi
151
 }
163
 }
152
 
164
 
153
 # returns 1 if an app has been marked as removed
165
 # returns 1 if an app has been marked as removed
182
 
194
 
183
     # Why does this secondary file exist, apart from COMPLETION_FILE ?
195
     # Why does this secondary file exist, apart from COMPLETION_FILE ?
184
     # It's so that it is visible to unprivileged users from the user control panel
196
     # It's so that it is visible to unprivileged users from the user control panel
185
-    INSTALLED_APPS_LIST=/usr/share/${PROJECT_NAME}/installed.txt
186
     if [ -f $INSTALLED_APPS_LIST ]; then
197
     if [ -f $INSTALLED_APPS_LIST ]; then
187
         if ! grep -Fxq "install_${app_name}" $INSTALLED_APPS_LIST; then
198
         if ! grep -Fxq "install_${app_name}" $INSTALLED_APPS_LIST; then
188
             echo "0"
199
             echo "0"