diff options
-rwxr-xr-x | libreboot | 6 | ||||
-rwxr-xr-x | libs/project | 16 |
2 files changed, 8 insertions, 14 deletions
@@ -155,12 +155,11 @@ 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 + for ((i=0, nogeneric=${#TOOL_ACTIONS_GENERIC[@]}; i<nogeneric; ++i)); do tool_actions+=("${TOOL_ACTIONS_GENERIC[i]}") if [[ "${TOOL_ACTIONS_GENERIC[i]}" == !(${ignore// /|}) ]]; then @@ -172,12 +171,11 @@ libreboot_setup_tool_actions() { } libreboot_setup_project_actions() { - local -i project_actions_count="${#PROJECT_ACTIONS_GENERIC[@]}" local ignore="${PROJECT_ACTIONS_GENERIC_IGNORE_CHECK[*]}" local -a project_actions - for ((i=0; i<"$project_actions_count"; i++)); do + for ((i=0, nogeneric=${#PROJECT_ACTIONS_GENERIC[@]}; i<nogeneric; ++i)); do project_actions+=("${PROJECT_ACTIONS_GENERIC[i]}") if [[ "${PROJECT_ACTIONS_GENERIC[i]}" == !(${ignore// /|}) ]]; then diff --git a/libs/project b/libs/project index 6fae6fa0..25d6ca74 100755 --- a/libs/project +++ b/libs/project @@ -75,13 +75,12 @@ project_dependencies_check() { local -a dependencies mapfile -t dependencies < <(project_dependencies "$project" "$@") - local -i count=${#dependencies[@]} local -i missing=0 - for ((i = 0; i < count; i++)); do + for ((i = 0, nodeps = ${#dependencies[@]}; i < nodeps; ++i)); do local -a dependency=(${dependencies[i]}) - project_check "${dependency[0]}" || let missing++ + project_check "${dependency[0]}" || let ++missing done return $missing @@ -94,14 +93,13 @@ project_dependencies_sources_check() { local -a dependencies mapfile -t dependencies < <(project_dependencies "$project" "$@") - local -i count=${#dependencies[@]} local -i missing=0 - for ((i = 0; i < count; i++)); do + for ((i = 0, nodeps = ${#dependencies[@]}; i < nodeps; ++i)); do local -a dependency=(${dependencies[i]}) - project_sources_directory_filled_check "${dependency[0]}" \ - || let missing++ + project_sources_directory_filled_check "${dependency[0]}" || + let ++missing done return $missing @@ -115,9 +113,7 @@ project_dependencies_action_arguments() { local -a dependencies mapfile -t dependencies < <(project_dependencies "$project" "$@") - local -i count=${#dependencies[@]} - - for ((i = 0; i < count; i++)); do + for ((i = 0, nodeps = ${#dependencies[@]}; i < nodeps; ++i)); do local -a dependency=(${dependencies[i]}) if project_function_check "${dependency[0]}" "$action"; then |