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
352b259b
Commit
352b259b
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Extra onion app checks
parent
a1a7e92d
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
+57
-37
57 additions, 37 deletions
src/freedombone-utils-selector
with
57 additions
and
37 deletions
src/freedombone-utils-selector
+
57
−
37
View file @
352b259b
...
...
@@ -285,11 +285,12 @@ function detect_apps {
for
filename
in
$FILES
do
app_name
=
$(
echo
"
${
filename
}
"
|
awk
-F
'-app-'
'{print $2}'
)
# shellcheck disable=SC2068
if
!
item_in_array
"
${
app_name
}
"
${
APPS_AVAILABLE
[@]
}
;
then
APPS_AVAILABLE+
=(
"
${
app_name
}
"
)
APPS_CHOSEN+
=(
"0"
)
if
[[
$(
app_not_on_onion_only
"
$app_name
"
)
!=
"0"
]]
;
then
# shellcheck disable=SC2068
if
!
item_in_array
"
${
app_name
}
"
${
APPS_AVAILABLE
[@]
}
;
then
APPS_AVAILABLE+
=(
"
${
app_name
}
"
)
APPS_CHOSEN+
=(
"0"
)
fi
fi
done
...
...
@@ -298,6 +299,20 @@ function detect_apps {
get_apps_installed_names
}
function
app_not_on_onion_only
{
app_name
=
"
$1
"
read_config_param ONION_ONLY
if
[[
"
$ONION_ONLY
"
!=
'no'
]]
;
then
if
grep
-q
"NOT_ON_ONION=1"
"/usr/share/
${
PROJECT_NAME
}
/apps/
${
PROJECT_NAME
}
-app-
${
app_name
}
"
;
then
echo
"0"
return
fi
fi
echo
"1"
}
# detects what apps are available and can be installed
# If the variants list within an app script is an empty string then
# it is considered to be too experimental to be installable
...
...
@@ -318,16 +333,18 @@ function detect_installable_apps {
do
app_name
=
$(
echo
"
${
filename
}
"
|
awk
-F
'-app-'
'{print $2}'
)
# shellcheck disable=SC2068
if
!
item_in_array
"
${
app_name
}
"
${
APPS_AVAILABLE
[@]
}
;
then
variants_list
=
$(
app_variants
"
$filename
"
)
# check for empty string
if
[
${#
variants_list
}
-gt
0
]
;
then
APPS_AVAILABLE+
=(
"
${
app_name
}
"
)
APPS_CHOSEN+
=(
"0"
)
APPS_INSTALLED+
=(
"
$(
app_is_installed
"
$app_name
"
)
"
)
if
[[
$(
app_is_installed
"
$app_name
"
)
==
"1"
]]
;
then
APPS_INSTALLED_NAMES+
=(
"
$app_name
"
)
if
[[
$(
app_not_on_onion_only
"
$app_name
"
)
!=
"0"
]]
;
then
# shellcheck disable=SC2068
if
!
item_in_array
"
${
app_name
}
"
${
APPS_AVAILABLE
[@]
}
;
then
variants_list
=
$(
app_variants
"
$filename
"
)
# check for empty string
if
[
${#
variants_list
}
-gt
0
]
;
then
APPS_AVAILABLE+
=(
"
${
app_name
}
"
)
APPS_CHOSEN+
=(
"0"
)
APPS_INSTALLED+
=(
"
$(
app_is_installed
"
$app_name
"
)
"
)
if
[[
$(
app_is_installed
"
$app_name
"
)
==
"1"
]]
;
then
APPS_INSTALLED_NAMES+
=(
"
$app_name
"
)
fi
fi
fi
fi
...
...
@@ -350,13 +367,15 @@ function detect_installed_apps {
do
app_name
=
$(
echo
"
${
filename
}
"
|
awk
-F
'-app-'
'{print $2}'
)
if
[[
$(
app_is_installed
"
$app_name
"
)
==
"1"
]]
;
then
# shellcheck disable=SC2068
if
!
item_in_array
"
${
app_name
}
"
${
APPS_AVAILABLE
[@]
}
;
then
variants_list
=
$(
app_variants
"
$filename
"
)
if
[
${#
variants_list
}
-gt
0
]
;
then
APPS_AVAILABLE+
=(
"
${
app_name
}
"
)
APPS_INSTALLED_NAMES+
=(
"
$app_name
"
)
if
[[
$(
app_not_on_onion_only
"
$app_name
"
)
!=
"0"
]]
;
then
if
[[
$(
app_is_installed
"
$app_name
"
)
==
"1"
]]
;
then
# shellcheck disable=SC2068
if
!
item_in_array
"
${
app_name
}
"
${
APPS_AVAILABLE
[@]
}
;
then
variants_list
=
$(
app_variants
"
$filename
"
)
if
[
${#
variants_list
}
-gt
0
]
;
then
APPS_AVAILABLE+
=(
"
${
app_name
}
"
)
APPS_INSTALLED_NAMES+
=(
"
$app_name
"
)
fi
fi
fi
fi
...
...
@@ -385,27 +404,28 @@ function choose_apps_for_variant {
for
filename
in
$FILES
do
app_name
=
$(
echo
"
${
filename
}
"
|
awk
-F
'-app-'
'{print $2}'
)
# shellcheck disable=SC2068
if
item_in_array
"
${
app_name
}
"
${
APPS_AVAILABLE
[@]
}
;
then
if
grep
-q
"VARIANTS="
"
${
filename
}
"
;
then
variants_list
=
$(
app_variants
"
$filename
"
)
if
[[
"
${
variants_list
}
"
==
'all'
*
||
\
"
${
variants_list
}
"
==
"
$variant_name
"
||
\
"
${
variants_list
}
"
==
"
$variant_name
"
*
||
\
"
${
variants_list
}
"
==
*
"
$variant_name
"
*
||
\
"
${
variants_list
}
"
==
*
"
$variant_name
"
]]
;
then
if
[[
$(
app_is_removed
"
${
a
}
"
)
==
"0"
]]
;
then
#echo $"${app_name} chosen"
APPS_CHOSEN+
=(
"1"
)
if
[[
$(
app_not_on_onion_only
"
$app_name
"
)
!=
"0"
]]
;
then
# shellcheck disable=SC2068
if
item_in_array
"
${
app_name
}
"
${
APPS_AVAILABLE
[@]
}
;
then
if
grep
-q
"VARIANTS="
"
${
filename
}
"
;
then
variants_list
=
$(
app_variants
"
$filename
"
)
if
[[
"
${
variants_list
}
"
==
'all'
*
||
\
"
${
variants_list
}
"
==
"
$variant_name
"
||
\
"
${
variants_list
}
"
==
"
$variant_name
"
*
||
\
"
${
variants_list
}
"
==
*
"
$variant_name
"
*
||
\
"
${
variants_list
}
"
==
*
"
$variant_name
"
]]
;
then
if
[[
$(
app_is_removed
"
${
a
}
"
)
==
"0"
]]
;
then
#echo $"${app_name} chosen"
APPS_CHOSEN+
=(
"1"
)
else
APPS_CHOSEN+
=(
"0"
)
fi
else
APPS_CHOSEN+
=(
"0"
)
fi
else
APPS_CHOSEN+
=(
"0"
)
fi
else
APPS_CHOSEN+
=(
"0"
)
fi
fi
done
...
...
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