Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
9783a402
Commit
9783a402
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Function checks
parent
dd6b3b5d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-utils-selector
+31
-0
31 additions, 0 deletions
src/freedombone-utils-selector
with
31 additions
and
0 deletions
src/freedombone-utils-selector
+
31
−
0
View file @
9783a402
...
...
@@ -106,6 +106,8 @@ function item_in_array {
# returns a list of available system variants
# based upon the variants string in each app script
function
available_system_variants
{
function_check item_in_array
FILES
=
/usr/share/
${
PROJECT_NAME
}
/apps/
${
PROJECT_NAME
}
-app-
*
new_available_variants_list
=()
...
...
@@ -127,6 +129,8 @@ function available_system_variants {
function
is_valid_variant
{
sys_type
=
"
$1
"
available_variants_list
=()
function_check available_system_variants
available_system_variants
for
variant_str
in
"
${
available_variants_list
[@]
}
"
...
...
@@ -140,6 +144,8 @@ function is_valid_variant {
function
show_available_variants
{
available_variants_list
=()
function_check available_system_variants
available_system_variants
for
variant_str
in
"
${
available_variants_list
[@]
}
"
...
...
@@ -250,6 +256,8 @@ function get_apps_installed_names {
function
detect_apps
{
FILES
=
/usr/share/
${
PROJECT_NAME
}
/apps/
${
PROJECT_NAME
}
-app-
*
function_check item_in_array
APPS_AVAILABLE
=()
APPS_CHOSEN
=()
...
...
@@ -281,7 +289,9 @@ function detect_installable_apps {
APPS_INSTALLED
=()
APPS_INSTALLED_NAMES
=()
function_check app_variants
function_check app_is_installed
function_check item_in_array
# for all the app scripts
for
filename
in
$FILES
...
...
@@ -309,6 +319,10 @@ function detect_installable_apps {
function
choose_apps_for_variant
{
variant_name
=
"
$1
"
function_check item_in_array
function_check app_variants
function_check app_is_removed
if
[
${#
variant_name
}
-eq
0
]
;
then
echo
$"No variant name for choosing apps"
exit
237567
...
...
@@ -370,9 +384,16 @@ function remove_apps {
if
[[
${
APPS_INSTALLED
[
$app_index
]
}
==
"1"
]]
;
then
if
[[
${
APPS_CHOSEN
[
$app_index
]
}
==
"0"
]]
;
then
echo
$"Removing application:
${
a
}
"
function_check app_load_variables
app_load_variables
${
a
}
function_check remove_app
remove_app
${
a
}
function_check remove_
${
a
}
remove_
${
a
}
echo
$"
${
a
}
was removed"
fi
fi
...
...
@@ -417,8 +438,10 @@ function install_apps {
if
[[
${
APPS_CHOSEN
[
$app_index
]
}
==
"1"
]]
;
then
if
[
${
is_interactive
}
]
;
then
# clears any removal indicator
function_check reinstall_app
reinstall_app
${
a
}
function_check app_load_variables
app_load_variables
${
a
}
if
[[
$(
app_is_installed
${
a
}
)
==
"1"
]]
;
then
...
...
@@ -430,7 +453,10 @@ function install_apps {
APP_INSTALLED
=
install_
${
a
}
if
[
$APP_INSTALLED
]
;
then
function_check app_save_variables
app_save_variables
${
a
}
function_check install_completed
install_completed
${
a
}
echo
$"
${
a
}
was installed from interactive"
else
...
...
@@ -440,6 +466,7 @@ function install_apps {
else
# check if the app was removed
if
[[
$(
app_is_removed
${
a
}
)
==
"0"
]]
;
then
function_check app_load_variables
app_load_variables
${
a
}
if
[[
$(
app_is_installed
${
a
}
)
==
"1"
]]
;
then
echo
$"Upgrading application:
${
a
}
"
...
...
@@ -450,7 +477,10 @@ function install_apps {
APP_INSTALLED
=
install_
${
a
}
if
[
$APP_INSTALLED
]
;
then
function_check app_save_variables
app_save_variables
${
a
}
function_check install_completed
install_completed
${
a
}
echo
$"
${
a
}
was installed"
else
...
...
@@ -466,6 +496,7 @@ function install_apps {
app_index
=
$[
app_index+1]
done
function_check update_installed_apps_list
update_installed_apps_list
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment