Extra onion app checks
This commit is contained in:
parent
a1a7e92d90
commit
352b259bbb
|
@ -285,11 +285,12 @@ function detect_apps {
|
||||||
for filename in $FILES
|
for filename in $FILES
|
||||||
do
|
do
|
||||||
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
||||||
|
if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
|
||||||
# shellcheck disable=SC2068
|
# shellcheck disable=SC2068
|
||||||
if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
||||||
APPS_AVAILABLE+=("${app_name}")
|
APPS_AVAILABLE+=("${app_name}")
|
||||||
APPS_CHOSEN+=("0")
|
APPS_CHOSEN+=("0")
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -298,6 +299,20 @@ function detect_apps {
|
||||||
get_apps_installed_names
|
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
|
# detects what apps are available and can be installed
|
||||||
# If the variants list within an app script is an empty string then
|
# If the variants list within an app script is an empty string then
|
||||||
# it is considered to be too experimental to be installable
|
# it is considered to be too experimental to be installable
|
||||||
|
@ -318,16 +333,18 @@ function detect_installable_apps {
|
||||||
do
|
do
|
||||||
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
||||||
|
|
||||||
# shellcheck disable=SC2068
|
if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
|
||||||
if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
# shellcheck disable=SC2068
|
||||||
variants_list=$(app_variants "$filename")
|
if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
||||||
# check for empty string
|
variants_list=$(app_variants "$filename")
|
||||||
if [ ${#variants_list} -gt 0 ]; then
|
# check for empty string
|
||||||
APPS_AVAILABLE+=("${app_name}")
|
if [ ${#variants_list} -gt 0 ]; then
|
||||||
APPS_CHOSEN+=("0")
|
APPS_AVAILABLE+=("${app_name}")
|
||||||
APPS_INSTALLED+=("$(app_is_installed "$app_name")")
|
APPS_CHOSEN+=("0")
|
||||||
if [[ $(app_is_installed "$app_name") == "1" ]]; then
|
APPS_INSTALLED+=("$(app_is_installed "$app_name")")
|
||||||
APPS_INSTALLED_NAMES+=("$app_name")
|
if [[ $(app_is_installed "$app_name") == "1" ]]; then
|
||||||
|
APPS_INSTALLED_NAMES+=("$app_name")
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -350,13 +367,15 @@ function detect_installed_apps {
|
||||||
do
|
do
|
||||||
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
||||||
|
|
||||||
if [[ $(app_is_installed "$app_name") == "1" ]]; then
|
if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
|
||||||
# shellcheck disable=SC2068
|
if [[ $(app_is_installed "$app_name") == "1" ]]; then
|
||||||
if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
# shellcheck disable=SC2068
|
||||||
variants_list=$(app_variants "$filename")
|
if ! item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
||||||
if [ ${#variants_list} -gt 0 ]; then
|
variants_list=$(app_variants "$filename")
|
||||||
APPS_AVAILABLE+=("${app_name}")
|
if [ ${#variants_list} -gt 0 ]; then
|
||||||
APPS_INSTALLED_NAMES+=("$app_name")
|
APPS_AVAILABLE+=("${app_name}")
|
||||||
|
APPS_INSTALLED_NAMES+=("$app_name")
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -385,27 +404,28 @@ function choose_apps_for_variant {
|
||||||
for filename in $FILES
|
for filename in $FILES
|
||||||
do
|
do
|
||||||
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
|
||||||
|
if [[ $(app_not_on_onion_only "$app_name") != "0" ]]; then
|
||||||
# shellcheck disable=SC2068
|
# shellcheck disable=SC2068
|
||||||
if item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
if item_in_array "${app_name}" ${APPS_AVAILABLE[@]}; then
|
||||||
if grep -q "VARIANTS=" "${filename}"; then
|
if grep -q "VARIANTS=" "${filename}"; then
|
||||||
variants_list=$(app_variants "$filename")
|
variants_list=$(app_variants "$filename")
|
||||||
if [[ "${variants_list}" == 'all'* || \
|
if [[ "${variants_list}" == 'all'* || \
|
||||||
"${variants_list}" == "$variant_name" || \
|
"${variants_list}" == "$variant_name" || \
|
||||||
"${variants_list}" == "$variant_name "* || \
|
"${variants_list}" == "$variant_name "* || \
|
||||||
"${variants_list}" == *" $variant_name "* || \
|
"${variants_list}" == *" $variant_name "* || \
|
||||||
"${variants_list}" == *" $variant_name" ]]; then
|
"${variants_list}" == *" $variant_name" ]]; then
|
||||||
if [[ $(app_is_removed "${a}") == "0" ]]; then
|
if [[ $(app_is_removed "${a}") == "0" ]]; then
|
||||||
#echo $"${app_name} chosen"
|
#echo $"${app_name} chosen"
|
||||||
APPS_CHOSEN+=("1")
|
APPS_CHOSEN+=("1")
|
||||||
|
else
|
||||||
|
APPS_CHOSEN+=("0")
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
APPS_CHOSEN+=("0")
|
APPS_CHOSEN+=("0")
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
APPS_CHOSEN+=("0")
|
APPS_CHOSEN+=("0")
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
APPS_CHOSEN+=("0")
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue