|  | @@ -106,6 +106,8 @@ function item_in_array {
 | 
	
		
			
			| 106 | 106 |  # returns a list of available system variants
 | 
	
		
			
			| 107 | 107 |  # based upon the variants string in each app script
 | 
	
		
			
			| 108 | 108 |  function available_system_variants {
 | 
	
		
			
			|  | 109 | +    function_check item_in_array
 | 
	
		
			
			|  | 110 | +
 | 
	
		
			
			| 109 | 111 |      FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
 | 
	
		
			
			| 110 | 112 |  
 | 
	
		
			
			| 111 | 113 |      new_available_variants_list=()
 | 
	
	
		
			
			|  | @@ -127,6 +129,8 @@ function available_system_variants {
 | 
	
		
			
			| 127 | 129 |  function is_valid_variant {
 | 
	
		
			
			| 128 | 130 |      sys_type="$1"
 | 
	
		
			
			| 129 | 131 |      available_variants_list=()
 | 
	
		
			
			|  | 132 | +
 | 
	
		
			
			|  | 133 | +    function_check available_system_variants
 | 
	
		
			
			| 130 | 134 |      available_system_variants
 | 
	
		
			
			| 131 | 135 |  
 | 
	
		
			
			| 132 | 136 |      for variant_str in "${available_variants_list[@]}"
 | 
	
	
		
			
			|  | @@ -140,6 +144,8 @@ function is_valid_variant {
 | 
	
		
			
			| 140 | 144 |  
 | 
	
		
			
			| 141 | 145 |  function show_available_variants {
 | 
	
		
			
			| 142 | 146 |      available_variants_list=()
 | 
	
		
			
			|  | 147 | +
 | 
	
		
			
			|  | 148 | +    function_check available_system_variants
 | 
	
		
			
			| 143 | 149 |      available_system_variants
 | 
	
		
			
			| 144 | 150 |  
 | 
	
		
			
			| 145 | 151 |      for variant_str in "${available_variants_list[@]}"
 | 
	
	
		
			
			|  | @@ -250,6 +256,8 @@ function get_apps_installed_names {
 | 
	
		
			
			| 250 | 256 |  function detect_apps {
 | 
	
		
			
			| 251 | 257 |      FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
 | 
	
		
			
			| 252 | 258 |  
 | 
	
		
			
			|  | 259 | +    function_check item_in_array
 | 
	
		
			
			|  | 260 | +
 | 
	
		
			
			| 253 | 261 |      APPS_AVAILABLE=()
 | 
	
		
			
			| 254 | 262 |      APPS_CHOSEN=()
 | 
	
		
			
			| 255 | 263 |  
 | 
	
	
		
			
			|  | @@ -281,7 +289,9 @@ function detect_installable_apps {
 | 
	
		
			
			| 281 | 289 |      APPS_INSTALLED=()
 | 
	
		
			
			| 282 | 290 |      APPS_INSTALLED_NAMES=()
 | 
	
		
			
			| 283 | 291 |  
 | 
	
		
			
			|  | 292 | +    function_check app_variants
 | 
	
		
			
			| 284 | 293 |      function_check app_is_installed
 | 
	
		
			
			|  | 294 | +    function_check item_in_array
 | 
	
		
			
			| 285 | 295 |  
 | 
	
		
			
			| 286 | 296 |      # for all the app scripts
 | 
	
		
			
			| 287 | 297 |      for filename in $FILES
 | 
	
	
		
			
			|  | @@ -309,6 +319,10 @@ function detect_installable_apps {
 | 
	
		
			
			| 309 | 319 |  function choose_apps_for_variant {
 | 
	
		
			
			| 310 | 320 |      variant_name="$1"
 | 
	
		
			
			| 311 | 321 |  
 | 
	
		
			
			|  | 322 | +    function_check item_in_array
 | 
	
		
			
			|  | 323 | +    function_check app_variants
 | 
	
		
			
			|  | 324 | +    function_check app_is_removed
 | 
	
		
			
			|  | 325 | +
 | 
	
		
			
			| 312 | 326 |      if [ ${#variant_name} -eq 0 ]; then
 | 
	
		
			
			| 313 | 327 |          echo $"No variant name for choosing apps"
 | 
	
		
			
			| 314 | 328 |          exit 237567
 | 
	
	
		
			
			|  | @@ -370,9 +384,16 @@ function remove_apps {
 | 
	
		
			
			| 370 | 384 |          if [[ ${APPS_INSTALLED[$app_index]} == "1" ]]; then
 | 
	
		
			
			| 371 | 385 |              if [[ ${APPS_CHOSEN[$app_index]} == "0" ]]; then
 | 
	
		
			
			| 372 | 386 |                  echo $"Removing application: ${a}"
 | 
	
		
			
			|  | 387 | +
 | 
	
		
			
			|  | 388 | +                function_check app_load_variables
 | 
	
		
			
			| 373 | 389 |                  app_load_variables ${a}
 | 
	
		
			
			|  | 390 | +
 | 
	
		
			
			|  | 391 | +                function_check remove_app
 | 
	
		
			
			| 374 | 392 |                  remove_app ${a}
 | 
	
		
			
			|  | 393 | +
 | 
	
		
			
			|  | 394 | +                function_check remove_${a}
 | 
	
		
			
			| 375 | 395 |                  remove_${a}
 | 
	
		
			
			|  | 396 | +
 | 
	
		
			
			| 376 | 397 |                  echo $"${a} was removed"
 | 
	
		
			
			| 377 | 398 |              fi
 | 
	
		
			
			| 378 | 399 |          fi
 | 
	
	
		
			
			|  | @@ -417,8 +438,10 @@ function install_apps {
 | 
	
		
			
			| 417 | 438 |              if [[ ${APPS_CHOSEN[$app_index]} == "1" ]]; then
 | 
	
		
			
			| 418 | 439 |                  if [ ${is_interactive} ]; then
 | 
	
		
			
			| 419 | 440 |                      # clears any removal indicator
 | 
	
		
			
			|  | 441 | +                    function_check reinstall_app
 | 
	
		
			
			| 420 | 442 |                      reinstall_app ${a}
 | 
	
		
			
			| 421 | 443 |  
 | 
	
		
			
			|  | 444 | +                    function_check app_load_variables
 | 
	
		
			
			| 422 | 445 |                      app_load_variables ${a}
 | 
	
		
			
			| 423 | 446 |  
 | 
	
		
			
			| 424 | 447 |                      if [[ $(app_is_installed ${a}) == "1" ]]; then
 | 
	
	
		
			
			|  | @@ -430,7 +453,10 @@ function install_apps {
 | 
	
		
			
			| 430 | 453 |                          APP_INSTALLED=
 | 
	
		
			
			| 431 | 454 |                          install_${a}
 | 
	
		
			
			| 432 | 455 |                          if [ $APP_INSTALLED ]; then
 | 
	
		
			
			|  | 456 | +                            function_check app_save_variables
 | 
	
		
			
			| 433 | 457 |                              app_save_variables ${a}
 | 
	
		
			
			|  | 458 | +
 | 
	
		
			
			|  | 459 | +                            function_check install_completed
 | 
	
		
			
			| 434 | 460 |                              install_completed ${a}
 | 
	
		
			
			| 435 | 461 |                              echo $"${a} was installed from interactive"
 | 
	
		
			
			| 436 | 462 |                          else
 | 
	
	
		
			
			|  | @@ -440,6 +466,7 @@ function install_apps {
 | 
	
		
			
			| 440 | 466 |                  else
 | 
	
		
			
			| 441 | 467 |                      # check if the app was removed
 | 
	
		
			
			| 442 | 468 |                      if [[ $(app_is_removed ${a}) == "0" ]]; then
 | 
	
		
			
			|  | 469 | +                        function_check app_load_variables
 | 
	
		
			
			| 443 | 470 |                          app_load_variables ${a}
 | 
	
		
			
			| 444 | 471 |                          if [[ $(app_is_installed ${a}) == "1" ]]; then
 | 
	
		
			
			| 445 | 472 |                              echo $"Upgrading application: ${a}"
 | 
	
	
		
			
			|  | @@ -450,7 +477,10 @@ function install_apps {
 | 
	
		
			
			| 450 | 477 |                              APP_INSTALLED=
 | 
	
		
			
			| 451 | 478 |                              install_${a}
 | 
	
		
			
			| 452 | 479 |                              if [ $APP_INSTALLED ]; then
 | 
	
		
			
			|  | 480 | +                                function_check app_save_variables
 | 
	
		
			
			| 453 | 481 |                                  app_save_variables ${a}
 | 
	
		
			
			|  | 482 | +
 | 
	
		
			
			|  | 483 | +                                function_check install_completed
 | 
	
		
			
			| 454 | 484 |                                  install_completed ${a}
 | 
	
		
			
			| 455 | 485 |                                  echo $"${a} was installed"
 | 
	
		
			
			| 456 | 486 |                              else
 | 
	
	
		
			
			|  | @@ -466,6 +496,7 @@ function install_apps {
 | 
	
		
			
			| 466 | 496 |          app_index=$[app_index+1]
 | 
	
		
			
			| 467 | 497 |      done
 | 
	
		
			
			| 468 | 498 |  
 | 
	
		
			
			|  | 499 | +    function_check update_installed_apps_list
 | 
	
		
			
			| 469 | 500 |      update_installed_apps_list
 | 
	
		
			
			| 470 | 501 |  }
 | 
	
		
			
			| 471 | 502 |  
 |