From 436971aa5a2cd6ba3662ee29b83f06424bc466ce Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Sat, 19 Oct 2019 17:32:48 -0500 Subject: libs/project: Simplify acting on dependencies --- libs/project | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'libs') diff --git a/libs/project b/libs/project index cfb886ed..adc738fb 100755 --- a/libs/project +++ b/libs/project @@ -149,15 +149,11 @@ project_dependencies_check() { local project=$1 shift - local -a dependencies - mapfile -t dependencies < <(project_dependencies "$project" "$@") - + local dependency local -i missing=0 - for ((i = 0, nodeps = ${#dependencies[@]}; i < nodeps; ++i)); do - local -a dependency=(${dependencies[i]}) - - project_check "${dependency[0]}" || let ++missing + project_dependencies "$project" "$@" | while read -r dependency; do + project_check $dependency || let ++missing done return $missing @@ -167,16 +163,11 @@ project_dependencies_sources_check() { local project=$1 shift - local -a dependencies - mapfile -t dependencies < <(project_dependencies "$project" "$@") - + local dependency local -i missing=0 - for ((i = 0, nodeps = ${#dependencies[@]}; i < nodeps; ++i)); do - local -a dependency=(${dependencies[i]}) - - project_sources_directory_filled_check "${dependency[0]}" || - let ++missing + project_dependencies "$project" "$@" | while read -r dependency; do + project_sources_directory_filled_check $dependency || let ++missing done return $missing @@ -187,12 +178,9 @@ project_dependencies_action_arguments() { local project=$2 shift 2 - local -a dependencies - mapfile -t dependencies < <(project_dependencies "$project" "$@") - - for ((i = 0, nodeps = ${#dependencies[@]}; i < nodeps; ++i)); do - local -a dependency=(${dependencies[i]}) + local -a dependency + project_dependencies "$project" "$@" | while read -ra dependency; do if project_function_check "${dependency[0]}" "$action"; then project_action_arguments "$action" "${dependency[@]}" fi -- cgit v1.2.3-70-g09d2