diff options
-rwxr-xr-x | libreboot | 16 | ||||
-rwxr-xr-x | libs/tool | 5 |
2 files changed, 16 insertions, 5 deletions
@@ -129,6 +129,7 @@ libreboot_setup() { executable="$(basename "$0")" libreboot_setup_include + libreboot_setup_tool_actions libreboot_setup_project_actions requirements 'tar' 'sed' 'gpg' 'sha256sum' 'git' @@ -136,6 +137,21 @@ libreboot_setup() { libreboot_setup_variables } +libreboot_setup_tool_actions() { + local -i tool_actions_count="${#TOOL_ACTIONS_GENERIC[@]}" + local -a tool_actions + + for ((i=0; i<"${tool_actions_count}"; i++)); do + tool_actions+=("${TOOL_ACTIONS_GENERIC[i]}") + + if [[ "${TOOL_ACTIONS_GENERIC[i]}" == @(extract) ]]; then + tool_actions+=("${TOOL_ACTIONS_GENERIC[i]/%/_check}") + fi + done + + TOOL_ACTIONS=("${TOOL_ACTIONS_HELPERS[@]}" "${tool_actions[@]}") +} + libreboot_setup_project_actions() { local -i project_actions_count="${#PROJECT_ACTIONS_GENERIC[@]}" local -a project_actions @@ -17,11 +17,6 @@ TOOL_ACTIONS_GENERIC=(usage update execute) TOOL_ACTIONS_HELPERS=(arguments) -TOOL_ACTIONS=( - "${TOOL_ACTIONS_GENERIC[@]}" - "${TOOL_ACTIONS_GENERIC[@]/%/_check}" - "${TOOL_ACTIONS_HELPERS[@]}" -) tool_include() { local tool=$1 |