diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2017-07-20 23:12:55 -0400 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2017-07-21 02:04:43 -0400 |
commit | 656823d295a2740118428490099a33e09f76fe68 (patch) | |
tree | 5a74d2f9fc178dc2689c5b80713ba2f97e1b2ee8 | |
parent | ae33b7b9573e0d152dafa3cdc1d02882a778dee3 (diff) | |
download | librebootfr-656823d295a2740118428490099a33e09f76fe68.tar.gz librebootfr-656823d295a2740118428490099a33e09f76fe68.zip |
Create array TOOL_ACTIONS_GENERIC_IGNORE_CHECK
Located in libs/tool, this array's elements are compared with actions
in TOOLS_ACTIONS_GENERIC when libreboot_setup_tool_actions() is
called. This makes it simpler to add/remove actions which
should/shouldn't have a corresponding check function in TOOL_ACTIONS.
-rwxr-xr-x | libreboot | 4 | ||||
-rwxr-xr-x | libs/tool | 1 |
2 files changed, 4 insertions, 1 deletions
@@ -155,12 +155,14 @@ libreboot_setup_include() { libreboot_setup_tool_actions() { local -i tool_actions_count="${#TOOL_ACTIONS_GENERIC[@]}" + local ignore="${TOOL_ACTIONS_GENERIC_IGNORE_CHECK[*]}" + 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 + if [[ "${TOOL_ACTIONS_GENERIC[i]}" == !(${ignore// /|}) ]]; then tool_actions+=("${TOOL_ACTIONS_GENERIC[i]/%/_check}") fi done @@ -16,6 +16,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. TOOL_ACTIONS_GENERIC=(usage update execute) +TOOL_ACTIONS_GENERIC_IGNORE_CHECK=(usage update) TOOL_ACTIONS_HELPERS=(arguments) tool_include() { |