Sfoglia il codice sorgente

Some apps will not install on arm

Bob Mottram 6 anni fa
parent
commit
71c2059742
2 ha cambiato i file con 57 aggiunte e 35 eliminazioni
  1. 1
    0
      src/freedombone-app-rocketchat
  2. 56
    35
      src/freedombone-utils-selector

+ 1
- 0
src/freedombone-app-rocketchat Vedi File

@@ -29,6 +29,7 @@ VARIANTS='full full-vim'
29 29
 
30 30
 IN_DEFAULT_INSTALL=0
31 31
 SHOW_ON_ABOUT=1
32
+NOT_ON_ARM=1
32 33
 
33 34
 ROCKETCHAT_DOMAIN_NAME=
34 35
 ROCKETCHAT_CODE=

+ 56
- 35
src/freedombone-utils-selector Vedi File

@@ -286,6 +286,19 @@ function app_not_on_onion_only {
286 286
     echo "1"
287 287
 }
288 288
 
289
+function app_not_on_arm {
290
+    app_name="$1"
291
+
292
+    if grep -q "NOT_ON_ARM=1" "/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${app_name}"; then
293
+        archtype=$(uname -m)
294
+        if [[ "$archtype" == 'arm'* ]]; then
295
+            echo "0"
296
+            return
297
+        fi
298
+    fi
299
+    echo "1"
300
+}
301
+
289 302
 function enough_ram_for_app {
290 303
     app_name="$1"
291 304
 
@@ -320,10 +333,12 @@ function detect_apps {
320 333
         app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
321 334
         if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
322 335
             if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
323
-                # shellcheck disable=SC2068
324
-                if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
325
-                    APPS_AVAILABLE+=("${app_name}")
326
-                    APPS_CHOSEN+=("0")
336
+                if [[ $(app_not_on_arm "$app_name") != "0" ]]; then
337
+                    # shellcheck disable=SC2068
338
+                    if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
339
+                        APPS_AVAILABLE+=("${app_name}")
340
+                        APPS_CHOSEN+=("0")
341
+                    fi
327 342
                 fi
328 343
             fi
329 344
         fi
@@ -356,16 +371,18 @@ function detect_installable_apps {
356 371
 
357 372
         if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
358 373
             if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
359
-                # shellcheck disable=SC2068
360
-                if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
361
-                    variants_list=$(app_variants "$filename")
362
-                    # check for empty string
363
-                    if [ ${#variants_list} -gt 0 ]; then
364
-                        APPS_AVAILABLE+=("${app_name}")
365
-                        APPS_CHOSEN+=("0")
366
-                        APPS_INSTALLED+=("$(app_is_installed "$app_name")")
367
-                        if [[ $(app_is_installed "$app_name") == "1" ]]; then
368
-                            APPS_INSTALLED_NAMES+=("$app_name")
374
+                if [[ $(app_not_on_arm "$app_name") != "0" ]]; then
375
+                    # shellcheck disable=SC2068
376
+                    if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
377
+                        variants_list=$(app_variants "$filename")
378
+                        # check for empty string
379
+                        if [ ${#variants_list} -gt 0 ]; then
380
+                            APPS_AVAILABLE+=("${app_name}")
381
+                            APPS_CHOSEN+=("0")
382
+                            APPS_INSTALLED+=("$(app_is_installed "$app_name")")
383
+                            if [[ $(app_is_installed "$app_name") == "1" ]]; then
384
+                                APPS_INSTALLED_NAMES+=("$app_name")
385
+                            fi
369 386
                         fi
370 387
                     fi
371 388
                 fi
@@ -392,13 +409,15 @@ function detect_installed_apps {
392 409
 
393 410
         if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
394 411
             if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
395
-                if [[ $(app_is_installed "$app_name") == "1" ]]; then
396
-                    # shellcheck disable=SC2068
397
-                    if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
398
-                        variants_list=$(app_variants "$filename")
399
-                        if [ ${#variants_list} -gt 0 ]; then
400
-                            APPS_AVAILABLE+=("${app_name}")
401
-                            APPS_INSTALLED_NAMES+=("$app_name")
412
+                if [[ $(app_not_on_arm "$app_name") != "0" ]]; then
413
+                    if [[ $(app_is_installed "$app_name") == "1" ]]; then
414
+                        # shellcheck disable=SC2068
415
+                        if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
416
+                            variants_list=$(app_variants "$filename")
417
+                            if [ ${#variants_list} -gt 0 ]; then
418
+                                APPS_AVAILABLE+=("${app_name}")
419
+                                APPS_INSTALLED_NAMES+=("$app_name")
420
+                            fi
402 421
                         fi
403 422
                     fi
404 423
                 fi
@@ -431,26 +450,28 @@ function choose_apps_for_variant {
431 450
         app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
432 451
         if [[ $(enough_ram_for_app "$app_name") == "0" ]]; then
433 452
             if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
434
-                # shellcheck disable=SC2068
435
-                if item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
436
-                    if grep -q "VARIANTS=" "${filename}"; then
437
-                        variants_list=$(app_variants "$filename")
438
-                        if [[ "${variants_list}" == 'all'* || \
439
-                                  "${variants_list}" == "$variant_name" || \
440
-                                  "${variants_list}" == "$variant_name "* || \
441
-                                  "${variants_list}" == *" $variant_name "* || \
442
-                                  "${variants_list}" == *" $variant_name" ]]; then
443
-                            if [[ $(app_is_removed "${a}") == "0" ]]; then
444
-                                #echo $"${app_name} chosen"
445
-                                APPS_CHOSEN+=("1")
453
+                if [[ $(app_not_on_arm "$app_name") != "0" ]]; then
454
+                    # shellcheck disable=SC2068
455
+                    if item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
456
+                        if grep -q "VARIANTS=" "${filename}"; then
457
+                            variants_list=$(app_variants "$filename")
458
+                            if [[ "${variants_list}" == 'all'* || \
459
+                                      "${variants_list}" == "$variant_name" || \
460
+                                      "${variants_list}" == "$variant_name "* || \
461
+                                      "${variants_list}" == *" $variant_name "* || \
462
+                                      "${variants_list}" == *" $variant_name" ]]; then
463
+                                if [[ $(app_is_removed "${a}") == "0" ]]; then
464
+                                    #echo $"${app_name} chosen"
465
+                                    APPS_CHOSEN+=("1")
466
+                                else
467
+                                    APPS_CHOSEN+=("0")
468
+                                fi
446 469
                             else
447 470
                                 APPS_CHOSEN+=("0")
448 471
                             fi
449 472
                         else
450 473
                             APPS_CHOSEN+=("0")
451 474
                         fi
452
-                    else
453
-                        APPS_CHOSEN+=("0")
454 475
                     fi
455 476
                 fi
456 477
             fi