Przeglądaj źródła

Initially select all apps for install in interactive mode

Bob Mottram 8 lat temu
rodzic
commit
ad39b2c78d

+ 32
- 12
src/freedombone-addremove Wyświetl plik

130
 }
130
 }
131
 
131
 
132
 function install_apps_selected {
132
 function install_apps_selected {
133
+    select_all_apps=$1
133
     # which apps need to be installed?
134
     # which apps need to be installed?
134
     installs=""
135
     installs=""
135
     app_index=0
136
     app_index=0
136
     n=0
137
     n=0
137
-    for a in "${APPS_INSTALLED[@]}"
138
-    do
139
-        if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
140
-            if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
138
+
139
+    if [ ! $select_all_apps ]; then
140
+        for a in "${APPS_INSTALLED[@]}"
141
+        do
142
+            if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
143
+                if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
144
+                    if [ ${n} -gt 0 ]; then
145
+                        installs="$installs ${APPS_AVAILABLE[$app_index]}"
146
+                    else
147
+                        installs="${APPS_AVAILABLE[$app_index]}"
148
+                    fi
149
+                    n=$[n+1]
150
+                fi
151
+            fi
152
+            app_index=$[app_index+1]
153
+        done
154
+    fi
155
+
156
+    if [[ $select_all_apps == "add-all" ]]; then
157
+        for a in "${APPS_INSTALLED[@]}"
158
+        do
159
+            if [[ ${APPS_INSTALLED[$app_index]} == "0" ]]; then
141
                 if [ ${n} -gt 0 ]; then
160
                 if [ ${n} -gt 0 ]; then
142
                     installs="$installs ${APPS_AVAILABLE[$app_index]}"
161
                     installs="$installs ${APPS_AVAILABLE[$app_index]}"
143
                 else
162
                 else
145
                 fi
164
                 fi
146
                 n=$[n+1]
165
                 n=$[n+1]
147
             fi
166
             fi
148
-        fi
149
-        app_index=$[app_index+1]
150
-    done
167
+            APPS_CHOSEN[$app_index]="1"
168
+            app_index=$[app_index+1]
169
+        done
170
+    fi
151
 
171
 
152
     # if no apps to be installed then don't do anything
172
     # if no apps to be installed then don't do anything
153
     if [ ${n} -eq 0 ]; then
173
     if [ ${n} -eq 0 ]; then
181
 
201
 
182
 detect_installable_apps
202
 detect_installable_apps
183
 
203
 
184
-if [[ $1 == "all"* ]]; then
185
-    choose_all_installable_apps
186
-fi
187
-
188
 # if no applications were found
204
 # if no applications were found
189
 if [[ ${#APPS_AVAILABLE[@]} == 0 ]]; then
205
 if [[ ${#APPS_AVAILABLE[@]} == 0 ]]; then
190
     exit 1
206
     exit 1
195
 clear
211
 clear
196
 
212
 
197
 remove_apps_selected
213
 remove_apps_selected
198
-install_apps_selected
214
+if [[ $1 == "add-all" ]]; then
215
+    install_apps_selected add-all
216
+else
217
+    install_apps_selected
218
+fi
199
 
219
 
200
 exit 0
220
 exit 0

+ 0
- 10
src/freedombone-utils-selector Wyświetl plik

316
     done
316
     done
317
 }
317
 }
318
 
318
 
319
-function choose_all_installable_apps {
320
-    # selects all of the apps
321
-    app_index=0
322
-    for a in "${APPS_AVAILABLE[@]}"
323
-    do
324
-        APPS_CHOSEN[$app_index]="1"
325
-        app_index=$[app_index+1]
326
-    done
327
-}
328
-
329
 # creates the APPS_AVAILABLE and APPS_CHOSEN arrays based on
319
 # creates the APPS_AVAILABLE and APPS_CHOSEN arrays based on
330
 # the given variant name
320
 # the given variant name
331
 function choose_apps_for_variant {
321
 function choose_apps_for_variant {

+ 1
- 1
src/freedombone-utils-setup Wyświetl plik

535
     upgrade_apps
535
     upgrade_apps
536
 
536
 
537
     if [[ $is_interactive == "menuconfig"* ]]; then
537
     if [[ $is_interactive == "menuconfig"* ]]; then
538
-        ${PROJECT_NAME}-addremove all
538
+        ${PROJECT_NAME}-addremove add-all
539
     fi
539
     fi
540
 
540
 
541
     if [[ $is_interactive == "noninteractive" || $is_interactive == "headless" ]]; then
541
     if [[ $is_interactive == "noninteractive" || $is_interactive == "headless" ]]; then